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

Spaces + Diffusion - make creating a new repository work again

Summary: Fixes T8702. Needed to teach these controls how to serialize / unserialize themselves in that they are storing two values (policy phid + space phid) nowadays

Test Plan: made a new repo successfully with policy as described in T8702. Also edited policy successfully.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8702

Differential Revision: https://secure.phabricator.com/D13472
This commit is contained in:
Bob Trahan 2015-06-29 11:55:52 -07:00
parent b39f5d651c
commit 12b966f44e

View file

@ -39,6 +39,22 @@ final class AphrontFormPolicyControl extends AphrontFormControl {
return $this;
}
public function getSerializedValue() {
return json_encode(array(
$this->getValue(),
$this->getSpacePHID(),
));
}
public function readSerializedValue($value) {
$decoded = phutil_json_decode($value);
$policy_value = $decoded[0];
$space_phid = $decoded[1];
$this->setValue($policy_value);
$this->setSpacePHID($space_phid);
return $this;
}
public function readValueFromDictionary(array $dictionary) {
// TODO: This is a little hacky but will only get us into trouble if we
// have multiple view policy controls in multiple paged form views on the