MDL-30545 - messagelib: use $DB->sql_concat()

This commit is contained in:
Dan Poltawski
2012-11-13 15:09:14 +08:00
parent 1f5205b344
commit 675ea3231c
+3 -2
View File
@@ -447,7 +447,8 @@ function message_get_providers_for_user($userid) {
WHERE ra.userid = :userid
AND rc.capability $capcondition
AND rc.permission > 0
AND (CONCAT(actx.path, '/') LIKE CONCAT(cctx.path, '/%') OR CONCAT(cctx.path, '/') LIKE CONCAT(actx.path, '/%'))";
AND (".$DB->sql_concat('actx.path', "'/'")." LIKE ".$DB->sql_concat('cctx.path', "'/%'").
" OR ".$DB->sql_concat('cctx.path', "'/'")." LIKE ".$DB->sql_concat('actx.path', "'/%'").")";
if (!empty($CFG->defaultfrontpageroleid)) {
$frontpagecontext = context_course::instance(SITEID);
@@ -469,7 +470,7 @@ function message_get_providers_for_user($userid) {
WHERE rc.roleid = :frontpageroleid
AND rc.capability $capcondition2
AND rc.permission > 0
AND CONCAT(cctx.path, '/') LIKE :frontpagepathpattern";
AND ".$DB->sql_concat('cctx.path', "'/'")." LIKE :frontpagepathpattern";
}
$relevantcapabilities = $DB->get_records_sql_menu($sql, $params);