mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Merge branch 'develop-olympus' into develop
* develop-olympus: (57 commits) Revert "[ticket/7716] Data too long for column 'message_subject'" [ticket/7716] Data too long for column 'message_subject' [ticket/9780] Adding unit tests for gen_rand_string(). [ticket/9780] Add length check back to gen_rand_string(). [ticket/7972] Copying topics in the MCP now indexes the new topic. [ticket/9782] Board disable radio set on when server load high [ticket/9635] Useless parameter $data['post_time'] in function submit_post. [ticket/9104] Safari does not display box headers correctly in the ACP. [ticket/9777] Print error message in pre-commit hook when php is not installed. [ticket/7716] Data too long for column 'message_subject' [task/git-tools] Ignore git commit message comments [task/git-tools] Adjust the hook to enforce that a ticket is always mentioned [task/git-tools] Vastly expanded commit-msg hook. [task/git-tools] Beginnings of a syntax checking hook. [task/git-tools] Append ticket identifier to commit message prior to editing. [ticket/7332] Redirect users back to post details when performing actions. [ticket/7332] Collapse post details content down to a maximum of 300px heigh [ticket/9771] Remove query string parameters that have no name. [ticket/9760] Remove unrestricted wildcards from search terms. [ticket/9599] Reimplement phpbb_checkdnsrr() function. ... Conflicts: tests/template/template.php
This commit is contained in:
@@ -1749,6 +1749,52 @@ function change_database_data(&$no_updates, $version)
|
||||
_sql($sql, $errored, $error_ary);
|
||||
// end Bing Bot addition
|
||||
|
||||
// Delete shadow topics pointing to not existing topics
|
||||
$batch_size = 500;
|
||||
|
||||
// Set of affected forums we have to resync
|
||||
$sync_forum_ids = array();
|
||||
|
||||
do
|
||||
{
|
||||
$sql_array = array(
|
||||
'SELECT' => 't1.topic_id, t1.forum_id',
|
||||
'FROM' => array(
|
||||
TOPICS_TABLE => 't1',
|
||||
),
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(TOPICS_TABLE => 't2'),
|
||||
'ON' => 't1.topic_moved_id = t2.topic_id',
|
||||
),
|
||||
),
|
||||
'WHERE' => 't1.topic_moved_id <> 0
|
||||
AND t2.topic_id IS NULL',
|
||||
);
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $db->sql_query_limit($sql, $batch_size);
|
||||
|
||||
$topic_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_ids[] = (int) $row['topic_id'];
|
||||
|
||||
$sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!empty($topic_ids))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
while (sizeof($topic_ids) == $batch_size);
|
||||
|
||||
// Sync the forums we have deleted shadow topics from.
|
||||
sync('forum', 'forum_id', $sync_forum_ids, true, true);
|
||||
|
||||
$no_updates = false;
|
||||
break;
|
||||
}
|
||||
|
@@ -192,6 +192,17 @@ class install_update extends module
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the update files are actually meant to update from the current version
|
||||
if ($config['version'] != $this->update_info['version']['from'])
|
||||
{
|
||||
$this->unequal_version = true;
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_ERROR' => true,
|
||||
'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to']),
|
||||
));
|
||||
}
|
||||
|
||||
// Check if the update files stored are for the latest version...
|
||||
if ($this->latest_version != $this->update_info['version']['to'])
|
||||
{
|
||||
|
Reference in New Issue
Block a user