From ba2ee3a66e893055a76f1bae0cda36cdb0bb2029 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 16 Mar 2017 11:55:16 -0700 Subject: [PATCH] Make "bin/config set --database ..." resurrect deleted values Summary: Fixes T12409. Config entries may be marked as "deleted", and `bin/config set --database` doesn't un-delete them, so the edit doesn't do anything. The "most correct" fix here is to swap to transactions so we run the same code, but just fix this narrowly for now since it's one line of code. Test Plan: - Set `maniphest.default-priority` to `123`. - Deleted `maniphest.default-priority` from the web UI by deleting all the text in the box. - Before patch: `bin/config set --database maniphest.default-priority 789` had no effect. - After patch: `bin/config set --database maniphest.default-priority 789` worked. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12409 Differential Revision: https://secure.phabricator.com/D17506 --- .../management/PhabricatorConfigManagementSetWorkflow.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index f6d40a5126..4511865785 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -158,6 +158,10 @@ final class PhabricatorConfigManagementSetWorkflow $config_type = 'database'; $config_entry = PhabricatorConfigEntry::loadConfigEntry($key); $config_entry->setValue($value); + + // If the entry has been deleted, resurrect it. + $config_entry->setIsDeleted(0); + $config_entry->save(); } else { $config_type = 'local';