Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict and exception with traw/powermailcaptcha and powermail_cleaner #1

Closed
sypets opened this issue Oct 16, 2024 · 2 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@sypets
Copy link
Contributor

sypets commented Oct 16, 2024

I think there is a conflict between powermailcaptcha and powermail_cleaner because they both XCLASS FormController.

Short term solution could be to add a "conflicts" in composer.json for this.

I had other extensions too where more than one extension tries to XCLASS. It is possible to solve this, but it is messy.

Perhaps there is another way to provide the behaviour without having to XCLASS? That would be the preferable solution in my opinion. FormController already sends an event. Ideal would also be if extensions which provide a captcha solution would not have to XCLASS.

Reproduce

  1. Install powermail, powermail_cleaner und powermailcaptcha (composer require traw/powermailcaptcha ...)
  2. Create a minimal working form
  3. Fill out form and send
An Exception is thrown:

(1/1) Error
Call to undefined method TRAW\Powermailcaptcha\Controller\FormController::getContentObject()

in /var/www/t3intro12/vendor/in2code/powermail_cleaner/Classes/EventListener/FormControllerCreateActionBeforeRenderViewEventListener.php line 25
        /** @var Mail $mail */
        $mail = $event->getMail();
        $hash = $event->getHash();

        $mail->setPlugin($controller->getContentObject()->data['uid']);
        $mail->setDeletionTimestamp($this->calculateDeletionTimeStamp($controller));

        $event->setMail($mail);

VErsions

To verify issue, I used a "clean" installation with minimal configuration:

  • TYPO3 12.4.8
  • PHP 8.2
  • powermail 12.4.2
  • powermail_cleaner 5.2.0
  • powermailcaptcha 2.1.1

With following static includes:

image

@sypets
Copy link
Contributor Author

sypets commented Oct 16, 2024

in2code/powermailrecaptcha does not have the same problem. It does not XCLASS anything.

In that case, you could argue, it is the problem of traw/powermailcaptcha and not powermail_cleaner or powermail.

(Probably the extension author could use the event, which already exists. I will check).

However, I still think the multiple XCLASSes are probably not the best solution (especially since both extensions are from the same vendor). powermail_cleaner XClASSes 4.

$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Controller\FormController::class] = [
        'className' => \In2code\PowermailCleaner\Controller\FormController::class
    ];
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Model\Mail::class] = [
        'className' => \In2code\PowermailCleaner\Domain\Model\Mail::class
    ];
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Repository\MailRepository::class] = [
        'className' => \In2code\PowermailCleaner\Domain\Repository\MailRepository::class
    ];
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\In2code\Powermail\Domain\Service\Mail\ReceiverMailReceiverPropertiesService::class] = [
        'className' => \In2code\PowermailCleaner\Domain\Service\ReceiverAddressService::class
    ];

This might also result in problems with other powermail add-on extensions ....

I will update the issue. Please feel free to close.

@sbusemann
Copy link
Contributor

sbusemann added a commit that referenced this issue Nov 14, 2024
@sbusemann sbusemann added this to the 12.0 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants