From ce3e49db188c7e77989e775b2eb0f3932fb0c4d2 Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Fri, 1 Dec 2023 09:47:20 +0100 Subject: [PATCH] [TASK] Fix PHP warnings and 404 for files (#27) * [TASK] Add .DS_Store to .gitignore * [TASK] Update to use minimum PHP 8.1 * [TASK] Change runTests.sh * [TASK] Additional update for Build/Scripts/runTests.sh * [BUGFIX] Check if languageField isset * [BUGFIX] Remove unused connector_overrides from JS * [TASK] Update to version ''2.0.2'' --- .gitignore | 1 + Build/Scripts/runTests.sh | 9 +++------ .../Xclass/Form/Container/FilesControlContainer.php | 6 ++++-- Resources/Public/JavaScript/qbank-connector.js | 13 +------------ Resources/Public/JavaScript/qbank-connector.min.js | 2 +- composer.json | 2 +- ext_emconf.php | 2 +- 7 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 8a21830..6e9de1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /*.idea +.DS_Store /.Build/* /.fleet /.php-cs-fixer.cache diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index c6643e3..15917b5 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -57,17 +57,14 @@ Options: - postgres: use postgres - sqlite: use sqlite - -p <7.4|8.0|8.1|8.2> + -p <8.1|8.2> Specifies the PHP minor version to be used - - 7.4: (default) use PHP 7.4 - - 8.0: use PHP 8.0 - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - -t <11|12> + -t <12> Only with -s composerUpdate Specifies the TYPO3 core major version to be used - - 11: (default) use TYPO3 core v11 - 12: use TYPO3 core v12 -e "" @@ -119,7 +116,7 @@ cd ../testing-docker || exit 1 ROOT_DIR=`realpath ${PWD}/../../` TEST_SUITE="unit" DBMS="mariadb" -PHP_VERSION="8.1" +PHP_VERSION="8.2" TYPO3_VERSION="12" PHP_XDEBUG_ON=0 PHP_XDEBUG_PORT=9003 diff --git a/Classes/Xclass/Form/Container/FilesControlContainer.php b/Classes/Xclass/Form/Container/FilesControlContainer.php index b005e83..9c6baaf 100644 --- a/Classes/Xclass/Form/Container/FilesControlContainer.php +++ b/Classes/Xclass/Form/Container/FilesControlContainer.php @@ -114,9 +114,11 @@ protected function getExtensionConfigurationManager(): ExtensionConfigurationMan /** @var ExtensionConfigurationManager $extensionConfigurationManager */ $extensionConfigurationManager = GeneralUtility::makeInstance(ExtensionConfigurationManager::class); - $languageField = $GLOBALS['TCA'][$this->data['tableName']]['ctrl']['languageField']; - $languageId = -1; + if (isset($GLOBALS['TCA'][$this->data['tableName']]['ctrl']['languageField'])) { + $languageField = $GLOBALS['TCA'][$this->data['tableName']]['ctrl']['languageField']; + } + if ($languageField) { $languageId = (int)$this->data['databaseRow'][$languageField]; } diff --git a/Resources/Public/JavaScript/qbank-connector.js b/Resources/Public/JavaScript/qbank-connector.js index 884376d..cb38cda 100644 --- a/Resources/Public/JavaScript/qbank-connector.js +++ b/Resources/Public/JavaScript/qbank-connector.js @@ -93,24 +93,13 @@ * Returns an object with user AND potential connector config override for the current user */ this.getUser = function() { - var delayed = new QBCJQ.Deferred(), userRequest = this.call("accounts/me"), settingsRequest = this.call("accounts/settings.json/connector_override"), object = {}; + var delayed = new QBCJQ.Deferred(), userRequest = this.call("accounts/me"), object = {}; userRequest.then(function(user) { object.user = user; if (object.settings !== undefined) { delayed.resolve(object); } }); - settingsRequest.then(function(settings) { - object.settings = JSON.parse(settings); - if (object.user) { - delayed.resolve(object); - } - }, function() { - object.settings = false; - if (object.user) { - delayed.resolve(object); - } - }); return delayed; }; this.listCategories = function() { diff --git a/Resources/Public/JavaScript/qbank-connector.min.js b/Resources/Public/JavaScript/qbank-connector.min.js index 3767e80..2d106fd 100644 --- a/Resources/Public/JavaScript/qbank-connector.min.js +++ b/Resources/Public/JavaScript/qbank-connector.min.js @@ -1 +1 @@ -!function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){return e(b[g][1][a]||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g")?b.replace(/[\[\]]/g,""):b.replace(/\[.*?\]/g,""),b=b.replace(/||