From dc729e796a24a8eee4d407b2abdb76fad163f7fe Mon Sep 17 00:00:00 2001 From: Alexander Walther Date: Sun, 17 Dec 2023 17:48:23 +0100 Subject: [PATCH] add id to sql value pool --- lib/yform.php | 1 + lib/yform/action/db.php | 4 ++++ plugins/manager/lib/yform/action/manage_db.php | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/yform.php b/lib/yform.php index 6c86bc5ea..1ec588524 100644 --- a/lib/yform.php +++ b/lib/yform.php @@ -452,6 +452,7 @@ public function executeActions() /** @deprecated use 'id' instead of 'ID' */ $this->objparams['value_pool']['email']['ID'] = $this->objparams['main_id']; $this->objparams['value_pool']['email']['id'] = $this->objparams['main_id']; + $this->objparams['value_pool']['sql']['id'] = $this->objparams['main_id']; } $hasWarnings = 0 != count($this->objparams['warning']); diff --git a/lib/yform/action/db.php b/lib/yform/action/db.php index 260689593..9ef0ac31b 100644 --- a/lib/yform/action/db.php +++ b/lib/yform/action/db.php @@ -61,7 +61,10 @@ public function executeAction(): void $sql_id->setWhere($where); $sql_id->select('id'); $this->params['main_id'] = $sql_id->getValue('id'); + /** @deprecated use 'id' instead of 'ID' */ $this->params['value_pool']['email']['ID'] = $this->params['main_id']; + $this->params['value_pool']['email']['id'] = $this->params['main_id']; + $this->params['value_pool']['sql']['id'] = $this->params['main_id']; } } else { $sql->insert(); @@ -71,6 +74,7 @@ public function executeAction(): void /** @deprecated since 3.4.1 use id (lowercase) instead */ $this->params['value_pool']['email']['ID'] = $id; $this->params['value_pool']['email']['id'] = $id; + $this->params['value_pool']['sql']['id'] = $id; } } catch (Exception $e) { $this->params['form_show'] = true; diff --git a/plugins/manager/lib/yform/action/manage_db.php b/plugins/manager/lib/yform/action/manage_db.php index d9c54f5a7..7ef9fbf93 100644 --- a/plugins/manager/lib/yform/action/manage_db.php +++ b/plugins/manager/lib/yform/action/manage_db.php @@ -81,10 +81,11 @@ public function executeAction(): void $sql->insert(); $flag = 'insert'; $id = $sql->getLastId(); - + /** @deprecated use 'id' instead of 'ID' */ $this->params['value_pool']['email']['ID'] = $id; + $this->params['value_pool']['email']['id'] = $id; $this->params['main_id'] = $id; - // $this->params["value_pool"]["sql"]["ID"] = $id; + $this->params["value_pool"]["sql"]["id"] = $id; if (0 == $id) { $this->params['form_show'] = true; $this->params['hasWarnings'] = true;