Commit dbf8cfee authored by Penny Leach's avatar Penny Leach
Browse files

horrible workaround for mysql- you cannot insert id = 0 into usr at core data...

horrible workaround for mysql- you cannot insert id = 0 into usr at core data install time, which breaks things that rely on the root user (eg templates with no owner)
parent 3262c218
......@@ -475,7 +475,11 @@ function core_install_defaults() {
$user->lastname = 'User';
$user->email = 'root@example.org';
$user->quota = get_config_plugin('artefact', 'file', 'defaultquota');
insert_record('usr', $user);
$newid = insert_record('usr', $user);
if ($newid > 0 && get_config('dbtype') == 'mysql') { // gratuitous mysql workaround
set_field('usr', 'id', 0, 'id', $newid);
}
// Insert the admin user
$user = new StdClass;
......
Supports Markdown
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