Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add id to sql valuepool #1464

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading