[PATCH 3 of 4] (issue1754) Also fixup master artifact for already loaded recommendations

Wald Commits scm-commit at wald.intevation.org
Fri Apr 24 16:02:55 CEST 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1429883843 -7200
# Node ID 71ae185533771aac1d8ce52d18509db19b96ee6f
# Parent  d718edbf0b0c9c57db5c3a9a942639f8722f335b
(issue1754) Also fixup master artifact for already loaded recommendations

    As the load many call creates (and needs to create) all artifacts
    in the reccomendations this would break "old" recommendations after
    a reload through the "Pencil" mode.

    A better fix would probably be to just set the master artifiact
    in the recommendations but due to the extremly weird interaction
    with the server at this point it is not trivial to identify how
    this can be done.

diff -r d718edbf0b0c -r 71ae18553377 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java	Fri Apr 24 12:45:55 2015 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java	Fri Apr 24 15:57:23 2015 +0200
@@ -721,17 +721,17 @@
         }
 
         for (final Recommendation recommendation: recommendations) {
-            if (collection.loadedRecommendation(recommendation)) {
-                continue;
-            }
-            newRecommendations.push(recommendation);
-
             // XXX: UGLY! If no reference artifact given use uuid of
             //      current artifact as reference.
             if (recommendation.getMasterArtifact() == null) {
                 recommendation.setMasterArtifact(masterArtifact.getUuid());
             }
 
+            if (collection.loadedRecommendation(recommendation)) {
+                GWT.log("Already loaded " +  recommendation.getDisplayName());
+                continue;
+            }
+            newRecommendations.push(recommendation);
         }
 
         loadArtifactService.loadMany(


More information about the Dive4Elements-commits mailing list