[Fusionforge-commits] FusionForge branch Branch_5_2 updated. 490f21c894f89b4cfacf596503bcd6f55646042f

Thorsten Glaser mirabilos at fusionforge.org
Thu Jun 13 15:15:14 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, Branch_5_2 has been updated
       via  490f21c894f89b4cfacf596503bcd6f55646042f (commit)
       via  3527346e4943e59c62ecc7c6d5b53a8261ae31b4 (commit)
      from  0aba7b2b1693d092a059dd59175699bcd781d69b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 490f21c894f89b4cfacf596503bcd6f55646042f
Author: Thorsten Glaser <t.glaser at tarent.de>
Date:   Thu Jun 13 15:15:00 2013 +0200

    fix typo (‘=’ ipv ‘==’)

diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index c55eeb7..00963ae 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -49,7 +49,7 @@ class WidgetLayoutManager {
 		$sql = "SELECT * from owner_layouts where owner_id=$1 and owner_type=$2";
 		$res = db_query_params($sql, array($owner_id, $owner_type));
 		if($res && db_numrows($res)<1) {
-			if($owner_type = self::OWNER_TYPE_USER) {
+			if ($owner_type == self::OWNER_TYPE_USER) {
 				$this->createDefaultLayoutForUser($owner_id);
 				$this->displayLayout($owner_id,$owner_type);
 			} else {

commit 3527346e4943e59c62ecc7c6d5b53a8261ae31b4
Author: Thorsten Glaser <t.glaser at tarent.de>
Date:   Thu Jun 13 14:57:06 2013 +0200

    some error checking for widgets

diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index 92e4328..c55eeb7 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -146,6 +146,8 @@ class WidgetLayoutManager {
 	 */
 	function createDefaultLayoutForUser($owner_id) {
 		$owner_type = self::OWNER_TYPE_USER;
+		db_begin();
+		$success = true;
 		$sql = "INSERT INTO owner_layouts(layout_id, is_default, owner_id, owner_type) VALUES (1, 1, $1, $2)";
 		if (db_query_params($sql, array($owner_id, $owner_type))) {
 
@@ -159,7 +161,10 @@ class WidgetLayoutManager {
 			$args[] = "($1, $2, 1, 2, 'mymonitoredfp', 1)";
 
 			foreach($args as $a) {
-				db_query_params($sql.$a,array($owner_id,$owner_type));
+				if (!db_query_params($sql.$a,array($owner_id,$owner_type))) {
+					$success = false;
+					break;
+				}
 			}
 
 			/*  $em =& EventManager::instance();
@@ -168,8 +173,14 @@ class WidgetLayoutManager {
 			    foreach($widgets as $widget) {
 			    $sql .= ",($13, $14, 1, $15, $16, $17)";
 			    }*/
+		} else
+			$success = false;
+		if (!$success) {
+			$success = db_error();
+			db_rollback();
+			exit_error(sprintf(_('DB Error: %s'), $success), 'widgets');
 		}
-		echo db_error();
+		db_commit();
 	}
 
 	/**

-----------------------------------------------------------------------

Summary of changes:
 src/common/widget/WidgetLayoutManager.class.php |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list