@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.

Make Maniphest project prefill more modern and standard

Summary: Fixes T4777. We technically support `?projects=...` already, but parse it in an unusual way and apply old, awkward, excessively strict lookups to it.

Test Plan: Used reasonable, standard, human-readable strings to prefill `?projects=` and got the results I expected.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T4777

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

+6 -22
+6 -22
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 57 57 if ($can_edit_projects) { 58 58 $projects = $request->getStr('projects'); 59 59 if ($projects) { 60 - $tokens = explode(';', $projects); 60 + $tokens = $request->getStrList('projects'); 61 61 62 - $slug_map = id(new PhabricatorProjectQuery()) 63 - ->setViewer($user) 64 - ->withPhrictionSlugs($tokens) 65 - ->execute(); 62 + foreach ($tokens as $key => $token) { 63 + $tokens[$key] = '#'.$token; 64 + } 66 65 67 - $name_map = id(new PhabricatorProjectQuery()) 66 + $default_projects = id(new PhabricatorObjectQuery()) 68 67 ->setViewer($user) 69 68 ->withNames($tokens) 70 69 ->execute(); 71 - 72 - $phid_map = id(new PhabricatorProjectQuery()) 73 - ->setViewer($user) 74 - ->withPHIDs($tokens) 75 - ->execute(); 76 - 77 - $all_map = mpull($slug_map, null, 'getPhrictionSlug') + 78 - mpull($name_map, null, 'getName') + 79 - mpull($phid_map, null, 'getPHID'); 80 - 81 - $default_projects = array(); 82 - foreach ($tokens as $token) { 83 - if (isset($all_map[$token])) { 84 - $default_projects[] = $all_map[$token]->getPHID(); 85 - } 86 - } 70 + $default_projects = mpull($default_projects, 'getPHID'); 87 71 88 72 if ($default_projects) { 89 73 $task->setProjectPHIDs($default_projects);