Skip to content

Commit

Permalink
Release: 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paeddym committed Dec 11, 2024
1 parent e1d5f7b commit 79c93e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions Classes/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -26,19 +28,29 @@ 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);
} catch (Exception $e) {
$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();
}

Expand Down Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/Formloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 79c93e8

Please sign in to comment.