[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1417-ge9ddc8e

Franck Villaume nerville at libremir.placard.fr.eu.org
Wed Feb 1 21:24:58 CET 2017


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  e9ddc8e75a10ca3fda84ff0c081ca79f8a505c4f (commit)
      from  d8c9d7f1d03e6e4e84711ab0a267971c9c208deb (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=e9ddc8e75a10ca3fda84ff0c081ca79f8a505c4f

commit e9ddc8e75a10ca3fda84ff0c081ca79f8a505c4f
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Feb 1 21:24:42 2017 +0100

    artifact tracker: cloning from template fixes: hardening tests & fix single artifact status custom field

diff --git a/src/common/tracker/ArtifactType.class.php b/src/common/tracker/ArtifactType.class.php
index 239c6be..dbb397d 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -746,7 +746,6 @@ class ArtifactType extends FFError {
 	 * cloneFieldsFrom - clone all the fields and elements from another tracker
 	 *
 	 * @param	int	$clone_tracker_id	id of the cloned tracker
-	 * @param	int	$group_id		id of the project template to use.
 	 * @param	array	$id_mappings		array mapping between template objects and new project objects
 	 * @return	boolean	true/false on success
 	 */
@@ -868,7 +867,7 @@ class ArtifactType extends FFError {
 			//new field in this tracker
 			$nef = new ArtifactExtraField($this);
 			foreach ($current_efs as $current_ef) {
-				if ($current_ef['field_name'] == $ef['field_name']) {
+				if ($current_ef['field_name'] == $ef['field_name'] || $current_ef['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
 					// we delete the current extra field and use the template one...
 					$current_ef_todelete = new ArtifactExtraField($this, $current_ef);
 					$current_ef_todelete->delete(true,true);
@@ -961,11 +960,13 @@ class ArtifactType extends FFError {
 						}
 					}
 				} else {
-					$nef->setDefaultValues($default);
+					if ($default) {
+						$nef->setDefaultValues($default);
+					}
 				}
 			}
 			// update Dependency between extrafield
-			if ($oef->getParent() != 100) {
+			if (!empty($oef->getParent()) && $oef->getParent() != 100) {
 				if (!$nef->update($nef->getName(), $nef->getAttribute1(), $nef->getAttribute2(), $nef->isRequired(), $nef->getAlias(), $nef->getShow100(), $nef->getShow100label(), $nef->getDescription(), $nef->getPattern(), $newEFIds[$oef->getParent()], $nef->isAutoAssign(), $nef->isHiddenOnSubmit(), $nef->isDisabled())) {
 					db_rollback();
 					$this->setError(_('Error Updating New Extra Field Parent')._(':').' '.$nef->getErrorMessage());
diff --git a/src/common/tracker/views/form-clonetracker.php b/src/common/tracker/views/form-clonetracker.php
index 4320552..a2344d6 100644
--- a/src/common/tracker/views/form-clonetracker.php
+++ b/src/common/tracker/views/form-clonetracker.php
@@ -59,7 +59,7 @@ if (count($ids) < 1) {
 	?>
 	<input type="hidden" name="clone_tracker" value="y" />
 	<?php
-	echo $HTML->warning_msg(_('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. If you have preexisting extrafields with same name, they will be dropped. You have been warned!'));
+	echo $HTML->warning_msg(_('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. If you have preexisting custom fields with same name or a preexisting custom status type field, they will be dropped. You have been warned!'));
 	?>
 	<p><?php echo html_build_select_box_from_arrays($ids,$titles,'clone_id','',false); ?></p>
 	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />

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

Summary of changes:
 src/common/tracker/ArtifactType.class.php      | 9 +++++----
 src/common/tracker/views/form-clonetracker.php | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list