Problem/Motivation

After upgrading to 3.17, Twig template overrides don't seem to take effect.

Regression in the upgrade from 3.16 -> 3.17.

Steps to reproduce

I managed to bisect the issue to the changes introduced by #2887778: Layout template suggestions does not always work.

Lets compare the suggestion markup provided by Twig debug:

Before

With 3.16, or commit #8a4f075

FILE NAME SUGGESTIONS:
   * field--default--paragraph--field-image-slider-item--image-slider---custom.html.twig
   * field--default--paragraph--field-image-slider-item--image-slider.html.twig
   * field--default--paragraph--image-slider---custom.html.twig
   * field--default--paragraph--image-slider.html.twig
   x field--default--paragraph--field-image-slider-item.html.twig
   * field--default--field-image-slider-item--image-slider---custom.html.twig
   * field--default--field-image-slider-item--image-slider.html.twig
   * field--default--image-slider---custom.html.twig
   * field--default--image-slider.html.twig
   * field--default--field-image-slider-item.html.twig
   * field--default.html.twig
   * field--theme-ds-field-default.html.twig
   * field--paragraph--field-image-slider-item--image-slider.html.twig
   * field--paragraph--field-image-slider-item.html.twig
   * field--paragraph--image-slider.html.twig
   * field--field-image-slider-item.html.twig
   * field--entity-reference-revisions.html.twig
   * field.html.twig

After

With 3.17, or #833693c:

 FILE NAME SUGGESTIONS:
   * field--paragraph--field-image-slider-item--image-slider.html.twig
   * field--paragraph--field-image-slider-item.html.twig
   * field--paragraph--image-slider.html.twig
   * field--field-image-slider-item.html.twig
   * field--entity-reference-revisions.html.twig
   x field.html.twig

As you can see, all of the default prefix templates, among others, are not present.

Things ive tried:

Bonus configuration

3.16

_core:
  default_config_hash: xfB0qOeoAomOThclNNokdKTrVwXLcXz13SU3-4a5-FY
disabled: false
field_template: false
ft-default: default
ft-show-colon: false
classes:
  region: {  }
  field: {  }
use_field_names: true

After 3.17 upgrade

_core:
  default_config_hash: xfB0qOeoAomOThclNNokdKTrVwXLcXz13SU3-4a5-FY
disabled: false
field_template: false
classes:
  region: {  }
  field: {  }
use_field_names: true
ft_bc: true
exclude_layout_builder_blocks_on_block_field: false
ft_expert_prefix_suffix_textarea: false
ft_default: default
ft_show_colon: false
ft_layout_builder: null
exclude_ds_layout_layout_builder: false
layout_icon_image_bc: true
ft_default_bc: true
layout_suggestion_bc: true

Proposed resolution

Rework or revert.

Since its been only a few days since the release, I'd suggest a make or break decision to revert should happen soon.

Remaining tasks

tbd

User interface changes

nil

API changes

nil

Data model changes

configuration!?

CommentFileSizeAuthor
#6 3415154-6.patch1.04 KBswentel

Comments

dpi created an issue. See original summary.

dpi’s picture

Issue summary: View changes
swentel’s picture

Hmm, the 'default' rather points to the 'Undo default field template fix', not entity layout. It's interesting that setting doesn't take effect at all, so I'll double check, so the issue that caused this is in #3295021: Field template suggestion is wrong when global default is overridden

dpi’s picture

Issue summary: View changes

Added extra before/after configuration exports to issue summary.

swentel’s picture

So you are right, I've also touched that code in #2887778: Layout template suggestions does not always work, so it might be that commit that has actually introduced the BC setting to not work completely .. getting close as I really don't want to revert :)

swentel’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

This should do it, could you test? With the 'Undo default field template fix' toggled, this should revert to what we had until up to 3.16

dpi’s picture

Status: Needs review » Reviewed & tested by the community

Yep this works.

Site teardown and redeploy with the new config and code: 3.17+patch. Tests back to passing. Twig suggestions are now identical to as they were for 3.16.

Thanks @swentel

swentel’s picture

Ok cool! Will release in about two days I think as I'm tracking two other issues and we're internally upgrading sites as well. So I'm following closely to make sure no other regressions have been introduced in 3.17 release which is a quite ambitious one :)

And thanks for reporting and debugging!

  • swentel committed 38a12a74 on 8.x-3.x
    Issue #3415154 by swentel, dpi: Missing template suggestions after...
swentel’s picture

Status: Reviewed & tested by the community » Fixed

committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.