- Issue created by @izus
- Status changed to Needs review
27 days ago 5:05pm 10 February 2025 - 🇫🇷France goz
Looks like this issue has been fixed on 1.1.x. I can see changes of this patch in currnet code.
- 🇫🇷France goz
My bad... i don't know how i check this but i was wrong.
So close duplicate 🐛 Does not cast options label in styles definitions Active and fix this patch
- 🇫🇷France goz
Trying to add a card on layout builder with ui_patterns2 and ui_suite_dsfr, i have the following error generating /ui_styles/stylesheet with this patch
InvalidArgumentException: $string ("0") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 132 of core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php). Drupal\ui_styles\Definition\StyleDefinition->t(0) (Line: 156) Drupal\ui_styles\Definition\StyleDefinition->getOptionsAsOptions() (Line: 217) Drupal\ui_styles\Service\StylesheetGenerator->getThemeStyleOptions('ui_suite_dsfr') (Line: 68)
ui_suite_dsfr has some style options with int, not string
options: fr-m-0: 0
Proposed resolution
Cast to string in \Drupal\ui_styles\Definition\StyleDefinition::getOptionsAsOptions()
$options[$option_id] = $this->t((string) $option);
- 🇫🇷France goz
Tests fail because now options are TranslatableMarkup and not string anymore