Follow up from #2856283: Overridden twig field templates have empty content.

Quoted from a comment there:

Ok, we have the same problem as in #2860490: Invalid argument supplied for foreach() in ds_preprocess_ds_layout() line 366 of ds.module. We committed a fix there which we can remove if when #2861840: Preprocess functions are not merged when a module registers a theme hook for a theme-provided template is committed to core. We'll probably need a similar workaround for the field templates too.

Further more, since we're also using a 'base hook' for the DS field templates, this means suggestions won't work, just like in #2802429: Display layout twig not overridable.. That added an insane workaround which we hopefully can remove if we have a solution in #2862683: 'base hook' key prevents template suggestions from working. Will look if I can come up with the same crazy workaround for field templates.

Part one is done. Now part two: make sure all suggestions work and add some more tests. Suggestions for field templates are a bit different than we do for layouts, so the insane workaround which exists didn't work out of the box. So either

  • we need to alter that work around a bit more to discover the right theme hooks
  • change the suggestions, but that's maybe BC break ?

Comments

swentel created an issue. See original summary.

swentel’s picture

Issue summary: View changes
swentel’s picture

Title: Field template suggestions » Make field template suggestions work

Better title