From f4ddf2ba23b2dbb26b92089f6c6364bd2edd7f66 Mon Sep 17 00:00:00 2001 From: slawkens Date: Tue, 19 Nov 2024 15:32:55 +0100 Subject: [PATCH] Set blank & color only if current db version supports it --- system/src/Plugins.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/system/src/Plugins.php b/system/src/Plugins.php index 00515139..243ced24 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -770,6 +770,8 @@ class Plugins { */ public static function installMenus($templateName, $menus, $clearOld = false) { + global $db; + if ($clearOld) { Menu::where('template', $templateName)->delete(); } @@ -804,10 +806,14 @@ class Plugins { 'link' => $link, 'category' => $category, 'ordering' => $i++, - 'blank' => $blank, - 'color' => $color, ]; + // support for color and blank attributes + if($db->hasColumn(TABLE_PREFIX . 'menu', 'blank') && $db->hasColumn(TABLE_PREFIX . 'menu', 'color')) { + $insert_array['blank'] = $blank; + $insert_array['color'] = $color; + } + Menu::create($insert_array); } }