From 9fd51a42ee3625f031d0127772fd9acb72fb5ff6 Mon Sep 17 00:00:00 2001 From: bbaer Date: Tue, 23 Aug 2022 08:25:13 +0200 Subject: [PATCH 1/8] added css classes --- less/qfq-bs.css.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/less/qfq-bs.css.less b/less/qfq-bs.css.less index 6f75567d..41bdfd17 100644 --- a/less/qfq-bs.css.less +++ b/less/qfq-bs.css.less @@ -1346,6 +1346,14 @@ thead.qfq-sticky td { background-color: #1a1a1a; } +.qfq-max-width-1280 { + max-width: 1280px; +} + +.qfq-max-width-1600 { + max-width: 1600px; +} + @font-face { font-family: 'password'; font-style: normal; -- GitLab From 60d1e61efb7383a7c506f16fc5e4f96dbc5f31a6 Mon Sep 17 00:00:00 2001 From: bbaer Date: Tue, 23 Aug 2022 13:41:18 +0200 Subject: [PATCH 2/8] Removed empty typeahead request at the beginning --- javascript/src/TypeAhead.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/javascript/src/TypeAhead.js b/javascript/src/TypeAhead.js index 800225ba..0ea7911a 100644 --- a/javascript/src/TypeAhead.js +++ b/javascript/src/TypeAhead.js @@ -47,7 +47,8 @@ var QfqNS = QfqNS || {}; var url = n.TypeAhead.makeUrl(typeahead_endpoint, $element); url = url.replace('%QUERY', ''); console.log(url); - $.getJSON(url, {}, console.log); // API by hand + // Seems to trigger an empty query - why? + //$.getJSON(url, {}, console.log); // API by hand // initialize typeahead (either with or without tags) if ($element.data('typeahead-tags')) { @@ -123,6 +124,7 @@ var QfqNS = QfqNS || {}; // when tag is pushed, look up key and add it to existingTags tagApi.bind('tm:pushed', function (e, tag) { + if(tag === "") return; var tagLookup = typeaheadList.filter(function (t) {return t.value.toLowerCase() === tag.toLowerCase();})[0]; if (undefined === tagLookup) { existingTags.push({key: 0, value: tag}); -- GitLab From 3822f1afa6c7c6417d69ce9a665b8a678c6d339d Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 09:48:28 +0200 Subject: [PATCH 3/8] Extend Support::getColumnSize with further MariaDB column type sizes --- extension/Classes/Core/Helper/Support.php | 39 +++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/extension/Classes/Core/Helper/Support.php b/extension/Classes/Core/Helper/Support.php index 57867071..b61fdcf9 100644 --- a/extension/Classes/Core/Helper/Support.php +++ b/extension/Classes/Core/Helper/Support.php @@ -1137,7 +1137,7 @@ class Support { * @return bool|int a) 'false' if there is no length definition, b) length definition, c) * date|time|datetime|timestamp use hardcoded length */ - private static function getColumnSize($typeSpec) { + public static function getColumnSize($typeSpec) { $matches = array(); @@ -1149,6 +1149,22 @@ class Support { return 19; case 'time': // hh:mm:ss return 8; + case 'tinytext': + case 'tinyblob': + return 255; + case 'text': + case 'blob': + return 65535; + case 'mediumtext': + case 'mediumblob': + return 16777215; + case 'longtext': + case 'longblob': + return 4294967295; + case 'inet4': + return 4; + case 'inet6': + return 16; default: if (substr($typeSpec, 0, 4) === 'set(' || substr($typeSpec, 0, 5) === 'enum(') { return self::maxLengthSetEnum($typeSpec); @@ -1158,8 +1174,25 @@ class Support { // e.g.: string(64) >> 64, enum('yes','no') >> false if (1 === preg_match('/\((.+)\)/', $typeSpec, $matches)) { - if (is_numeric($matches[1])) - return $matches[1]; + // Check for 'decimal(5,3)' or 'decimal(5,3) unsigned' + if (substr($typeSpec, 0, 8) === 'decimal(') { + $cnt = 0; + // $arr[0]=m, $arr[1]=d + $arr = explode(',', $matches[1]); + $tmp = $arr[1] ?? 0; + if ($tmp > 0) { + $cnt += $tmp + 1; + } + if (strpos('unsigned', $typeSpec) !== false) { + // Without 'unsigned', a '-' (minus) might be given. + $cnt++; + } + return $arr[0] + $cnt; + } else { + + if (is_numeric($matches[1])) + return (int)$matches[1]; + } } return false; -- GitLab From 2b5e0338200b358aca9f536e7afb92594ea44d80 Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 10:13:06 +0200 Subject: [PATCH 4/8] Add pill 'table definition' to form=FormElement. Fix problem with renamed pill. --- extension/Resources/Private/Form/form.json | 4 +- .../Resources/Private/Form/formElement.json | 85 +++++++++++++++++++ 2 files changed, 87 insertions(+), 2 deletions(-) diff --git a/extension/Resources/Private/Form/form.json b/extension/Resources/Private/Form/form.json index c107b62b..7981ec3b 100644 --- a/extension/Resources/Private/Form/form.json +++ b/extension/Resources/Private/Form/form.json @@ -1586,7 +1586,7 @@ { "dynamicUpdate": "no", "enabled": "yes", - "name": "Table Definition", + "name": "TableDefinition", "label": "Table Definition", "mode": "show", "modeSql": "", @@ -1662,7 +1662,7 @@ "deleted": "no", "modified": "2022-06-03 15:19:42", "created": "2022-06-03 15:06:55", - "containerName_ff": "Table Definition" + "containerName_ff": "TableDefinition" } ] } \ No newline at end of file diff --git a/extension/Resources/Private/Form/formElement.json b/extension/Resources/Private/Form/formElement.json index 71563812..7e796a9f 100644 --- a/extension/Resources/Private/Form/formElement.json +++ b/extension/Resources/Private/Form/formElement.json @@ -1664,6 +1664,91 @@ "deleted": "no", "modified": "2021-04-06 12:05:41", "created": "2021-04-06 12:05:41" + }, + { + "dynamicUpdate": "no", + "encryption": "no", + "encryptionMethod": "Default", + "enabled": "yes", + "name": "tableDefinition", + "label": "Table Definition", + "mode": "show", + "modeSql": "", + "class": "container", + "type": "pill", + "subrecordOption": "", + "encode": "specialchar", + "checkType": "auto", + "checkPattern": "", + "onChange": "", + "ord": 670, + "tabindex": 0, + "size": "", + "maxLength": "", + "labelAlign": "default", + "bsLabelColumns": "", + "bsInputColumns": "", + "bsNoteColumns": "", + "rowLabelInputNote": "row,label,\/label,input,\/input,note,\/note,\/row", + "note": "", + "adminNote": "", + "tooltip": "", + "placeholder": "", + "value": "", + "sql1": "", + "parameter": "", + "parameterLanguageA": "", + "parameterLanguageB": "", + "parameterLanguageC": "", + "parameterLanguageD": "", + "clientJs": "", + "feGroup": "", + "deleted": "no", + "modified": "2022-08-28 09:41:12", + "created": "2022-08-28 09:37:36" + }, + { + "dynamicUpdate": "no", + "encryption": "no", + "encryptionMethod": "Default", + "enabled": "yes", + "name": "Table Definition", + "label": "", + "mode": "show", + "modeSql": "", + "class": "native", + "type": "note", + "subrecordOption": "", + "encode": "specialchar", + "checkType": "auto", + "checkPattern": "", + "onChange": "", + "ord": 680, + "tabindex": 0, + "size": "", + "maxLength": "", + "labelAlign": "default", + "bsLabelColumns": "", + "bsInputColumns": "col-md-12", + "bsNoteColumns": "", + "rowLabelInputNote": "row,input,\/input,\/row", + "note": "", + "adminNote": "", + "tooltip": "", + "placeholder": "", + "value": "#!report\r\n\r\n10 {\r\n sql = SELECT tableName AS _tableName FROM {{dbNameQfq:Y}}.Form AS f WHERE f.id={{formId:SR0}}\r\n althead = Please save the record.\r\n 20 {\r\n sql = SHOW COLUMNS FROM {{dbNameData:Y}}.{{tableName:RE}}\r\n head = \r\n rend = <\/tr>\r\n fbeg =
Field<\/th>Type<\/th>Null<\/th>Key<\/th>Default<\/th>Extra<\/th><\/tr><\/thead>\r\n tail = <\/table>\r\n rbeg =
\r\n fend = <\/td>\r\n}\r\n}", + "sql1": "", + "parameter": "", + "parameterLanguageA": "", + "parameterLanguageB": "", + "parameterLanguageC": "", + "parameterLanguageD": "", + "clientJs": "", + "feGroup": "", + "deleted": "no", + "modified": "2022-08-28 09:40:13", + "created": "2022-08-28 09:40:13", + "containerName_ff": "tableDefinition" } ] } \ No newline at end of file -- GitLab From 7894a706c07f3c86f4bfdbdcb35440ce9a60f3ed Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 10:19:30 +0200 Subject: [PATCH 5/8] Extension config description baseUrl: updated. --- extension/ext_conf_template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/ext_conf_template.txt b/extension/ext_conf_template.txt index cd38498e..1dd6b548 100644 --- a/extension/ext_conf_template.txt +++ b/extension/ext_conf_template.txt @@ -7,7 +7,7 @@ render = single # cat=config/config; type=string; label=Max file size for file uploads:If empty, take minimum of 'post_max_size' and 'upload_max_filesize' (PHP.INI). maxFileSize = -# cat=config/config; type=string; label=Base URL of the current Typo3 installation: Example: https://your.base.url/including/sub/dir. Separate multiple URLs with comma. Final one will dynamically detected. Will be used to convert local pages to PDF. Use {{baseUrl:Y}} whenever the own URL should be displayed. Skip the scheme if the website needs to be accessible with http and https. +# cat=config/config; type=string; label=Base URL of the current Typo3 installation. Use {{baseUrl:Y}} whenever the own URL should be referenced. Important for downloads and PDF conversion too. Example: https://your.base.url/including/sub/dir. Separate multiple URLs with comma. Final one will detected dynamically. Skip the scheme if the website needs to be accessible with http and https. Advanced example: first.base.url/sub1,second.example.url baseUrl = # cat=config/date; type=string; label=Date format:Default is 'dd.mm.yyyy'. Possible options: 'yyyy-mm-dd', 'dd.mm.yyyy' -- GitLab From 90e9909baf88bc14cc8b81d769c68a216b5a1df1 Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 11:39:19 +0200 Subject: [PATCH 6/8] Refs #9281 - Allow STRICT_TRANS_TABLES - Default '0' is now set for all INT columns. DB-Update will change column definition. TEXT columns still don't have a default: Before MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT value. This restriction was lifted in MariaDB 10.2.1. - we still have several DBs with 10.0 and 10.1. --- .../Classes/Core/Database/DatabaseUpdateData.php | 11 +++++++++++ extension/Classes/Sql/qfqDefaultTables.sql | 16 ++++++++-------- extension/Classes/Sql/testtables.sql | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/extension/Classes/Core/Database/DatabaseUpdateData.php b/extension/Classes/Core/Database/DatabaseUpdateData.php index 6710d5d5..ac09609b 100644 --- a/extension/Classes/Core/Database/DatabaseUpdateData.php +++ b/extension/Classes/Core/Database/DatabaseUpdateData.php @@ -213,6 +213,17 @@ $UPDATE_ARRAY = array( "ALTER TABLE `FormElement` ADD `encryptionMethod` ENUM('Default', 'AES-128','AES-256') NOT NULL DEFAULT 'Default' AFTER `encryption`;", ], + '22.8.0' => [ + "ALTER TABLE `FormElement` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `Dirty` CHANGE `recordId` `recordId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `FormSubmitLog` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `FormSubmitLog` CHANGE `recordId` `recordId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `Cron` CHANGE `grId` `grId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `Cron` CHANGE `xId` `xId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `Split` CHANGE `xId` `xId` INT(11) NOT NULL DEFAULT '0';", + "ALTER TABLE `Setting` CHANGE `public` `public` TINYINT(1) NOT NULL DEFAULT '0';", + ], + ); diff --git a/extension/Classes/Sql/qfqDefaultTables.sql b/extension/Classes/Sql/qfqDefaultTables.sql index 1416d711..13ed6b10 100644 --- a/extension/Classes/Sql/qfqDefaultTables.sql +++ b/extension/Classes/Sql/qfqDefaultTables.sql @@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `Form` CREATE TABLE IF NOT EXISTS `FormElement` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `formId` INT(11) NOT NULL, + `formId` INT(11) NOT NULL DEFAULT '0', `feIdContainer` INT(11) NOT NULL DEFAULT '0', `dynamicUpdate` ENUM ('yes', 'no') NOT NULL DEFAULT 'no', `encryption` ENUM ('yes', 'no') NOT NULL DEFAULT 'no', @@ -132,7 +132,7 @@ CREATE TABLE IF NOT EXISTS `Dirty` `id` INT(11) NOT NULL AUTO_INCREMENT, `sip` VARCHAR(255) NOT NULL, `tableName` VARCHAR(255) NOT NULL, - `recordId` INT(11) NOT NULL, + `recordId` INT(11) NOT NULL DEFAULT '0', `expire` DATETIME NOT NULL, `recordHashMd5` CHAR(32) NOT NULL, `tabUniqId` CHAR(32) NOT NULL, @@ -187,9 +187,9 @@ CREATE TABLE IF NOT EXISTS `FormSubmitLog` `clientIp` VARCHAR(64) NOT NULL, `feUser` VARCHAR(64) NOT NULL, `userAgent` TEXT NOT NULL, - `formId` INT(11) NOT NULL, + `formId` INT(11) NOT NULL DEFAULT '0', `formName` VARCHAR(255) NOT NULL, - `recordId` INT(11) NOT NULL, + `recordId` INT(11) NOT NULL DEFAULT '0', `pageId` INT NOT NULL, `sessionId` VARCHAR(32) NOT NULL, `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -224,8 +224,8 @@ CREATE TABLE IF NOT EXISTS `Clipboard` CREATE TABLE IF NOT EXISTS `Cron` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `grId` INT(11) NOT NULL, - `xId` INT(11) NOT NULL, + `grId` INT(11) NOT NULL DEFAULT '0', + `xId` INT(11) NOT NULL DEFAULT '0', `type` ENUM ('mail', 'website') NOT NULL DEFAULT 'website', `lastRun` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `lastStatus` TEXT NOT NULL, @@ -254,7 +254,7 @@ CREATE TABLE IF NOT EXISTS `Split` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `tableName` VARCHAR(255) NOT NULL, - `xId` INT(11) NOT NULL, + `xId` INT(11) NOT NULL DEFAULT '0', `pathFileName` VARCHAR(255) NOT NULL, `modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -272,7 +272,7 @@ CREATE TABLE IF NOT EXISTS `Setting` `type` ENUM ('', 'tablesorter') NOT NULL, `readonly` ENUM ('yes', 'no') NOT NULL DEFAULT 'no' COMMENT 'Settings can''t be modified.', `name` VARCHAR(64) NOT NULL, - `public` TINYINT(1) NOT NULL, + `public` TINYINT(1) NOT NULL DEFAULT '0', `feUser` VARCHAR(32) NOT NULL COMMENT 'In case there is no logged in user, take QFQ cookie.', `tableId` VARCHAR(64) NOT NULL, `view` TEXT NOT NULL, diff --git a/extension/Classes/Sql/testtables.sql b/extension/Classes/Sql/testtables.sql index 891eb2c4..1760c1bf 100644 --- a/extension/Classes/Sql/testtables.sql +++ b/extension/Classes/Sql/testtables.sql @@ -24,7 +24,7 @@ DROP TABLE IF EXISTS PersFunction; CREATE TABLE PersFunction ( id BIGINT AUTO_INCREMENT PRIMARY KEY, - personId BIGINT, + personId BIGINT DEFAULT '0', type ENUM ('Student', 'Assistant', 'Professor', 'Administration'), start DATE NOT NULL DEFAULT '0000-00-00', end DATE NOT NULL DEFAULT '0000-00-00', -- GitLab From f772a76798ed2028a1fd65e238685e061ef906f2 Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 11:45:48 +0200 Subject: [PATCH 7/8] Fix DB update reference version from 22.8.0. tpo 22.8.1 --- extension/Classes/Core/Database/DatabaseUpdateData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/Classes/Core/Database/DatabaseUpdateData.php b/extension/Classes/Core/Database/DatabaseUpdateData.php index ac09609b..8704cd78 100644 --- a/extension/Classes/Core/Database/DatabaseUpdateData.php +++ b/extension/Classes/Core/Database/DatabaseUpdateData.php @@ -213,7 +213,7 @@ $UPDATE_ARRAY = array( "ALTER TABLE `FormElement` ADD `encryptionMethod` ENUM('Default', 'AES-128','AES-256') NOT NULL DEFAULT 'Default' AFTER `encryption`;", ], - '22.8.0' => [ + '22.8.1' => [ "ALTER TABLE `FormElement` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';", "ALTER TABLE `Dirty` CHANGE `recordId` `recordId` INT(11) NOT NULL DEFAULT '0';", "ALTER TABLE `FormSubmitLog` CHANGE `formId` `formId` INT(11) NOT NULL DEFAULT '0';", -- GitLab From 08adad795f7c238cf1bdbc4e5ebf7663e0b29c99 Mon Sep 17 00:00:00 2001 From: Carsten Rose Date: Sun, 28 Aug 2022 21:19:51 +0200 Subject: [PATCH 8/8] Refs #14618 - fix can't be proofed, problem can't be reproduced. --- extension/Classes/Core/Helper/EncryptDecrypt.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extension/Classes/Core/Helper/EncryptDecrypt.php b/extension/Classes/Core/Helper/EncryptDecrypt.php index e7bcc257..59c7959c 100644 --- a/extension/Classes/Core/Helper/EncryptDecrypt.php +++ b/extension/Classes/Core/Helper/EncryptDecrypt.php @@ -358,7 +358,11 @@ class EncryptDecrypt { * @param string $value * @return boolean */ - public static function checkForEncryptedValue(string $value): bool { + public static function checkForEncryptedValue($value): bool { + + if (is_null($value)) { + $value = ''; + } // Try to split value and check for first element of array $arrayValues = explode(':', $value, 4); if (isset($arrayValues[0]) && $arrayValues[0] !== '') { -- GitLab