Skip to content

Commit

Permalink
MDL-72001 my: Add '__default' name check when retrieving default page
Browse files Browse the repository at this point in the history
  • Loading branch information
roland04 committed Jul 16, 2021
1 parent 8453fe0 commit ef30d47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions my/lib.php
Expand Up @@ -63,7 +63,7 @@ function my_copy_page($userid, $private=MY_PAGE_PRIVATE, $pagetype='my-index') {
}

// Get the system default page
if (!$systempage = $DB->get_record('my_pages', array('userid' => null, 'private' => $private))) {
if (!$systempage = $DB->get_record('my_pages', array('userid' => null, 'name' => '__default', 'private' => $private))) {
return false; // error
}

Expand Down Expand Up @@ -144,7 +144,7 @@ function my_reset_page($userid, $private=MY_PAGE_PRIVATE, $pagetype='my-index')
}

// Get the system default page
if (!$systempage = $DB->get_record('my_pages', array('userid' => null, 'private' => $private))) {
if (!$systempage = $DB->get_record('my_pages', array('userid' => null, 'name' => '__default', 'private' => $private))) {
return false; // error
}

Expand Down

0 comments on commit ef30d47

Please sign in to comment.