From c9df8f77c8b5cabb5fe2a3c8874c82d12d1cf431 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 31 Jan 2018 10:37:38 -0800 Subject: [PATCH] Fix transcription of single-value bulk edit fields ("Assign to") Summary: See PHI333. Some of the cleanup at the tail end of the bulk edit changes made "Assign To" stop working properly, since we don't strip the `array(...)` off the `array(PHID)` value we receive. Test Plan: - Used bulk editor to assign and unassign tasks (single value datasource). - Used bulk editor to change projects (multi-value datasource). Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18975 --- resources/celerity/map.php | 12 ++++++------ .../edittype/PhabricatorPHIDListEditType.php | 12 ++++++++++++ webroot/rsrc/js/phuix/PHUIXFormControl.js | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 661ac58c15..d9aebf32bc 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -532,7 +532,7 @@ return array( 'rsrc/js/phuix/PHUIXButtonView.js' => '8a91e1ac', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '04b2ae03', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', - 'rsrc/js/phuix/PHUIXFormControl.js' => '1dd0870c', + 'rsrc/js/phuix/PHUIXFormControl.js' => '16ad6224', 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', ), 'symbols' => array( @@ -884,7 +884,7 @@ return array( 'phuix-autocomplete' => 'e0731603', 'phuix-button-view' => '8a91e1ac', 'phuix-dropdown-menu' => '04b2ae03', - 'phuix-form-control-view' => '1dd0870c', + 'phuix-form-control-view' => '16ad6224', 'phuix-icon-view' => 'bff6884b', 'policy-css' => '957ea14c', 'policy-edit-css' => '815c66f7', @@ -995,6 +995,10 @@ return array( 'aphront-typeahead-control-css', 'phui-tag-view-css', ), + '16ad6224' => array( + 'javelin-install', + 'javelin-dom', + ), '17bb8539' => array( 'javelin-behavior', 'javelin-stratcom', @@ -1029,10 +1033,6 @@ return array( 'javelin-request', 'javelin-uri', ), - '1dd0870c' => array( - 'javelin-install', - 'javelin-dom', - ), '1e911d0f' => array( 'javelin-stratcom', 'javelin-request', diff --git a/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php b/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php index eb728a6808..07489521b6 100644 --- a/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php +++ b/src/applications/transactions/edittype/PhabricatorPHIDListEditType.php @@ -55,4 +55,16 @@ abstract class PhabricatorPHIDListEditType } } + public function getTransactionValueFromBulkEdit($value) { + if (!$this->getIsSingleValue()) { + return $value; + } + + if ($value) { + return head($value); + } + + return null; + } + } diff --git a/webroot/rsrc/js/phuix/PHUIXFormControl.js b/webroot/rsrc/js/phuix/PHUIXFormControl.js index cd67e89691..eb5f32963d 100644 --- a/webroot/rsrc/js/phuix/PHUIXFormControl.js +++ b/webroot/rsrc/js/phuix/PHUIXFormControl.js @@ -293,7 +293,7 @@ JX.install('PHUIXFormControl', { }, _newPoints: function(spec) { - return this._newText(); + return this._newText(spec); }, _newText: function(spec) {