--- a/classes/install/Installer.inc.php +++ b/classes/install/Installer.inc.php @@ -290,10 +290,16 @@ class Installer { function updateVersion() { if ($this->newVersion->compare($this->currentVersion) > 0) { if ($this->getParam('manualInstall')) { + // Mark old version as no longer current + $this->executeSQL(sprintf('UPDATE versions SET current = 0 WHERE product = %s', $this->dbconn->qstr($this->currentVersion->getProduct()))); + // FIXME Would be better to have a mode where $dbconn->execute() saves the query return $this->executeSQL(sprintf('INSERT INTO versions (major, minor, revision, build, date_installed, current, product_type, product, product_class_name, lazy_load, sitewide) VALUES (%d, %d, %d, %d, NOW(), 1, %s, %s, %s, %d, %d)', $this->newVersion->getMajor(), $this->newVersion->getMinor(), $this->newVersion->getRevision(), $this->newVersion->getBuild(), $this->dbconn->qstr($this->newVersion->getProductType()), $this->dbconn->qstr($this->newVersion->getProduct()), $this->dbconn->qstr($this->newVersion->getProductClassName()), ($this->newVersion->getLazyLoad()?1:0), ($this->newVersion->getSitewide()?1:0))); } else { $versionDao =& DAORegistry::getDAO('VersionDAO'); + // Mark old version as no longer current + $versionDao->disableVersion($this->currentVersion->getProduct()); + if (!$versionDao->insertVersion($this->newVersion)) { return false; }