Input template breaks module temnplate (rate module)

Created on 17 August 2020, over 4 years ago
Updated 21 June 2024, 6 months ago

Problem/Motivation

The implementation of the input.html.twig does not respect the template of the rate module. So the modules template is not used at all and breaks the style.

#3163476: Stars formatting incomplete (radix/bootstrap issue)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

4.8

Component

Code

Created by

🇩🇪Germany marcoka

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇦🇺Australia Stefan Lehmann

    Thank you marcoka. You lead me onto the right track. Here a slightly improved code.

    /**
     * Implements hook_theme_suggestions_HOOK_alter().
     */
    function THEME_NAME_theme_suggestions_form_element_alter(array &$suggestions, array $variables) {
      if (isset($variables['element']['#attributes']['twig-suggestion']) && $variables['element']['#attributes']['twig-suggestion'] == 'rating-input') {
        // Radix overrides the "rate" modules theme suggestion
        // for the rating input fields with "form_element__radio"
        // so we're overriding this again in the sub theme.
        $suggestions[] = 'form_element__rating';
      }
    }
    
  • Thanks for the work guys, since 4.x is not actively maintained I'd appreciate a MR, thanks

  • 🇩🇪Germany marcoka

    I use 5.x now too. I have no idea how to do a MR :(

  • 🇦🇺Australia Stefan Lehmann

    This fix is for a sub theme not for the Radix base theme.

    I'm not sure what would have to be done to fix this issue in the base theme without having any side effects for all the other sub themes. It might very well be that the "Rate" module is at fault here.

  • Status changed to Closed: outdated 6 months ago
  • No longer supported/outdated, closing - feel free to open MR.

Production build 0.71.5 2024