mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Check that Phurl alias is unique
Summary: Ref T8992, Phurl aliases must be unique. Otherwise throw an error. Test Plan: Create two Phurl's both with alias 'asdf'. When saving second Phurl, form should show an error about the duplicate alias. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Maniphest Tasks: T8992 Differential Revision: https://secure.phabricator.com/D14401
This commit is contained in:
parent
18f0371b71
commit
262d7b7780
1 changed files with 14 additions and 0 deletions
|
@ -248,5 +248,19 @@ final class PhabricatorPhurlURLEditor
|
|||
return $body;
|
||||
}
|
||||
|
||||
protected function didCatchDuplicateKeyException(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions,
|
||||
Exception $ex) {
|
||||
|
||||
$errors = array();
|
||||
$errors[] = new PhabricatorApplicationTransactionValidationError(
|
||||
PhabricatorPhurlURLTransaction::TYPE_ALIAS,
|
||||
pht('Duplicate'),
|
||||
pht('This alias is already in use.'),
|
||||
null);
|
||||
|
||||
throw new PhabricatorApplicationTransactionValidationException($errors);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue