Differential D21868 Diff 52164 src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php
Show All 34 Lines | abstract class PhabricatorStandardCustomFieldPHIDs | ||||
public function setValueFromStorage($value) { | public function setValueFromStorage($value) { | ||||
// NOTE: We're accepting either a JSON string (a real storage value) or | // NOTE: We're accepting either a JSON string (a real storage value) or | ||||
// an array (from HTTP parameter prefilling). This is a little hacky, but | // an array (from HTTP parameter prefilling). This is a little hacky, but | ||||
// should hold until this can get cleaned up more thoroughly. | // should hold until this can get cleaned up more thoroughly. | ||||
// TODO: Clean this up. | // TODO: Clean this up. | ||||
$result = array(); | $result = array(); | ||||
if (!is_array($value)) { | if ($value !== null && !is_array($value)) { | ||||
$value = json_decode($value, true); | $value = json_decode($value, true); | ||||
if (is_array($value)) { | if (is_array($value)) { | ||||
$result = array_values($value); | $result = array_values($value); | ||||
} | } | ||||
} | } | ||||
$this->setFieldValue($value); | $this->setFieldValue($value); | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |