1
0
Fork 0
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:
lkassianik 2015-11-04 09:01:21 -08:00
parent 18f0371b71
commit 262d7b7780

View file

@ -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);
}
}