mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Fix board links in TaskDetail
Summary: Not sure if this is the correct fix, but I think it's where you intend to go? Test Plan: Click on link in Task, get the the correct board. Click lots of links of boards and make sure everything still works. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5361 Differential Revision: https://secure.phabricator.com/D9520
This commit is contained in:
parent
cc5ba7e801
commit
fefe5ae27c
3 changed files with 13 additions and 11 deletions
|
@ -565,16 +565,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
$column = head(array_intersect_key($columns, $in_column_phids));
|
||||
if ($column) {
|
||||
$column_name = pht('(%s)', $column->getDisplayName());
|
||||
// TODO: This is really hacky but there's no cleaner way to do it
|
||||
// right now, T4022 should give us better tools for this.
|
||||
$column_href = str_replace(
|
||||
'project/view',
|
||||
'project/board',
|
||||
$handle->getURI());
|
||||
$column_link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $column_href,
|
||||
'href' => $handle->getURI().'board/',
|
||||
'class' => 'maniphest-board-link',
|
||||
),
|
||||
$column_name);
|
||||
|
|
|
@ -79,6 +79,7 @@ final class PhabricatorApplicationProject extends PhabricatorApplication {
|
|||
),
|
||||
'/tag/' => array(
|
||||
'(?P<slug>[^/]+)/' => 'PhabricatorProjectProfileController',
|
||||
'(?P<slug>[^/]+)/board/' => 'PhabricatorProjectBoardViewController',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ final class PhabricatorProjectBoardViewController
|
|||
extends PhabricatorProjectBoardController {
|
||||
|
||||
private $id;
|
||||
private $slug;
|
||||
private $handles;
|
||||
private $queryKey;
|
||||
private $filter;
|
||||
|
@ -13,7 +14,8 @@ final class PhabricatorProjectBoardViewController
|
|||
}
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->id = $data['id'];
|
||||
$this->id = idx($data, 'id');
|
||||
$this->slug = idx($data, 'slug');
|
||||
$this->queryKey = idx($data, 'queryKey');
|
||||
$this->filter = (bool)idx($data, 'filter');
|
||||
}
|
||||
|
@ -24,12 +26,17 @@ final class PhabricatorProjectBoardViewController
|
|||
|
||||
$project = id(new PhabricatorProjectQuery())
|
||||
->setViewer($viewer)
|
||||
->needImages(true)
|
||||
->withIDs(array($this->id))
|
||||
->executeOne();
|
||||
->needImages(true);
|
||||
if ($this->slug) {
|
||||
$project->withSlugs(array($this->slug));
|
||||
} else {
|
||||
$project->withIDs(array($this->id));
|
||||
}
|
||||
$project = $project->executeOne();
|
||||
if (!$project) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$this->setProject($project);
|
||||
|
||||
$columns = id(new PhabricatorProjectColumnQuery())
|
||||
|
|
Loading…
Reference in a new issue