Deprecate text_with_summary

Created on 16 May 2016, over 8 years ago
Updated 22 May 2024, 7 months ago

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:

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

Remaining tasks

User interface changes

API changes

Data model changes

🌱 Plan
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
TextΒ  β†’

Last updated 28 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Needs product manager review

    It is used to alert the product manager core committer(s) that an issue represents a significant new feature, UI change, or change to the "user experience" of Drupal, and their signoff is needed. If an issue significantly affects the usability of Drupal, use Needs usability review instead (see the governance policy draft for more information).

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    If this is still desired what would the alternative be?

  • Issue was unassigned.
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    The 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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    I'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.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Yes 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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So 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.

  • Status changed to Closed: won't fix over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    If anyone disagrees please reopen explaining how. Thanks

  • Status changed to Active 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    How to deprecate it:

    1. Move the field type, formatter and widget to a module
    2. Switch standard + umami to using 'long text'
    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.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    That 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?

  • πŸ‡¬πŸ‡§United Kingdom catch

    That 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

    I 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.

    Updating standard and umami seems like something that we could do anyway. Probably should also introduce separate teaser fields then?

    Umami doesn't use the summary, at all:

    MariaDB [db]> SELECT body_summary from node__body;
    +--------------+
    | body_summary |
    +--------------+
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    | NULL         |
    +--------------+
    18 rows in set (0.001 sec)
    

    The tags/articles/recipe pages use a cards/grid layout (although checking this, I just opened πŸ“Œ Umami views should use responsive grid Active because it doesnt use that), so don't show anything from the body field at all.

    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.

  • πŸ‡¬πŸ‡§United Kingdom catch

    Opened πŸ› Don't use text_with_summary in Umami Needs review 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.

  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡¬πŸ‡§United Kingdom joachim

    > 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 πŸ“Œ Change Standard profile to use Media instead of image fields Active , where it's painful how out-of-date the architecture is.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So updating πŸ› Don't use text_with_summary in Umami Needs review 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?

  • Status changed to Postponed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Started a new META to track decisions that will be needed for this 🌱 [Meta] Deprecate text_with_summary Active

  • Status changed to Closed: duplicate 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Closing as duplicate for the new META which is getting started :)

Production build 0.71.5 2024