From 89e552ce7bb1d49af9ea420d70b2cc0c19c57fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 12 Jan 2025 20:09:34 +0100 Subject: [PATCH] avoid too many hacks --- src/Form/Layout.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Form/Layout.php b/src/Form/Layout.php index 6cd0eac8c3..ace96018c3 100644 --- a/src/Form/Layout.php +++ b/src/Form/Layout.php @@ -125,12 +125,7 @@ private function getEntityFieldCaptionWithoutIdSuffix(Control $control): string { $field = $control->entityField->getField(); - $idSuffixes = ['ID']; - if ($field->getOwner()->idField && $field->getOwner()->hasField($field->getOwner()->idField)) { - $idSuffixes = $field->getOwner()->getIdField()->getCaption(); - } - - return preg_replace('~ (' . implode('|', array_map(fn ($v) => preg_quote($v, '~'), $idSuffixes)) . ')$~i', '', $field->getCaption()); + return preg_replace('~ ID$~i', '', $field->getCaption()); } #[\Override]