diff --git a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php index d89d4b7eb3..8f8cea0838 100644 --- a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php @@ -56,15 +56,9 @@ final class PhabricatorConfigManagementDeleteWorkflow } if ($use_database) { - $config_entry = id(new PhabricatorConfigOption()) - ->loadOneWhere( - 'namespace = %s and key = %s', - 'default', - $key); - PhabricatorConfigEditor::deleteConfig( - $this->getViewer(), - $config_entry, - PhabricatorContentSource::newConsoleSource()); + $config_entry = PhabricatorConfigEntry::loadConfigEntry($key); + $config_entry->setIsDeleted(1); + $config_entry->save(); } else { $config->deleteKeys(array($key)); } diff --git a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php index 4b3caa09ce..1f992d003a 100644 --- a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php @@ -55,11 +55,9 @@ final class PhabricatorConfigManagementMigrateWorkflow 'Skipping option "%s"; already in database config.', $key)."\n"); continue; } else { - PhabricatorConfigEditor::storeNewValue( - $this->getViewer(), - id(new PhabricatorConfigEntry()) - ->loadOneWhere('namespace = %s AND key = %s', 'default', $key), - PhabricatorContentSource::newConsoleSource()); + $config_entry = PhabricatorConfigEntry::loadConfigEntry($key); + $config_entry->setValue($value); + $config_entry->save(); $key_count++; $console->writeOut(pht( 'Migrated option "%s" from file to database config.', $key)."\n"); diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index 5c4fc2765c..b20c91cbff 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -111,12 +111,9 @@ final class PhabricatorConfigManagementSetWorkflow if ($use_database) { $config_type = 'database'; - PhabricatorConfigEditor::storeNewValue( - $this->getViewer(), - id(new PhabricatorConfigEntry()) - ->loadOneWhere('namespace = %s AND key = %s', 'default', $key), - $value, - PhabricatorContentSource::newConsoleSource()); + $config_entry = PhabricatorConfigEntry::loadConfigEntry($key); + $config_entry->setValue($value); + $config_entry->save(); } else { $config_type = 'local'; id(new PhabricatorConfigLocalSource()) diff --git a/src/applications/config/storage/PhabricatorConfigEntry.php b/src/applications/config/storage/PhabricatorConfigEntry.php index 54fac1e333..abe7f4e036 100644 --- a/src/applications/config/storage/PhabricatorConfigEntry.php +++ b/src/applications/config/storage/PhabricatorConfigEntry.php @@ -46,7 +46,8 @@ final class PhabricatorConfigEntry if (!$config_entry) { $config_entry = id(new PhabricatorConfigEntry()) ->setConfigKey($key) - ->setNamespace('default'); + ->setNamespace('default') + ->setIsDeleted(0); } return $config_entry;