Skip to content

Commit

Permalink
Fixes to installMenus function
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Nov 18, 2024
1 parent d0b4065 commit a2fadc5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions system/src/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,15 +770,14 @@ public static function getError() {
*/
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) {
Expand Down

0 comments on commit a2fadc5

Please sign in to comment.