change field lookup logic

This commit is contained in:
2026-07-22 16:14:00 +02:00
parent 90851908b7
commit 5ae01c3038
2 changed files with 23 additions and 19 deletions
+9 -11
View File
@@ -50,7 +50,7 @@ class ElixFormsController
$matchingInstances = [];
foreach ($instances as $instance) {
if (!is_array($instance)) {
if (!\is_array($instance)) {
continue;
}
@@ -67,18 +67,16 @@ class ElixFormsController
$exportGroup
);
foreach ($exportTags as $exportTag) {
if (!is_array($exportTag) || !isset($exportTag['name'])) {
continue;
}
$exportTagsByName = array_column($exportTags, null, 'name');
if (!\array_key_exists($fieldName, $exportTagsByName)) {
continue;
}
$name = (string) $exportTag['name'];
$value = isset($exportTag['value']) ? (string) $exportTag['value'] : '';
$exportTag = $exportTagsByName[$fieldName];
$value = isset($exportTag['value']) ? (string) $exportTag['value'] : '';
if (strcasecmp($name, $fieldName) === 0 && stripos($value, $fieldValue) !== false) {
$matchingInstances[] = $instance;
break;
}
if (stripos($value, $fieldValue) !== false) {
$matchingInstances[] = $instance;
}
}