Differential D25103 Diff 434 src/applications/project/controller/PhabricatorProjectBoardViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectBoardViewController.php
Show First 20 Lines • Show All 687 Lines • ▼ Show 20 Lines | if ($column->getProxyPHID()) { | ||||
$default_phid = $column->getProjectPHID(); | $default_phid = $column->getProjectPHID(); | ||||
} | } | ||||
$specs = id(new ManiphestEditEngine()) | $specs = id(new ManiphestEditEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->newCreateActionSpecifications(array()); | ->newCreateActionSpecifications(array()); | ||||
foreach ($specs as $spec) { | foreach ($specs as $spec) { | ||||
// Prefill tags= when you open the Column menu | |||||
// https://we.phorge.it/T15147 | |||||
$spec_href = new PhutilURI($spec['uri']); | |||||
$spec_slug = $project->getPrimarySlug(); | |||||
if ($spec_slug !== null) { | |||||
$spec_href->replaceQueryParam('tags', $spec_slug); | |||||
} | |||||
valerio.bozzolan: The fix just involves a NULL check here ↑ | |||||
$column_items[] = id(new PhabricatorActionView()) | $column_items[] = id(new PhabricatorActionView()) | ||||
->setIcon($spec['icon']) | ->setIcon($spec['icon']) | ||||
->setName($spec['name']) | ->setName($spec['name']) | ||||
->setHref(id(new PhutilURI($spec['uri'])) | ->setHref($spec_href) | ||||
Done Inline ActionsAlso, this change gets rid of the id() function. This avoids some CPU cycles for just this syntax sugar, and it makes the code more readable. valerio.bozzolan: Also, this change gets rid of the `id()` function. This avoids some CPU cycles for just this… | |||||
->replaceQueryParam('tags', $project->getPrimarySlug())) | |||||
->setDisabled($spec['disabled']) | ->setDisabled($spec['disabled']) | ||||
->addSigil('column-add-task') | ->addSigil('column-add-task') | ||||
->setMetadata( | ->setMetadata( | ||||
array( | array( | ||||
'createURI' => $spec['uri'], | 'createURI' => $spec['uri'], | ||||
'columnPHID' => $column->getPHID(), | 'columnPHID' => $column->getPHID(), | ||||
'boardPHID' => $project->getPHID(), | 'boardPHID' => $project->getPHID(), | ||||
'projectPHID' => $default_phid, | 'projectPHID' => $default_phid, | ||||
▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
The fix just involves a NULL check here ↑