Differential D12680 Diff 30538 src/infrastructure/customfield/config/PhabricatorCustomFieldConfigOptionType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/config/PhabricatorCustomFieldConfigOptionType.php
| <?php | <?php | ||||
| final class PhabricatorCustomFieldConfigOptionType | final class PhabricatorCustomFieldConfigOptionType | ||||
| extends PhabricatorConfigOptionType { | extends PhabricatorConfigOptionType { | ||||
| public function readRequest( | public function readRequest( | ||||
| PhabricatorConfigOption $option, | PhabricatorConfigOption $option, | ||||
| AphrontRequest $request) { | AphrontRequest $request) { | ||||
| $e_value = null; | $e_value = null; | ||||
| $errors = array(); | $errors = array(); | ||||
| $storage_value = $request->getStr('value'); | $storage_value = $request->getStr('value'); | ||||
| $in_value = json_decode($storage_value, true); | $in_value = phutil_json_decode($storage_value); | ||||
| if (!is_array($in_value)) { | if (!is_array($in_value)) { | ||||
| $in_value = array(); | $in_value = array(); | ||||
| } | } | ||||
| // When we submit from JS, we submit a list (since maps are not guaranteed | // When we submit from JS, we submit a list (since maps are not guaranteed | ||||
| // to retain order). Convert it into a map for storage (since it's far more | // to retain order). Convert it into a map for storage (since it's far more | ||||
| // convenient for us elsewhere). | // convenient for us elsewhere). | ||||
| $storage_value = ipull($in_value, null, 'key'); | $storage_value = ipull($in_value, null, 'key'); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||