You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently a conflict with in2code/powermail_cleaner. The conflict is due to both extensions XCLASSing FormController.
This could be resolved if one of the extensions does not use XCLASS but uses for example the event In2code\Powermail\Events\FormControllerFormActionEvent
Unfortunately it is not possible to assign a variable to the view currently with this method.
I propose the following:
add PR to in2code/powermail to make it possible to get the view from the controller
add PR here to remove XCLASS and use the event
Example:
<?php
declare(strict_types=1);
namespace TRAW\Powermailcaptcha\EventListener;
use In2code\Powermail\Controller\AbstractController;
use In2code\Powermail\Domain\Model\Form;
use In2code\Powermail\Events\FormControllerFormActionEvent;
use In2code\Powermail\Utility\FrontendUtility;
use Psr\Log\LoggerAwareTrait;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* >= v12 only
*
* Listens to event FormControllerFormActionEvent
* @see \In2code\Powermail\Events\FormControllerFormActionEvent
*
* Documentation: How to listen to events
* @see https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Events/EventDispatcher/Index.html
*/
final class PowermailFormControllerFormActionEventListener implements SingletonInterface
{
public function __invoke(FormControllerFormActionEvent $event): void
{
$form = $event->getForm();
if ($form === null) {
return;
}
$formController = $event->getFormController();
$settings = $formController->getSettings();
if ($settings['powermailcaptcha']['useSiteLanguage'] ?? 0) {
// !!!! this method does not exist
$this->event->assignView('languageIso', $GLOBALS['TYPO3_REQUEST']->getAttribute('language')->getLocale()->getLanguageCode());
}
}
}
The text was updated successfully, but these errors were encountered:
sypets
added a commit
to sypets/powermailcaptcha
that referenced
this issue
Dec 10, 2024
todo:
* [ ] Requires method to add a variable to the view in the EventListener
There was a conflict with powermail_cleaner because both extensions
XCLASSed FormController.
Resolvers: thomasrawiel#28
There is currently a conflict with in2code/powermail_cleaner. The conflict is due to both extensions XCLASSing FormController.
This could be resolved if one of the extensions does not use XCLASS but uses for example the event In2code\Powermail\Events\FormControllerFormActionEvent
Unfortunately it is not possible to assign a variable to the view currently with this method.
I propose the following:
Example:
The text was updated successfully, but these errors were encountered: