Problem/Motivation
As mentioned in #3050389: Remove dependency to Classy from core themes, Classy will be moved to contrib before Drupal 9 and we have to remove dependencies on Classy from all core themes. Part of removing these dependencies includes providing each theme their own copies of templates that previously belonged to Classy.
There's considerable potential for error when copying ~100 templates to four different themes, so we need a test that removes some of the uncertainty from the process.
Proposed resolution
Create a test that confirms that themes do not inherit templates from Classy, and that none of the templates they use include/extend Classy templates or attach Classy libraries.
The test will include a per-theme ignore-list of templates that do not need to be included as part of the test. At first, the ignore-lists will be very large, and will shrink with each template-copying issue filed. When a new template-copying issue is filed (for example, copy aggregator templates to Bartik), the first patch will be this test, but with aggregator's templates removed from Bartik's ignore list. This way, the test won't pass until the templates are properly copied.
Every Classy-inheriting core theme currently extends, includes or attaches something from Classy, so these tests will not pass at first.
Remaining tasks
Write the test, configured it to ignore templates that still need to be copied.
Create issues to address existing attach_library() calls to Classy libraries in Bartik/Seven/Claro/Umami, as these will cause the test created here to fail.
- Umami calls
{{ attach_library('classy/node') }}
in node--article--full.html.twig, node--card--common.html.twig, node--card.html.twig, node.html.twig - Bartik calls
{{ attach_library('classy/node') }}
in node.html.twig - Claro calls
{{ attach_library('classy/file') }}
in file-link.html.twig - Seven calls
{{ attach_library('classy/image-widget') }}
in image-widget.html.twig
These library-copying followup issues can't be created until #3096203: Create Classy library dependency tests that can be used for all themes, and verify by providing an Umami-specific classy/dropbutton is complete.
The Claro template include/require's should be addressed in the scope of this issue as this is where the test exists to verify they were done properly. This needs to be addressed with the following:
- Bartik
{% extends ""@classy/block/block--search-form-block.html.twig"" %}
in block--search-form-block.html.twig - Bartik
{% extends "@classy/block/block--system-menu-block.html.twig" %}
in block--system-menu-block.html.twig - Bartik
{% extends "@classy/content/page-title.html.twig" %}
in page-title.html.twig - Bartik
{% extends "@classy/misc/status-messages.html.twig" %}
in status-messages.html.twig - Seven
{% include '@classy/content-edit/image-widget.html.twig' %}
in image-widget.html.twig - Claro
{% extends '@classy/form/form-element-label.html.twig' %}
in form-element-label.html.twig
The template copying can't happen until #3095713: Create classy directory with README, in the templates and css directories for all themes subtheming Classy is complete
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Release notes snippet
n/a