diff --git a/Classes/Controller/FormController.php b/Classes/Controller/FormController.php index 59dabaf..e9feb66 100644 --- a/Classes/Controller/FormController.php +++ b/Classes/Controller/FormController.php @@ -10,6 +10,8 @@ use Psr\Log\LoggerInterface; use RuntimeException; use Itx\HubspotForms\Event\EditFormBeforeSubmitEvent; +use ITX\Jobapplications\Utility\Typo3VersionUtility; +use TYPO3\CMS\Core\Messaging\FlashMessage; class FormController extends ActionController { @@ -26,7 +28,7 @@ public function __construct( public function displayAction() { $formID = $this->settings['form'] ?? ''; // Kann nicht im Konstruktor schon geladen werden - + try { $form = $this->hubspotService->fetchHubspotFormData($formID); $this->view->assign('form', $form); @@ -34,11 +36,21 @@ public function displayAction() $this->addFlashMessage( 'Please set your Access Token in the Extension settings', 'Warning', - ContextualFeedbackSeverity::ERROR, + Typo3VersionUtility::getMajorVersion() < 12 ? FlashMessage::ERROR : ContextualFeedBackSeverity::ERROR, false ); $this->logger->error('Error fetching data from HubSpot API', ['error' => $e]); } + + if ((bool)$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['hubspot_forms']['simulateSubmit']) { + $this->addFlashMessage( + 'You are currently in Simulated Submit Mode', + 'Reminder', + Typo3VersionUtility::getMajorVersion() < 12 ? FlashMessage::INFO : ContextualFeedBackSeverity::INFO, + false + ); + } + return $this->htmlResponse(); } @@ -124,7 +136,7 @@ public function submitAction() $this->addFlashMessage( 'Please set your PortalID in the Extension settings', 'Warning', - ContextualFeedbackSeverity::ERROR, + Typo3VersionUtility::getMajorVersion() < 12 ? FlashMessage::ERROR : ContextualFeedBackSeverity::ERROR, false ); $this->logger->error('Error fetching data from HubSpot API', ['error' => $e]); diff --git a/Classes/Service/Formloader.php b/Classes/Service/Formloader.php index 8a9c863..fc446d3 100644 --- a/Classes/Service/Formloader.php +++ b/Classes/Service/Formloader.php @@ -29,7 +29,7 @@ public function loadForms(array &$config) FlashMessage::class, 'Please configure a HubSpot access token in the extension configuration.', 'Missing HubSpot access token', - ContextualFeedbackSeverity::WARNING, + Typo3VersionUtility::getMajorVersion() < 12 ? FlashMessage::ERROR : ContextualFeedBackSeverity::ERROR, true ); diff --git a/ext_emconf.php b/ext_emconf.php index 1545e51..bb94259 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -35,7 +35,7 @@ 'uploadfolder' => 1, 'createDirs' => '', 'clearCacheOnLoad' => true, - 'version' => '1.0.1', + 'version' => '1.0.2', 'constraints' => [ 'depends' => [ 'typo3' => '11.5.1-13.9.99'