From d0f1ab7e5e3ea362cc51566ce803e157e39f2eef Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 21:28:32 +0200 Subject: [PATCH 01/14] [TASK] Allow installation on TYPO3 10 LTS --- composer.json | 2 +- ext_emconf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 46f9543..c7b2396 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "issues": "https://forge.typo3.org/projects/extension-jpfaq/" }, "require": { - "typo3/cms-core": "^9.5" + "typo3/cms-core": "^9.5 || ^10.4" }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index 09cd409..e48b091 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -15,7 +15,7 @@ array( 'depends' => array( - 'typo3' => '9.5.0-9.5.99', + 'typo3' => '9.5.0-10.4.99', ), 'conflicts' => array(), From 5660d8830aecf908bf6f58940f7a572e476545e8 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 21:36:40 +0200 Subject: [PATCH 02/14] [TASK] Don't use $_EXTKEY anymore (#82692) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.0/Important-82692-GuidelinesForExtensionFiles.html --- ext_localconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_localconf.php b/ext_localconf.php index 5c442f0..099b0b6 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -20,7 +20,7 @@ function ($extKey) { ] ); }, - $_EXTKEY + 'jpfaq' ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); From 626bc805a3cfc0f7635cbddf14fa5afdca4e2665 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 21:41:11 +0200 Subject: [PATCH 03/14] [TASK] Remove management DB fields (#85160) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.3/Feature-85160-AutoCreateManagementDBFieldsFromTCACtrl.html --- ext_tables.sql | 139 ++----------------------------------------------- 1 file changed, 5 insertions(+), 134 deletions(-) diff --git a/ext_tables.sql b/ext_tables.sql index 298c915..316738a 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -2,46 +2,13 @@ # Table structure for table 'tx_jpfaq_domain_model_question' # CREATE TABLE tx_jpfaq_domain_model_question ( - - uid int(11) NOT NULL auto_increment, - pid int(11) DEFAULT '0' NOT NULL, - question varchar(255) DEFAULT '' NOT NULL, answer text NOT NULL, additional_content_answer int(11) unsigned DEFAULT '0' NOT NULL, categories int(11) unsigned DEFAULT '0' NOT NULL, questioncomment int(11) unsigned DEFAULT '0' NOT NULL, helpful int(11) unsigned DEFAULT '0' NOT NULL, - nothelpful int(11) unsigned DEFAULT '0' NOT NULL, - - tstamp int(11) unsigned DEFAULT '0' NOT NULL, - crdate int(11) unsigned DEFAULT '0' NOT NULL, - cruser_id int(11) unsigned DEFAULT '0' NOT NULL, - deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, - hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, - starttime int(11) unsigned DEFAULT '0' NOT NULL, - endtime int(11) unsigned DEFAULT '0' NOT NULL, - - t3ver_oid int(11) DEFAULT '0' NOT NULL, - t3ver_id int(11) DEFAULT '0' NOT NULL, - t3ver_wsid int(11) DEFAULT '0' NOT NULL, - t3ver_label varchar(255) DEFAULT '' NOT NULL, - t3ver_state tinyint(4) DEFAULT '0' NOT NULL, - t3ver_stage int(11) DEFAULT '0' NOT NULL, - t3ver_count int(11) DEFAULT '0' NOT NULL, - t3ver_tstamp int(11) DEFAULT '0' NOT NULL, - t3ver_move_id int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - - sys_language_uid int(11) DEFAULT '0' NOT NULL, - l10n_parent int(11) DEFAULT '0' NOT NULL, - l10n_diffsource mediumblob, - - PRIMARY KEY (uid), - KEY parent (pid), - KEY t3ver_oid (t3ver_oid,t3ver_wsid), - KEY language (l10n_parent,sys_language_uid) - + nothelpful int(11) unsigned DEFAULT '0' NOT NULL ); # IRRE Records @@ -53,42 +20,9 @@ CREATE TABLE tt_content ( # Table structure for table 'tx_jpfaq_domain_model_category' # CREATE TABLE tx_jpfaq_domain_model_category ( - - uid int(11) NOT NULL auto_increment, - pid int(11) DEFAULT '0' NOT NULL, - category varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, - categorycomment int(11) unsigned DEFAULT '0' NOT NULL, - - tstamp int(11) unsigned DEFAULT '0' NOT NULL, - crdate int(11) unsigned DEFAULT '0' NOT NULL, - cruser_id int(11) unsigned DEFAULT '0' NOT NULL, - deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, - hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, - starttime int(11) unsigned DEFAULT '0' NOT NULL, - endtime int(11) unsigned DEFAULT '0' NOT NULL, - - t3ver_oid int(11) DEFAULT '0' NOT NULL, - t3ver_id int(11) DEFAULT '0' NOT NULL, - t3ver_wsid int(11) DEFAULT '0' NOT NULL, - t3ver_label varchar(255) DEFAULT '' NOT NULL, - t3ver_state tinyint(4) DEFAULT '0' NOT NULL, - t3ver_stage int(11) DEFAULT '0' NOT NULL, - t3ver_count int(11) DEFAULT '0' NOT NULL, - t3ver_tstamp int(11) DEFAULT '0' NOT NULL, - t3ver_move_id int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - - sys_language_uid int(11) DEFAULT '0' NOT NULL, - l10n_parent int(11) DEFAULT '0' NOT NULL, - l10n_diffsource mediumblob, - - PRIMARY KEY (uid), - KEY parent (pid), - KEY t3ver_oid (t3ver_oid,t3ver_wsid), - KEY language (l10n_parent,sys_language_uid) - + categorycomment int(11) unsigned DEFAULT '0' NOT NULL ); # @@ -108,87 +42,24 @@ CREATE TABLE tx_jpfaq_question_category_mm ( # Table structure for table 'tx_jpfaq_domain_model_questioncomment' # CREATE TABLE tx_jpfaq_domain_model_questioncomment ( - uid int(11) NOT NULL auto_increment, - pid int(11) DEFAULT '0' NOT NULL, - question int(11) unsigned DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL, comment text NOT NULL, ip varchar(255) DEFAULT 'local' NOT NULL, - finfo varchar(255) DEFAULT '' NOT NULL, - - tstamp int(11) unsigned DEFAULT '0' NOT NULL, - crdate int(11) unsigned DEFAULT '0' NOT NULL, - cruser_id int(11) unsigned DEFAULT '0' NOT NULL, - deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, - hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, - starttime int(11) unsigned DEFAULT '0' NOT NULL, - endtime int(11) unsigned DEFAULT '0' NOT NULL, - - t3ver_oid int(11) DEFAULT '0' NOT NULL, - t3ver_id int(11) DEFAULT '0' NOT NULL, - t3ver_wsid int(11) DEFAULT '0' NOT NULL, - t3ver_label varchar(255) DEFAULT '' NOT NULL, - t3ver_state tinyint(4) DEFAULT '0' NOT NULL, - t3ver_stage int(11) DEFAULT '0' NOT NULL, - t3ver_count int(11) DEFAULT '0' NOT NULL, - t3ver_tstamp int(11) DEFAULT '0' NOT NULL, - t3ver_move_id int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - - sys_language_uid int(11) DEFAULT '0' NOT NULL, - l10n_parent int(11) DEFAULT '0' NOT NULL, - l10n_diffsource mediumblob, - - PRIMARY KEY (uid), - KEY parent (pid), - KEY t3ver_oid (t3ver_oid,t3ver_wsid), - KEY language (l10n_parent,sys_language_uid) + finfo varchar(255) DEFAULT '' NOT NULL ); - # # Table structure for table 'tx_jpfaq_domain_model_categorycomment' # CREATE TABLE tx_jpfaq_domain_model_categorycomment ( - uid int(11) NOT NULL auto_increment, - pid int(11) DEFAULT '0' NOT NULL, - category int(11) unsigned DEFAULT '0' NOT NULL, name varchar(255) DEFAULT '' NOT NULL, email varchar(255) DEFAULT '' NOT NULL, comment text NOT NULL, ip varchar(255) DEFAULT 'local' NOT NULL, - finfo varchar(255) DEFAULT '' NOT NULL, - - tstamp int(11) unsigned DEFAULT '0' NOT NULL, - crdate int(11) unsigned DEFAULT '0' NOT NULL, - cruser_id int(11) unsigned DEFAULT '0' NOT NULL, - deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, - hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, - starttime int(11) unsigned DEFAULT '0' NOT NULL, - endtime int(11) unsigned DEFAULT '0' NOT NULL, - - t3ver_oid int(11) DEFAULT '0' NOT NULL, - t3ver_id int(11) DEFAULT '0' NOT NULL, - t3ver_wsid int(11) DEFAULT '0' NOT NULL, - t3ver_label varchar(255) DEFAULT '' NOT NULL, - t3ver_state tinyint(4) DEFAULT '0' NOT NULL, - t3ver_stage int(11) DEFAULT '0' NOT NULL, - t3ver_count int(11) DEFAULT '0' NOT NULL, - t3ver_tstamp int(11) DEFAULT '0' NOT NULL, - t3ver_move_id int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - - sys_language_uid int(11) DEFAULT '0' NOT NULL, - l10n_parent int(11) DEFAULT '0' NOT NULL, - l10n_diffsource mediumblob, - - PRIMARY KEY (uid), - KEY parent (pid), - KEY t3ver_oid (t3ver_oid,t3ver_wsid), - KEY language (l10n_parent,sys_language_uid) + finfo varchar(255) DEFAULT '' NOT NULL ); # @@ -202,4 +73,4 @@ CREATE TABLE tx_jpfaq_category_comment_mm ( KEY uid_local (uid_local), KEY uid_foreign (uid_foreign) -); \ No newline at end of file +); From f7879e059d4ffd519c111c16ae9850bcbce9b3e7 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 21:49:35 +0200 Subject: [PATCH 04/14] [TASK] Use default file extension .typoscript (#78161) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/8.7.x/Feature-78161-IntroduceTypoScriptFileExtension.html --- Configuration/TypoScript/{constants.ts => constants.typoscript} | 0 Configuration/TypoScript/{setup.ts => setup.typoscript} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Configuration/TypoScript/{constants.ts => constants.typoscript} (100%) rename Configuration/TypoScript/{setup.ts => setup.typoscript} (100%) diff --git a/Configuration/TypoScript/constants.ts b/Configuration/TypoScript/constants.typoscript similarity index 100% rename from Configuration/TypoScript/constants.ts rename to Configuration/TypoScript/constants.typoscript diff --git a/Configuration/TypoScript/setup.ts b/Configuration/TypoScript/setup.typoscript similarity index 100% rename from Configuration/TypoScript/setup.ts rename to Configuration/TypoScript/setup.typoscript From 0b8112678362600b39f08b91cc8355769484c22f Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:04:51 +0200 Subject: [PATCH 05/14] [TASK] Use default file extension .tsconfig (#78161) https://decisions.typo3.org/t/file-endings-for-typoscript-and-tsconfig-files-results/71/3 --- .../Page/contentElementWizard.tsconfig} | 0 .../pageTSconfig.ts => TsConfig/Page/pageTSconfig.tsconfig} | 0 Configuration/TsConfig/includePageTSconfig.tsconfig | 1 + Configuration/TypoScript/TSconfig/includePageTSconfig.ts | 1 - ext_localconf.php | 2 +- 5 files changed, 2 insertions(+), 2 deletions(-) rename Configuration/{TypoScript/TSconfig/Page/contentElementWizard.ts => TsConfig/Page/contentElementWizard.tsconfig} (100%) rename Configuration/{TypoScript/TSconfig/Page/pageTSconfig.ts => TsConfig/Page/pageTSconfig.tsconfig} (100%) create mode 100644 Configuration/TsConfig/includePageTSconfig.tsconfig delete mode 100644 Configuration/TypoScript/TSconfig/includePageTSconfig.ts diff --git a/Configuration/TypoScript/TSconfig/Page/contentElementWizard.ts b/Configuration/TsConfig/Page/contentElementWizard.tsconfig similarity index 100% rename from Configuration/TypoScript/TSconfig/Page/contentElementWizard.ts rename to Configuration/TsConfig/Page/contentElementWizard.tsconfig diff --git a/Configuration/TypoScript/TSconfig/Page/pageTSconfig.ts b/Configuration/TsConfig/Page/pageTSconfig.tsconfig similarity index 100% rename from Configuration/TypoScript/TSconfig/Page/pageTSconfig.ts rename to Configuration/TsConfig/Page/pageTSconfig.tsconfig diff --git a/Configuration/TsConfig/includePageTSconfig.tsconfig b/Configuration/TsConfig/includePageTSconfig.tsconfig new file mode 100644 index 0000000..9723846 --- /dev/null +++ b/Configuration/TsConfig/includePageTSconfig.tsconfig @@ -0,0 +1 @@ + diff --git a/Configuration/TypoScript/TSconfig/includePageTSconfig.ts b/Configuration/TypoScript/TSconfig/includePageTSconfig.ts deleted file mode 100644 index 1ee75b1..0000000 --- a/Configuration/TypoScript/TSconfig/includePageTSconfig.ts +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index 099b0b6..1ec50ab 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -23,7 +23,7 @@ function ($extKey) { 'jpfaq' ); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); /** * Icon registry From 23f16879d98b78cd881cb01535fe54557ecf0575 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:30:30 +0200 Subject: [PATCH 06/14] [TASK] Remove dividers2tabs from TCA (#62833) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/7.0/Breaking-62833-Dividers2Tabs.html --- Configuration/TCA/tx_jpfaq_domain_model_category.php | 1 - Configuration/TCA/tx_jpfaq_domain_model_question.php | 1 - 2 files changed, 2 deletions(-) diff --git a/Configuration/TCA/tx_jpfaq_domain_model_category.php b/Configuration/TCA/tx_jpfaq_domain_model_category.php index 247fca2..9d8c4ed 100644 --- a/Configuration/TCA/tx_jpfaq_domain_model_category.php +++ b/Configuration/TCA/tx_jpfaq_domain_model_category.php @@ -7,7 +7,6 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', - 'dividers2tabs' => 1, 'sortby' => 'sorting', 'versioningWS' => true, 'languageField' => 'sys_language_uid', diff --git a/Configuration/TCA/tx_jpfaq_domain_model_question.php b/Configuration/TCA/tx_jpfaq_domain_model_question.php index 4c7eb47..69851de 100644 --- a/Configuration/TCA/tx_jpfaq_domain_model_question.php +++ b/Configuration/TCA/tx_jpfaq_domain_model_question.php @@ -7,7 +7,6 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', - 'dividers2tabs' => 1, 'sortby' => 'sorting', 'versioningWS' => true, 'languageField' => 'sys_language_uid', From 73c24647fc7fc3975b2079430a617914d96dcf9a Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:30:52 +0200 Subject: [PATCH 07/14] [BUGFIX] Add missing sorting property --- Configuration/TCA/tx_jpfaq_domain_model_questioncomment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Configuration/TCA/tx_jpfaq_domain_model_questioncomment.php b/Configuration/TCA/tx_jpfaq_domain_model_questioncomment.php index 7d0d263..4200df3 100644 --- a/Configuration/TCA/tx_jpfaq_domain_model_questioncomment.php +++ b/Configuration/TCA/tx_jpfaq_domain_model_questioncomment.php @@ -6,6 +6,7 @@ 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', + 'sortby' => 'sorting', 'default_sortby' => 'crdate DESC', 'versioningWS' => true, 'languageField' => 'sys_language_uid', From e98989492828b66fc48971d63ceaaa800016dee8 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:38:55 +0200 Subject: [PATCH 08/14] [BUGFIX] CMS ViewHelper base classes removed (#82414) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.0/Breaking-82414-RemoveCMSBaseViewHelperClasses.html --- .../ExcludeAlreadyDisplayedQuestionsViewHelper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Classes/ViewHelpers/ExcludeAlreadyDisplayedQuestionsViewHelper.php b/Classes/ViewHelpers/ExcludeAlreadyDisplayedQuestionsViewHelper.php index 468320b..f20e11a 100644 --- a/Classes/ViewHelpers/ExcludeAlreadyDisplayedQuestionsViewHelper.php +++ b/Classes/ViewHelpers/ExcludeAlreadyDisplayedQuestionsViewHelper.php @@ -11,8 +11,7 @@ * LICENSE file that was distributed with this source code. */ use Jp\Jpfaq\Domain\Model\Question; -use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface; -use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface; +use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface; use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic; /** @@ -28,7 +27,7 @@ * * */ -class ExcludeAlreadyDisplayedQuestionsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper implements CompilableInterface +class ExcludeAlreadyDisplayedQuestionsViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper { use CompileWithRenderStatic; From 9766de89bc440bc6ece9a98441f35c4e7a4a2744 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:42:19 +0200 Subject: [PATCH 09/14] [BUGFIX] Properties uid and pid not compatible with base class AbstractDomainObject --- Classes/Domain/Model/TtContent.php | 33 ------------------------------ 1 file changed, 33 deletions(-) diff --git a/Classes/Domain/Model/TtContent.php b/Classes/Domain/Model/TtContent.php index da1817b..5d0eb25 100644 --- a/Classes/Domain/Model/TtContent.php +++ b/Classes/Domain/Model/TtContent.php @@ -20,20 +20,6 @@ */ class TtContent extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { - /** - * uid - * - * @var string - */ - protected $uid = ''; - - /** - * pid - * - * @var string - */ - protected $pid = ''; - /** * @var \DateTime */ @@ -617,23 +603,4 @@ public function getContentType() { public function setContentType($contentType) { $this->contentType = $contentType; } - - /** - * Gets the uid - * - * @return string $uid - */ - public function getUid() { - return $this->uid; - } - - /** - * Gets the pid - * - * @return string $pid - */ - public function getPid() { - return $this->pid; - } - } From a325d7b9c4d8002bf717b58ed3da494fe1642e7e Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:55:36 +0200 Subject: [PATCH 10/14] [TASK] Add persistence configuration for TYPO3 10 (#87623) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.0/Breaking-87623-ReplaceConfigpersistenceclassesTyposcriptConfiguration.html --- Configuration/Extbase/Persistence/Classes.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Configuration/Extbase/Persistence/Classes.php diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php new file mode 100644 index 0000000..1d89a0a --- /dev/null +++ b/Configuration/Extbase/Persistence/Classes.php @@ -0,0 +1,13 @@ + [ + 'tableName' => 'tt_content', + 'properties' => [ + 'contentType' => [ + 'fieldName' => 'CType' + ], + ], + ], +]; From 44ae50f0eb4b068a706c98c5261fbcb53cea78ff Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 22:55:58 +0200 Subject: [PATCH 11/14] [BUGFIX] Add missing getter for questioncomment --- Classes/Domain/Model/Question.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/Domain/Model/Question.php b/Classes/Domain/Model/Question.php index 7278675..8dd8765 100644 --- a/Classes/Domain/Model/Question.php +++ b/Classes/Domain/Model/Question.php @@ -254,6 +254,16 @@ public function setNothelpful($nothelpful) $this->nothelpful = $nothelpful; } + /** + * Returns the Questioncomment + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Jp\Jpfaq\Domain\Model\Questioncomment> + */ + public function getQuestioncomment() + { + return $this->questioncomment; + } + /** * Adds a questioncomment * From 952fdf1bfbc59a14899dfa7500e70e60cf630163 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 23:34:03 +0200 Subject: [PATCH 12/14] [BUGFIX] Setting the body of the MailMessage does not work in TYPO3 10 --- Classes/Service/SendMailService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Classes/Service/SendMailService.php b/Classes/Service/SendMailService.php index 77d2dd2..c900d07 100644 --- a/Classes/Service/SendMailService.php +++ b/Classes/Service/SendMailService.php @@ -29,7 +29,14 @@ public static function sendMail(string $receivers, array $sender, string $subjec $mail->setTo($receivers); $mail->setFrom($sender); $mail->setSubject($subject); - $mail->setBody('' . $body . ' ', 'text/html'); + + // TYPO3 10 uses Mailer whereas TYPO3 9 uses SwiftMailer + if (method_exists($mail, 'html')) { + $mail->html('' . $body . ' '); + } else { + $mail->setBody('' . $body . ' ', 'text/html'); + } + $mail->send(); return $mail->isSent(); From ef4c66ea38ed30045e2223b3eb255c6fe665cca7 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 23:36:04 +0200 Subject: [PATCH 13/14] [TASK] Update readme file --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be39d05..1b57ee6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # jpfaq Frequently Asked Questions (FAQ) plugin. Optional features: categories, on-the-fly search, customer helpfulness tracking and comments. -For TYPO3 9.5 +For TYPO3 9.5 and TYPO3 10.4 -Install: composer require jvdp/jpfaq +## Install + +To install this extension, run `composer require jvdp/jpfaq`. From 7bcdcf82270a9b3239df5fe71251e3637a338fb7 Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Tue, 25 Aug 2020 23:50:31 +0200 Subject: [PATCH 14/14] [TASK] User ExtensionConfiguration API (#82254) https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.0/Feature-82254-StoreExtensionConfigurationAsPlainArray.html --- Classes/Controller/CategorycommentController.php | 3 ++- Classes/Controller/QuestioncommentController.php | 3 ++- Classes/Service/SendMailService.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/Controller/CategorycommentController.php b/Classes/Controller/CategorycommentController.php index 0a8d286..cdcf5f8 100644 --- a/Classes/Controller/CategorycommentController.php +++ b/Classes/Controller/CategorycommentController.php @@ -15,6 +15,7 @@ use Jp\Jpfaq\Service\SendMailService; use Jp\Jpfaq\Domain\Model\Categorycomment; +use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -104,7 +105,7 @@ public function addCommentAction(Categorycomment $newCategorycomment, array $cat if ($currentUid == $pluginUid) { // Set comment IP - $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['jpfaq']); + $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('jpfaq'); $anonymizeIpSetting = $extensionConfiguration['anonymizeIp']; $commentIp= (string)GeneralUtility::getIndpEnv('REMOTE_ADDR'); diff --git a/Classes/Controller/QuestioncommentController.php b/Classes/Controller/QuestioncommentController.php index f446ae5..c9ca211 100644 --- a/Classes/Controller/QuestioncommentController.php +++ b/Classes/Controller/QuestioncommentController.php @@ -16,6 +16,7 @@ use Jp\Jpfaq\Service\SendMailService; use Jp\Jpfaq\Domain\Model\Question; use Jp\Jpfaq\Domain\Model\Questioncomment; +use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -85,7 +86,7 @@ public function addCommentAction(Question $question, Questioncomment $newQuestio if ($currentUid == $pluginUid) { // Set comment IP - $extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['jpfaq']); + $extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('jpfaq'); $anonymizeIpSetting = $extensionConfiguration['anonymizeIp']; $commentIp= (string)GeneralUtility::getIndpEnv('REMOTE_ADDR'); diff --git a/Classes/Service/SendMailService.php b/Classes/Service/SendMailService.php index c900d07..6e1ec6d 100644 --- a/Classes/Service/SendMailService.php +++ b/Classes/Service/SendMailService.php @@ -36,7 +36,7 @@ public static function sendMail(string $receivers, array $sender, string $subjec } else { $mail->setBody('' . $body . ' ', 'text/html'); } - + $mail->send(); return $mail->isSent();