aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-04-19 03:18:20 +0200
committerNils Adermann <naderman@naderman.de>2012-04-19 03:18:20 +0200
commitc43373068636a4f361423f2fe41231ac2e32f70f (patch)
treec28f3db650c8fade9474d440fb7efec9e0bf59a3 /phpBB/install
parentea8f83de6f87af8fc9413e1be557953cabe8811e (diff)
downloadforums-c43373068636a4f361423f2fe41231ac2e32f70f.tar
forums-c43373068636a4f361423f2fe41231ac2e32f70f.tar.gz
forums-c43373068636a4f361423f2fe41231ac2e32f70f.tar.bz2
forums-c43373068636a4f361423f2fe41231ac2e32f70f.tar.xz
forums-c43373068636a4f361423f2fe41231ac2e32f70f.zip
[ticket/10759] Retrieve style_id after INSERT since we cannot set it
PHPBB3-10759
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index cddc1c4164..d71226a29c 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2503,10 +2503,17 @@ function change_database_data(&$no_updates, $version)
// No valid styles: remove everything and add prosilver
_sql('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary);
- $sql = 'INSERT INTO ' . STYLES_TABLE . " (style_id, style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES (1, 'prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')";
+ $sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')";
_sql($sql, $errored, $error_ary);
- set_config('default_style', '1');
+ $sql = 'SELECT style_id
+ FROM ' . $table . "
+ WHERE style_name = 'prosilver'";
+ $result = _sql($sql, $errored, $error_ary);
+ $default_style = $db->sql_fetchfield($result);
+ $db->sql_freeresult($result);
+
+ set_config('default_style', $default_style);
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0';
_sql($sql, $errored, $error_ary);