- Issue created by @arturopanetta
- 🇮🇹Italy marcob77
renderMessages is a method of class \Drupal\Core\Render\Element\StatusMessages
- 🇮🇹Italy arturopanetta Grotteria (RC)
@deepali-sardana thanks for your help, I checked the code and there are some things wrong.
The first thing wrong is the name of the suggestions, the name of the suggestions is wrong. In the file you modified it should be `bootstrap_italia_preprocess_block__system_messages_block`; maybe my example above misled you, sorry. In the jargon of this project `italiagov` means `your_sub_theme`, the change must be applied in the subtheme that each user creates. I correct the example above to be more specific.
The second thing I didn't understand is why you use: `BubbleableMetadata::renderMessages();` instead of `StatusMessages::renderMessages()`.
@marcob77 yes sure, you have to import StatusMessage, I correct the suggestion above, a complete example here https://github.com/ouitoulia/skenografia/blob/2.x/includes/workaround.inc
- 🇮🇹Italy marcob77
why fix it in subtheme and not in the main theme? Just to wait drupal fix problem?
- 🇮🇹Italy arturopanetta Grotteria (RC)
Since I used the workaround as a temporary patch most of the time, it provided me with short-lived solutions. I would like to avoid releasing continuous patches for this issue and wait for a stable fix from Drupal core, also I thought I would use this issue to communicate updates on new workarounds and/or discuss better solutions.
So far I have not identified any benefits of putting the workaround in the main theme, if you have identified any maybe we can discuss it here and see if it is possible to do so. Please note that: 1) until February 2025 you also need to patch/keep 2.8.x up to date; 2) not all installations are on Drupal 10.3, for older versions you should not use the workaround.