diff options
author | Bruno Ais <brunoaiss@gmail.com> | 2012-11-07 09:13:16 +0000 |
---|---|---|
committer | Bruno Ais <brunoaiss@gmail.com> | 2012-11-26 17:45:18 +0000 |
commit | 80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9 (patch) | |
tree | 0cb04a240b83b15b31417e7f851c70810943e0fc /phpBB | |
parent | 81547ba980a09832240ab3523448a159f2d514e1 (diff) | |
download | forums-80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9.tar forums-80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9.tar.gz forums-80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9.tar.bz2 forums-80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9.tar.xz forums-80da19ca7c12feb2996fd9d64dbdc8cb5c3cd2d9.zip |
[ticket/10601] Database updating code
This is what is needed to update the database to comply with these code changes
PHPBB3-10601
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/install/database_update.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 377e38c423..7b20404cf2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2749,6 +2749,33 @@ function change_database_data(&$no_updates, $version) $config->set('site_home_url', ''); $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 + FROM ' . MODULES_TABLE . ' + WHERE + module_basename = \'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']; + + _sql($sql, $errored, $error_ary); + + } + } + $db->sql_freeresult($result); break; } |