Problem/Motivation

Number routes, specifically :

  • entity.group.canonical
  • entity.group.version_history
  • view.group_members.page_1
  • view.group_nodes.page_1

are ignoring "Use admin theme" configuration option and showing front end theme.

Tested on Drupal 9.5.3 and latest 3.x group on 8cefda266dedfc6657dee736780400cc1a8d00d6 commit.

Steps to reproduce

  • enable group module
  • create group type
  • create group
  • navigate to the group view page - observe front end theme
  • click "Edit" tab - observe admin theme
  • click "Revisions" tab - observe front end theme
  • click "All entities" tab - observe admin theme
  • click "Members" tab - observe front end theme
  • click "Nodes" tab - observe front end theme

Proposed resolution

Fix the bug

Remaining tasks

  • Patch
  • Review
  • Commit

User interface changes

None

API changes

None

Data model changes

None

Issue fork group-3346626

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

RoSk0 created an issue. See original summary.

kristiaanvandeneynde’s picture

Title: "Use admin theme" configuration is ignored by some routes » Enable "Use admin theme" on version history and listings
Category: Bug report » Feature request

You want your group canonical route to be a landing page so displaying that in the admin theme makes little sense. The other routes I could agree with, but I never really triggered it for the members and nodes view because of #2719797: New option for Views page displays to use the admin theme

Not really a bug report as it boils down to personal preference and what makes the most sense.

kristiaanvandeneynde’s picture

Status: Active » Postponed

The core issue only just landed in 10.1 so we will have to wait for 9.x support to be dropped before we can start using that. entity.group.version_history now shows in admin theme, so I see no actionable items here until Drupal 10 is the minimum supported core version.

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

s_leu’s picture

Status: Postponed » Needs review

entity.group.version_history now shows in admin theme

This seems a to work only randomly depending on the apparently random order of route subscribers, which in you case seemed to be correct. The order seems to be different in my case and to ensure that the admin theme is used, we need the altering in GroupRevisionRouteSubscriber to run before the one in GroupAdminRouteSubscriber. A corresponding change can be found in the MR.

Btw. I wasn't sure which target branch to use, please change it if it's incorrect.

kristiaanvandeneynde’s picture

I would do it the other way around and make the admin subscriber run really late, rather than the revision subscriber run early. This way we don't get the same bug when new route subscribers are introduced.

We should also update the default views and write an update hook to make sure existing installs get the same update.

gwvoigt’s picture

I think this would be very useful. The patch worked for me in the lats release of Group 3.3.5. I can't see why the revisions list would not be using Admin theme by default.

p-neyens’s picture

The patch worked for me in the 2.3.2 release of Group.
I also provide the patch file to use with composer-patches.

kristiaanvandeneynde’s picture

Version: 3.0.x-dev » 4.0.x-dev
Status: Needs review » Needs work

See #7, the admin subscriber should be running late, not other subscribers running early.

Also the minimum core version is now 10+, so it's also actionable to update the views. For that, I'd need to see "use_admin_theme: true" on both views mentioned in the issue summary + an update hook.

kristiaanvandeneynde changed the visibility of the branch 3346626-revision-admin-theme to hidden.

kristiaanvandeneynde changed the visibility of the branch 4.0.x to hidden.

kristiaanvandeneynde changed the visibility of the branch 3.3.x to hidden.

kristiaanvandeneynde’s picture

Actually, GroupAdminRouteSubscriber alters the route options in a non-destructive way. It only touches the _admin_route option. GroupLatestRevisionRouteSubscriber touches the route requirements, but not options. So I have no clue where the claim comes from that they interfere with each other, they shouldn't.

So just adjusting the views should do enough. If not, then we really need to look into why it's misbehaving and that would be a bug report of its own.

kristiaanvandeneynde’s picture

Status: Needs work » Needs review

MR updates the views to use the admin theme, please check.

kristiaanvandeneynde’s picture

Status: Needs review » Fixed

Okay going to commit this as such due to lack of feedback. If people are still struggling with entity.group.canonical or entity.group.version_history, then please open a new issue.

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.

Status: Fixed » Closed (fixed)

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