View | Details | Raw Unified | Return to bug 6667 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/install/Installer.inc.php (+3 lines)
 Lines 290-295   class Installer { Link Here 
290
	function updateVersion() {
290
	function updateVersion() {
291
		if ($this->newVersion->compare($this->currentVersion) > 0) {
291
		if ($this->newVersion->compare($this->currentVersion) > 0) {
292
			if ($this->getParam('manualInstall')) {
292
			if ($this->getParam('manualInstall')) {
293
				// Mark old version as no longer current
294
				$this->executeSQL(sprintf('UPDATE versions SET current = 0 WHERE product = %s', $this->dbconn->qstr($this->currentVersion->getProduct())));
295
293
				// FIXME Would be better to have a mode where $dbconn->execute() saves the query
296
				// FIXME Would be better to have a mode where $dbconn->execute() saves the query
294
				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)));
297
				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)));
295
			} else {
298
			} else {
(-)a/classes/site/VersionDAO.inc.php (-1 / +2 lines)
 Lines 139-145   class VersionDAO extends DAO { Link Here 
139
					$isNewVersion = false;
139
					$isNewVersion = false;
140
				} elseif ($version->compare($oldVersion) == 1) {
140
				} elseif ($version->compare($oldVersion) == 1) {
141
					// Version to insert is newer than the existing version entry.
141
					// Version to insert is newer than the existing version entry.
142
					// We'll update the existing entry below.
142
					// We reset existing entry.
143
					$this->update('UPDATE versions SET current = 0 WHERE current = 1 AND product = ?', $version->getProduct());
143
				} else {
144
				} else {
144
					// We do not support downgrades.
145
					// We do not support downgrades.
145
					fatalError('You are trying to downgrade the product "'.$version->getProduct().'" from version ['.$oldVersion->getVersionString().'] to version ['.$version->getVersionString().']. Downgrades are not supported.');
146
					fatalError('You are trying to downgrade the product "'.$version->getProduct().'" from version ['.$oldVersion->getVersionString().'] to version ['.$version->getVersionString().']. Downgrades are not supported.');

Return to bug 6667