diff options
author | Bruno Ais <brunoaiss@gmail.com> | 2012-12-01 09:44:51 +0000 |
---|---|---|
committer | Bruno Ais <brunoaiss@gmail.com> | 2012-12-01 09:44:51 +0000 |
commit | a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e (patch) | |
tree | c4aef66b258b3938fabc82f61cdbe0d50e270ede /phpBB | |
parent | 1d9891588182c831aeb1ce20065f6ceaa3f892b4 (diff) | |
download | forums-a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e.tar forums-a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e.tar.gz forums-a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e.tar.bz2 forums-a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e.tar.xz forums-a0d5c52eb6e8ef3a6bb44cff60b364d3a3a5bf3e.zip |
[ticket/10601] New approach in the update algorithm
- New approach in the database update algorithm
PHPBB3-10601
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/install/database_update.php | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index eed484dfae..f3136690a2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2750,28 +2750,25 @@ function change_database_data(&$no_updates, $version) $config->set('site_home_text', ''); } - // ticket/10601: Make inbox default. Add basename to ucp's pm category - // Check if this was already applied - $sql = 'SELECT module_id, module_basename, parent_id, left_id, right_id + // PHPBB3-10601: Make inbox default. Add basename to ucp's pm category + + // Get the category wanted while checking, at the same time, if this has already been applied + $sql = 'SELECT module_id, module_basename FROM ' . MODULES_TABLE . " - WHERE module_basename = 'ucp_pm' + WHERE module_basename <> 'ucp_pm' AND + module_langname='UCP_PM' ORDER BY module_id"; $result = $db->sql_query_limit($sql, 1); if ($row = $db->sql_fetchrow($result)) { - // Checking if this is not a category - if ($row['left_id'] === $row['right_id'] - 1) - { - // This update is still not applied. Applying it - - $sql = 'UPDATE ' . MODULES_TABLE . " - SET module_basename = 'ucp_pm' - WHERE module_id = " . (int) $row['parent_id']; + // This update is still not applied. Applying it - _sql($sql, $errored, $error_ary); + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_basename = 'ucp_pm' + WHERE module_id = " . (int) $row['module_id']; - } + _sql($sql, $errored, $error_ary); } $db->sql_freeresult($result); |