fix: drop errors in form submissions to myep api silently
This commit is contained in:
@@ -23,16 +23,31 @@ class BpnApiFinisher extends AbstractFinisher
|
|||||||
|
|
||||||
protected function executeInternal()
|
protected function executeInternal()
|
||||||
{
|
{
|
||||||
$values = [];
|
try {
|
||||||
$formValues = $this->finisherContext->getFormValues();
|
$values = [];
|
||||||
$mappingOption = $this->parseOption('mapping');
|
$formValues = $this->finisherContext->getFormValues();
|
||||||
$mappings = GeneralUtility::trimExplode(',', $mappingOption, true);
|
$mappingOption = (string)$this->parseOption('mapping');
|
||||||
foreach ($mappings as $mapping) {
|
$mappings = GeneralUtility::trimExplode(',', $mappingOption, true);
|
||||||
[$remote, $local] = GeneralUtility::trimExplode(':', $mapping);
|
|
||||||
$values[$remote] = $formValues[$local];
|
foreach ($mappings as $mapping) {
|
||||||
}
|
$parts = GeneralUtility::trimExplode(':', $mapping, true, 2);
|
||||||
if (count($values) > 0) {
|
if (2 !== count($parts)) {
|
||||||
$this->apiClient->registerAddress($values);
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
[$remote, $local] = $parts;
|
||||||
|
if ('' === $remote || '' === $local || false === array_key_exists($local, $formValues)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$values[$remote] = $formValues[$local];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([] !== $values) {
|
||||||
|
$this->apiClient->registerAddress($values);
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Intentionally ignore all errors so the form submission stays silent.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user