Commit bde024ac authored by Carsten  Rose's avatar Carsten Rose
Browse files

FormAction.php: throw exception if 'fillStoreVar' selects more than one row.

parent 2e7fdf64
......@@ -652,7 +652,7 @@ abstract class AbstractBuildForm {
if (isset($fe[FE_FILL_STORE_VAR])) {
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, FE_FILL_STORE_VAR, STORE_SYSTEM); // debug
$fe[FE_FILL_STORE_VAR] = $this->evaluate->parse($fe[FE_FILL_STORE_VAR]);
$fe[FE_FILL_STORE_VAR] = $this->evaluate->parse($fe[FE_FILL_STORE_VAR], ROW_EXPECT_0_1);
$this->store->appendToStore($fe[FE_FILL_STORE_VAR], STORE_VAR);
}
......
......@@ -113,7 +113,7 @@ class Evaluate {
* Token to replace have to be enclosed by '{{' and '}}'
*
* @param string $line
* @param string $sqlMode ROW_IMPLODE | ROW_REGULAR - might be overwritten in $line by '{{!...'
* @param string $sqlMode ROW_IMPLODE | ROW_REGULAR | ... - might be overwritten in $line by '{{!...'
* @param int $recursion
*
* @param array $debugStack
......@@ -271,7 +271,7 @@ class Evaluate {
*
* @param string $token
* @param string $foundInStore Returns the name of the store where $key has been found. If $key is not found, return ''.
* @param string $sqlMode - ROW_IMPLODE | ROW_REGULAR - might be overwritten in $line by '{{!...'
* @param string $sqlMode - ROW_IMPLODE | ROW_REGULAR | ... - might be overwritten in $line by '{{!...'
*
* @return array|null|string
* @throws CodeException
......
......@@ -905,7 +905,7 @@ class QuickFormQuery {
// Fire FE_FILL_STORE_VAR after the primary form record has been loaded
if (!empty($fillStoreVar)) {
$rows = $this->eval->parse($fillStoreVar);
$rows = $this->eval->parse($fillStoreVar, ROW_EXPECT_0_1);
if (is_array($rows)) {
$this->store->appendToStore($rows[0], STORE_VAR);
// LOG
......
......@@ -102,7 +102,7 @@ class FormAction {
if (isset($fe[FE_FILL_STORE_VAR])) {
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, FE_FILL_STORE_VAR, STORE_SYSTEM); // debug
$rows = $this->evaluate->parse($fe[FE_FILL_STORE_VAR], ROW_REGULAR);
$rows = $this->evaluate->parse($fe[FE_FILL_STORE_VAR], ROW_EXPECT_0_1);
if (is_array($rows)) {
$this->store->appendToStore($rows[0], STORE_VAR);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment