Commit d0c90a6d authored by Robert Lyon's avatar Robert Lyon

Bug 1850712: When copying a group task without an assigned portfolio

When we turn off the switch (set to 'No') there is an error with
trying to fetch the portfolio info

behatnotneeded

Change-Id: Ide34fb96b21de12681a8cff0734f5c14e1d9679c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 0fda9aed
......@@ -57,7 +57,10 @@ try {
$taskview = $rootGroupTask->get('taskview');
if ($userTask) {
$portfolioElement = PlansTools::getPortfolioElementByTypeAndId($rootGroupTask->get('outcometype'), $rootGroupTask->get('outcome'));
$outcomeurl = PlansTools::createOutcomeUrlForPortfolioElement($portfolioElement);
$outcomeurl = false;
if ($portfolioElement) {
$outcomeurl = PlansTools::createOutcomeUrlForPortfolioElement($portfolioElement);
}
$buttons = '';
if ($taskview) {
$buttons .= '<a href="' . get_config('wwwroot') . 'view/view.php?id=' . $taskview . '" class="btn btn-secondary btn-sm btn-view" title="' . get_string('showassignedview', 'artefact.plans') . '">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment