From a2d9e7dc24f92dae2f8194316499d9d206355990 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Sat, 25 May 2024 10:51:22 +0200
Subject: [PATCH] [BUGFIX] Add proper check in TcaInputPlaceholders

The configuration `foreign_table` of the type `select` is optional.
Add a check to avoid PHP warnings.

Resolves: #103825
Releases: main, 12.4, 11.5
Change-Id: I65925bae287a0ed340c67923ac4e4a2c72ce9d28
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84391
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Classes/Form/FormDataProvider/TcaInputPlaceholders.php      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php
index f5a15896c127..32156e5fdc25 100644
--- a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php
+++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php
@@ -120,7 +120,7 @@ class TcaInputPlaceholders implements FormDataProviderInterface
                 // The FormDataProviders already resolved the select items to an array of uids,
                 // filter out empty values that occur when no related record has been selected.
                 $possibleUids = array_filter($value);
-                $foreignTableName = $fieldConfig['foreign_table'];
+                $foreignTableName = $fieldConfig['foreign_table'] ?? '';
                 break;
             case 'group':
                 $possibleUids = $this->getRelatedGroupFieldUids($fieldConfig, $value);
-- 
GitLab