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  e5aef22c5e14774cf3ad5eeee72d49061cdbb4f2 (commit)
      from  55042450d349a60d4ae408aa03ec76a731bf8783 (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=e5aef22c5e14774cf3ad5eeee72d49061cdbb4f2

commit e5aef22c5e14774cf3ad5eeee72d49061cdbb4f2
Author: Stéphane-Eymeric Bredthauer <sebredtha...@gmail.com>
Date:   Wed Sep 21 09:56:27 2016 +0200

    Tracker: improve import 4

diff --git a/src/common/tracker/ArtifactWorkflow.class.php 
b/src/common/tracker/ArtifactWorkflow.class.php
index 0a26d3f..058a301 100644
--- a/src/common/tracker/ArtifactWorkflow.class.php
+++ b/src/common/tracker/ArtifactWorkflow.class.php
@@ -255,26 +255,28 @@ class ArtifactWorkflow extends FFError {
        }
 
        function _addEvent($from, $to) {
-               $res = db_query_params ('INSERT INTO artifact_workflow_event
-                               (group_artifact_id, field_id, from_value_id, 
to_value_id)
-                               VALUES ($1, $2, $3, $4)',
-                       array($this->artifact_id,
-                               $this->field_id,
-                               $from,
-                               $to));
-               if (!$res) {
-                       $this->setError('Unable to add Event($from, $to): 
'.db_error());
-                       return false;
+               $event_id = $this->_getEventId($from, $to);
+               if (!$event_id) {
+                       $res = db_query_params ('INSERT INTO 
artifact_workflow_event
+                                       (group_artifact_id, field_id, 
from_value_id, to_value_id)
+                                       VALUES ($1, $2, $3, $4)',
+                               array($this->artifact_id,
+                                       $this->field_id,
+                                       $from,
+                                       $to));
+                       if (!$res) {
+                               $this->setError('Unable to add Event($from, 
$to): '.db_error());
+                               return false;
+                       }
+                       $event_id = $this->_getEventId($from, $to);
                }
 
-               $event_id = $this->_getEventId($from, $to);
                if ($event_id) {
                        // By default, all roles are allowed on a new event.
                        foreach ($this->ath->Group->getRoles() as $r) {
                                $this->_addRole($event_id, $r->getID());
                        }
                }
-
                return true;
        }
 

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

Summary of changes:
 src/common/tracker/ArtifactWorkflow.class.php | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to