@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Always pass handles to tokenizers, not `<phid -> name>` maps

Summary: Ref T1279. Prerequisite for adding icons or other type information to tokenizers, since we don't currently have enough information to prefill them when rendering things from the server side. By passing handles in, the tokenizer can extract type information.

Test Plan:
- Searched by user in Audit.
- Sent Conpherence from profile page.
- Tried to send an empty conpherence.
- Searched Countdown by user.
- Edited CCs in Differential.
- Edited reviewers in Differential.
- Edited a commit's projects.
- Searched lint by owner.
- Searched feed by owner/project.
- Searched files by owner.
- Searched Herald by owner.
- Searched Legalpad by owner.
- Searched Macro by owner.
- Filtered Maniphest reports by project.
- Edited CCs in Maniphest.
- Searched Owners by owner.
- Edited an Owners package.
- Searched Paste by owner.
- Searched activity logs by owner.
- Searched for mocks by owner.
- Edited a mock's CCs.
- Searched Ponder by owner.
- Searched projects by owner.
- Edited a Releeph project's pushers.
- Searched Releeph by requestor.
- Edited "Uses Symbols" for an Arcanist project.
- Edited all tokenizers in main search.
- Searched Slowvote by user.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1279

Differential Revision: https://secure.phabricator.com/D7248

