diff --git a/CHANGELOG.md b/CHANGELOG.md index 93fc63b837ec1e3bfec9ee27fcb0905541026e85..90eaf33da2d587dc612e9edf411106b80ec6c161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,18 @@ Features Bug Fixes ^^^^^^^^^ +Version 23.6.4 +-------------- + +Date: 26.06.2023 + +Bug Fixes +^^^^^^^^^ + +* #16485 / TypeAhead: strpos() string, array given error. +* #16488 / Missing default values break saving records. New custom FE.parameter.defaultValue. +* #16491 / FE Typ Upload - JS failure: document.querySelector() is null. + Version 23.6.3 -------------- diff --git a/Documentation-develop/NewVersion.md b/Documentation-develop/NewVersion.md index 5706a8da208a2c2c5a5fdf5acc292712c3688053..041021b92c6a6a873c00823d75c568f031dbb250 100644 --- a/Documentation-develop/NewVersion.md +++ b/Documentation-develop/NewVersion.md @@ -44,7 +44,7 @@ Neue Versionsnummer **Achtung**: die Release Minor darf KEINE fuehrenden Nullen enthalten!!! Ansonsten funktioniert die Verteilung vie TER nicht. - **Auto**: ./setVersion.sh 23.6.3 + **Auto**: ./setVersion.sh 23.6.4 Manuell: @@ -56,7 +56,7 @@ Neue Versionsnummer * **Commit & Push** to develop branch: - New version v23.6.3 + New version v23.6.4 6) * Merge 'Develop' to **Master**: git.math.uzh.ch > QFQ > Merge Requests > New merge request > 'Develop >> Master' @@ -66,10 +66,10 @@ Neue Versionsnummer * Neuen tag via Browser auf dem **master** branch setzen: git.math.uzh.ch > QFQ > Repository > Tags > New tag - Tag: v23.6.3 + Tag: v23.6.4 # Den tag mit diesem Command zu setzen scheint den Build Prozess nicht zu triggern. - git tag -a v23.6.3 -m 'New version v23.6.3' git push + git tag -a v23.6.4 -m 'New version v23.6.4' git push 7) **Merge 'master' into 'develop'** diff --git a/Documentation/Form.rst b/Documentation/Form.rst index 26ac485ad681ddbb42a9a21eb8034e67750cbb89..9c5ba9f8b9cc6104cb63a7aa30a8e9c12460ad06 100644 --- a/Documentation/Form.rst +++ b/Documentation/Form.rst @@ -1119,6 +1119,8 @@ FormElement.parameter | clearMe | 0 (off)|1(on) - Overwrite default from Form.parameter.clearMe or :ref:`configuration`. Show a small | | | 'x' in input or textarea fields to clear the input. | +---------------------------------+----------------------------------------------------------------------------------------------------------+ +| defaultValue | Set custom default value. If not set, db column default value will be taken. | ++---------------------------------+----------------------------------------------------------------------------------------------------------+ * `s/d/n`: string or date or number. diff --git a/Documentation/Release.rst b/Documentation/Release.rst index 4c0cf4c5a95455606585df3ada89242679cf00f8..ecec19a501b581e0857e876d70e883429575bcd2 100644 --- a/Documentation/Release.rst +++ b/Documentation/Release.rst @@ -52,6 +52,18 @@ Features Bug Fixes ^^^^^^^^^ +Version 23.6.4 +-------------- + +Date: 26.06.2023 + +Bug Fixes +^^^^^^^^^ + +* #16485 / TypeAhead: strpos() string, array given error. +* #16488 / Missing default values break saving records. New custom FE.parameter.defaultValue. +* #16491 / FE Typ Upload - JS failure: document.querySelector() is null. + Version 23.6.3 -------------- diff --git a/Documentation/Settings.cfg b/Documentation/Settings.cfg index 9605b6ae29c32f283cc7286e51691beb1cf2cbed..a3e3750c6f9533df3bb9b016a11f84b6e65363a2 100644 --- a/Documentation/Settings.cfg +++ b/Documentation/Settings.cfg @@ -22,7 +22,7 @@ project = QFQ - Quick Form Query version = 23.6 -release = 23.6.3 +release = 23.6.4 t3author = Carsten Rose copyright = since 2017 by the author diff --git a/Documentation/conf.py b/Documentation/conf.py index 8646e62991aada3948db46783ab1fc7e27a02853..c94be1264b9461cc76abccedf4afd24b03b50adb 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -64,7 +64,7 @@ author = 'Carsten Rose, Benjamin Baer' # The short X.Y version. version = '23.6' # The full version, including alpha/beta/rc tags. -release = '23.6.3' +release = '23.6.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/extension/Classes/Core/Constants.php b/extension/Classes/Core/Constants.php index cb0b771417c65bf3a3a8d7bdaa920ab218054ba6..532732210bbed3e5e57da6a517e0166957c95d29 100644 --- a/extension/Classes/Core/Constants.php +++ b/extension/Classes/Core/Constants.php @@ -1383,6 +1383,7 @@ const FE_EDITOR_TYPE = 'editorType'; // tinymce | codemirror const FE_EDITOR_TYPE_TINYMCE = 'tinymce'; const FE_EDITOR_TYPE_CODEMIRROR = 'codemirror'; const FE_EDITOR_FILE_UPLOAD_PATH = 'fileUploadPath'; +const FE_DEFAULT_VALUE = 'defaultValue'; const FE_SENDMAIL_TO = 'sendMailTo'; // Receiver email adresses. Separate multiple by comma. diff --git a/extension/Classes/Core/QuickFormQuery.php b/extension/Classes/Core/QuickFormQuery.php index 812785ecfcd8a8b728c69a7f54f17165b51b3e59..bdad7dc533096fcf975713669d5224f8a09130e8 100644 --- a/extension/Classes/Core/QuickFormQuery.php +++ b/extension/Classes/Core/QuickFormQuery.php @@ -304,8 +304,10 @@ class QuickFormQuery { $forwardPage = $this->formSpec[F_FORWARD_PAGE]; //Language handling for T3 V10 and above - if (OnString::strStartsWith($forwardPage, '/') && T3Handler::typo3VersionGreaterEqual10()) - $languagePath = Store::getVar(TYPO3_PAGE_LANGUAGE_PATH, STORE_TYPO3); + if (OnString::strStartsWith($forwardPage, '/') && T3Handler::typo3VersionGreaterEqual10()) { + $languagePath = Store::getVar(TYPO3_PAGE_LANGUAGE_PATH, STORE_TYPO3); + } + if (isset($languagePath) && $languagePath !== '') { $forwardPage = '/' . $languagePath . $forwardPage; } @@ -608,6 +610,9 @@ class QuickFormQuery { $tableDefinition = $this->dbArray[$this->dbIndexData]->getTableDefinition($this->formSpec[F_TABLE_NAME]); $this->store->fillStoreTableDefaultColumnType($tableDefinition); + // Check if empty columns exists and set default from fe or database + $this->setFeDefaultValues(); + // Check if the defined column primary key exist. if ($this->store::getVar($this->formSpec[F_PRIMARY_KEY], STORE_TABLE_COLUMN_TYPES) === false) { throw new \UserFormException("Primary Key '" . $this->formSpec[F_PRIMARY_KEY] . "' not found in table " . $this->formSpec[F_TABLE_NAME], ERROR_INVALID_OR_MISSING_PARAMETER); @@ -2507,4 +2512,37 @@ EOF; } } + /** + * Get and set default values for FEs from FE.parameter.defaultValue or from db default value. + * + * @throws \CodeException + * @throws \UserFormException + * @throws \DbException + * @throws \UserReportException + */ + + private function setFeDefaultValues(): void { + + $feValues = $this->store->getStore(STORE_FORM); + $dbDefaultValues = $this->store->getStore(STORE_TABLE_DEFAULT); + + // Check each FE + foreach ($this->feSpecNative as $fe) { + $feName = $fe[FE_NAME]; + // If $feValues[$feName] if given and empty + if (isset($feValues[$feName]) && ($feValues[$feName] === '' || $feValues[$feName] === 0)) { + if (isset($fe[FE_DEFAULT_VALUE])) { + // Is there a custom default value configured (prio over DB scheme default value) + $defaultValue = $fe[FE_DEFAULT_VALUE]; + } elseif (isset($dbDefaultValues[$feName]) && $dbDefaultValues[$feName] !== null) { + // Take DB scheme default value + $defaultValue = $dbDefaultValues[$feName]; + } else { + // no default: skip + continue; + } + $this->store->setVar($feName, $defaultValue, STORE_FORM); + } + } + } } \ No newline at end of file diff --git a/extension/Classes/Core/Save.php b/extension/Classes/Core/Save.php index fd0d2aec8c107e8100b086ac08bbf13f97b854ed..751f44a15f1813488b989f46a5ff060851d34e0a 100644 --- a/extension/Classes/Core/Save.php +++ b/extension/Classes/Core/Save.php @@ -453,6 +453,7 @@ class Save { if (!isset($feColumnTypes[$column])) { $feColumnTypes[$column] = ''; } + // Convert time to datetime if mysql column is datetime, keep date if given if ($tableColumnTypes[$column] === DB_COLUMN_TYPE_DATETIME && $feColumnTypes[$column] === FE_TYPE_TIME) { $actualDate = explode(' ', $this->store->getVar($column, STORE_RECORD), 2)[0]; diff --git a/extension/RELEASE.txt b/extension/RELEASE.txt index 4c0cf4c5a95455606585df3ada89242679cf00f8..ecec19a501b581e0857e876d70e883429575bcd2 100644 --- a/extension/RELEASE.txt +++ b/extension/RELEASE.txt @@ -52,6 +52,18 @@ Features Bug Fixes ^^^^^^^^^ +Version 23.6.4 +-------------- + +Date: 26.06.2023 + +Bug Fixes +^^^^^^^^^ + +* #16485 / TypeAhead: strpos() string, array given error. +* #16488 / Missing default values break saving records. New custom FE.parameter.defaultValue. +* #16491 / FE Typ Upload - JS failure: document.querySelector() is null. + Version 23.6.3 -------------- diff --git a/extension/ext_emconf.php b/extension/ext_emconf.php index f656673ed40ab865d878b11474bf189d0fa2ec39..8a4d7505b49a630d4803b1e01df960a3683d4938 100644 --- a/extension/ext_emconf.php +++ b/extension/ext_emconf.php @@ -12,7 +12,7 @@ $EM_CONF['qfq'] = array( 'dependencies' => 'fluid,extbase', 'clearcacheonload' => true, 'state' => 'stable', - 'version' => '23.6.3', + 'version' => '23.6.4', 'constraints' => [ 'depends' => [ 'typo3' => '8.0.0-11.9.99', diff --git a/javascript/src/QfqForm.js b/javascript/src/QfqForm.js index 93b84e9ccfc508d433c97fa86d1a822403728ff6..147144d1c92e9e22c5f4361a3a3b977b634a7464 100644 --- a/javascript/src/QfqForm.js +++ b/javascript/src/QfqForm.js @@ -1278,7 +1278,7 @@ var QfqNS = QfqNS || {}; $("." + formElementName).html(configurationItem.value); } // Insert download button for uploads after Form is saved. - if (configurationItem["type-file"]) { + if (configurationItem["type-file"] && document.querySelector("button[name='delete-" + formElementName + "']") !== null) { var downloadButton = configurationItem["html-content"]; var fileNameSpan = document.querySelector("button[name='delete-" + formElementName + "']").previousElementSibling; fileNameSpan.innerHTML = ''; diff --git a/version b/version index fed07458c6869729e45304e0055aed88ab4beb22..5c688c6f996eb9d85de2fc1a16104c09c6af144d 100644 --- a/version +++ b/version @@ -1 +1 @@ -23.6.3 +23.6.4