I keep seeing warning in the log file for this

    $element['#below'] = $data['below'] ? menu_tree_output($data['below']) : $data['below'];

Should be changed to

    $element['#below'] = isset($data['below']) ? menu_tree_output($data['below']) : array();
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
Issue tags: +Novice
FileSize
761 bytes

A couple of quick notes:

- This needs to be fixed in 8.x and then backported to 7.x
- When reporting a bug like this, please indicate what file & line the incriminating code lives in

That said, attached is a quick patch based on your post.

Status: Needs review » Needs work

The last submitted patch, 1537528.patch, failed testing.

marcingy’s picture

Status: Needs work » Needs review
FileSize
2.18 KB
1.5 KB

Version of the patch with a test away to try and work out why we book tests are failing

Status: Needs review » Needs work

The last submitted patch, menu-no-below-full.patch, failed testing.

marcingy’s picture

And again - this also tidys up the array structure as it was a mess.

marcingy’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, menu-no-below-full.patch, failed testing.

marcingy’s picture

Status: Needs work » Needs review
FileSize
6.46 KB

We need !empty rather than isset. This will also improve performance a small amount as we will reduce calls on menu items that have no children but below set.

Niklas Fiekas’s picture

Alright, thank you. Looks like the tests are catching the problem and that the fix is working.

There is also a coding style clean-up included -- splitting the arrays on to multiple lines -- which is think is OK, here. If we do that, I have only this minor point: Maybe we should also add the usual trailing commas (),)?

A patch with that + a test only patch, again, would be awesome.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+          )
+        )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+              )
             )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+                  )
+                )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+                  )
+                )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+          )
+        )
+      )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+          )
+        )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+          )
+        )

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
+     'below' => array()

Here.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
           )
         )

Here, too.

+++ b/core/modules/system/tests/menu.testundefined
@@ -979,21 +979,132 @@ class MenuTreeOutputTestCase extends DrupalWebTestCase {
           )
         )
marcingy’s picture

The test has not changed so there is no benefit what so ever in uploading it as a seperate patch again - we know that existing code fails. I re-roll this later with fixes above.

valthebald’s picture

tagging

melsi’s picture

Looked for in D8 but cannot find either watchdog message nor similar code evidence.
Tested in D7 where the code is present. In unpatched state I cannot reproduce the error with multiple hierarchical menu entries. Are there special conditions involved?

valthebald’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -Novice, -needs relevance check

Changing status

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
Issue tags: +Bug Smash Initiative

As part of the Bug smash initiative, we are triaging issues that are marked 'Postponed (maintainer needs more info)'. Based on the lack of additional information on this ticket, we believe this issue is no longer relevant so I am marking it 'Closed (outdated)'.