phorge/src/applications/transactions/error/PhabricatorApplicationTransactionValidationError.php
epriestley b4a07d528f Allow users to unset "Editor", tailor short error messages properly on settings forms
Summary:
Ref T11098.

  - Allow "Editor" to be set to the empty string.
  - Don't match a validation error to a field unless the actual settings for the field and error match.

Test Plan:
  - Tried to set "Editor" to "", success.
  - Tried to set "Editor" to "javascript://", only that field got marked "Invalid".

Reviewers: avivey, chad

Reviewed By: chad

Maniphest Tasks: T11098

Differential Revision: https://secure.phabricator.com/D16051
2016-06-05 14:03:02 -07:00

50 lines
993 B
PHP

<?php
final class PhabricatorApplicationTransactionValidationError
extends Phobject {
private $type;
private $transaction;
private $shortMessage;
private $message;
private $isMissingFieldError;
public function __construct(
$type,
$short_message,
$message,
PhabricatorApplicationTransaction $xaction = null) {
$this->type = $type;
$this->shortMessage = $short_message;
$this->message = $message;
$this->transaction = $xaction;
}
public function getType() {
return $this->type;
}
public function getTransaction() {
return $this->transaction;
}
public function getShortMessage() {
return $this->shortMessage;
}
public function getMessage() {
return $this->message;
}
public function setIsMissingFieldError($is_missing_field_error) {
$this->isMissingFieldError = $is_missing_field_error;
return $this;
}
public function getIsMissingFieldError() {
return $this->isMissingFieldError;
}
}