Details
Description
lib/accesslib.php makes a call to SQL function SUBSTR in the statement:
$sql = "UPDATE {$CFG->prefix}context
SET path = ".sql_concat("'$newpath'", 'SUBSTR(path, '.$len.' +1)')."
$setdepth
WHERE path LIKE '{$frompath}/%'";
execute_sql($sql,false);
but SUBSTR is not legitimate in MSSQL, SUBSTRING must be used, which is fine with MySQL except there may be a difference in the length parameter.
Problem discussed at:
http://moodle.org/mod/forum/discuss.php?d=106337
Fixed under 19_STABLE and HEAD.
Here it's the 19_STABLE change: http://cvs.moodle.org/moodle/lib/accesslib.php?r1=1.421.2.77&r2=1.421.2.78
Now it's using the cross-db sql_substr() function and the 3rd parameter is added to MSSQL DBs.