Index: trunk/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r8860 -r8905 --- trunk/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 8860) +++ trunk/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 8905) @@ -299,6 +299,7 @@ } $updater =& $this->Application->recallObject('kPermCacheUpdater', null, Array('continue' => $continue)); + /* @var $updater kPermCacheUpdater */ if ($continue === '0') { // No in dialog $updater->clearData(); $this->Application->Redirect($params['destination_template']); @@ -322,7 +323,7 @@ } else { // all done -> redirect - $updater->clearData(); + $updater->SaveData(); $this->Application->RemoveVar('PermCache_UpdateRequired'); $this->Application->Redirect($params['destination_template']); } Index: trunk/core/units/categories/cache_updater.php =================================================================== diff -u -N -r8860 -r8905 --- trunk/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 8860) +++ trunk/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 8905) @@ -254,7 +254,7 @@ function initData() { - $this->clearData(true); // drop table before starting anyway + $this->clearData(); // drop table before starting anyway // 1. create table for rebuilding permissions cache $this->Conn->Query('CREATE TABLE '.$this->permCacheTable.' LIKE '.TABLE_PREFIX.'PermCache'); @@ -278,24 +278,26 @@ $this->doneCats = 0; } - function clearData($init_updater = false) + function clearData() { - if (!$init_updater) { - // copy data from temp permission cache table back to live - $this->Conn->Query('TRUNCATE '.TABLE_PREFIX.'PermCache'); - - $sql = 'INSERT INTO '.TABLE_PREFIX.'PermCache - SELECT * - FROM '.$this->permCacheTable; - $this->Conn->Query($sql); - } - $this->Conn->Query('DROP TABLE IF EXISTS '.$this->progressTable); $this->Conn->Query('DROP TABLE IF EXISTS '.$this->permCacheTable); $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\''); $this->Conn->Query('UPDATE '.TABLE_PREFIX.'ConfigurationValues SET VariableValue = VariableValue+1 WHERE VariableName = \'CategoriesRebuildSerial\''); } + function SaveData() + { + // copy data from temp permission cache table back to live + $this->Conn->Query('TRUNCATE '.TABLE_PREFIX.'PermCache'); + + $sql = 'INSERT INTO '.TABLE_PREFIX.'PermCache + SELECT * + FROM '.$this->permCacheTable; + $this->Conn->Query($sql); + $this->clearData(); + } + function DoTheJob() { $data = $this->Stack->Get(); @@ -481,7 +483,7 @@ // until proceeeded in this step category count exceeds category per step limit $needs_more = $this->DoTheJob(); } - $this->clearData(); + $this->SaveData(); } } ?> \ No newline at end of file