Problem/Motivation

In the Views UI menu settings form, the Show as expanded checkbox is visible for every Menu radio option. Title, description, parent, weight and context all hide via #states when they do not apply; expanded is the only one that does not. It is only read for normal menu entries (PathPluginBase::getMenuLinks()).

Steps to reproduce

Add a view with a Page display, open Page settings > Menu, and switch between the radio options: the other settings appear and disappear, Show as expanded never does.

Proposed resolution

Add a #states condition on menu[type] === 'normal' to the expanded element in Views\display\Page.

Remaining tasks

Review.

User interface changes

The checkbox only shows for Normal menu entry.

API changes

None.

Data model changes

None.

Before Patch Apply
link-text-screenshot

After Patch Apply
link-text-screenshot

Issue fork drupal-2703349

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

peri22 created an issue. See original summary.

peri22’s picture

Here is the patch.

peri22’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: views.module-show-as-expanded-2703349-1-8.patch, failed testing.

peri22’s picture

Assigned: peri22 » Unassigned
Issue tags: +#PenceoWeeklySprint

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.

rosinegrean’s picture

Issue tags: -DCTransylvania

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.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.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.

larowlan’s picture

Version: 8.9.x-dev » 9.3.x-dev
Issue tags: +Needs reroll, +Bug Smash Initiative, +Needs tests

Flagging for needs reroll, as the use of array() needs to use [] short array syntax instead.

I just manually tested this against HEAD and can confirm the bug still exists.

Moving to 9.3 as 8.9 is now end of life.

Tagging for needs tests although that may be difficult because it would require JS test.

larowlan’s picture

Priority: Normal » Minor

Downgrading to minor as the impact here is low.

Discussed with @darvanen in #bugsmash

yogeshmpawar’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.05 KB

reroll against 9.3.x branch

yogeshmpawar’s picture

Status: Needs review » Needs work

Needs work for tests

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rakhi soni’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB

Kindly review patch for branch 9.5x,,

rinku jacob 13’s picture

StatusFileSize
new264.72 KB
new280.02 KB

Reviewed and tested patch #20 for 9.5x. Adding Screenshots for the reference .

sonam.chaturvedi’s picture

StatusFileSize
new85.99 KB
new81.78 KB

Verified and tested patch #20. Patch applied successfully.

Test Steps:
1. Goto /admin/structure/views
2. Create a view page
3. Click on menu entry setting
4. Check by default 'No menu entry' option is selected
5. Verify 'Show as expanded' checkbox is not displayed

Test Result: 'Show as expanded' checkbox is not displayed when 'No menu entry' is selected.

Attached screenshot for reference.

kristen pol’s picture

Status: Needs review » Needs work

Thanks for testing. This still needs test so moving back to needs work. The code itself is straightforward.

smustgrave’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.13 KB

Adding some tests.

Status: Needs review » Needs work

The last submitted patch, 24: 2703349-24-tests-only.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review

Moving back to NR. Looks like the test only patch did fail.

dipesh_goswami made their first commit to this issue’s fork.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs screenshots

Self review this needs before/after screenshots in the issue summary.

nikhil_110’s picture

Issue summary: View changes
nikhil_110’s picture

Status: Needs work » Needs review
borisson_’s picture

Status: Needs review » Needs work

Latest patch does not pass tests.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

peri22’s picture

Status: Needs work » Needs review

MR !16610 against main. expanded was the only menu setting without #states - title, description, parent, weight and context all hide for "No menu entry". Adds a views_ui FunctionalJavascript test.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Thank you for picking up.

IS appears to be incomplete.

peri22’s picture

Status: Needs work » Needs review
peri22’s picture

Issue summary: View changes
peri22’s picture

saman_malik’s picture

StatusFileSize
new154.58 KB
new152.28 KB

Tested the patch from MR !16610 against main.

Test steps:

Applied the diff
Went to /admin/structure/views
Created a view with a Page display
Opened Page settings → Menu (Menu link entry popup)
With "No menu entry" selected, confirmed "Show as expanded" checkbox is no longer displayed
Switched to "Normal menu entry" — confirmed "Show as expanded" checkbox correctly appears
Switched through "Menu tab" and "Default menu tab" — confirmed the checkbox stays hidden for these too, only showing for "Normal menu entry"

Result: Working fine

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Manually tested following the steps (pretty basic)

Change does resolve the issue and is a nice little improvement.

Not thrilled about a dedicated test for this but I really couldn't find one that could be expanded. So maybe this is a good start and future tests can expand it?!

LGTM.

alexpott’s picture

Version: main » 11.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed b0128a3aae0 to main and 6884ce47578 to 12.0.x and 55758e4e67e to 11.x and 2cecffc40b1 to 11.5.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 2cecffc4 on 11.5.x
    fix: #2703349 Show as expanded checkbox is not necessary when No menu...

  • alexpott committed 55758e4e on 11.x
    fix: #2703349 Show as expanded checkbox is not necessary when No menu...

  • alexpott committed 6884ce47 on 12.0.x
    fix: #2703349 Show as expanded checkbox is not necessary when No menu...

  • alexpott committed b0128a3a on main
    fix: #2703349 Show as expanded checkbox is not necessary when No menu...

Status: Fixed » Closed (fixed)

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