Index: branches/5.2.x/core/install/upgrades.php =================================================================== diff -u -N -r14853 -r14856 --- branches/5.2.x/core/install/upgrades.php (.../upgrades.php) (revision 14853) +++ branches/5.2.x/core/install/upgrades.php (.../upgrades.php) (revision 14856) @@ -1,6 +1,6 @@ transformSortings(); $this->transformFieldPhrases(); // because of "la_col_ItemPrefix" phrase + $this->createPageRevisions(); } } @@ -1896,4 +1897,31 @@ $this->Conn->Query($sql); } } + + protected function createPageRevisions() + { + $sql = 'SELECT DISTINCT PageId + FROM ' . TABLE_PREFIX . 'PageContent'; + $page_ids = $this->Conn->GetCol($sql); + + foreach ($page_ids as $page_id) { + $fields_hash = Array ( + 'PageId' => $page_id, + 'RevisionNumber' => 1, + 'IsDraft' => 0, + 'FromRevisionNumber' => 0, + 'CreatedById' => USER_ROOT, + 'CreatedOn' => adodb_mktime(), + 'Status' => STATUS_ACTIVE, + ); + + $this->Conn->doInsert($fields_hash, TABLE_PREFIX . 'PageRevisions'); + + $fields_hash = Array ( + 'RevisionId' => $this->Conn->getInsertID(), + ); + + $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'PageContent', 'PageId = ' . $page_id); + } + } } \ No newline at end of file