1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 03:54:10 +01:00

[ticket/10601] Database updating code

This is what is needed to update the database to comply with these code changes

PHPBB3-10601
This commit is contained in:
Bruno Ais 2012-11-07 09:13:16 +00:00
parent 81547ba980
commit 80da19ca7c

View File

@ -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;
}