Merged in bugfix/HOR-2791 (pull request #5570)

HOR-2791

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2017-05-03 18:06:47 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -754,6 +754,10 @@ class pmDynaform
preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
$variables = isset($result[2]) ? $result[2] : array();
foreach ($variables as $key => $value) {
//Prevents an infinite cycle. If the name of the variable is used within its own dependent.
if ($value[0] === $json->variable) {
continue;
}
$jsonSearch = $this->jsonsf(G::json_decode($this->record["DYN_CONTENT"]), $value[0], $json->variable === "" ? "id" : "variable");
$a = $this->getValuesDependentFields($jsonSearch);
foreach ($a as $i => $v) {