nuvoleweb / ui_patterns

[NOTE] Development has moved to https://drupal.org/project/ui_patterns
https://drupal.org/project/ui_patterns
GNU General Public License v2.0
85 stars 56 forks source link

Theme suggestions overriding patterns with hyphens in their ID are not loaded #271

Open gambry opened 5 years ago

gambry commented 5 years ago

With #243 we allowed hyphens as pattern id. Although this work perfectly, we haven't fully tested overriding patterns template through theme suggestions.

And indeed if there is a hyphen in the pattern id, overrides are not loaded.

In order to reproduce:

  1. Create a pattern with hyphens in is ID, i.e. this-is-a-test
  2. In your active theme try to override that pattern, creating pattern-this-is-a-test.html.twig template (of course different from content of pattern template!)
  3. Load the pattern in your website, i.e. visiting the Pattern Library section.
  4. Override is not loaded.
gambry commented 5 years ago

PR #270 addresses this issue.