]> git.mjollnir.org Git - moodle.git/commitdiff
accesslib:build_context_path() - fix $emptyclause to avoid Oracle's dirty hack
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 23:46:37 +0000 (23:46 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 23:46:37 +0000 (23:46 +0000)
accesslib is now clean of Oracle's dirty hack. Thanks Eloy for the idea.

MDL-11347

lib/accesslib.php

index 1aa630dd9e52ebf43260a00ec0d8211a1bc7bdff..85b38342b6fc5467e0381a682725c9155cd02918 100755 (executable)
@@ -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