MDL-72182 user: cross-DB compatibility for getting user pages/blocks.

This commit is contained in:
Paul Holden
2023-02-06 09:34:32 +00:00
parent a2b88160d7
commit cd7ec775ae
+2 -1
View File
@@ -244,7 +244,7 @@ function my_reset_page_for_all_users(
JOIN {context} ctx ON ctx.instanceid = p.userid AND ctx.contextlevel = :usercontextlevel
JOIN {block_instances} bi ON bi.parentcontextid = ctx.id
AND bi.pagetypepattern = :pagetypepattern
AND (bi.subpagepattern IS NULL OR bi.subpagepattern = " . $DB->sql_concat("''", 'p.id') . ")
AND (bi.subpagepattern IS NULL OR bi.subpagepattern = " . $DB->sql_concat(':empty', 'p.id') . ")
WHERE p.private = :private
AND p.name = :name
AND p.userid $infragment";
@@ -253,6 +253,7 @@ function my_reset_page_for_all_users(
'private' => $private,
'usercontextlevel' => CONTEXT_USER,
'pagetypepattern' => $pagetype,
'empty' => '',
'name' => $pagename
], $inparams);
$blockids = $DB->get_fieldset_sql($sql, $params);