teaminmedias-pluswerk / ke_search

Search Extension for TYPO3 Content Management System, including faceting search functions.
https://extensions.typo3.org/extension/ke_search/
GNU General Public License v3.0
35 stars 62 forks source link

Issue with sending a notification (Typo 3 v10) #415

Closed carli-eb closed 3 years ago

carli-eb commented 3 years ago

Hi, there

I use Typo3 v10 with ke_search (both up to date) and get an error using the scheduler:

Your cronjob '"Scheduler Typo3"' has generated an output. Account: "p108144" Cronjob: "Scheduler Typo3" Interpreter: /usr/local/bin/php Pfad: ../typo3/sysext/core/bin/typo3 Parameter: scheduler:run Fehlercode: 1 Zeitpunkt der Ausführung: 15.04.2021 - 02:00:02

Output: Uncaught TYPO3 Exception Argument 1 passed to Symfony\Component\Mime\Message::setBody() must be an instance of Symfony\Component\Mime\Part\AbstractPart or null, string given, called in /html/typo3-202103240826/typo3conf/ext/ke_search/Classes/Indexer/IndexerRunner.php on line 245 thrown in file /html/typo3-202103240826/typo3_src-10.4.14/vendor/symfony/mime/Message.php in line 45 error code 1 - The directory of the specified script no longer exists. Please check in the Customer Centre whether the correct script is stored.

Furthermore, the following was supplied: Uncaught TYPO3 Exception Argument 1 passed to Symfony\Component\Mime\Message::setBody() must be an instance of Symfony\Component\Mime\Part\AbstractPart or null, string given, called in /../typo3conf/ext/ke_search/Classes/Indexer/IndexerRunner.php on line 245 thrown in file /../typo3_src-10.4.14/vendor/symfony/mime/Message.php in line 45

My provider found out: After a little research, the error seems to come from the fact that in Typo3-10 the methodology for creating e-mails via script has been slightly changed. If you look at the script /../typo3conf/ext/ke_search/Classes/Indexer/IndexerRunner.php at line 245, an attempt is made here to send the mailbody via "$mail->setBody($plaintextReport);" Since Typo3-10, this is no longer sufficient. The line should now read "$mail->setBody()->text($plaintextReport);"

Basically, setting the body needs to be further specified as either: ->setBody()->text(Inhalt); resp. ->text(Inhalt); if plaintext content is to be sent

or: ->setBody()->html(HTML-Inhalt); resp. ->html(HTML-Inhalt) if HTML content is to be sent.

Reports found: https://www.naderio.de/typo3-v10-mail-api-fehlersammlung/ https://symfony.com/blog/new-in-symfony-4-3-mime-component https://symfony.com/doc/current/mailer.html#message-contents

Perhaps this will be helpful in the further development of ke_search. carli

christianbltr commented 3 years ago

This has been fixed with https://github.com/teaminmedias-pluswerk/ke_search/commit/c69cff75ab131dad7b4bc9598b6dca0cd0904c95 and will be in the next version after 3.6.1

carli-eb commented 3 years ago

Thanks a lot.