Enable "Use admin theme" on version history and listings

Created on 8 March 2023, almost 2 years ago
Updated 30 May 2024, 8 months ago

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

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇳🇿New Zealand RoSk0 Wellington

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @RoSk0
  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    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 New option for Views page displays to use the admin theme Fixed

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

  • Status changed to Postponed over 1 year ago
  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    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.

  • First commit to issue fork.
  • Status changed to Needs review 8 months ago
  • 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.

  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    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.

Production build 0.71.5 2024