Problem/Motivation
#1378350: Clean up the "Long text and summary" field has a list of some of the issues with text_with_summary
#2725415: Text Editor module fails to track usage of images uploaded in text_with_summary fields, allows uploaded images to be deleted is a current example of it causing data-loss - editor module has to hard-code support for the double-column field.
We've had usabiity problems with this ever since #107061: Add jQuery Teaser Splitter, and then with the <!-- break -->
tag before that.
Display modes didn't exist when this was originally added, and the field type for me is a case of 'port the feature verbatim to the new API' without necessarily taking the time to consider whether the feature should still exist. With display modes, this isn't really necessary any more.
Long-standing issues:
- #626546: The body field on the Basic Page content type should not allow a summary to be input
- #553308: Clean up UI for 'Text with summary' field settings
- #3016343: Fix inconsistencies of TextareaWidget and TextareaWithSummaryWidget form elements
- #3115978: After enabling Require Summary on a field can't save the field
It's also been responsible for data loss in the past with #2725415: Text Editor module fails to track usage of images uploaded in text_with_summary fields, allows uploaded images to be deleted which required special handling in editor module.
Proposed resolution
How to deprecate it:
1. Switch standard + umami to using 'long text'
2. Change the body field to persist_with_no_fields: false
so it can be deleted on sites that don't use it.
2. Move the field type, formatter and widget to a module
3. Deprecate the module and move it to contrib
Comments
Comment #2
BerdirThis was also discussed a bit in #2150511: [meta] Deduplicate the set of available field types and I thought I've seen another issue about it too
Interested in this, but there are going to be a lot of things to figure out. For example, the body field.
Body is automatically created, we can't just switch that. We also can't really make it configurable, since the field storage for body is default config of node.module and always created, very early.
I know the install process is not part of the API (although it's not exactly clear to me how much that includes), and we could also argue that configurable fields aren't. But while code does have to cope with the fact that body may or may not exist (and at least in 7.x, we still have core bugs in comment.module about that AFAIK), if it exists, there is lots of core, contrib and custom code assuming that ->summary exists.
I guess we'd have to keep body as text with summary but don't allow to create more fields of that type?
Comment #3
catchYou can quite reasonably delete the body field, recreate it as text long with no summary, and then assign it around. I've done that before in 7.x, so that code is already broken no?
However I think we should definitely make this a multi-stage issue, and make worrying about that bit the last stage.
Comment #4
Wim LeersIn the name of the flying spaghetti monster, yes please!
Comment #5
yoroy CreditAttribution: yoroy at Roy Scholten commentedI'm all for it! It's a weird Drupalism, superseded by fields + view modes, which is the right way to do this now.
Comment #6
Bojhan CreditAttribution: Bojhan as a volunteer and commentedComment #7
yoroy CreditAttribution: yoroy at Roy Scholten commented@webchick, what do you think?
Comment #8
webchickSure. :)
Comment #10
joel_guesclin CreditAttribution: joel_guesclin as a volunteer commentedWhat to do about an existing site?
I'm beginning to ramp up to migrating to D8 from a D6 site with upwards of 4000 nodes (book pages mostly) which of course uses the Body+Summary.
What to do?
If the summary is deprecated (and anyway not very usable because it doesn't get the CKEditor), then if I migrate my present site into D8, and follow Wim Leers' advice by creating a special field for the summary, what will happen when the body_summary gets not merely deprecated but removed? Ideally, when that happens, I think I would like to be able to choose the field that the summary gets moved into. But at least for a while it seems that the summary presently held in "body_summary" will have to co-exist with the new "Summary" field.
Comment #24
smustgrave CreditAttribution: smustgrave at Mobomo commentedIf this is still desired what would the alternative be?
Comment #25
BerdirThe alternative would be to have two fields, a teaser/intro field and a text field. That gives you more control, like separate text formats and you can display them both on a page if you want.
That said, I have no idea how we'd achieve this today with our BC approach, we would need an upgrade path which could be absolutely massive for large sites.
I do agree that this would have been a good idea, but I think we should consider to close it, there are more important tasks.
Comment #26
smustgrave CreditAttribution: smustgrave at Mobomo commentedI've been neglecting text module so trying to play catch up.
I'm for closing it
But could the upgrade be the summary goes to a auto generated text field and actual text goes into a regular non summary text field?
For display 0 idea how to handle that.
Comment #27
BerdirYes exactly, that's how you'd do it. New field, move all summary content over to that. There are a bunch of differences though, like the text with summary has the summary as optional, so we'd need to include the runtime fallback of the summary to a cut of part of the regular text on migration.
But most sites that use paragraphs, layout builder and so on already deal with that, because text with summary is not something that you can really use there.
The problem is the amount of data that we're dealing with here. There are sites with a million nodes and they might have millions of revisions, we wouldn't just need to update the default revision but the full history as well. That would require either a very long downtime or a separate migration process that will gradually move data over while the site continuous to be used. But that also means that the site needs to be able to support both fields for that time.
Comment #28
smustgrave CreditAttribution: smustgrave at Mobomo commentedSo essentially the cost to reward is too great.
Seems this kind of update would be super problematic for a lot of sites at this point.
Comment #29
smustgrave CreditAttribution: smustgrave at Mobomo commentedIf anyone disagrees please reopen explaining how. Thanks
Comment #30
catchHow to deprecate it:
1. Switch standard + umami to using 'long text'
2. Move the field type, formatter and widget to a module
3. Deprecate the module and move it to contrib
Existing sites would then need to use the contrib module, or do a custom update/migration to long text.
Comment #31
BerdirThat would technically work, but we'd be forcing _every_ existing site to use that. body is a non-deletable storage field, even if you don't use the body field on any node type, you wouldn't be able to remove it (we could do some shenanigans and replace an unused storage field in an update I guess.
Updating standard and umami seems like something that we could do anyway. Probably should also introduce separate teaser fields then?
Comment #32
catchI think we could update the body field to
persist_with_no_fields: false
as one of the deprecation steps? Then sites that don't use it could delete it.Umami doesn't use the summary, at all:
The tags/articles/recipe pages use a cards/grid layout (although checking this, I just opened #3425104: Umami views should use responsive grid because it doesnt use responsive grid yet), so don't show anything from the body field at all. This is a very good example of how it's not useful on a lot of sites, and introduces confusion on sites that don't change the defaults but end up not actually using the feature - we've even done it ourselves in what's supposed to be a demo/showcase.
Standard still has various pages with teasers - we could do the two fields thing, or use the trimmed formatter, or possibly got further and add a card view mode + responsive grid in standard.
Comment #33
catchOpened #3425105: Don't use text_with_summary in Umami because for me that's a straight bug in Umami that it includes a black hole field in the content creation UX that doesn't show up anywhere if you try to use it.
Comment #34
catchComment #35
catchComment #36
joachim CreditAttribution: joachim at Factorial GmbH commented> Updating standard and umami seems like something that we could do anyway. Probably should also introduce separate teaser fields then?
If we have time to update Standard, then a better use of that time would be #3258492: Change Standard profile to use Media instead of image fields, where it's painful how out-of-date the architecture is.
Comment #37
smustgrave CreditAttribution: smustgrave at Mobomo commentedSo updating #3425105: Don't use text_with_summary in Umami I actually had to change a lot to use "field_body" since body seems to be hardset to be text_with_summary. This the approach we are going to want and take?
Would we then move that hardcoded storage to a contrib module?
Comment #38
smustgrave CreditAttribution: smustgrave at Mobomo commentedStarted a new META to track decisions that will be needed for this #3427095: [Meta] Deprecate text_with_summary