Problem/Motivation
This
one →
broke my site.
Steps to reproduce
Seems like the chain of the theming should be (the order of the base):
My Custom Theme(Material Top) -> Material Base MDC -> Material Base -> Material Stable 9
But since we moved Material Stable 9 into the material_base folder(issue 3316641), when Drupal looks for a template, it will find the material_stable9 version of it. Effectively not using material_base templates at all (since material_stable9 has all)
The Drupal process is here:
web/core/includes/theme.inc:225
$files = \Drupal::service('file_system')->scanDirectory($path, $regex, ['key' => 'filename']);
This function gets invoked for all enabled themes (as it should), and scan blindly the entire directory for html.twig files.
For example:
Trying to render: menu-local-tasks.html.twig
:
1st version: material_base/templates/navigation/menu-local-tasks.html.twig
2nd version (overrides the first) material_base/themes/material_stable9/templates/navigation/menu-local-tasks.html.twig
So when this function get's invoked the first time with material_stable9 it will correctly return the 2nd version.
But the second time, when invoked against material_base it will mistakingly still returns the 2nd version.
Essentially when your active theme search this template up the base themes tree, we only get the material_stable9 version.
Proposed resolution
I'm not sure what the solution should be here.
As a quick workaround, we have copied the entire templates directory into our own theme.
cp -a material_base/templates ../custom/material_top
Remaining tasks
Code/Documentation change
If I'm missing something, and I mess something up during the upgrade from 2.x-beta to 2.0 , please let me know.
User interface changes
API changes
Data model changes