From 2836aff7224d0cb1d84930ebe5903f4e5b978a38 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Thu, 16 May 2019 16:29:09 +0200
Subject: [PATCH] Prevent PAB from offering irs children' linkable values

---
 src/nub.ts | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/nub.ts b/src/nub.ts
index 811cf5a7..b53b73f6 100644
--- a/src/nub.ts
+++ b/src/nub.ts
@@ -1,7 +1,7 @@
 import { CalculatorType, ComputeNode } from "./compute-node"; // nghyd build fails when commenting CalculatorType @WTF
 import { Dichotomie } from "./dichotomie";
-import { acSection, IParamDefinitionIterator, ParamDefinition, ParamsEquation, ParamsEquationArrayIterator,
-         Session, Structure } from "./index";
+import { acSection, IParamDefinitionIterator, Pab, ParamDefinition, ParamsEquation,
+         ParamsEquationArrayIterator, Session, Structure } from "./index";
 import { LinkedValue } from "./linked-value";
 import { ParamCalculability } from "./param/param-definition";
 import { ParamValueMode } from "./param/param-value-mode";
@@ -500,9 +500,11 @@ export abstract class Nub extends ComputeNode implements IObservable {
             }
         }
 
-        // 3. children Nubs
-        for (const cn of this.getChildren()) {
-            res = res.concat(cn.getLinkableValues(src));
+        // 3. children Nubs, except for PAB
+        if (! (this instanceof Pab)) {
+            for (const cn of this.getChildren()) {
+                res = res.concat(cn.getLinkableValues(src));
+            }
         }
 
         return res;
-- 
GitLab