Skip to content

Commit efe8a8d

Browse files
committed
updated to work with the code in the latest PH version
1 parent 08ef4b9 commit efe8a8d

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

src/BurndownController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function processRequest() {
5050
$tasks_table = $data->buildTasksTable();
5151
$events_table = $data->buildEventTable();
5252
} catch (BurndownException $e) {
53-
$error_box = id(new AphrontErrorView())
53+
$error_box = id(new PHUIErrorView())
5454
->setTitle(pht('Burndown could not be rendered for this project'))
5555
->setErrors(array($e->getMessage()));
5656
}

src/BurndownData.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function __construct($project, $viewer) {
7070
$tasks = id(new ManiphestTaskQuery())
7171
->setViewer($viewer)
7272
->withAnyProjects(array($this->project->getPHID()))
73+
->needProjectPHIDs(true)
7374
->execute();
7475

7576
// Now load *every transaction* for those tasks. This loads all the
@@ -440,8 +441,8 @@ public function buildTasksTable() {
440441
*/
441442
private function buildTasksTree() {
442443
// Shorter constants
443-
$DEPENDS_ON = PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK;
444-
$DEPENDED_ON = PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK;
444+
$DEPENDS_ON = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
445+
$DEPENDED_ON = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
445446

446447
// Load all edges of depends and depended on tasks
447448
$edges = id(new PhabricatorEdgeQuery())
@@ -693,4 +694,4 @@ private function extractEvents($xactions, array $scope_phids) {
693694
return $events;
694695
}
695696

696-
}
697+
}

src/SprintTaskStoryPointsField.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,27 @@ public function getStandardCustomFieldNamespace() {
4343
public function showField() {
4444
static $show = null;
4545

46-
if ($show == null)
47-
{
48-
$toTest = $this->getObject()->getProjectPHIDs();
49-
if (empty($toTest)) {
46+
$viewer = $this->getViewer();
47+
48+
if ($show == null) {
49+
$id = $this->getObject()->getID();
50+
$task = id(new ManiphestTaskQuery())
51+
->setViewer($viewer)
52+
->withIds(array($id))
53+
->needProjectPHIDs(true)
54+
->executeOne();
55+
if (!($task instanceof ManiphestTask)) {
56+
return $show = false;
57+
}
58+
$project_phids = $task->getProjectPHIDs();
59+
if (empty($project_phids)) {
5060
return $show = false;
5161
}
5262
// Fetch the names from all the Projects associated with this task
5363
$projects = id(new PhabricatorProject())
5464
->loadAllWhere(
5565
'phid IN (%Ls)',
56-
$this->getObject()->getProjectPHIDs());
66+
$project_phids);
5767
$names = mpull($projects, 'getName');
5868

5969
// Set show to true if one of the Projects contains "Sprint"

0 commit comments

Comments
 (0)