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

This commit is contained in:
Michael Hawkins 2023-07-20 13:25:17 +08:00 committed by Huong Nguyen
parent d4cec28c30
commit a18da528cc
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

View File

@ -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();
}