Subissue of #1787218: Convert testing variables to state system..

Change the variables menu_test_active_trail_initial, menu_test_hook_custom_theme_name, menu_test_menu_tree_set_path and menu_test_record_active_trail to the state system.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ACF’s picture

Status: Active » Needs review
FileSize
6.88 KB

patch attached.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Lets reroll and see if its still green

aspilicious’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Configuration system, +Config novice, +State system

The last submitted patch, 1843954-menu_to_state-drupal8-1.patch, failed testing.

ACF’s picture

Status: Needs work » Needs review
FileSize
6.88 KB

re-rolled

Status: Needs review » Needs work
Issue tags: -Configuration system, -Config novice, -State system

The last submitted patch, 1843954-menu_to_state-drupal8-5.patch, failed testing.

ACF’s picture

Status: Needs work » Needs review
Issue tags: +Configuration system, +Config novice, +State system
gdd’s picture

+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.phpundefined
@@ -171,13 +171,13 @@ function testCustom403And404Pages() {
-      $initial_trail = variable_get('menu_test_active_trail_initial', array());
+      $initial_trail = state()->get('menu_test.active_trail_initial');

I'd like to see all these get() calls set with their old default values if not present. It just makes the code read a lot easier and its more plain what will happen if a value is ever not present.

Other than that this looks good.

gdd’s picture

Status: Needs review » Needs work
ACF’s picture

Status: Needs work » Needs review
FileSize
6.94 KB

Updated with get defaults.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

Should be fine now.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

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