Skip to content

Commit

Permalink
MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhawkins authored and HuongNV13 committed Aug 10, 2023
1 parent 0922737 commit b50d053
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions admin/tool/policy/classes/output/page_viewalldoc.php
Expand Up @@ -48,8 +48,8 @@
*/
class page_viewalldoc implements renderable, templatable {

/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;

/** @var array List current (active) policy versions. */
private array $policies = [];
Expand All @@ -59,7 +59,10 @@ class page_viewalldoc implements renderable, templatable {
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}

$this->prepare_global_page_access();
$this->prepare_policies();
}
Expand Down

0 comments on commit b50d053

Please sign in to comment.