1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00
phorge-phorge/resources/sql/autopatches/20150120.maniphestdefaultauthor.php
epriestley ffaed67711 Fix default-public-author migration script
Summary: Via IRC. This parameter isn't constructed quite correctly. See P1710.

Test Plan: Inspection.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: yelirekim, epriestley

Differential Revision: https://secure.phabricator.com/D11568
2015-01-29 14:03:45 -08:00

22 lines
657 B
PHP

<?php
$key = 'metamta.maniphest.default-public-author';
echo "Migrating `$key` to new application email infrastructure...\n";
$value = PhabricatorEnv::getEnvConfigIfExists($key);
$maniphest = new PhabricatorManiphestApplication();
$config_key =
PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR;
if ($value) {
$app_emails = id(new PhabricatorMetaMTAApplicationEmailQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withApplicationPHIDs(array($maniphest->getPHID()))
->execute();
foreach ($app_emails as $app_email) {
$app_email->setConfigValue($config_key, $value);
$app_email->save();
}
}
echo "Done.\n";