MDL-78763 tool_policy: Initialise returnurl as a moodle_url in viewall

This commit is contained in:
Michael Hawkins
2023-08-10 18:46:02 +07:00
committed by Huong Nguyen
parent 9a200b3ef9
commit 3f5aeb8baa
@@ -48,15 +48,18 @@ use tool_policy\policy_version;
*/
class page_viewalldoc implements renderable, templatable {
/** @var string Return url */
private $returnurl;
/** @var ?moodle_url Return url */
private $returnurl = null;
/**
* Prepare the page for rendering.
*
*/
public function __construct($returnurl) {
$this->returnurl = $returnurl;
if (!empty($returnurl)) {
$this->returnurl = new moodle_url($returnurl);
}
$this->prepare_global_page_access();
$this->prepare_policies();
}