Button to ignore setup issues + refractoring

Summary: T2381

Test Plan:
Click on the ignore link in /config/issue/ and respond to the dialog box.

Also, test uninstalling and reinstalling an application in the web UI (to verify that refractoring didn't break anything).

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2381

Differential Revision: https://secure.phabricator.com/D5234
This commit is contained in:
Nick Pellegrino
2013-03-06 14:14:09 -08:00
committed by epriestley
parent 457b91f6cb
commit 8ec987dd2f
7 changed files with 122 additions and 41 deletions

View File

@@ -61,50 +61,18 @@ final class PhabricatorApplicationUninstallController
public function manageApplication() {
$key = 'phabricator.uninstalled-applications';
$config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
$list = $config_entry->getValue();
$uninstalled = PhabricatorEnv::getEnvConfig($key);
$config_entry = id(new PhabricatorConfigEntry())
->loadOneWhere(
'configKey = %s AND namespace = %s',
$key,
'default');
if (!$config_entry) {
$config_entry = id(new PhabricatorConfigEntry())
->setConfigKey($key)
->setNamespace('default');
}
$list = $config_entry->getValue();
$uninstalled = PhabricatorEnv::getEnvConfig($key);
if ($uninstalled[$this->application]) {
unset($list[$this->application]);
} else {
if ($uninstalled[$this->application]) {
unset($list[$this->application]);
} else {
$list[$this->application] = true;
}
$xaction = id(new PhabricatorConfigTransaction())
->setTransactionType(PhabricatorConfigTransaction::TYPE_EDIT)
->setNewValue(
array(
'deleted' => false,
'value' => $list
));
$editor = id(new PhabricatorConfigEditor())
->setActor($this->getRequest()->getUser())
->setContinueOnNoEffect(true)
->setContentSource(
PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_WEB,
array(
'ip' => $this->getRequest()->getRemoteAddr(),
)));
$editor->applyTransactions($config_entry, array($xaction));
}
PhabricatorConfigEditor::storeNewValue(
$config_entry, $list, $this->getRequest());
}
}