+66 -119
+1 -3
src/applications/audit/controller/PhabricatorAuditListController.php
··· 139 139 140 140 $tok_value = null; 141 141 if ($handle) { 142 - $tok_value = array( 143 - $handle->getPHID() => $handle->getFullName(), 144 - ); 142 + $tok_value = array($handle); 145 143 } 146 144 147 145 $form->appendChild(
+9 -7
src/applications/conpherence/controller/ConpherenceNewController.php
··· 11 11 12 12 $title = pht('New Message'); 13 13 $participants = array(); 14 + $participant_prefill = null; 14 15 $message = ''; 15 16 $e_participants = null; 16 17 $e_message = null; 17 18 18 19 // this comes from ajax requests from all over. should be a single phid. 19 - $participant_prefill = $request->getStr('participant'); 20 - if ($participant_prefill) { 21 - $participants[] = $participant_prefill; 22 - } 23 20 24 21 if ($request->isFormPost()) { 25 22 $participants = $request->getArr('participants'); ··· 47 44 return id(new AphrontRedirectResponse()) 48 45 ->setURI($uri); 49 46 } 47 + } else { 48 + $participant_prefill = $request->getStr('participant'); 49 + if ($participant_prefill) { 50 + $participants[] = $participant_prefill; 51 + } 50 52 } 51 53 54 + 52 55 $participant_handles = array(); 53 56 if ($participants) { 54 - $handles = id(new PhabricatorHandleQuery()) 57 + $participant_handles = id(new PhabricatorHandleQuery()) 55 58 ->setViewer($user) 56 59 ->withPHIDs($participants) 57 60 ->execute(); 58 - $participant_handles = mpull($handles, 'getFullName', 'getPHID'); 59 61 } 60 62 61 63 $submit_uri = $this->getApplicationURI('new/'); ··· 64 66 // TODO - we can get a better cancel_uri once we get better at crazy 65 67 // ajax jonx T2086 66 68 if ($participant_prefill) { 67 - $handle = $handles[$participant_prefill]; 69 + $handle = $participant_handles[$participant_prefill]; 68 70 $cancel_uri = $handle->getURI(); 69 71 } 70 72
+2 -3
src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
··· 33 33 AphrontFormView $form, 34 34 PhabricatorSavedQuery $saved_query) { 35 35 $phids = $saved_query->getParameter('authorPHIDs', array()); 36 - $handles = id(new PhabricatorHandleQuery()) 36 + $author_handles = id(new PhabricatorHandleQuery()) 37 37 ->setViewer($this->requireViewer()) 38 38 ->withPHIDs($phids) 39 39 ->execute(); 40 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 41 40 42 41 $upcoming = $saved_query->getParameter('upcoming'); 43 42 ··· 47 46 ->setDatasource('/typeahead/common/users/') 48 47 ->setName('authors') 49 48 ->setLabel(pht('Authors')) 50 - ->setValue($author_tokens)) 49 + ->setValue($author_handles)) 51 50 ->appendChild( 52 51 id(new AphrontFormCheckboxControl()) 53 52 ->addCheckbox(
+1 -1
src/applications/differential/field/specification/DifferentialCCsFieldSpecification.php
··· 50 50 public function renderEditControl() { 51 51 $cc_map = array(); 52 52 foreach ($this->ccs as $phid) { 53 - $cc_map[$phid] = $this->getHandle($phid)->getFullName(); 53 + $cc_map[] = $this->getHandle($phid); 54 54 } 55 55 return id(new AphrontFormTokenizerControl()) 56 56 ->setLabel('CC')
+1 -1
src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php
··· 89 89 public function renderEditControl() { 90 90 $reviewer_map = array(); 91 91 foreach ($this->reviewers as $phid) { 92 - $reviewer_map[$phid] = $this->getHandle($phid)->getFullName(); 92 + $reviewer_map[] = $this->getHandle($phid); 93 93 } 94 94 return id(new AphrontFormTokenizerControl()) 95 95 ->setLabel(pht('Reviewers'))
+1 -1
src/applications/diffusion/controller/DiffusionCommitEditController.php
··· 27 27 $commit_phid, 28 28 $edge_type); 29 29 $handles = $this->loadViewerHandles($current_proj_phids); 30 - $proj_t_values = mpull($handles, 'getFullName', 'getPHID'); 30 + $proj_t_values = $handles; 31 31 32 32 if ($request->isFormPost()) { 33 33 $proj_phids = $request->getArr('projects');
+5 -9
src/applications/diffusion/controller/DiffusionLintController.php
··· 21 21 $owners = array(); 22 22 if (!$drequest) { 23 23 if (!$request->getArr('owner')) { 24 - if ($user->isLoggedIn()) { 25 - $owners[$user->getPHID()] = $user->getFullName(); 26 - } 24 + $owners = array($user->getPHID()); 27 25 } else { 28 - $phids = $request->getArr('owner'); 29 - $phid = reset($phids); 30 - $handles = $this->loadViewerHandles(array($phid)); 31 - $owners[$phid] = $handles[$phid]->getFullName(); 26 + $owners = array(head($request->getArr('owner'))); 32 27 } 28 + $owner_handles = $this->loadViewerHandles($owners); 33 29 } 34 30 35 - $codes = $this->loadLintCodes(array_keys($owners)); 31 + $codes = $this->loadLintCodes($owners); 36 32 37 33 if ($codes && !$drequest) { 38 34 // TODO: Build some real Query classes for this stuff. ··· 125 121 ->setLimit(1) 126 122 ->setName('owner') 127 123 ->setLabel(pht('Owner')) 128 - ->setValue($owners)) 124 + ->setValue($owner_handles)) 129 125 ->appendChild( 130 126 id(new AphrontFormSubmitControl()) 131 127 ->setValue('Filter'));
+4 -5
src/applications/feed/query/PhabricatorFeedSearchEngine.php
··· 66 66 ->setViewer($this->requireViewer()) 67 67 ->withPHIDs($phids) 68 68 ->execute(); 69 - $tokens = mpull($handles, 'getFullName', 'getPHID'); 70 - $user_tokens = array_select_keys($tokens, $user_phids); 71 - $proj_tokens = array_select_keys($tokens, $proj_phids); 69 + $user_handles = array_select_keys($handles, $user_phids); 70 + $proj_handles = array_select_keys($handles, $proj_phids); 72 71 73 72 $viewer_projects = $saved_query->getParameter('viewerProjects'); 74 73 ··· 78 77 ->setDatasource('/typeahead/common/users/') 79 78 ->setName('users') 80 79 ->setLabel(pht('Include Users')) 81 - ->setValue($user_tokens)) 80 + ->setValue($user_handles)) 82 81 ->appendChild( 83 82 id(new AphrontFormTokenizerControl()) 84 83 ->setDatasource('/typeahead/common/projects/') 85 84 ->setName('projectPHIDs') 86 85 ->setLabel(pht('Include Projects')) 87 - ->setValue($proj_tokens)) 86 + ->setValue($proj_handles)) 88 87 ->appendChild( 89 88 id(new AphrontFormCheckboxControl()) 90 89 ->addCheckbox(
+2 -3
src/applications/files/query/PhabricatorFileSearchEngine.php
··· 46 46 PhabricatorSavedQuery $saved_query) { 47 47 48 48 $phids = $saved_query->getParameter('authorPHIDs', array()); 49 - $handles = id(new PhabricatorHandleQuery()) 49 + $author_handles = id(new PhabricatorHandleQuery()) 50 50 ->setViewer($this->requireViewer()) 51 51 ->withPHIDs($phids) 52 52 ->execute(); 53 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 54 53 55 54 $explicit = $saved_query->getParameter('explicit'); 56 55 ··· 60 59 ->setDatasource('/typeahead/common/users/') 61 60 ->setName('authors') 62 61 ->setLabel(pht('Authors')) 63 - ->setValue($author_tokens)) 62 + ->setValue($author_handles)) 64 63 ->appendChild( 65 64 id(new AphrontFormCheckboxControl()) 66 65 ->addCheckbox(
+2 -3
src/applications/herald/query/HeraldRuleSearchEngine.php
··· 52 52 PhabricatorSavedQuery $saved_query) { 53 53 54 54 $phids = $saved_query->getParameter('authorPHIDs', array()); 55 - $handles = id(new PhabricatorHandleQuery()) 55 + $author_handles = id(new PhabricatorHandleQuery()) 56 56 ->setViewer($this->requireViewer()) 57 57 ->withPHIDs($phids) 58 58 ->execute(); 59 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 60 59 61 60 $content_type = $saved_query->getParameter('contentType'); 62 61 $rule_type = $saved_query->getParameter('ruleType'); ··· 67 66 ->setDatasource('/typeahead/common/users/') 68 67 ->setName('authors') 69 68 ->setLabel(pht('Authors')) 70 - ->setValue($author_tokens)) 69 + ->setValue($author_handles)) 71 70 ->appendChild( 72 71 id(new AphrontFormSelectControl()) 73 72 ->setName('contentType')
+2 -3
src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
··· 53 53 ->setViewer($this->requireViewer()) 54 54 ->withPHIDs($phids) 55 55 ->execute(); 56 - $tokens = mpull($handles, 'getFullName', 'getPHID'); 57 56 58 57 $form 59 58 ->appendChild( ··· 61 60 ->setDatasource('/typeahead/common/users/') 62 61 ->setName('creators') 63 62 ->setLabel(pht('Creators')) 64 - ->setValue(array_select_keys($tokens, $creator_phids))) 63 + ->setValue(array_select_keys($handles, $creator_phids))) 65 64 ->appendChild( 66 65 id(new AphrontFormTokenizerControl()) 67 66 ->setDatasource('/typeahead/common/users/') 68 67 ->setName('contributors') 69 68 ->setLabel(pht('Contributors')) 70 - ->setValue(array_select_keys($tokens, $contributor_phids))); 69 + ->setValue(array_select_keys($handles, $contributor_phids))); 71 70 72 71 $this->buildDateRange( 73 72 $form,
+2 -3
src/applications/macro/query/PhabricatorMacroSearchEngine.php
··· 66 66 PhabricatorSavedQuery $saved_query) { 67 67 68 68 $phids = $saved_query->getParameter('authorPHIDs', array()); 69 - $handles = id(new PhabricatorHandleQuery()) 69 + $author_handles = id(new PhabricatorHandleQuery()) 70 70 ->setViewer($this->requireViewer()) 71 71 ->withPHIDs($phids) 72 72 ->execute(); 73 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 74 73 75 74 $status = $saved_query->getParameter('status'); 76 75 $names = implode(', ', $saved_query->getParameter('names', array())); ··· 89 88 ->setDatasource('/typeahead/common/users/') 90 89 ->setName('authors') 91 90 ->setLabel(pht('Authors')) 92 - ->setValue($author_tokens)) 91 + ->setValue($author_handles)) 93 92 ->appendChild( 94 93 id(new AphrontFormTextControl()) 95 94 ->setName('nameLike')
+2 -6
src/applications/maniphest/controller/ManiphestReportController.php
··· 265 265 266 266 $tokens = array(); 267 267 if ($handle) { 268 - $tokens = array( 269 - $handle->getPHID() => $handle->getFullName(), 270 - ); 268 + $tokens = array($handle); 271 269 } 272 270 273 271 $filter = $this->renderReportFilters($tokens, $has_window = false); ··· 635 633 636 634 $tokens = array(); 637 635 if ($project_handle) { 638 - $tokens = array( 639 - $project_handle->getPHID() => $project_handle->getFullName(), 640 - ); 636 + $tokens = array($project_handle); 641 637 } 642 638 $filter = $this->renderReportFilters($tokens, $has_window = true); 643 639
+3 -7
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 343 343 344 344 $handles = $this->loadViewerHandles($phids); 345 345 346 - $tvalues = mpull($handles, 'getFullName', 'getPHID'); 347 - 348 346 $error_view = null; 349 347 if ($errors) { 350 348 $error_view = new AphrontErrorView(); ··· 355 353 $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); 356 354 357 355 if ($task->getOwnerPHID()) { 358 - $assigned_value = array( 359 - $task->getOwnerPHID() => $handles[$task->getOwnerPHID()]->getFullName(), 360 - ); 356 + $assigned_value = array($handles[$task->getOwnerPHID()]); 361 357 } else { 362 358 $assigned_value = array(); 363 359 } 364 360 365 361 if ($task->getCCPHIDs()) { 366 - $cc_value = array_select_keys($tvalues, $task->getCCPHIDs()); 362 + $cc_value = array_select_keys($handles, $task->getCCPHIDs()); 367 363 } else { 368 364 $cc_value = array(); 369 365 } 370 366 371 367 if ($task->getProjectPHIDs()) { 372 - $projects_value = array_select_keys($tvalues, $task->getProjectPHIDs()); 368 + $projects_value = array_select_keys($handles, $task->getProjectPHIDs()); 373 369 } else { 374 370 $projects_value = array(); 375 371 }
+5 -8
src/applications/owners/controller/PhabricatorOwnersEditController.php
··· 123 123 124 124 $primary = $package->getPrimaryOwnerPHID(); 125 125 if ($primary && isset($handles[$primary])) { 126 - $token_primary_owner = array( 127 - $primary => $handles[$primary]->getFullName(), 128 - ); 126 + $handle_primary_owner = array($handles[$primary]); 129 127 } else { 130 - $token_primary_owner = array(); 128 + $handle_primary_owner = array(); 131 129 } 132 130 133 - $token_all_owners = array_select_keys($handles, $owners); 134 - $token_all_owners = mpull($token_all_owners, 'getFullName'); 131 + $handles_all_owners = array_select_keys($handles, $owners); 135 132 136 133 if ($package->getID()) { 137 134 $title = pht('Edit Package'); ··· 195 192 ->setLabel(pht('Primary Owner')) 196 193 ->setName('primary') 197 194 ->setLimit(1) 198 - ->setValue($token_primary_owner) 195 + ->setValue($handle_primary_owner) 199 196 ->setError($e_primary)) 200 197 ->appendChild( 201 198 id(new AphrontFormTokenizerControl()) 202 199 ->setDatasource('/typeahead/common/usersorprojects/') 203 200 ->setLabel(pht('Owners')) 204 201 ->setName('owners') 205 - ->setValue($token_all_owners)) 202 + ->setValue($handles_all_owners)) 206 203 ->appendChild( 207 204 id(new AphrontFormSelectControl()) 208 205 ->setName('auditing')
+1 -3
src/applications/owners/controller/PhabricatorOwnersListController.php
··· 153 153 $phids = $request->getArr('owner'); 154 154 $phid = reset($phids); 155 155 $handles = $this->loadViewerHandles(array($phid)); 156 - $owners_search_value = array( 157 - $phid => $handles[$phid]->getFullName(), 158 - ); 156 + $owners_search_value = array($handles[$phid]); 159 157 } 160 158 161 159 $callsigns = array('' => pht('(Any Repository)'));
+2 -3
src/applications/paste/query/PhabricatorPasteSearchEngine.php
··· 48 48 AphrontFormView $form, 49 49 PhabricatorSavedQuery $saved_query) { 50 50 $phids = $saved_query->getParameter('authorPHIDs', array()); 51 - $handles = id(new PhabricatorHandleQuery()) 51 + $author_handles = id(new PhabricatorHandleQuery()) 52 52 ->setViewer($this->requireViewer()) 53 53 ->withPHIDs($phids) 54 54 ->execute(); 55 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 56 55 57 56 $languages = $saved_query->getParameter('languages', array()); 58 57 $no_language = false; ··· 70 69 ->setDatasource('/typeahead/common/users/') 71 70 ->setName('authors') 72 71 ->setLabel(pht('Authors')) 73 - ->setValue($author_tokens)) 72 + ->setValue($author_handles)) 74 73 ->appendChild( 75 74 id(new AphrontFormTextControl()) 76 75 ->setName('languages')
+2 -6
src/applications/people/controller/PhabricatorPeopleLogsController.php
··· 22 22 $handles = $this->loadViewerHandles($phids); 23 23 if ($filter_user) { 24 24 $filter_user = reset($filter_user); 25 - $user_value = array( 26 - $filter_user => $handles[$filter_user]->getFullName(), 27 - ); 25 + $user_value = array($handles[$filter_user]); 28 26 } 29 27 30 28 if ($filter_actor) { 31 29 $filter_actor = reset($filter_actor); 32 - $actor_value = array( 33 - $filter_actor => $handles[$filter_actor]->getFullName(), 34 - ); 30 + $actor_value = array($handles[$filter_actor]); 35 31 } 36 32 } 37 33
+1 -3
src/applications/pholio/controller/PholioMockEditController.php
··· 230 230 ->withPHIDs($v_cc) 231 231 ->execute(); 232 232 233 - $cc_tokens = mpull($handles, 'getFullName', 'getPHID'); 234 - 235 233 $image_elements = array(); 236 234 foreach ($mock_images as $mock_image) { 237 235 $image_elements[] = id(new PholioUploadedImageView()) ··· 303 301 id(new AphrontFormTokenizerControl()) 304 302 ->setLabel(pht('CC')) 305 303 ->setName('cc') 306 - ->setValue($cc_tokens) 304 + ->setValue($handles) 307 305 ->setUser($user) 308 306 ->setDatasource('/typeahead/common/mailable/')) 309 307 ->appendChild(
+2 -4
src/applications/pholio/query/PholioMockSearchEngine.php
··· 27 27 PhabricatorSavedQuery $saved_query) { 28 28 29 29 $phids = $saved_query->getParameter('authorPHIDs', array()); 30 - $handles = id(new PhabricatorHandleQuery()) 30 + $author_handles = id(new PhabricatorHandleQuery()) 31 31 ->setViewer($this->requireViewer()) 32 32 ->withPHIDs($phids) 33 33 ->execute(); 34 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 35 34 36 35 $form 37 36 ->appendChild( ··· 39 38 ->setDatasource('/typeahead/common/users/') 40 39 ->setName('authors') 41 40 ->setLabel(pht('Authors')) 42 - ->setValue($author_tokens)); 43 - 41 + ->setValue($author_handles)); 44 42 } 45 43 46 44 protected function getURI($path) {
+2 -6
src/applications/ponder/query/PonderQuestionSearchEngine.php
··· 61 61 ->setViewer($this->requireViewer()) 62 62 ->withPHIDs($phids) 63 63 ->execute(); 64 - $tokens = mpull($handles, 'getFullName', 'getPHID'); 65 - 66 - $author_tokens = array_select_keys($tokens, $author_phids); 67 - $answerer_tokens = array_select_keys($tokens, $answerer_phids); 68 64 69 65 $form 70 66 ->appendChild( ··· 72 68 ->setDatasource('/typeahead/common/users/') 73 69 ->setName('authors') 74 70 ->setLabel(pht('Authors')) 75 - ->setValue($author_tokens)) 71 + ->setValue(array_select_keys($handles, $author_phids))) 76 72 ->appendChild( 77 73 id(new AphrontFormTokenizerControl()) 78 74 ->setDatasource('/typeahead/common/users/') 79 75 ->setName('answerers') 80 76 ->setLabel(pht('Answered By')) 81 - ->setValue($answerer_tokens)) 77 + ->setValue(array_select_keys($handles, $answerer_phids))) 82 78 ->appendChild( 83 79 id(new AphrontFormSelectControl()) 84 80 ->setLabel(pht('Status'))
+2 -3
src/applications/project/query/PhabricatorProjectSearchEngine.php
··· 36 36 PhabricatorSavedQuery $saved_query) { 37 37 38 38 $phids = $saved_query->getParameter('memberPHIDs', array()); 39 - $handles = id(new PhabricatorHandleQuery()) 39 + $member_handles = id(new PhabricatorHandleQuery()) 40 40 ->setViewer($this->requireViewer()) 41 41 ->withPHIDs($phids) 42 42 ->execute(); 43 - $member_tokens = mpull($handles, 'getFullName', 'getPHID'); 44 43 45 44 $status = $saved_query->getParameter('status'); 46 45 ··· 50 49 ->setDatasource('/typeahead/common/users/') 51 50 ->setName('members') 52 51 ->setLabel(pht('Members')) 53 - ->setValue($member_tokens)) 52 + ->setValue($member_handles)) 54 53 ->appendChild( 55 54 id(new AphrontFormSelectControl()) 56 55 ->setLabel(pht('Status'))
+2 -5
src/applications/releeph/controller/project/ReleephProjectEditController.php
··· 135 135 ->withPHIDs($pusher_phids) 136 136 ->execute(); 137 137 138 - $pusher_tokens = array(); 139 - foreach ($pusher_phids as $phid) { 140 - $pusher_tokens[$phid] = $handles[$phid]->getFullName(); 141 - } 138 + $pusher_handles = array_select_keys($handles, $pusher_phids); 142 139 143 140 $basic_inset = id(new AphrontFormInsetView()) 144 141 ->setTitle(pht('Basics')) ··· 209 206 ->setLabel(pht('Pushers')) 210 207 ->setName('pushers') 211 208 ->setDatasource('/typeahead/common/users/') 212 - ->setValue($pusher_tokens)); 209 + ->setValue($pusher_handles)); 213 210 214 211 $commit_author_inset = $this->buildCommitAuthorInset($commit_author); 215 212
+2 -3
src/applications/releeph/query/ReleephRequestSearchEngine.php
··· 60 60 PhabricatorSavedQuery $saved_query) { 61 61 62 62 $phids = $saved_query->getParameter('requestorPHIDs', array()); 63 - $handles = id(new PhabricatorHandleQuery()) 63 + $requestor_handles = id(new PhabricatorHandleQuery()) 64 64 ->setViewer($this->requireViewer()) 65 65 ->withPHIDs($phids) 66 66 ->execute(); 67 - $requestor_tokens = mpull($handles, 'getFullName', 'getPHID'); 68 67 69 68 $form 70 69 ->appendChild( ··· 84 83 ->setDatasource('/typeahead/common/users/') 85 84 ->setName('requestors') 86 85 ->setLabel(pht('Requestors')) 87 - ->setValue($requestor_tokens)); 86 + ->setValue($requestor_handles)); 88 87 } 89 88 90 89 protected function getURI($path) {
+4 -4
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 59 59 } 60 60 61 61 if ($project->getSymbolIndexProjects()) { 62 - $uses = id(new PhabricatorRepositoryArcanistProject())->loadAllWhere( 63 - 'phid in (%Ls)', 64 - $project->getSymbolIndexProjects()); 65 - $uses = mpull($uses, 'getName', 'getPHID'); 62 + $uses = id(new PhabricatorHandleQuery()) 63 + ->setViewer($user) 64 + ->withPHIDs($project->getSymbolIndexProjects()) 65 + ->execute(); 66 66 } else { 67 67 $uses = array(); 68 68 }
-4
src/applications/search/controller/PhabricatorSearchController.php
··· 128 128 $author_value = array_select_keys( 129 129 $handles, 130 130 $query->getParameter('author', array())); 131 - $author_value = mpull($author_value, 'getFullName', 'getPHID'); 132 131 133 132 $owner_value = array_select_keys( 134 133 $handles, 135 134 $query->getParameter('owner', array())); 136 - $owner_value = mpull($owner_value, 'getFullName', 'getPHID'); 137 135 138 136 $subscribers_value = array_select_keys( 139 137 $handles, 140 138 $query->getParameter('subscribers', array())); 141 - $subscribers_value = mpull($subscribers_value, 'getFullName', 'getPHID'); 142 139 143 140 $project_value = array_select_keys( 144 141 $handles, 145 142 $query->getParameter('project', array())); 146 - $project_value = mpull($project_value, 'getFullName', 'getPHID'); 147 143 148 144 $search_form = new AphrontFormView(); 149 145 $search_form
+2 -3
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
··· 29 29 AphrontFormView $form, 30 30 PhabricatorSavedQuery $saved_query) { 31 31 $phids = $saved_query->getParameter('authorPHIDs', array()); 32 - $handles = id(new PhabricatorHandleQuery()) 32 + $author_handles = id(new PhabricatorHandleQuery()) 33 33 ->setViewer($this->requireViewer()) 34 34 ->withPHIDs($phids) 35 35 ->execute(); 36 - $author_tokens = mpull($handles, 'getFullName', 'getPHID'); 37 36 38 37 $voted = $saved_query->getParameter('voted', false); 39 38 ··· 43 42 ->setDatasource('/typeahead/common/users/') 44 43 ->setName('authors') 45 44 ->setLabel(pht('Authors')) 46 - ->setValue($author_tokens)) 45 + ->setValue($author_handles)) 47 46 ->appendChild( 48 47 id(new AphrontFormCheckboxControl()) 49 48 ->addCheckbox(
+2 -9
src/view/form/control/AphrontFormTokenizerControl.php
··· 35 35 $name = $this->getName(); 36 36 $values = nonempty($this->getValue(), array()); 37 37 38 - // TODO: Convert tokenizers to always take raw handles. For now, we 39 - // accept either a list of handles or a `map<phid, string>`. 40 - try { 41 - assert_instances_of($values, 'PhabricatorObjectHandle'); 42 - $values = mpull($values, 'getFullName', 'getPHID'); 43 - } catch (InvalidArgumentException $ex) { 44 - // Ignore this, just use the values as provided. 45 - } 46 - 38 + assert_instances_of($values, 'PhabricatorObjectHandle'); 39 + $values = mpull($values, 'getFullName', 'getPHID'); 47 40 48 41 if ($this->getID()) { 49 42 $id = $this->getID();