[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 3be8986b6f209e0eff1d0f6c4c4458cd4c1c5bed

Sylvain Beucler beuc-inria at fusionforge.org
Wed Apr 30 12:16:50 CEST 2014


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_3 has been updated
       via  3be8986b6f209e0eff1d0f6c4c4458cd4c1c5bed (commit)
      from  ae5620a716d608a93bfc490c1f6276e0cccac3b0 (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 3be8986b6f209e0eff1d0f6c4c4458cd4c1c5bed
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Apr 30 12:15:39 2014 +0200

    scm_admin: don't call scm plugin update if their form wasn't displayed,
    to avoid processing an apparently empty form and reset configuration

diff --git a/src/www/scm/admin/index.php b/src/www/scm/admin/index.php
index d07e5bb..54dbe0f 100644
--- a/src/www/scm/admin/index.php
+++ b/src/www/scm/admin/index.php
@@ -106,13 +106,17 @@ if (getStringFromRequest('create_repository') && getStringFromRequest('submit'))
 	$SCMFactory = new SCMFactory();
 	$scm_plugins = $SCMFactory->getSCMs();
 
+	$scm_changed = false;
 	if (in_array($scmradio, $scm_plugins)) {
 		foreach ($scm_plugins as $plugin) {
 			$myPlugin = plugin_get_object($plugin);
 			if ($scmradio == $myPlugin->name) {
-				$group->setPluginUse($myPlugin->name, 1);
-				if ($myPlugin->getDefaultServer()) {
-					$group->setSCMBox($myPlugin->getDefaultServer());
+				if (!$group->usesPlugin($myPlugin->name)) {
+					$group->setPluginUse($myPlugin->name, 1);
+					if ($myPlugin->getDefaultServer()) {
+						$group->setSCMBox($myPlugin->getDefaultServer());
+					}
+					$scm_changed = true;
 				}
 			} else {
 				$group->setPluginUse($myPlugin->name, 0);
@@ -120,7 +124,10 @@ if (getStringFromRequest('create_repository') && getStringFromRequest('submit'))
 		}
 	}
 
-	plugin_hook("scm_admin_update", $hook_params);
+	// Don't call scm plugin update if their form wasn't displayed
+	// to avoid processing an apparently empty form and reset configuration
+	if (!$scm_changed)
+		plugin_hook("scm_admin_update", $hook_params);
 }
 
 $hook_params = array();

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

Summary of changes:
 src/www/scm/admin/index.php |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list