Problem/Motivation

When having more than one group content menu available for creation on a group, the link to the menu form opens a page not found.

Steps :

  1. Create a group type.
  2. Create a group instance.
  3. Create multiple group content menu types.
  4. Install those group content menu types for the group type.
  5. Go to /group/1/menu/add.
  6. Click on one of the add links: /group/1/menu/add/group_content_menu%3Amenu_id.
  7. Page is not found.

Proposed resolution

Fix the routing for the add form link.

Or maybe, use the create-form route instead of add-form for the links at /group/1/menu/add.

Side notes

You can workaround the bug by going to the /group/{group_id}/content/create/group_content_menu%3A{menu_id} path.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dakwamine created an issue. See original summary.

edysmp’s picture

Status: Active » Needs review
FileSize
2.71 KB

Here a test that proves this issue.

Status: Needs review » Needs work

The last submitted patch, 2: 3143838-2-test-only.patch, failed testing. View results

edysmp’s picture

FileSize
2.17 KB
4.36 KB

This issue was introduced here https://www.drupal.org/project/group_content_menu/issues/3130387#comment-13591680

The entity.group_content_menu.add_form route was changed to receive a GroupContentMenuType instance, but the createForm callback parameters were not updated. If we update the parameter it will not match with the parent definition, so I am reverting to use {plugin_id} as the argument instead of {group_content_menu_type}. If for any reason we would want to use the entity parameter (group_content_menu_type) we will need to create a function wrapper that call createFrom.

edysmp’s picture

Status: Needs work » Needs review
FileSize
4.32 KB
588 bytes

Clean test.

heddn’s picture

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

Needs re-roll after [#3144201 landed.

edysmp’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
4.28 KB

Here we go!

  • heddn committed a221d62 on 8.x-1.x authored by edysmp
    Issue #3143838 by edysmp, Dakwamine, heddn: Page not found when adding a...
heddn’s picture

Status: Needs review » Fixed

Thanks so much for the tests that reproduce the issue.

Status: Fixed » Closed (fixed)

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