Commit fb32aa28 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Georg Ringer
Browse files

[BUGFIX] Fix undefined array key warnings in field providers

Resolves: #95995
Releases: master
Change-Id: I6faea581aba0ca9171a6b79c94c1371c56b60387
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72192


Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 6a882fff
......@@ -102,7 +102,7 @@ class CleanerFieldProvider extends AbstractAdditionalFieldProvider
public function validateAdditionalFields(array &$submittedData, SchedulerModuleController $schedulerModule)
{
$validPeriod = $this->validateAdditionalFieldPeriod($submittedData['RecyclerCleanerPeriod']);
$validTca = $this->validateAdditionalFieldTca($submittedData['RecyclerCleanerTCA']);
$validTca = $this->validateAdditionalFieldTca($submittedData['RecyclerCleanerTCA'] ?? []);
return $validPeriod && $validTca;
}
......
......@@ -88,7 +88,7 @@ class OptimizeDatabaseTableAdditionalFieldProvider extends AbstractAdditionalFie
{
$validData = true;
$availableTables = $this->getOptimizableTables();
if (is_array($submittedData['scheduler_optimizeDatabaseTables_selectedTables'])) {
if (is_array($submittedData['scheduler_optimizeDatabaseTables_selectedTables'] ?? false)) {
$invalidTables = array_diff(
$submittedData['scheduler_optimizeDatabaseTables_selectedTables'],
$availableTables
......
......@@ -266,9 +266,9 @@ class TableGarbageCollectionAdditionalFieldProvider extends AbstractAdditionalFi
*/
public function saveAdditionalFields(array $submittedData, AbstractTask $task)
{
$task->allTables = $submittedData['scheduler_tableGarbageCollection_allTables'] === 'on';
$task->table = $submittedData['scheduler_tableGarbageCollection_table'];
$task->numberOfDays = (int)$submittedData['scheduler_tableGarbageCollection_numberOfDays'];
$task->allTables = ($submittedData['scheduler_tableGarbageCollection_allTables'] ?? '') === 'on';
$task->table = $submittedData['scheduler_tableGarbageCollection_table'] ?? '';
$task->numberOfDays = (int)($submittedData['scheduler_tableGarbageCollection_numberOfDays'] ?? 0);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment