Commit 3b5054f8 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug 7289. Fixes #7289. {{<level>.line.insertId}} - missing for altsql

parent ceb752cc
Pipeline #1249 passed with stage
in 1 minute and 33 seconds
......@@ -21,8 +21,8 @@
Release
=======
Version 18.x.x
--------------
Version 18.xx.x
---------------
Date: <date>
......@@ -35,6 +35,95 @@ Features
Bug Fixes
^^^^^^^^^
Version 18.12.2
---------------
Date: 23.12.2018
Bug Fixes
^^^^^^^^^
* Version 18.12.1 was broken due to incorrect and missing autoloader dependencies.
Version 18.12.1
---------------
Date: 22.12.2018
Notes
^^^^^
* Existing installations: update QFQ extension config form-layout.formBsColumns/formBsLabelColumns/formBsInputColumns,formBsNoteColumns.
old: 12, new: 'col-md-12 col-lg10' resp. smaller values for individual columns.
* New config values:
* Config/flagProduction: yes/now - differentiate between development und production system. Will be used for
'throwExceptionGeneralError' too.
* Debug/throwExceptionGeneralError - shows/hide exception of general errors.
* Renamed config values:
* SITE_PATH >> sitePath
* EXT_PATH >> extPath
* _dbName >> dbName
* Record locking: revert to old behaviour, that a locked record can't be modified by another form, even if the second
form has modeRecordLock=NONE.
Features
^^^^^^^^
* #7228 / Show error if form element with same name and class already exists.
* #7494 / Exception 'General Error': disable/enable per config.
* Adapt class paths in composer.json to the newly refactored folder names.
* Add col-lg-10 to notes section.
* Added Alert Manager to have better control over the Alerts.
* Config.php: make 'reading dbname' Typo3 version dependent.
* Delete two old composer.json and call new composer in Makefile.
* Excel.php: change autoload.php path to new composer folder.
* Manual.rst: several places where the bs-column description are updated with the new way 'col-md-...' instead of '12'.
Replace ''{{pageId' with '{{pageAlias'. Replace '... AS _Page' by '... AS _page'. Add 'tablesorter tablesorter-filter'
to FormEditor example page.
* Move bootstrap.php and BindParamTest.php due to refactoring.
* phpunit.xml: implement const 'PHPUNIT_QFQ'. Store.php: set self::$phpUnit on const 'PHPUNIT_QFQ'
* Refactor: 'extension/qfq/qfq/...' to 'extension/Source/core/...'
* Refactor: Manual.rst update config variables (reorder), add 'qfqLog'. Support.php: formSubmitLog hardcoded to
fileadmin/protected/log. DOCUMENTATION_QFQ > SYSTEM_DOCUMENTATION_QFQ. Remove config var 'logDir'.
* Refactor: SITE_PATH >> sitePath, EXT_PATH >> extPath, SYSTEM_PATH_EXT >> SYSTEM_EXT_PATH
* Remove report/Define.php, report/Error.php.
Bug Fixes
^^^^^^^^^
* #3464 / Checkboxes now disabled (readonly), even when rendered as Bootstrap. Fixes missing readonly for Template Groups.
* #6467 / Sanitizing a hidden field makes the form unsubmittable. Updated elementupdate for pattern, added "false" as an
alternative to null. 'element-update' now get's 'pattern=<pattern>|false' on element-update.
* #7089 / FE.type=extra: value already set in SIP store.
* #7223 / Add "-" as allowed characters in filenames.
* #7455 / phpunit: Remove outdated report syntax. Catch exception on trying to open a non existing logfile.
* #7461 / Bug in Doku.
* #7464 / DragAndDrop - Undefined index: ord. Bug in subrecord fixed.
* AbstractException.php: fixed problem with empty $match in sql syntax highlighting.
* Block screen stuck seems fixed.
* Check not to try to number_format() empty string.
* config.qfq.example.php: add missing '>'.
* Fixed broken init in phpunit run. Fixed access to uninitialized var. Throw exception if dndTable or form is missing.
* Fixed missing $formElement[FE_DECIMAL_FORMAT]. Add 'missing primary record' check. Fixed missing fe['id'].
* Fixed problem with '?:' - implemented in 2016.
* Fixed problem with resultset in 'altsql'.
* formEditor.sql, Manual.rst: renamed '{{_dbName...:Y}}' to '{{dbName...:Y}}'.
* Manual.rst: Unify 'dbName*' documentation..
* phpunit: Update fixtures table 'Form', 'FormElement' & 'Dirty' definition. Update LDAP Test - surrounding spaces seems
to be escaped now by '\20'. Create tests dir outside of source, create phpunit.xml, move some tests and make them work.
Rename tests directory to Tests
* Record Lock. Revert change in cb2e2a70cfe5c251cffbfce65bdc0899da75a9c5: if a record lock exist, another form, with
record lock mode=NONE, can't get write access to it. This is what the manual describes.
* Sanitize.php: fixes "Uninitialized string offset: 0" error.
* Save.php: Fixed exception (file size, mime type) for non-existing uploads.
* Store.php: fixed problem with wrong config varname for DB.
* Timeout check throws error since php.ini cookie lifetime is zero during unit test. Fix filepath relative to Typo3 dir
when running unit test.
Version 18.12.0
---------------
......
......@@ -49,12 +49,12 @@ Neue Versionsnummer
* Update the version number in this document (topic 6)
* Commit & Push new version changes to master branch:
New version 18.12.0
New version 18.12.2
6) **New Tag**:
git tag v18.12.0
git push -u origin v18.12.0
git tag v18.12.2
git push -u origin v18.12.2
7) Tickets: schliessen und der QFQ Version zuweisen.
......
......@@ -4982,7 +4982,7 @@ For **each** row of a query (this means *all* queries), all subqueries will be f
* E.g. if the outer query selects 5 rows, and a nested query select 3 rows, than the total number of rows are 5 x 3 = 15 rows.
There is a set of **variables** that will get replaced before the SQL-Query gets executed:
There is a set of **variables** that will get replaced before ('count' also after) the SQL-Query gets executed:
``{{<name>[:<store/s>[:...]]}}``
Variables from specific stores.
......@@ -5005,6 +5005,13 @@ There is a set of **variables** that will get replaced before the SQL-Query gets
``{{<level>.line.content}}``
If the content of `<level>` have been stored, e.g. `<level>.content=hide`.
``{{<level>.line.altCount}}`` - Like 'line.count' but for 'alt' query.
``{{<level>.line.altTotal}}`` - Like 'line.total' but for 'alt' query.
``{{<level>.line.altInsertId}}`` - Like 'line.insertId' but for 'alt' query.
See :ref:`variables` for a full list of all available variables.
......
......@@ -21,8 +21,8 @@
Release
=======
Version 18.x.x
--------------
Version 18.xx.x
---------------
Date: <date>
......@@ -35,6 +35,95 @@ Features
Bug Fixes
^^^^^^^^^
Version 18.12.2
---------------
Date: 23.12.2018
Bug Fixes
^^^^^^^^^
* Version 18.12.1 was broken due to incorrect and missing autoloader dependencies.
Version 18.12.1
---------------
Date: 22.12.2018
Notes
^^^^^
* Existing installations: update QFQ extension config form-layout.formBsColumns/formBsLabelColumns/formBsInputColumns,formBsNoteColumns.
old: 12, new: 'col-md-12 col-lg10' resp. smaller values for individual columns.
* New config values:
* Config/flagProduction: yes/now - differentiate between development und production system. Will be used for
'throwExceptionGeneralError' too.
* Debug/throwExceptionGeneralError - shows/hide exception of general errors.
* Renamed config values:
* SITE_PATH >> sitePath
* EXT_PATH >> extPath
* _dbName >> dbName
* Record locking: revert to old behaviour, that a locked record can't be modified by another form, even if the second
form has modeRecordLock=NONE.
Features
^^^^^^^^
* #7228 / Show error if form element with same name and class already exists.
* #7494 / Exception 'General Error': disable/enable per config.
* Adapt class paths in composer.json to the newly refactored folder names.
* Add col-lg-10 to notes section.
* Added Alert Manager to have better control over the Alerts.
* Config.php: make 'reading dbname' Typo3 version dependent.
* Delete two old composer.json and call new composer in Makefile.
* Excel.php: change autoload.php path to new composer folder.
* Manual.rst: several places where the bs-column description are updated with the new way 'col-md-...' instead of '12'.
Replace ''{{pageId' with '{{pageAlias'. Replace '... AS _Page' by '... AS _page'. Add 'tablesorter tablesorter-filter'
to FormEditor example page.
* Move bootstrap.php and BindParamTest.php due to refactoring.
* phpunit.xml: implement const 'PHPUNIT_QFQ'. Store.php: set self::$phpUnit on const 'PHPUNIT_QFQ'
* Refactor: 'extension/qfq/qfq/...' to 'extension/Source/core/...'
* Refactor: Manual.rst update config variables (reorder), add 'qfqLog'. Support.php: formSubmitLog hardcoded to
fileadmin/protected/log. DOCUMENTATION_QFQ > SYSTEM_DOCUMENTATION_QFQ. Remove config var 'logDir'.
* Refactor: SITE_PATH >> sitePath, EXT_PATH >> extPath, SYSTEM_PATH_EXT >> SYSTEM_EXT_PATH
* Remove report/Define.php, report/Error.php.
Bug Fixes
^^^^^^^^^
* #3464 / Checkboxes now disabled (readonly), even when rendered as Bootstrap. Fixes missing readonly for Template Groups.
* #6467 / Sanitizing a hidden field makes the form unsubmittable. Updated elementupdate for pattern, added "false" as an
alternative to null. 'element-update' now get's 'pattern=<pattern>|false' on element-update.
* #7089 / FE.type=extra: value already set in SIP store.
* #7223 / Add "-" as allowed characters in filenames.
* #7455 / phpunit: Remove outdated report syntax. Catch exception on trying to open a non existing logfile.
* #7461 / Bug in Doku.
* #7464 / DragAndDrop - Undefined index: ord. Bug in subrecord fixed.
* AbstractException.php: fixed problem with empty $match in sql syntax highlighting.
* Block screen stuck seems fixed.
* Check not to try to number_format() empty string.
* config.qfq.example.php: add missing '>'.
* Fixed broken init in phpunit run. Fixed access to uninitialized var. Throw exception if dndTable or form is missing.
* Fixed missing $formElement[FE_DECIMAL_FORMAT]. Add 'missing primary record' check. Fixed missing fe['id'].
* Fixed problem with '?:' - implemented in 2016.
* Fixed problem with resultset in 'altsql'.
* formEditor.sql, Manual.rst: renamed '{{_dbName...:Y}}' to '{{dbName...:Y}}'.
* Manual.rst: Unify 'dbName*' documentation..
* phpunit: Update fixtures table 'Form', 'FormElement' & 'Dirty' definition. Update LDAP Test - surrounding spaces seems
to be escaped now by '\20'. Create tests dir outside of source, create phpunit.xml, move some tests and make them work.
Rename tests directory to Tests
* Record Lock. Revert change in cb2e2a70cfe5c251cffbfce65bdc0899da75a9c5: if a record lock exist, another form, with
record lock mode=NONE, can't get write access to it. This is what the manual describes.
* Sanitize.php: fixes "Uninitialized string offset: 0" error.
* Save.php: Fixed exception (file size, mime type) for non-existing uploads.
* Store.php: fixed problem with wrong config varname for DB.
* Timeout check throws error since php.ini cookie lifetime is zero during unit test. Fix filepath relative to Typo3 dir
when running unit test.
Version 18.12.0
---------------
......
......@@ -1363,6 +1363,14 @@ const TOKEN_CONTENT_STORE = 'store';
const TOKEN_CONTENT_HIDE = 'hide';
const TOKEN_CONTENT_SHOW = 'show';
const LINE_COUNT = 'count';
const LINE_TOTAL = 'total';
const LINE_INSERT_ID = 'insertId';
const LINE_ALT_COUNT = 'altCount';
const LINE_ALT_TOTAL = 'altTotal';
const LINE_ALT_INSERT_ID = 'altInsertId';
//Report: Column Token
const COLUMN_LINK = 'link';
const COLUMN_EXEC = 'exec';
......
......@@ -483,8 +483,8 @@ class Report {
$this->store->setVar(SYSTEM_REPORT_FULL_LEVEL, $fullLevel, STORE_SYSTEM);
// Prepare SQL: replace variables. Actual 'line.total' or 'line.count' will recalculated: don't replace them now!
unset($this->variables->resultArray[$fullLevel . ".line."]["total"]);
unset($this->variables->resultArray[$fullLevel . ".line."]["count"]);
unset($this->variables->resultArray[$fullLevel . ".line."][LINE_TOTAL]);
unset($this->variables->resultArray[$fullLevel . ".line."][LINE_COUNT]);
$sql = $this->variables->doVariables($this->frArray[$fullLevel . "." . TOKEN_SQL]);
......@@ -499,9 +499,9 @@ class Report {
// insert, delete, update: number of affected rows
$rowTotal = isset($stat[DB_NUM_ROWS]) ? $stat[DB_NUM_ROWS] : $stat[DB_AFFECTED_ROWS];
$this->variables->resultArray[$fullLevel . ".line."]["total"] = $rowTotal;
$this->variables->resultArray[$fullLevel . ".line."]["count"] = is_array($result) ? 1 : 0;
$this->variables->resultArray[$fullLevel . ".line."]["insertId"] = isset($stat[DB_INSERT_ID]) ? $stat[DB_INSERT_ID] : 0;
$this->variables->resultArray[$fullLevel . ".line."][LINE_TOTAL] = $rowTotal;
$this->variables->resultArray[$fullLevel . ".line."][LINE_COUNT] = is_array($result) ? 1 : 0;
$this->variables->resultArray[$fullLevel . ".line."][LINE_INSERT_ID] = $stat[DB_INSERT_ID] ?? 0;
$contentLevel .= $this->variables->doVariables($this->frArray[$fullLevel . "." . TOKEN_SHEAD]);
// HEAD: If there is at least one record, do 'head'.
......@@ -509,7 +509,6 @@ class Report {
$contentLevel .= $this->variables->doVariables($this->frArray[$fullLevel . "." . TOKEN_HEAD]);
}
if (is_array($result)) {
// Prepare row alteration
......@@ -525,7 +524,7 @@ class Report {
$rowIndex = 0;
foreach ($result as $row) {
// record number counter
$this->variables->resultArray[$fullLevel . ".line."]["count"] = ++$rowIndex;
$this->variables->resultArray[$fullLevel . ".line."][LINE_COUNT] = ++$rowIndex;
// replace {{<level>.line.count}} and {{<level>.line.total}} in __result__, if the variables specify their own full_level. This can't be replaced before firing the query.
for ($ii = 0; $ii < count($row); $ii++) {
......@@ -568,7 +567,12 @@ class Report {
$sql = $this->variables->doVariables($this->frArray[$fullLevel . "." . TOKEN_ALT_SQL]);
if (!empty($sql)) {
$result = $this->db->sql($sql, ROW_KEYS, array(), '', $keys, $stat);
if(is_array($result)) {
$this->variables->resultArray[$fullLevel . ".line."][LINE_ALT_TOTAL] = $rowTotal;
$this->variables->resultArray[$fullLevel . ".line."][LINE_ALT_COUNT] = is_array($result) ? 1 : 0;
$this->variables->resultArray[$fullLevel . ".line."][LINE_ALT_INSERT_ID] = $stat[DB_INSERT_ID] ?? 0;
if (is_array($result)) {
foreach ($result as $row) {
$rowIndex = 0;
$contentLevel .= $this->collectRow($row, $keys, $fullLevel, $rowIndex);
......@@ -634,7 +638,7 @@ class Report {
if ($cur_level == 1) {
$value = $default;
} else {
$value = $this->variables->resultArray[$full_super_level . ".line."][$level_key]??'';
$value = $this->variables->resultArray[$full_super_level . ".line."][$level_key] ?? '';
}
}
$this->variables->resultArray[$full_level . ".line."][$level_key] = $value;
......
......@@ -12,7 +12,7 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase',
'clearcacheonload' => true,
'state' => 'stable',
'version' => '18.12.0',
'version' => '18.12.2',
'constraints' => [
'depends' => [
'typo3' => '6.0.0-9.2.99',
......
Supports Markdown
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