mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Let project prefilling accept PHIDs
Summary: I recently made this better about accepting project names, but we use it in some cases with PHIDs. Make that work properly again. Test Plan: Clicked "New Task" from a project page. Reviewers: chad, btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8778
This commit is contained in:
parent
20abf37b88
commit
041c3fd19d
1 changed files with 12 additions and 0 deletions
|
@ -58,7 +58,19 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
if ($projects) {
|
||||
$tokens = $request->getStrList('projects');
|
||||
|
||||
$type_project = PhabricatorProjectPHIDTypeProject::TYPECONST;
|
||||
foreach ($tokens as $key => $token) {
|
||||
if (phid_get_type($token) == $type_project) {
|
||||
// If this is formatted like a PHID, leave it as-is.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^#/', $token)) {
|
||||
// If this already has a "#", leave it as-is.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add a "#" prefix.
|
||||
$tokens[$key] = '#'.$token;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue