From 5ec7fa94c58847df3ab499b9f232185d7b35b1be Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 24 Jan 2025 10:50:09 +0000 Subject: [PATCH] MDL-83537 check: confirm presence of instance action link. --- lib/adminlib.php | 4 +++- lib/outputrenderers.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index d12cba3c51e..a4743f29ad5 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -11800,7 +11800,9 @@ class admin_setting_check extends admin_setting { $output = $OUTPUT->notification($loadingicon . $loadingstr, \core\output\notification::NOTIFY_INFO, false); // Add the action link. - $output .= $OUTPUT->render($this->check->get_action_link()); + if ($actionlink = $this->check->get_action_link()) { + $output .= $OUTPUT->render($actionlink); + } // Wrap in a div with a reference. The JS getAndRender will replace this with the response from the webservice. $statusdiv = \html_writer::div($output, '', ['data-check-reference' => $domref]); diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c84b5daaa55..9ca834801e1 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1867,7 +1867,9 @@ class core_renderer extends renderer_base { } // Add the action link. - $renderedresult .= $this->render_action_link($check->get_action_link()); + if ($actionlink = $check->get_action_link()) { + $renderedresult .= $this->render_action_link($actionlink); + } return $renderedresult; }