From 160e7b4faced96286d43a16e79f704707fdcea4f Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+github@gmail.com>
Date: Wed, 3 May 2023 12:08:44 +0200
Subject: [PATCH] prevent warning in migration, re #2071

---
 db/migrations/5.4.3_combine_my_courses_view_settings.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/db/migrations/5.4.3_combine_my_courses_view_settings.php b/db/migrations/5.4.3_combine_my_courses_view_settings.php
index f191a530d8a..0e62cbe2bc7 100644
--- a/db/migrations/5.4.3_combine_my_courses_view_settings.php
+++ b/db/migrations/5.4.3_combine_my_courses_view_settings.php
@@ -119,12 +119,12 @@ final class CombineMyCoursesViewSettings extends Migration
     {
         return [
             'regular' => [
-                'tiled'    => (bool) $config['MY_COURSES_TILED_DISPLAY'],
-                'only_new' => (bool) $config['MY_COURSES_SHOW_NEW_ICONS_ONLY'],
+                'tiled'    => (bool) ($config['MY_COURSES_TILED_DISPLAY'] ?? self::OLD_FIELDS['MY_COURSES_TILED_DISPLAY']),
+                'only_new' => (bool) ($config['MY_COURSES_SHOW_NEW_ICONS_ONLY'] ?? self::OLD_FIELDS['MY_COURSES_SHOW_NEW_ICONS_ONLY']),
             ],
             'responsive' => [
-                'tiled'    => (bool) $config['MY_COURSES_TILED_DISPLAY_RESPONSIVE'],
-                'only_new' => (bool) $config['MY_COURSES_SHOW_NEW_ICONS_ONLY'],
+                'tiled'    => (bool) ($config['MY_COURSES_TILED_DISPLAY_RESPONSIVE'] ?? self::OLD_FIELDS['MY_COURSES_TILED_DISPLAY_RESPONSIVE']),
+                'only_new' => (bool) ($config['MY_COURSES_SHOW_NEW_ICONS_ONLY'] ?? self::OLD_FIELDS['MY_COURSES_SHOW_NEW_ICONS_ONLY']),
             ],
         ];
     }
-- 
GitLab