mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +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)) {
|
switch (idx($locks, $key)) {
|
||||||
case self::LOCK_LOCKED:
|
case self::LOCK_LOCKED:
|
||||||
$field->setIsHidden(false);
|
$field->setIsHidden(false);
|
||||||
$field->setIsLocked(true);
|
if ($field->getIsLockable()) {
|
||||||
|
$field->setIsLocked(true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case self::LOCK_HIDDEN:
|
case self::LOCK_HIDDEN:
|
||||||
$field->setIsHidden(true);
|
$field->setIsHidden(true);
|
||||||
$field->setIsLocked(false);
|
if ($field->getIsLockable()) {
|
||||||
|
$field->setIsLocked(false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case self::LOCK_VISIBLE:
|
case self::LOCK_VISIBLE:
|
||||||
$field->setIsHidden(false);
|
$field->setIsHidden(false);
|
||||||
$field->setIsLocked(false);
|
if ($field->getIsLockable()) {
|
||||||
|
$field->setIsLocked(false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// If we don't have an explicit value, don't make any adjustments.
|
// If we don't have an explicit value, don't make any adjustments.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the field isn't lockable, remove any lock we applied.
|
|
||||||
if (!$field->getIsLockable()) {
|
|
||||||
$field->setIsLocked(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = $this->reorderFields($fields);
|
$fields = $this->reorderFields($fields);
|
||||||
|
|
Loading…
Reference in a new issue