mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-09 06:11:01 +01:00
743f0d65ea
Summary: Revisions with blocking reviewers had this stamp built incorrectly, which cascaded into trying to use `array()` as a PHID. Recover so these tasks succeed. Test Plan: Will deploy production. Differential Revision: https://secure.phabricator.com/D19082
45 lines
1,000 B
PHP
45 lines
1,000 B
PHP
<?php
|
|
|
|
final class PhabricatorPHIDMailStamp
|
|
extends PhabricatorMailStamp {
|
|
|
|
const STAMPTYPE = 'phid';
|
|
|
|
public function renderStamps($value) {
|
|
if ($value === null) {
|
|
return null;
|
|
}
|
|
|
|
$value = (array)$value;
|
|
if (!$value) {
|
|
return null;
|
|
}
|
|
|
|
// TODO: This recovers from a bug where blocking reviewers were serialized
|
|
// incorrectly into the flat mail stamp list in the worker queue as arrays.
|
|
// It can be removed some time after February 2018.
|
|
foreach ($value as $key => $v) {
|
|
if (is_array($v)) {
|
|
unset($value[$key]);
|
|
}
|
|
}
|
|
|
|
$viewer = $this->getViewer();
|
|
$handles = $viewer->loadHandles($value);
|
|
|
|
$results = array();
|
|
foreach ($value as $phid) {
|
|
$handle = $handles[$phid];
|
|
|
|
$mail_name = $handle->getMailStampName();
|
|
if ($mail_name === null) {
|
|
$mail_name = $handle->getPHID();
|
|
}
|
|
|
|
$results[] = $this->renderStamp($this->getKey(), $mail_name);
|
|
}
|
|
|
|
return $results;
|
|
}
|
|
|
|
}
|