[Fusionforge-commits] r15506 - branches/Branch_5_1/src/common/include

Thorsten Glaser mirabilos at fusionforge.org
Fri May 11 16:56:39 CEST 2012


Author: mirabilos
Date: 2012-05-11 16:56:39 +0200 (Fri, 11 May 2012)
New Revision: 15506

Modified:
   branches/Branch_5_1/src/common/include/Group.class.php
Log:
fix broken commit in r15354 by jheyman:

when choosing the SCM plugin from the group registration form
instead of the one from the template page, the logic in the
loop was wrong: instead of skipping to copy the scm plugin
from the template project and copying all others, it copied
only the scm projects but no others (we use extratabs and
mediawiki plugins in our template project in Evolvis by
default, so I noticed it)


Modified: branches/Branch_5_1/src/common/include/Group.class.php
===================================================================
--- branches/Branch_5_1/src/common/include/Group.class.php	2012-05-11 13:03:47 UTC (rev 15505)
+++ branches/Branch_5_1/src/common/include/Group.class.php	2012-05-11 14:56:39 UTC (rev 15506)
@@ -2575,13 +2575,27 @@
 				}
 			}
 
-			// Disabled to keep user choice from registration page.
-//			$this->setUseSCM ($template->usesSCM()) ;
+			if (0) {
+				/* use SCM plugin from template group */
+				$this->setUseSCM($template->usesSCM());
 
-			foreach ($template->getPlugins() as $plugin_id => $plugin_name) {
-				if (preg_match('/^scm/', $plugin_name) && ($plugin_name != 'scmhook')) {
+				foreach ($template->getPlugins() as
+				    $plugin_id => $plugin_name) {
 					$this->setPluginUse($plugin_name);
 				}
+			} else {
+				/* use SCM choice from registration page */
+
+				foreach ($template->getPlugins() as
+				    $plugin_id => $plugin_name) {
+					if (substr($plugin_name, 3) == 'scm' &&
+					    $plugin_name != 'scmhook') {
+						/* skip copying scm plugins */
+						continue;
+					}
+					/* enable other plugins though */
+					$this->setPluginUse($plugin_name);
+				}
 			}
 
 			foreach ($template->getRoles() as $oldrole) {




More information about the Fusionforge-commits mailing list