// don't try to migrate it. continue; } $value = $action->getTarget(); if (!is_array($value)) { // Only migrate PHID lists. continue; } foreach ($value as $v) { if (!is_string($v)) { // Only migrate PHID lists where all members are PHIDs. continue 2; } } $new = array(); $any_change = false; foreach ($value as $v) { if (isset($map[$v])) { $new[] = $map[$v]; $any_change = true; } else { $new[] = $v; } } if (!$any_change) { continue; } $id = $action->getID(); queryfx($conn_w, 'UPDATE %T SET target = %s WHERE id = %d', $table->getTableName(), json_encode($new), $id); echo pht('Updated mailing lists in Herald action %d.', $id) . "\n"; }