[Fusionforge-commits] FusionForge branch master updated. 2e95d597d22311728752b4b1b0b95870577b79b9

Roland Mas lolando at fusionforge.org
Thu Oct 18 15:47:15 CEST 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, master has been updated
       via  2e95d597d22311728752b4b1b0b95870577b79b9 (commit)
       via  8ddd0af12f3eddf3d321fc378c3aeb98107fdd5d (commit)
      from  de67fd4f008b0f74832b613d5a39276f361d6d6e (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 2e95d597d22311728752b4b1b0b95870577b79b9
Merge: de67fd4 8ddd0af
Author: Roland Mas <lolando at debian.org>
Date:   Thu Oct 18 15:47:04 2012 +0200

    Merged from 5.1 (via 5.2): Unlink external roles from a project when deleting it (with non-regression test) + syntax fix

diff --cc src/common/include/Group.class.php
index 13553f6,3626610..ca93c48
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@@ -1607,13 -1565,17 +1607,14 @@@ class Group extends Error 
  				return false;
  			}
  		}
 -		// Failsafe until user_group table is gone
 -		$res = db_query_params('DELETE FROM user_group WHERE group_id=$1',
 -					array($this->getID()));
  
  		// unlink roles from this project
- 		$ra = RoleAnonymous::getInstance();
- 		$rl = RoleLoggedIn::getInstance();
- 		$ra->unlinkProject($this);
- 		$rl->unlinkProject($this);
- 		// @todo : unlink all the other roles created in the project...
+ 		foreach ($this->getRoles() as $r) {
+ 			if ($r->getHomeProject() == NULL
+ 			    || $r->getHomeProject()->getID() != $this->getID()) {
+ 				$r->unlinkProject($this);
+ 			}
+ 		}
  
  		//
  		//	Delete Trackers
diff --cc tests/func/RBAC/rbacTest.php
index 416734e,f510dda..ae113d1
--- a/tests/func/RBAC/rbacTest.php
+++ b/tests/func/RBAC/rbacTest.php
@@@ -562,5 -562,24 +562,23 @@@ class RBAC extends FForge_SeleniumTestC
  		$this->click ("//input[@value='Submit']") ;
  		$this->waitForPageToLoad("30000");
  		$this->assertFalse($this->isTextPresent("Temporary role"));
+ 
+ 		// Non-regression test
+ 		$this->click("link=Site Admin");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->click("link=Display Full Project List/Edit Projects");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->click("link=SubProject");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->click("link=Permanently Delete Project");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->click("sure");
+ 		$this->click("reallysure");
+ 		$this->click("reallyreallysure");
+ 		$this->click("submit");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->click("link=Home");
+ 		$this->waitForPageToLoad("30000");
+ 		$this->assertFalse($this->isTextPresent("SubProject"));
  	}
  }
 -?>

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

Summary of changes:
 src/common/include/Group.class.php |   11 ++++++-----
 tests/func/RBAC/rbacTest.php       |   18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list