From a2fadc5945fe0a5e39f740827f6ffbda1bb501e2 Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 18 Nov 2024 23:48:03 +0100 Subject: [PATCH] Fixes to installMenus function --- system/src/Plugins.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/system/src/Plugins.php b/system/src/Plugins.php index fbaa5e40..4bb1cc15 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -770,15 +770,14 @@ class Plugins { */ public static function installMenus($templateName, $categories, $clearOld = true) { - global $db; - if (!$db->hasTable(TABLE_PREFIX . 'menu')) { - return; - } - if ($clearOld) { Menu::where('template', $templateName)->delete(); } + if (Menu::count()) { + return; + } + foreach ($categories as $category => $menus) { $i = 0; foreach ($menus as $name => $link) {