mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Don't use handles in the Calendar event name migration
Summary: Fixes T8209. Using handles can now cause cache fills as a side effect of T7707. Use a raw query instead. I'll follow up on T8209 with some context and ideas for longer-term fixes. Test Plan: - Set event names to `''`. - Reran migration with `--apply ... --trace`. - Saw migration work correctly without executing cache fills. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8209 Differential Revision: https://secure.phabricator.com/D12858
This commit is contained in:
parent
7179def064
commit
27b78d2147
1 changed files with 8 additions and 3 deletions
|
@ -11,12 +11,17 @@ foreach ($iterator as $event) {
|
||||||
if (strlen($event->getName()) == 0) {
|
if (strlen($event->getName()) == 0) {
|
||||||
echo "Renaming event {$id}...\n";
|
echo "Renaming event {$id}...\n";
|
||||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||||
$handle = id(new PhabricatorHandleQuery())
|
|
||||||
|
// NOTE: This uses PeopleQuery directly, instead of HandleQuery, to avoid
|
||||||
|
// performing cache fills as a side effect; the caches were added by a
|
||||||
|
// later patch. See T8209.
|
||||||
|
$user = id(new PhabricatorPeopleQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withPHIDs(array($event->getUserPHID()))
|
->withPHIDs(array($event->getUserPHID()))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if ($handle->isComplete()) {
|
|
||||||
$new_name = $handle->getName();
|
if ($user) {
|
||||||
|
$new_name = $user->getUsername();
|
||||||
} else {
|
} else {
|
||||||
$new_name = pht('Unnamed Event');
|
$new_name = pht('Unnamed Event');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue