fix: drop errors in form submissions to myep api silently

This commit is contained in:
Björn Fromme
2026-06-02 14:42:55 +02:00
parent acc4f6daaa
commit 85ad9711f1
@@ -23,16 +23,31 @@ class BpnApiFinisher extends AbstractFinisher
protected function executeInternal()
{
$values = [];
$formValues = $this->finisherContext->getFormValues();
$mappingOption = $this->parseOption('mapping');
$mappings = GeneralUtility::trimExplode(',', $mappingOption, true);
foreach ($mappings as $mapping) {
[$remote, $local] = GeneralUtility::trimExplode(':', $mapping);
$values[$remote] = $formValues[$local];
}
if (count($values) > 0) {
$this->apiClient->registerAddress($values);
try {
$values = [];
$formValues = $this->finisherContext->getFormValues();
$mappingOption = (string)$this->parseOption('mapping');
$mappings = GeneralUtility::trimExplode(',', $mappingOption, true);
foreach ($mappings as $mapping) {
$parts = GeneralUtility::trimExplode(':', $mapping, true, 2);
if (2 !== count($parts)) {
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.
}
}
}