Comments

dipakmdhrm created an issue. See original summary.

abhisekmazumdar’s picture

Assigned: Unassigned » abhisekmazumdar
abhisekmazumdar’s picture

Version: » 8.x-1.0-alpha1
Assigned: abhisekmazumdar » Unassigned
Status: Active » Needs review
Related issues: +#3014242: Allow altering 'menu tree' and 'menu tree manipulators' for the menu rendered by SuperFishBlock
StatusFileSize
new546 bytes

This patch is dependent on a patch from Superfish. Kindly apply that patch before applying this.

dipakmdhrm’s picture

Issue tags: +DIACWApril2020
dipakmdhrm’s picture

Nice work on this.
Thank you @abhisekmazumdar.
One change needed though because of a recent addition.

+++ b/asymmetric_menu_trees.module
@@ -65,3 +65,11 @@ function asymmetric_menu_trees_menu_links_discovered_alter(&$links) {
+  $manipulators[] = ['callable' => 'asymmetric_menu_trees.menu_tree_manipulators:removeDisabledLinks'];

As part of https://www.drupal.org/project/asymmetric_menu_trees/issues/3124461, another manipulator (restructureTree) is added which is crucial for ordering to work.
However that needs to be the first manipulator in the list. Can you add it and use array_unshift to make that first in the list.

dipakmdhrm’s picture

Status: Needs review » Needs work
abhisekmazumdar’s picture

Assigned: Unassigned » abhisekmazumdar
abhisekmazumdar’s picture

Assigned: abhisekmazumdar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new673 bytes

@dipakmdhrm
How does this patch look?

dipakmdhrm’s picture

Status: Needs review » Needs work
+++ b/asymmetric_menu_trees.module
@@ -87,6 +87,14 @@ function asymmetric_menu_trees_menu_form_menu_tree_manipulators_alter(&$manipula
+  array_unshift($manipulators, $manipulators[1]);

We actually need to add "a new" manipulator.
We need to keep the existing removeDisabledLinks manipulator and add the new reSructureTree one in the beginning of the array like this:

  array_unshift($manipulators, [
    'callable' => 'asymmetric_menu_trees.menu_tree_manipulators:restructureTree',
  ]);
abhisekmazumdar’s picture

Assigned: Unassigned » abhisekmazumdar
abhisekmazumdar’s picture

Assigned: abhisekmazumdar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new746 bytes
new662 bytes
dipakmdhrm’s picture

Status: Needs review » Reviewed & tested by the community

dipakmdhrm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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