Commit 311e012e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Ensure system user has id=0 when installing system profile view in upgrade from 1.0.x

parent fcb4a05e
......@@ -557,6 +557,11 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if (!get_record('view', 'owner', 0, 'type', 'profile')) {
// First ensure system user has id = 0; In older MySQL installations it may be > 0
$sysuser = get_record('usr', 'username', 'root');
if ($sysuser && $sysuser->id > 0 && !count_records('usr', 'id', 0)) {
set_field('usr', 'id', 0, 'id', $sysuser->id);
}
// Install system profile view
require_once(get_config('libroot') . 'view.php');
$dbtime = db_format_timestamp(time());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment