From: martinlanghoff Date: Wed, 19 Sep 2007 23:46:37 +0000 (+0000) Subject: accesslib:build_context_path() - fix $emptyclause to avoid Oracle's dirty hack X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=413a19dd4cf610e73fc98d1b69d8c18aada43d1e;p=moodle.git accesslib:build_context_path() - fix $emptyclause to avoid Oracle's dirty hack accesslib is now clean of Oracle's dirty hack. Thanks Eloy for the idea. MDL-11347 --- diff --git a/lib/accesslib.php b/lib/accesslib.php index 1aa630dd9e..85b38342b6 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -4443,13 +4443,7 @@ function build_context_path($force=false) { 'instanceid', SITEID); } - $emptyclause = " AND path=''"; - if ($CFG->dbtype==='oci8po') { // DIRTYHACK - everybody loves Oracle ;-) - $emptyclause = " AND path=' '"; - } - if ($force) { - $emptyclause = ''; - } + $emptyclause = " AND (depth IS NULL OR depth=0) "; // TODO: following could be improved with WHERE + $emptyclause, but there should be a better way $upathsql = "UPDATE {$CFG->prefix}context