@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix mail parameter error with old migrations

Summary:
Fixes T9251. Old mail could get saved with bad parameters for two reasons that I can come up with:

- Nothing ever set a parameter on it -- not sure this could ever actually happen; or
- some field contained non-UTF8 data prior to D13939 and we silently failed to encode it.

My guess is that the second case is probably the culprit here.

In any case, recover from this so `20150622.metamta.5.actor-phid-mig.php` can proceed.

Test Plan: Same effective patch as user patch in T9251; looked at some mail to make sure it was still pulling parameters properly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9251

Differential Revision: https://secure.phabricator.com/D13990

+8 -1
+8 -1
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 10 10 const RETRY_DELAY = 5; 11 11 12 12 protected $actorPHID; 13 - protected $parameters; 13 + protected $parameters = array(); 14 14 protected $status; 15 15 protected $message; 16 16 protected $relatedPHID; ··· 69 69 } 70 70 71 71 protected function getParam($param, $default = null) { 72 + // Some old mail was saved without parameters because no parameters were 73 + // set or encoding failed. Recover in these cases so we can perform 74 + // mail migrations, see T9251. 75 + if (!is_array($this->parameters)) { 76 + $this->parameters = array(); 77 + } 78 + 72 79 return idx($this->parameters, $param, $default); 73 80 } 74 81