Commit 389eb2e7 authored by David Greiner's avatar David Greiner Committed by Wouter Wolters
Browse files

[BUGFIX] Check if at least one table is selected for cleanup

Check if value to iterate over is set and is array. Without this
check the install tool breaks if no table is selected for cleanup
and displayErrors is set >= 1.

Resolves: #68030
Releases: master
Change-Id: I8af5c91107c70210001726cfb90e0e446f3e2450
Reviewed-on: http://review.typo3.org/41066


Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent f35d7e18
......@@ -127,10 +127,12 @@ class CleanUp extends Action\AbstractAction {
protected function clearSelectedTables() {
$clearedTables = array();
$database = $this->getDatabaseConnection();
foreach ($this->postValues['values'] as $tableName => $selected) {
if ($selected == 1) {
$database->exec_TRUNCATEquery($tableName);
$clearedTables[] = $tableName;
if (isset($this->postValues['values']) && is_array($this->postValues['values'])) {
foreach ($this->postValues['values'] as $tableName => $selected) {
if ($selected == 1) {
$database->exec_TRUNCATEquery($tableName);
$clearedTables[] = $tableName;
}
}
}
if (!empty($clearedTables)) {
......
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