mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 21:32:43 +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:
parent
b39f5d651c
commit
12b966f44e
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue