Skip to content

Commit

Permalink
Ensure cohorts and roles are re-encoded as arrays #737
Browse files Browse the repository at this point in the history
  • Loading branch information
marxjohnson committed Oct 24, 2024
1 parent ca69172 commit eb84286
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smartmenus/menulib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit eb84286

Please sign in to comment.