Skip to content

Commit

Permalink
Added exceptions to invalid Mautic ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Woeler committed Aug 3, 2017
1 parent 3edf2fc commit 6ee4cfa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/Domain/Finishers/MauticFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@ protected function executeInternal()
return;
}

if (!empty($mauticId)) {
if (!empty($mauticId) && is_numeric($mauticId)) {

// Get the values that were posted in the form and transform them to a format for Mautic
$formValues = $this->transformFormStructure($this->finisherContext->getFormValues());

$this->mauticService->pushForm($formValues, $this->mauticService->getConfigurationData('mauticUrl'), $mauticId);
} else {
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump('not meeting requirements for finisher mautic', 'ExecuteInternal');
if (GeneralUtility::getApplicationContext()->isDevelopment()) {
throw new \InvalidArgumentException('Your YAML does not appear to contain a valid Mautic Form ID.', 1499940157);
}

return;
}
}

Expand Down

0 comments on commit 6ee4cfa

Please sign in to comment.