- Issue created by @ilya.no
- Status changed to Postponed: needs info
over 1 year ago 1:30pm 25 June 2023 - πΊπΈUnited States ultimike Florida, USA
I am unable to reproduce this issue. Here's what I did (on a fresh D10 install):
Installed Smart Trim 2.0.0.
Configured the teaser view mode of a content type to use Layout Builder.
Configured the body field for the content type in teaser view mode to be smart trimmed (20 words).
Confirmed things were working as expected.
Updated to Smart Trim 2.1.0
Ran database updates.
Reviewed the settings for the same body field in the teaser view mode of my content type using Layout Builder, they were still intact (20 words).
Confirmed things were still working as expected.@ilya.no any chance you can provide more details on your situation? Did my steps above adequate to reproduce the issue you had?
Would also be good for someone else to try to reproduce the issue.
-mike
- First commit to issue fork.
- @codebymikey opened merge request.
- Status changed to Needs review
over 1 year ago 1:39pm 18 July 2023 Created a
post_update
hook which addresses the issue for layout_builder displays.@ultimike, the thing of note is making sure the config is updated to match the expected structure. I've attached a stripped down snippet of a view display config for reference purposes.
Another thing of note is that there's no upgrade paths for node-specific layout builder overrides, but that's not a use-case that's of a high enough priority for me right now, so this addresses the immediate issue quite well.
- First commit to issue fork.
- Status changed to Needs work
over 1 year ago 4:11pm 3 August 2023 - πΊπΈUnited States ultimike Florida, USA
Tests have passed - I would like to see a new test associated with this though...
I'm going to put this back on "Needs work" for a new test, but if @markie feels strongly about it, then he can merge it - and take full responsibility if it breaks something :p
-mike
- πΊπΈUnited States jrb Raleigh-Durham Area, NC, USA
Just FYI, the proposed change won't fix this issue in layouts created by the Layout builder library β module (used on 14K sites). The structure of its configurations is different from that of Layout Builder, so it wouldn't be simple to just add in support for updating them. For our site, we ended up just manually editing the config.
Who knows how many other modules may be supporting fields that could possibly use Smart Trim, so I don't know if it's realistic for you to support every use case. Unless there were some other way for you to find where Smart Trim was used? We grepped the config directory, but that wouldn't help with automatically fixing the config.
Maybe it would make sense to just output a warning message that says something like this?
If you're using Smart Trim in places other than entity view displays, you may need to manually update its configuration.