[Fusionforge-commits] FusionForge branch Branch_5_2 updated. 381a3683760f954e70a5aaa9bdf68d2fa1bcdaff

Roland Mas lolando at fusionforge.org
Fri Nov 9 13:31:30 CET 2012


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  381a3683760f954e70a5aaa9bdf68d2fa1bcdaff (commit)
      from  28b6e76ea2e007a716c7f77378a3f06851f4b559 (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 381a3683760f954e70a5aaa9bdf68d2fa1bcdaff
Author: Roland Mas <lolando at debian.org>
Date:   Fri Nov 9 13:31:21 2012 +0100

    Fixed crash when editing role permissions in projects where forums/pm/trackers are disabled

diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index 5335677..55f0609 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -327,9 +327,11 @@ abstract class BaseRole extends Error {
 		}
 
 		$atf = new ArtifactTypeFactory ($project) ;
-		$tids = $atf->getAllArtifactTypeIds () ;
-		foreach ($tids as $tid) {
-			$result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+		if (!$atf->isError()) {
+			$tids = $atf->getAllArtifactTypeIds () ;
+			foreach ($tids as $tid) {
+				$result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+			}
 		}
 		array_push ($sections,'tracker');
 
@@ -340,9 +342,11 @@ abstract class BaseRole extends Error {
 		$sections = array_merge($sections, $sections_forum);
 		
 		$ff = new ForumFactory ($project) ;
-		$fids = $ff->getAllForumIdsWithNews () ;
-		foreach ($fids as $fid) {
-			$result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+		if (!$ff->isError()) {
+			$fids = $ff->getAllForumIdsWithNews () ;
+			foreach ($fids as $fid) {
+				$result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+			}
 		}
 		array_push ($sections,'forum');
 
@@ -351,10 +355,13 @@ abstract class BaseRole extends Error {
 			$result[$section_pm][$group_id] = $this->getVal ($section_pm, $group_id) ;
 		}
 		$sections = array_merge($sections, $sections_pm);
+
 		$pgf = new ProjectGroupFactory ($project) ;
-		$pgids = $pgf->getAllProjectGroupIds () ;
-		foreach ($pgids as $pgid) {
-			$result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+		if (!$pgf->isError()) {
+			$pgids = $pgf->getAllProjectGroupIds () ;
+			foreach ($pgids as $pgid) {
+				$result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+			}
 		}
 		array_push ($sections,'pm') ;
 

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

Summary of changes:
 src/common/include/RBAC.php |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list