1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Ensure Maniphest CC PHID list is always a list in maniphest.info

Summary: See T626. Use array_values() to discard keys, for consistency and so
this will always encode as a list (JSON array) over the wire.

Test Plan: Added and removed CCs from a task while calling maniphest.info on it;
CCs worked and I always received a list.

Reviewers: btrahan, jungejason, nh, tuomaspelkonen, aran

Reviewed By: aran

CC: skrul, aran, btrahan, epriestley

Differential Revision: 1118
This commit is contained in:
epriestley 2011-11-16 09:21:11 -08:00
parent 42383214ea
commit ef020f711e

View file

@ -62,17 +62,21 @@ class ManiphestTask extends ManiphestDAO {
}
public function getCCPHIDs() {
return nonempty($this->ccPHIDs, array());
return array_values(nonempty($this->ccPHIDs, array()));
}
public function setProjectPHIDs(array $phids) {
$this->projectPHIDs = $phids;
$this->projectPHIDs = array_values($phids);
$this->projectsNeedUpdate = true;
return $this;
}
public function getProjectPHIDs() {
return array_values(nonempty($this->projectPHIDs, array()));
}
public function setCCPHIDs(array $phids) {
$this->ccPHIDs = $phids;
$this->ccPHIDs = array_values($phids);
$this->subscribersNeedUpdate = true;
return $this;
}