Skip to content

Commit

Permalink
add id to sql value pool
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed Dec 17, 2023
1 parent dfee9a7 commit dc729e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/yform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 4 additions & 0 deletions lib/yform/action/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions plugins/manager/lib/yform/action/manage_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dc729e7

Please sign in to comment.