Skip to content

v0.2.48..v0.2.49 changeset PopulateConsumersJs.h

Garret Voltz edited this page Oct 2, 2019 · 1 revision
diff --git a/hoot-js/src/main/cpp/hoot/js/util/PopulateConsumersJs.h b/hoot-js/src/main/cpp/hoot/js/util/PopulateConsumersJs.h
index bc24dc7..375b517 100644
--- a/hoot-js/src/main/cpp/hoot/js/util/PopulateConsumersJs.h
+++ b/hoot-js/src/main/cpp/hoot/js/util/PopulateConsumersJs.h
@@ -46,6 +46,7 @@
 #include <hoot/js/util/JsFunctionConsumer.h>
 #include <hoot/js/util/StringUtilsJs.h>
 #include <hoot/js/visitors/ElementVisitorJs.h>
+#include <hoot/core/visitors/MultipleCriterionConsumerVisitor.h>
 
 // node.js
 #include <hoot/js/SystemNodeJs.h>
@@ -146,6 +147,16 @@ public:
       throw IllegalArgumentException("Object does not accept custom settings as an argument.");
     }
 
+    // Configuration from Javascript for criterion consumers is handled a little differently where
+    // we expect the child crits to be configured separately outside of the parent visitor.
+    MultipleCriterionConsumerVisitor* multipleCritVis =
+      dynamic_cast<MultipleCriterionConsumerVisitor*>(consumer);
+    LOG_VARD(multipleCritVis == 0);
+    if (multipleCritVis != 0)
+    {
+      multipleCritVis->setConfigureChildren(false);
+    }
+
     c->setConfiguration(settings);
   }
 
Clone this wiki locally