diff --git a/smartmenus/menulib.php b/smartmenus/menulib.php index 3eef818e154..dc4e9e9a1e6 100644 --- a/smartmenus/menulib.php +++ b/smartmenus/menulib.php @@ -405,7 +405,7 @@ public static function remove_deleted_condition_menu($menus, $id, $method='cohor $value = json_decode($menu->$method); if (($key = array_search($id, $value)) !== false) { unset($value[$key]); - $updated = json_encode($value); + $updated = json_encode(array_values($value)); $DB->set_field('theme_boost_union_menus', $method, $updated, ['id' => $menu->id]); // Purge the cache of this menu. @@ -437,7 +437,7 @@ public static function remove_deleted_condition_menuitems($menuitems, $id, $meth $value = json_decode($item->$method); if (($key = array_search($id, $value)) !== false) { unset($value[$key]); - $updated = json_encode($value); + $updated = json_encode(array_values($value)); $DB->set_field('theme_boost_union_menuitems', $method, $updated, ['id' => $item->id]); // Purge the cache of this item and its menu. self::purge_menu_cache($item->menu);