From ebc99253043efdcc9dc90e73249bb8f118067b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 22 Oct 2026 15:46:04 +0200 Subject: [PATCH] fix: office tip labels no longer warn when the author was deleted 21 of 53 office tips still point to team members who have left (deleted records), so the backend label read 'name' from null: "Trying to access array offset on null" in production. TYPO3 10 on PHP 7.4 printed an empty name silently. The label is now the tip's text, with the author in brackets only when the team member still exists; a tip record that cannot be found (e.g. a new one) gives an empty title instead of a warning. Co-Authored-By: Claude Opus 5.5 --- packages/ep_products/Classes/Service/LabelService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ep_products/Classes/Service/LabelService.php b/packages/ep_products/Classes/Service/LabelService.php index 0d52d3a..e94363b 100644 --- a/packages/ep_products/Classes/Service/LabelService.php +++ b/packages/ep_products/Classes/Service/LabelService.php @@ -78,8 +78,12 @@ class LabelService public function getOfficetipLabel(&$parameters, $parentObject) { $officetip = BackendUtility::getRecord('tx_epproducts_domain_model_officetip', $parameters['row']['uid']); - $author = BackendUtility::getRecord('tx_epproducts_domain_model_teammember', $officetip['author']); - $parameters['title'] = sprintf('%s (%s)', substr($officetip['label'], 0, 30), $author['name']); + // Many tips still point to team members who have left (deleted records) + $author = BackendUtility::getRecord('tx_epproducts_domain_model_teammember', (int)($officetip['author'] ?? 0)); + $parameters['title'] = substr($officetip['label'] ?? '', 0, 30); + if (!empty($author['name'])) { + $parameters['title'] .= ' (' . $author['name'] . ')'; + } } /**