From 26563260adbb91d905c1ced647b244a2c4cf9a87 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 22 Mar 2019 13:44:22 +0000 Subject: [PATCH] dblayeroo : CONCAT must use the local entries if provided git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5165 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayeroo.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dblayeroo.php b/dblayeroo.php index c4cbf1e..8baa874 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -4,7 +4,7 @@ * @author Dominique Fournier */ -require_once ("domframework/dblayeroo.php"); +namespace vendor\domframework; // dblayeroo.php @@ -2079,16 +2079,17 @@ class dblayeroo $newJoinArray = array (); foreach ($joinArray as $fieldLocal=>$fieldToJoin) { - if (substr ($fieldToJoin, 0, 7) === "CONCAT(") - $fieldLocal = $this->concat ($fieldToJoin, $object); - elseif (array_key_exists ($fieldToJoin, $object->fields)) + if (substr ($fieldLocal, 0, 7) === "CONCAT(") + $fieldLocal = $this->concat ($fieldLocal, $this); + elseif (array_key_exists ($fieldLocal, $this->fields)) $fieldLocal = - $this->sep.$object->tableprefix.$object->table.$this->sep.".". - $this->sep.$fieldToJoin.$this->sep; + $this->sep.$this->tableprefix.$this->table.$this->sep.".". + $this->sep.$fieldLocal.$this->sep; else $this->DBException (sprintf ( "Invalid field to join '%s' : not defined in Local table", $fieldLocal)); + if (substr ($fieldToJoin, 0, 7) === "CONCAT(") $fieldToJoin = $this->concat ($fieldToJoin, $object); elseif (array_key_exists ($fieldToJoin, $object->fields))