From: <an...@us...> - 2007-06-16 14:51:32
|
Revision: 16640 http://svn.sourceforge.net/gallery/?rev=16640&view=rev Author: andy_st Date: 2007-06-16 07:51:32 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Fix upgrade - Upgrade Schema table automatically to 1.2 and store Entity/Map ASAP such that setPluginParameter() and other API methods work when starting the upgrade code. Review 303. Modified Paths: -------------- trunk/gallery2/modules/core/classes/GalleryModule.class trunk/gallery2/modules/core/classes/GalleryStorage/GalleryStorageExtras.class Modified: trunk/gallery2/modules/core/classes/GalleryModule.class =================================================================== --- trunk/gallery2/modules/core/classes/GalleryModule.class 2007-06-16 13:11:20 UTC (rev 16639) +++ trunk/gallery2/modules/core/classes/GalleryModule.class 2007-06-16 14:51:32 UTC (rev 16640) @@ -160,6 +160,11 @@ return $ret; } + $ret = $storage->updateTableInfo($this->getId()); + if ($ret) { + return $ret; + } + if ($gallery->getDebug()) { $gallery->debug(sprintf('Upgrade (or install) %s module', $this->getId())); } Modified: trunk/gallery2/modules/core/classes/GalleryStorage/GalleryStorageExtras.class =================================================================== --- trunk/gallery2/modules/core/classes/GalleryStorage/GalleryStorageExtras.class 2007-06-16 13:11:20 UTC (rev 16639) +++ trunk/gallery2/modules/core/classes/GalleryStorage/GalleryStorageExtras.class 2007-06-16 14:51:32 UTC (rev 16640) @@ -1279,6 +1279,16 @@ $canStoreSql = version_compare("$major.$minor", '1.1', '>='); $canStoreTableInfo = version_compare("$major.$minor", '1.2', '>='); + if (!$canStoreTableInfo && $moduleId == 'core' && !in_array('Schema:1.1', $upgradeInfo)) { + /* Ensure that the table info can be stored after the first configureStore() call */ + if (!in_array('Schema:1.0', $upgradeInfo)) { + $upgradeInfo[] = 'Schema:1.0'; + } + $upgradeInfo[] = 'Schema:1.1'; + + return $this->configureStore($moduleId, $upgradeInfo); + } + if ($canStoreTableInfo) { $mapInfo = $this->_getTableInfo($moduleId, 'map'); $entityInfo = $this->_getTableInfo($moduleId, 'entity'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |