Problem/Motivation
When using only sfsmallscreens the default feature to clone the menu parent item and place it inside the dropdown is not working after commit e9bbee05.
Previous Logic was
$plugins['smallscreen']['accordionButton'] = $ab != 1 ? $ab : '';
This would return an empty string for the first two options on the Accordion Button setting. The JavaScript library would set that to a 1.
The new logic:
$plugins['smallscreen']['accordionButton'] = $ab != 1 ? $ab : 0;
causes both 0 and 1 to result in accordionButton being set to 0. This prevents the JavaScript library from using the expected value and breaks the parent-item cloning functionality.
Steps to reproduce
- Install the Module
- Configure Superfish menu block to use sf-smallscreens. Do not configure sf-touchscreens to be used.
- Create a menu with nested items.
- Display the menu at a small-screen breakpoint.
- The parent item is expected to be cloned into the dropdown, but it is not.
Proposed resolution
Update the logic or just remove it entirely and set the value of accordionButton to
(int) $this->configuration['smallabt'];
Remaining tasks
Create PR
Add test coverage if applicable.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comments
Comment #2
lobsterr commentedThank you for your contribution