mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Preventing duplicate empty string aliases in Phurl's
Summary: Ref T8992, Make it impossible to save an empty string alias for a Phurl. Test Plan: - Create two Phurl's with non-empty aliases - Delete aliases for both Phurl's - Previously, this wouldn't allow to save the second Phurl because of a duplicate alias. Current diff should save empty alias as `null`, not empty string. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Maniphest Tasks: T8992 Differential Revision: https://secure.phabricator.com/D14413
This commit is contained in:
parent
9366edf255
commit
e2c0df4fb4
1 changed files with 5 additions and 1 deletions
|
@ -49,9 +49,13 @@ final class PhabricatorPhurlURLEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorPhurlURLTransaction::TYPE_NAME:
|
||||
case PhabricatorPhurlURLTransaction::TYPE_URL:
|
||||
case PhabricatorPhurlURLTransaction::TYPE_ALIAS:
|
||||
case PhabricatorPhurlURLTransaction::TYPE_DESCRIPTION:
|
||||
return $xaction->getNewValue();
|
||||
case PhabricatorPhurlURLTransaction::TYPE_ALIAS:
|
||||
if (!strlen($xaction->getNewValue())) {
|
||||
return null;
|
||||
}
|
||||
return $xaction->getNewValue();
|
||||
}
|
||||
|
||||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
|
|
Loading…
Reference in a new issue