From 06339e0c8ac8fdbbf5d2784df8019704da9bd6eb Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 13 Jan 2015 12:28:33 -0500
Subject: [PATCH] - fixed javascript call in json file

---
 install/lib/update.lib.php |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php
index 52d4a3c..d2d11bf 100644
--- a/install/lib/update.lib.php
+++ b/install/lib/update.lib.php
@@ -160,13 +160,15 @@
 
 		//* get the version of the db schema from the server table
 		$found = true;
+		$dev_patch = false;
 		while($found == true) {
-			$next_db_version = intval($current_db_version + 1);
+			if($dev_patch == true) $next_db_version = 'dev_collection';
+			else $next_db_version = intval($current_db_version + 1);
 			$sql_patch_filename = realpath(dirname(__FILE__).'/../').'/sql/incremental/upd_'.str_pad($next_db_version, 4, '0', STR_PAD_LEFT).'.sql';
 			$php_patch_filename = realpath(dirname(__FILE__).'/../').'/patches/upd_'.str_pad($next_db_version, 4, '0', STR_PAD_LEFT).'.php';
 			
 			// comma separated list of version numbers were a update has to be done silently
-			$silent_update_versions = '75';
+			$silent_update_versions = 'dev_collection,75';
 
 			if(is_file($sql_patch_filename)) {
 
@@ -182,7 +184,7 @@
 				}
 
 				//* Exec onBeforeSQL function
-				if(isset($php_patch) && is_object($php_patch)) {
+				if(isset($php_patch) && is_object($php_patch) && method_exists($php_patch, 'onBeforeSQL')) {
 					$php_patch->onBeforeSQL();
 					swriteln($inst->lng('Executing PHP patch file').': '.$php_patch_filename);
 				}
@@ -200,12 +202,16 @@
 				swriteln($inst->lng('Loading SQL patch file').': '.$sql_patch_filename);
 
 				//* Exec onAfterSQL function
-				if(isset($php_patch) && is_object($php_patch)) {
+				if(isset($php_patch) && is_object($php_patch) && method_exists($php_patch, 'onAfterSQL')) {
 					$php_patch->onAfterSQL();
 				}
 
-				$current_db_version = $next_db_version;
+				if($dev_patch == false) $current_db_version = $next_db_version;
+				else $found = false;
+				
 				if(isset($php_patch)) unset($php_patch);
+			} elseif($dev_patch == false) {
+				$dev_patch = true;
 			} else {
 				$found = false;
 			}

--
Gitblit v1.9.1