Closed (fixed)
Project:
Bootstrap
Version:
8.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2017 at 17:31 UTC
Updated:
4 May 2017 at 20:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fastangel commentedComment #3
markhalliwellCore supplies this property automatically, that's why this patch is adding a line, not changing an existing line; which would then mean it's a bug with this project.
Comment #4
fastangel commented@markcarver I think is a bug on Bootstrap. If you try this:
* enable drupal 8.3.1
* Enable display suite 8.x-3.0-beta3
* Enable boostrap theme
If you create a new display mode for a users and use a twocol layout for example you get this error if you try override the twocol layout on the theme. The path, .... everything is ok but the template is incorrect. If you use another theme (seven, ....) work fine (This can be related with the problem on core to find templates). I think we can add this change while is fixed. In another theme work fine because always use the template on module instead to find the override on theme.
NOTE: Bug on core I was talking https://www.drupal.org/node/2862683
Comment #5
markhalliwellI don't know what to tell you other than it's not an issue with this base theme. I can override in a sub-theme just fine:
Comment #6
fastangel commentedAre you sure?. I'm using a subtheme and I have the problem. With:
* drupal 8.3.1
* display suite 8.x-3.0-beta3
* layout discovery module (core)
We can't override a template and you get a exception with boostrap/subtheme theme only.
Comment #7
markhalliwellYes, I'm sure. I just posted the screenshot didn't I?
I tested this with the latest git commits in all projects (core-8.3.x, ds-8.x-3.x, bootstrap_layouts-8.x-5.x).
Comment #8
csedax90 commentedThe problem is not with base templates as I explained before, but with overridden templates with a suggesion name es. bs-1col--node-theater-menu.html.twig
Comment #9
markhalliwell@fastangel, I must apologize. You were correct.
I just stepped through all of this, in great length, to determine where the break down is happening.
The problem technically is a result of core's
\Drupal\Core\Theme\Registry::mergePreprocessFunctionswhen it merges the "parent hook" with the existing cache:However, since this base theme does all this in an alter hook to "Ensure paths to templates are set properly.", it creates a "fake" hook so they can get processed by core later.
Because the base hooks already have their templates, these get populated to the suggestions as well, thus not getting properly later.
---
I'm committing your patch above, but with a small tweak so it only sets the template when it creates a new theme hook for the suggestion.
It also includes making some minor documentation and whitespace changes to help explain this a bit better.
Comment #11
markhalliwell@sedax, this should solve your problems.
Comment #12
fastangel commentedPerfect. I was creating a environment on pantheon to show you hehe.