Theme suggestion change breaks BC

Created on 27 September 2023, 9 months ago
Updated 3 October 2023, 9 months ago

Problem/Motivation

In #3328817 the theme suggestions were changed. The original theme suggestion, menu__group_menu, was entirely replaced by the variants. The original was not kept around at all. This brings a backwards compatibility problem for sites that have used the original suggestion to theme their menus.

Edited to add: this also applies to 3.x since the change was made in that branch too.

Proposed resolution

Add back the original theme suggestion.

Remaining tasks

Create patch.

User interface changes

Should fix the theming for sites relying on the original theme suggestion.

API changes

None identified.

Data model changes

None identified.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇮Finland kekkis Pirkkala

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

Comments & Activities

  • Issue created by @kekkis
  • 🇫🇮Finland kekkis Pirkkala
  • 🇫🇮Finland kekkis Pirkkala

    I misinterpreted where the change was made, so I have no direct fix in mind for this. Maybe taking back the changes in the referenced issue and relying on hook_theme_suggestions_alter might be the most correct way. But if we can't have that (as I for example am a bit hesitant to propose such a change), shouldn't there at the very least be a change record for that original issue?

  • heddn Nicaragua

    What possible fixes would you propose at this point?

  • 🇫🇮Finland kekkis Pirkkala

    I think one way to fix this might be to add a hook_theme_suggestions_alter implementation in the module itself to add back the old suggestion. I'm not sure if I can think of other ways off the top of my head. As I mentioned I thought I was seeing an actual theme hook change but actually in https://git.drupalcode.org/project/group_content_menu/-/blob/8.x-1.x/gro... you will notice that hook_theme only defines group_content_menu and menu__group_menu still. So something is still a bit off maybe here in the original change too, I reckon?

    Or if I am misunderstanding the whole original change then please inform me. :-) I'm just seeing that the theme hooks in use (using theme debugging via the HTML comments) are different now than they were in the previous 1.x release, without fallback to the old one.

Production build 0.69.0 2024