Commit a655d9049fe33b7ab9ddd03f2245550d84c5ece2
1 parent
b3f52749
Exists in
master
and in
2 other branches
Fix a bug when a templated parameter is used to define a XParameter of a scatter plot
Showing
1 changed file
with
27 additions
and
2 deletions
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMParamManagerClass.php
... | ... | @@ -291,7 +291,19 @@ class IHMParamManagerClass |
291 | 291 | throw new Exception('Cannot generate parameter template file '.$paramId); |
292 | 292 | } |
293 | 293 | else { |
294 | - $paramPath = IHMConfigClass::getLocalParamDBPath().$paramId.".xml"; | |
294 | + $template_args = array(); | |
295 | + | |
296 | + $templated_ref_param = $this->templateParamsManager->parseTemplatedParam($paramId); | |
297 | + | |
298 | + if ($templated_ref_param !== FALSE) { | |
299 | + foreach ($templated_ref_param['template_args'] as $key => $val) { | |
300 | + $template_args[$key] = $val; | |
301 | + } | |
302 | + $paramPath = $this->templateParamsManager->generateTemplatedParamFile($templated_ref_param['paramid'], $templateArgs, $tableLink); | |
303 | + } | |
304 | + else { | |
305 | + $paramPath = IHMConfigClass::getLocalParamDBPath().$paramId.".xml"; | |
306 | + } | |
295 | 307 | if (!file_exists($paramPath)) |
296 | 308 | throw new Exception('Cannot find parameter local file '.$paramId); |
297 | 309 | } |
... | ... | @@ -319,7 +331,20 @@ class IHMParamManagerClass |
319 | 331 | throw new Exception('Cannot find parameter template file '.$paramId); |
320 | 332 | } |
321 | 333 | else { |
322 | - $paramPath = IHMConfigClass::getLocalParamDBPath().$paramId.".xml"; | |
334 | + $template_args = array(); | |
335 | + | |
336 | + $templated_ref_param = $this->templateParamsManager->parseTemplatedParam($paramId); | |
337 | + | |
338 | + if ($templated_ref_param !== FALSE) { | |
339 | + foreach ($templated_ref_param['template_args'] as $key => $val) { | |
340 | + $template_args[$key] = $val; | |
341 | + } | |
342 | + $paramPath = $this->templateParamsManager->generateTemplatedParamFile($templated_ref_param['paramid'], $templateArgs, $tableLink); | |
343 | + } | |
344 | + else { | |
345 | + $paramPath = IHMConfigClass::getLocalParamDBPath().$paramId.".xml"; | |
346 | + } | |
347 | + | |
323 | 348 | if (empty($paramPath) || !@$doc->load($paramPath)) |
324 | 349 | throw new Exception('Cannot find parameter local file '.$paramId); |
325 | 350 | } |
... | ... |