mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
When a field isn't lockable, just freeze the lock status instead of removing any lock
Summary: See downstream issue here: <https://phabricator.wikimedia.org/T150992> In at least one case (project milestones) we have a locked, non-lockable field. This means "this is locked, and you can't change the fact that it is locked". At least for now, preserve this behavior. Test Plan: Created a new milestone of an existing project. This worked correctly with the patch. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D16895
This commit is contained in:
parent
a590e0e753
commit
0033fe6667
1 changed files with 9 additions and 8 deletions
|
@ -144,25 +144,26 @@ final class PhabricatorEditEngineConfiguration
|
|||
switch (idx($locks, $key)) {
|
||||
case self::LOCK_LOCKED:
|
||||
$field->setIsHidden(false);
|
||||
if ($field->getIsLockable()) {
|
||||
$field->setIsLocked(true);
|
||||
}
|
||||
break;
|
||||
case self::LOCK_HIDDEN:
|
||||
$field->setIsHidden(true);
|
||||
if ($field->getIsLockable()) {
|
||||
$field->setIsLocked(false);
|
||||
}
|
||||
break;
|
||||
case self::LOCK_VISIBLE:
|
||||
$field->setIsHidden(false);
|
||||
if ($field->getIsLockable()) {
|
||||
$field->setIsLocked(false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// If we don't have an explicit value, don't make any adjustments.
|
||||
break;
|
||||
}
|
||||
|
||||
// If the field isn't lockable, remove any lock we applied.
|
||||
if (!$field->getIsLockable()) {
|
||||
$field->setIsLocked(false);
|
||||
}
|
||||
}
|
||||
|
||||
$fields = $this->reorderFields($fields);
|
||||
|
|
Loading…
Reference in a new issue