Files: 
CommentFileSizeAuthor
#5 menu_variable_state_with_upgrade_2.patch4.11 KBaspilicious
PASSED: [[SimpleTest]]: [MySQL] 46,434 pass(es).
[ View ]
#3 menu_variable_state_with_upgrade.patch4.14 KBaspilicious
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/includes/menu.inc.
[ View ]
menu_variable_state.patch3.55 KBaspilicious
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/includes/menu.inc.
[ View ]

Comments

Status:Active» Needs review

Status:Needs review» Needs work

Needs update functions, working on that.

Status:Needs work» Needs review
StatusFileSize
new4.14 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in core/includes/menu.inc.
[ View ]

Done

Status:Needs review» Needs work

You can save 3 lines here:

@@ -1254,7 +1254,10 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail =
           }
           $parents = $active_trail;
-          $expanded = variable_get('menu_expanded', array());
+          $expanded = state()->get('menu_expanded');
+          if (!$expanded) {
+            $expanded = array();
+          }
           // Check whether the current menu has any links set to be expanded.
           if (!$only_active_trail && in_array($menu_name, $expanded)) {

By doing this:

- if (!$only_active_trail && in_array($menu_name, $expanded)) {
+ if (!$only_active_trail && $expanded && in_array($menu_name, $expanded)) {

This hunk has a fatal error: too many parentheses:

+    $active = $config->get('active_menus_default');
+    if (empty($active)) {
+      $active = array_keys(menu_list_system_menus()));
+    }

And because D8 depends on PHP 5.3, you can shorten the above code to this:

+    $active = $config->get('active_menus_default') ?: array_keys(menu_list_system_menus());

Same for this:

+      $active_menus = $config->get('active_menus_default');
+      if (empty($active_menus)) {
+        $active_menus = array_keys(menu_get_menus());
+      }

Status:Needs work» Needs review
StatusFileSize
new4.11 KB
PASSED: [[SimpleTest]]: [MySQL] 46,434 pass(es).
[ View ]

Another try.

Status:Needs review» Reviewed & tested by the community

Looks good, thanks!

Status:Reviewed & tested by the community» Fixed

Committed to 8.x. Thanks.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

This didn't catch all menu_* variables. I have filled #2102521: Finish converting menu.module to CMI for the remainder.