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

Fixes #10505 Drag'n'Drop broken on Multi DB Instance - all checks done

parent a968dc21
Pipeline #5187 passed with stages
in 4 minutes and 25 seconds
...@@ -18,5 +18,10 @@ Request will be sent containing following GET variables: ...@@ -18,5 +18,10 @@ Request will be sent containing following GET variables:
* hoverId = `data-dnd-id` id of the element the dragged element is now hovering, meaning before or after. * hoverId = `data-dnd-id` id of the element the dragged element is now hovering, meaning before or after.
* hoverPosition = client internal position of currently hovered element. * hoverPosition = client internal position of currently hovered element.
Example: http://something/bla?dragId=uno&dragPosition=1&setTo=before&hoverId=tre&hoverPosition=3
Example: http://something/bla?dragId=uno&dragPosition=1&setTo=before&hoverId=tre&hoverPosition=3 ## Drag'n'drop in forms
\ No newline at end of file
* For FormElement.typ=subrecord DND is automatically detected.
* The encoded SIP contains: dnd-subrecord-form-id, dnd-subrecord-form-table, dnd-subrecord-id, dndTable, oderColumn,
oderInterval, dnd-db-index.
...@@ -1901,19 +1901,26 @@ include a column `id` (or `_id`) and a column `ord` (or `_ord`). E.g.:: ...@@ -1901,19 +1901,26 @@ include a column `id` (or `_id`) and a column `ord` (or `_ord`). E.g.::
FE.sql1 = {{!SELECT p.id AS _id, p.ord AS _ord, p.name FROM Person WHERE p.email!='' ORDER BY p.ord}} FE.sql1 = {{!SELECT p.id AS _id, p.ord AS _ord, p.name FROM Person WHERE p.email!='' ORDER BY p.ord}}
Tips: In case the modified ord value should be shown without reloading the page, add html id `qfq-dnd-ord-id-...`::
* If you want to deactivate a drag-and-drop that QFQ automatically renders, set the `orderColumn` to a non-existing column. FE.sql1 = {{!SELECT p.id AS _id, p.ord AS _ord, p.name
E.g., `orderColumn = nonExistingColumn`. This will deactivate drag-and-drop. , CONCAT('<span id="qfq-dnd-ord-id-', p.id,'">', p.ord, '</span>') AS 'Ord|nostrip'
* In order to evaluate the `sql1` query dynamically during a drag-and-drop event, the STORE_RECORD (with the current subrecord) FROM Person WHERE p.email!='' ORDER BY p.ord}}
is loaded.
* The stores STORE_RECORD, STORE_SIP and STORE_SYSTEM are supported during a drag-and-drop event and can be used in FE.sql1 query.
* STORE_SIP: SIP values on form load
* STORE_RECORD: values of the current record loaded in the form.
* If the subrecord is rendered with drag-and-drop active, but the order is not affected upon reload, there is .. tip::
most likely a problem with evaluating the `sql1` query at runtime.
* If you want to deactivate a drag-and-drop that QFQ automatically renders, set the `orderColumn` to a non-existing column.
E.g., `orderColumn = nonExistingColumn`. This will deactivate drag-and-drop.
* In order to evaluate the `sql1` query dynamically during a drag-and-drop event, the STORE_RECORD (with the current subrecord)
is loaded.
* The stores STORE_RECORD, STORE_SIP and STORE_SYSTEM are supported during a drag-and-drop event and can be used in FE.sql1 query.
* STORE_SIP: SIP values on form load
* STORE_RECORD: values of the current record loaded in the form.
* If the subrecord is rendered with drag-and-drop active, but the order is not affected upon reload, there is
most likely a problem with evaluating the `sql1` query at runtime.
Type: time Type: time
^^^^^^^^^^ ^^^^^^^^^^
......
...@@ -195,7 +195,7 @@ class QuickFormQuery { ...@@ -195,7 +195,7 @@ class QuickFormQuery {
// Set dbIndex, evaluate any // Set dbIndex, evaluate any
$dbIndex = $this->store->getVar(TOKEN_DB_INDEX, STORE_TYPO3 . STORE_EMPTY); $dbIndex = $this->store->getVar(TOKEN_DB_INDEX, STORE_TYPO3 . STORE_EMPTY);
$dbIndex = $this->evaluate->parse($dbIndex); $dbIndex = $this->evaluate->parse($dbIndex);
$dbIndex = ($dbIndex == '') ? DB_INDEX_DEFAULT : $dbIndex; $dbIndex = ($dbIndex == '') ? $this->dbIndexData : $dbIndex;
$this->store->setVar(TOKEN_DB_INDEX, $dbIndex, STORE_TYPO3); $this->store->setVar(TOKEN_DB_INDEX, $dbIndex, STORE_TYPO3);
// Create report file if file keyword not found (and auto export is enabled in qfq settings) // Create report file if file keyword not found (and auto export is enabled in qfq settings)
...@@ -1898,8 +1898,8 @@ class QuickFormQuery { ...@@ -1898,8 +1898,8 @@ class QuickFormQuery {
$recordId = $this->store::getVar(DND_SUBRECORD_FORM_ID, STORE_SIP . STORE_ZERO); $recordId = $this->store::getVar(DND_SUBRECORD_FORM_ID, STORE_SIP . STORE_ZERO);
$tableName = $this->store::getVar(DND_SUBRECORD_FORM_TABLE, STORE_SIP); $tableName = $this->store::getVar(DND_SUBRECORD_FORM_TABLE, STORE_SIP);
// $this->store->fillStoreWithRecord('form', $recordId, $this->dbArray[$this->dbIndexQfq]); // $this->store->fillStoreWithRecord($tableName, $recordId, $this->dbArray[$this->dbIndexQfq]);
$this->store->fillStoreWithRecord($tableName, $recordId, $this->dbArray[$this->dbIndexQfq]); $this->store->fillStoreWithRecord($tableName, $recordId, $this->dbArray[$dbIndex]);
$formSip = $this->store::getVar(DND_FORM_SIP_VALUES, STORE_SIP); $formSip = $this->store::getVar(DND_FORM_SIP_VALUES, STORE_SIP);
// Backup STORE_SIP // Backup STORE_SIP
......
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