Gregor-Agnes / newsletter_subscribe

TYPO3-extension: Subscribe and unsubscribe to tt_address, generate static Link to unsubscribe (to use in Newsletter), automatically delete unconfirmed subscribers
https://extensions.typo3.org/extension/newsletter_subscribe
GNU General Public License v3.0
2 stars 5 forks source link

must be of type Zwo3\NewsletterSubscribe\Domain\Model\Subscription, null given (bug) #91

Closed RZivaralam closed 1 week ago

RZivaralam commented 1 month ago

I have this error : Zwo3\NewsletterSubscribe\Controller\SubscribeController::createConfirmationAction(): Argument #1 ($subscription) must be of type Zwo3\NewsletterSubscribe\Domain\Model\Subscription, null given, called in /var/www/htdocs/typo3_src-12.4.13/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php on line 479

Even though the parameter subscription is checked in initializeCreateConfirmationAction() And if there is no subscription, it will be forwarded to showFormAction , createConfirmationAction(Subscription $subscription) is still called i changed public function createConfirmationAction(Subscription $subscription): ResponseInterface to public function createConfirmationAction(Subscription $subscription=null): ResponseInterface

and it works again without any problem.

SicorDev commented 1 week ago

Hello there, a hint for you. I thnk about half of the current open issues are caused because you moved css, javascript and other files from Resources/Public to Resources/Private without adjusting the according paths. I copied the stuff back where it was before and most of the extension works again.

SicorDev commented 1 week ago

More content of the 6.1.1. looks suspicious... when it's tailored for "Mail", then it shouldn't try to call methods for "direct_mail" like: $subscription->setModuleSysDmailNewsletter(true); $subscription->setModuleSysDmailHtml(true);

Gregor-Agnes commented 1 week ago

Fixed in 481276b2c6234020066094ad969a28dfd333772e and c1f8694ab2363f5388fb0acebecbe76e6958545d