diff options
author | Henry Sudhof <kellanved@phpbb.com> | 2007-05-25 09:34:05 +0000 |
---|---|---|
committer | Henry Sudhof <kellanved@phpbb.com> | 2007-05-25 09:34:05 +0000 |
commit | e45c503bde5df9583dde575bec2fe3ff406ac071 (patch) | |
tree | 05b0228c42e10d6736dcacd134f7eee64cb10e49 | |
parent | bd2f26a1862ae7737d830b41adb6f75e7ce1143e (diff) | |
download | forums-e45c503bde5df9583dde575bec2fe3ff406ac071.tar forums-e45c503bde5df9583dde575bec2fe3ff406ac071.tar.gz forums-e45c503bde5df9583dde575bec2fe3ff406ac071.tar.bz2 forums-e45c503bde5df9583dde575bec2fe3ff406ac071.tar.xz forums-e45c503bde5df9583dde575bec2fe3ff406ac071.zip |
undoing the fix for #11421 - correcting post counts was not well liked.
#11665
git-svn-id: file:///svn/phpbb/trunk@7674 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 17 | ||||
-rw-r--r-- | phpBB/install/install_convert.php | 87 |
3 files changed, 13 insertions, 92 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index e86fe1430d..bfac176f73 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -196,7 +196,6 @@ p a { <li>[Fix] Made Custom BBCode validation more strict (Bug #11335)</li> <li>[Fix] Proper sync of data on topic copy (Bug #11335)</li> <li>[Fix] Introduced ORDER BY clauses to converter queries (Bug #10697)</li> - <li>[Fix] added a sync to post counts during conversion (Bug #11421)</li> <li>[Fix] Stopped bots from getting added to the registered users group during conversion (Bug #11283)</li> <li>[Fix] Filled "SMILIEYS_DISABLED" template variable (Bug #11257)</li> <li>[Fix] Properly escaped the delimiter in disallowed username comparisons (Bug #11339)</li> diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index badac08999..4346c6f4d1 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -59,6 +59,15 @@ function phpbb_insert_forums() $max_forum_id++; + // pruning disabled globally? + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}config + WHERE config_name = 'prune_enable'"; + $result = $src_db->sql_query($sql); + $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); + $src_db->sql_freeresult($result); + + // Insert categories $sql = 'SELECT cat_id, cat_title FROM ' . $convert->src_table_prefix . 'categories @@ -84,13 +93,7 @@ function phpbb_insert_forums() break; } - // pruning disabled globally? - $sql = "SELECT config_value - FROM {$convert->src_table_prefix}config - WHERE config_name = 'prune_enable'"; - $result = $src_db->sql_query($sql); - $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); - $src_db->sql_freeresult($result); + $cats_added = array(); while ($row = $src_db->sql_fetchrow($result)) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 69ca75c9da..0ef32b1921 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -783,17 +783,9 @@ class install_convert extends module $jump = request_var('jump', 0); $final_jump = request_var('final_jump', 0); $sync_batch = request_var('sync_batch', -1); - $sync_post_count = request_var('sync_post_count', -1); $last_statement = request_var('last', 0); // We are running sync... - if ($sync_post_count >= 0) - { - $this->sync_user_posts($sync_post_count); - return; - } - - // We are running sync... if ($sync_batch >= 0) { $this->sync_forums($sync_batch); @@ -1171,12 +1163,10 @@ class install_convert extends module $sql .= (!empty($schema['having'])) ? "\nHAVING " . $schema['having'] : ''; // Order By - if (empty($schema['order_by']) && !empty($schema['primary'])) { $schema['order_by'] = $schema['primary']; } - $sql .= (!empty($schema['order_by'])) ? "\nORDER BY " . $schema['order_by'] : ''; // Counting basically holds the amount of rows processed. @@ -1415,78 +1405,6 @@ class install_convert extends module /** * Sync function being executed at the middle, some functions need to be executed after a successful sync. */ - function sync_user_posts($sync_batch) - { - global $db, $template, $user; - global $convert; - - $template->assign_block_vars('checks', array( - 'S_LEGEND' => true, - 'LEGEND' => $user->lang['SYNC_POST_COUNT'], - )); - - $batch_size = $convert->batch_size; - - $sql = 'SELECT COUNT(user_id) AS max_value - FROM ' . USERS_TABLE; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - // Set values of minimum/maximum primary value for this table. - $primary_min = 0; - $primary_max = $row['max_value']; - - if ($sync_batch == 1) - { - $sync_batch = (int) $primary_min; - } - // Fetch a batch of rows, process and insert them. - while ($sync_batch <= $primary_max && still_on_time()) - { - $end = ($sync_batch + $batch_size - 1); - - - $template->assign_block_vars('checks', array( - 'TITLE' => sprintf($user->lang['SYNC_POST_COUNT_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' KB]' : ''), - 'RESULT' => $user->lang['DONE'], - )); - - $sync_batch += $batch_size; - } - - if ($sync_batch >= $primary_max) - { - sync_post_count($sync_batch, $batch_size); - $url = $this->save_convert_progress('&sync_batch=0'); - - $template->assign_vars(array( - 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], - 'U_ACTION' => $url, - )); - - $this->meta_refresh($url); - return; - } - else - { - $sync_batch--; - } - - $url = $this->save_convert_progress('&sync_post_count=' . $sync_batch); - - $template->assign_vars(array( - 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], - 'U_ACTION' => $url, - )); - - $this->meta_refresh($url); - return; - } - - /** - * Sync function being executed at the middle, some functions need to be executed after a successful sync. - */ function sync_forums($sync_batch) { global $template, $user, $db, $phpbb_root_path, $phpEx, $config, $cache; @@ -1801,8 +1719,9 @@ class install_convert extends module 'RESULT' => $user->lang['DONE'], )); - // Continue with synchronizing the post counts... - $url = $this->save_convert_progress('&sync_post_count=0'); + // Continue with synchronizing the forums... + $url = $this->save_convert_progress('&sync_batch=0'); + $template->assign_vars(array( 'L_SUBMIT' => $user->lang['CONTINUE_CONVERT'], 'U_ACTION' => $url, |