From 6503321278368d15cdc45c73f0568566080a6cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 8 Dec 2023 16:57:12 -0300 Subject: [PATCH] Fix case where column hash is empty in table relation page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixes #18834 - Related to #14305 Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/Controllers/Table/RelationController.php | 2 +- phpstan-baseline.neon | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/classes/Controllers/Table/RelationController.php b/libraries/classes/Controllers/Table/RelationController.php index dca69b8a22..8b035c0888 100644 --- a/libraries/classes/Controllers/Table/RelationController.php +++ b/libraries/classes/Controllers/Table/RelationController.php @@ -134,12 +134,12 @@ final class RelationController extends AbstractController $column_hash_array = []; $column_array[''] = ''; foreach ($columns as $column) { + $column_hash_array[$column['Field']] = md5($column['Field']); if (strtoupper($storageEngine) !== 'INNODB' && empty($column['Key'])) { continue; } $column_array[$column['Field']] = $column['Field']; - $column_hash_array[$column['Field']] = md5($column['Field']); } if ($GLOBALS['cfg']['NaturalOrder']) { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b9e5ad0278..d090c346f4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -195,6 +195,11 @@ parameters: count: 1 path: libraries/classes/Config.php + - + message: "#^Parameter \\#1 \\$new_error_level of function error_reporting expects int, int\\|null given\\.$#" + count: 1 + path: libraries/classes/Config.php + - message: "#^Parameter \\#1 \\$str of function rtrim expects string, mixed given\\.$#" count: 1