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

Fix an issue where the "viewer" is not passed to Bulk Edit controls properly

Summary:
See PHI1442. If you have a bulk-editable datasource field with a composite datasource, it can currently fatal on the bulk edit workflow because the viewer is not passed correctly.

The error looks something like this:

> Argument 1 passed to PhabricatorDatasourceEngine::setViewer() must be an instance of PhabricatorUser, null given, called in /Users/epriestley/dev/core/lib/phabricator/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php on line 231

Test Plan: Configured a Maniphest custom field with a composite datasource, then tried a bulk edit. Things worked cleanly instead of fataling.

Differential Revision: https://secure.phabricator.com/D20841
This commit is contained in:
epriestley 2019-09-26 11:44:51 -07:00
parent 2c06815edb
commit 7a0090f4d0
2 changed files with 6 additions and 1 deletions

View file

@ -22,7 +22,8 @@ final class BulkTokenizerParameterType
$template = new AphrontTokenizerTemplateView();
$template_markup = $template->render();
$datasource = $this->getDatasource();
$datasource = $this->getDatasource()
->setViewer($this->getViewer());
return array(
'markup' => (string)hsprintf('%s', $template_markup),

View file

@ -2523,6 +2523,8 @@ abstract class PhabricatorEditEngine
}
final public function newBulkEditMap() {
$viewer = $this->getViewer();
$config = $this->loadDefaultConfiguration();
if (!$config) {
throw new Exception(
@ -2542,6 +2544,8 @@ abstract class PhabricatorEditEngine
continue;
}
$bulk_type->setViewer($viewer);
$bulk_label = $type->getBulkEditLabel();
if ($bulk_label === null) {
continue;