Skip to content

Commit

Permalink
[BUGFIX] Fix warnings in DataHandlerHook
Browse files Browse the repository at this point in the history
Fixes 2 PHP warnings that might occur in DataHandlerHook:
- Undefined array key "columnsOverrides"
- Undefined array key "tx_spreadsheets_assets"

Resolves: #603
  • Loading branch information
dkd-friedrich committed Oct 24, 2024
1 parent 42bb363 commit a67888b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Hooks/DataHandlerHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(

foreach ($GLOBALS['TCA'][$table]['types'] as $CType => $type) {
$CType = (string)$CType;
foreach ($type['columnsOverrides'] as $column => $conf) {
foreach ($type['columnsOverrides'] ?? [] as $column => $conf) {
if (
isset($conf['config']['renderType'], $conf['config']['uploadField'])
&& $conf['config']['renderType'] === 'spreadsheetInput'
Expand Down Expand Up @@ -81,7 +81,7 @@ public function processDatamap_afterDatabaseOperations( // @codingStandardsIgnor
$activationConfig = $this->activationTypes[$table][$CType] ?? $this->activationTypes[$table]['*'];
foreach ($activationConfig as $uploadField => $renderFields) {
// truncate render fields after update if assets have been removed
if ($fieldArray[$uploadField] === 0) {
if ($fieldArray[$uploadField] ?? null === 0) {
if ($status === 'update') {
$this->connectionPool
->getConnectionForTable($table)
Expand Down

0 comments on commit a67888b

Please sign in to comment.