From 0033fe6667570441b45fe0dc337c6f9dcd48bdeb Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 17 Nov 2016 14:50:50 -0800 Subject: [PATCH] When a field isn't lockable, just freeze the lock status instead of removing any lock Summary: See downstream issue here: 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 --- .../PhabricatorEditEngineConfiguration.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php b/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php index c1b1308801..65359bb0dd 100644 --- a/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php +++ b/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php @@ -144,25 +144,26 @@ final class PhabricatorEditEngineConfiguration switch (idx($locks, $key)) { case self::LOCK_LOCKED: $field->setIsHidden(false); - $field->setIsLocked(true); + if ($field->getIsLockable()) { + $field->setIsLocked(true); + } break; case self::LOCK_HIDDEN: $field->setIsHidden(true); - $field->setIsLocked(false); + if ($field->getIsLockable()) { + $field->setIsLocked(false); + } break; case self::LOCK_VISIBLE: $field->setIsHidden(false); - $field->setIsLocked(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); -- 2.54.0