Problem/Motivation

Final step in deprecating text_with_summary

Steps to reproduce

NA

Proposed resolution

Move all related code to a deprecated module

Remaining tasks

Implement (after other steps are merged)

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

The Text (formatted, long, with summary) field type, along with its widget and formatters has been moved out of the Text module into a new Text With Summary Field (text_with_summary) core module. This is the final step in deprecating the text with summary field type, which is removed from Drupal 12.0.0 and continued as a contributed module.

Sites using the text_with_summary field type must install the contributed module to continue using it from Drupal 12.0.0. Fields will be updated to depend on the new module upon updating to Drupal 11.5 or later. Sites trying to update directly to Drupal 12 without having installed the contributed module will see an update requirements warning if it's needed. Updating to Drupal 11.5.0 and running database updates is recommended prior to updating to Drupal 12.

Contributed and custom code that references the plugin classes from Drupal\text\Plugin\... should switch to the Drupal\text_with_summary\Plugin\... namespace. See the change record for details.

Issue fork drupal-3549134

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue. See original summary.

smustgrave’s picture

Status: Active » Postponed

smustgrave’s picture

Title: [P-3] Move text_with_summary to it's own module » [P-1] Move text_with_summary to it's own module

berdir’s picture

we don't do submodules in core except for tests, this should be on the same directory level as text, not below. I also wouldn't include _field in the module name, just text_with_summary.

cilefen’s picture

Title: [P-1] Move text_with_summary to it's own module » [P-1] Move text_with_summary to its own module

I fixed an its vs it’s typo in the title.

smustgrave’s picture

Only added field as there is already a contrib module called text_with_summary

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Most of the test failures are related to migration tests so my question is do I update them to install text_with_summary_field too? Or do I just pause until migrations are deleted.

smustgrave’s picture

Also a bunch of update test figures require it ugh, so not sure if we gotta wait for those to update too

smustgrave’s picture

Title: [P-1] Move text_with_summary to its own module » Move text_with_summary to its own module
Status: Postponed » Needs work

Migrations have been removed!

smustgrave’s picture

Status: Needs work » Postponed

Now this is postponed on test fixtures being updated.

smustgrave’s picture

Status: Postponed » Needs work

This actually isn't postponed.

smustgrave’s picture

Status: Needs work » Needs review

This is ready for eyes.

dcam’s picture

Status: Needs review » Needs work
Issue tags: +Needs update path tests

I left MR comments about a couple of things I noticed. But there's one other issue: the update path wasn't working correctly for me. I got inconsistent results in the dependency recalculations. My testing procedure was this:

  1. Install the standard profile.
  2. Add a content type.
  3. Add a text with summary field to the content type.
  4. Change the formatter for the field to "Summary or trimmed".
  5. Create an instance of the content type.
  6. Check out the issue branch.
  7. Run updates.
  8. Refresh the page of the content instance that I created to verify there are no errors.
  9. Visit the config single export page and view the updated field storage, field, entity form display, and entity view display config.

I ran this test several times to verify what I was seeing. The field storage did not have its module dependency updated from text to text_with_summary except one time on the third test. On the first test the field configuration didn't get updated. But the display configs got updated in all four tests.

Take those reports with a grain of salt. I almost stopped after the third test because the updates succeeded in all instances and I started to think I'd been mistakenly checking the block body config the entire time. But then I ran the fourth test and yes, the field storage config absolutely did not get updated that time.

My results need verification. We need to figure out what's causing this problem. Could it be because the plugin attributes are located in both the text and text-with-summary modules? Also, I don't think there's an update path test. Given what I've seen I think we definitely need one here. So I'm tagging the issue for that.

smustgrave’s picture

Pushed an upgrade path test, apparently the text_post_update_update_field_storage_dependencies needed more work and was causing the others to fail.

smustgrave’s picture

Status: Needs work » Needs review
Issue tags: -Needs update path tests

>Added upgrade path tests (which revealed the updates weren't working).
>Added back the js library and deprecated and per @longwave suggestion used library_info_alter to make sure text_with_summary is used and not text (adding credit).
>Cleaned up the CR (should of done that before)
>@catch said "If the new module is alphabetically later then nothing is needed." with my concern if the text plugins would beat out the text_with_summary.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for checking those things again, @smustgrave. I reviewed the latest changes and they look good to me. I also re-ran my updates several times again. This time all of the affected configuration had its dependencies updated every time. I'm ready to send this one up.

catch’s picture

Status: Reviewed & tested by the community » Needs review

Couple of questions on the MR.

smustgrave’s picture

Feedback addressed, free to RTBC?

dcam’s picture

Status: Needs review » Reviewed & tested by the community

The update hook contents are identical to the previous post-update function. It looks good.

The test failure appears to be random. I checked and it doesn't seem to have anything to do with a text_with_summary field. And it didn't fail in the previous pipelines.

catch’s picture

Status: Reviewed & tested by the community » Needs review

HelpNoSearchUpgradeTest failing without this seems odd though because it's not testing text_with_summary fields. I think we may need to change the database dumps themselves to remove this field type if it's in there, otherwise it will explode when we remove it from core.

smustgrave’s picture

I was hoping you wouldn't ask that, hate touching those fixtures something always goes wrong. So what branch do I need to be on and version to update to?

This is probably going to blow the MR update as I know those fixtures are using the old plugins

smustgrave’s picture

Status: Needs review » Needs work

Will update the fixtures in the morning, leaving assigned to myself.

mradcliffe’s picture

I un-gzipped drupal-11.3.0-filled.standard.php on the merge request and main branch to 2 separate files, and then manually diffed. There are a lot of changes (9.7mb diff text file) probably because the database hasn’t been manually dumped in a while.

I think the main big change is body to field_body in the dump, which made it hard to review the changes. Should that field name have changed if testing from 11.3.0?

smustgrave’s picture

Status: Needs work » Needs review

Had to use drush commands to delete the storage config for body as they use to persist.

smustgrave’s picture

@mradcliffe the just 'body' field is no more and was something that was auto added before. It's impossible to remove the old field and add it back as just body, we had to do something similar early on in this deprecation for Umami

ironnuts’s picture

Made a couple of additions to the CR. Added a few words for clarity.

nicxvan’s picture

@oily, I'm a little confused by your CR edit:

The text_with_summary plugins have been deprecated and moved to a new contrib module named 'text_with_summary'.

It's not a contrib module, it's a core module that will be deprecated and moved to contrib at some point.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

smustgrave’s picture

Status: Needs work » Needs review
dcam’s picture

Status: Needs review » Needs work

I know you aren't going to like reading this, but I found problems with both dump files.

It looks like cron ran while the "bare" dump file was being generated. This caused Search to start indexing the help_search content. It caused tens of thousands of rows of garbage indexing data to be added to the dump file. If you unzip and edit the file, then the following blocks of rows can be deleted to clean up the file:

  • Lines 13241 - 13788
  • Lines 13837 - 63874
  • Lines 63895 - 69902

The "filled" dump file has different issues. The field storage tables for the old text-with-summary fields, block_content__body and node__body are still in the dump. I kept reviewing it for a while until eventually the diff checker that I was using crashed because of the size of the files. There was one old text-with-summary field that kept showing up over and over again as being removed and it didn't look like it had been replaced. It was field_test_14 on nodes. I'm guessing that it isn't used anymore because tests are passing without it. I grepped the core directory for it and got no results. So it probably isn't an issue. Aside from that, the diffs were looking OK. But I didn't get all the way through them.

In both dump files, the config_snapshot file contains cached definitions of the old, pre-edit fields, including the text-with-summary fields. I don't fully understand this table, but I'm pretty sure it has something to do with config exports. I have a feeling the insert() statement for the config_snapshot table and all of its cached contents could probably be deleted with no penalty.

catch’s picture

I have a feeling the insert() statement for the config_snapshot table and all of its cached contents could probably be deleted with no penalty.

That sounds like it would be absolutely fine.

smustgrave’s picture

Status: Needs work » Needs review

With the updates fixtures ticket in this should be purely the move now.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

I looked at the recent commits and I think we've basically reverted back to the version of the MR that I RTBCed on 8/4, with the addition of the fixture that re-adds a text-with-summary body field to the database. This looked OK to me and the update path test verifies that it's adding the field to the DB correctly. So let's try this again.

  • catch committed 617b3ed9 on main
    task: #3549134 Move text_with_summary to its own module
    
    By: smustgrave...
catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
Issue tags: +12.0.0 release notes

Gave this another read through. The update path looks fine to me, I have a slight concern about the entity config query in the hook_update_N() - what would happen if we made a big update to the config entity structure, but it's only querying for the existence of a config entity property, not trying to save anything, and it needs to be a hook_update_N() anyway.

Also slightly concerned what happens if a site updates directly from 11.4 to 12.0, which won't have the deprecated 11.x plugins available before updates running. I think we can very strongly recommend updating from 11.5 or higher to 12.0.0 in general and especially if you have text_with_summary fields though. Tagging for 12.0.0 release notes.

Committed/pushed to main, thanks! Will need a backport MR for 11.x

smustgrave’s picture

Status: Patch (to be ported) » Needs review

Okay this took a number of test updates for 11.x but all these tests are removed in main so may not matter? It's ugly but ultimately fixed

xmacinfo’s picture

Who will move the code to the text_with_summary project?

smustgrave’s picture

I’ll do the subtree split if it lands in 11.x and already have the namespace in contrib

catch’s picture

Status: Needs review » Reviewed & tested by the community

Backport looks fine to me - just adding #IgnoreDeprecations to a couple of updates tests that previously didn't need it but now do (because they'll load the deprecated plugin before the new module is installed - we've had that with similar search/help issues), and lots of migration tests that need to migrate into text_with_summary which is what you'd expect.

Moving to RTBC but will hold of committing until at least tomorrow in case someone is able to give it a second look over.

smustgrave changed the visibility of the branch 11.x to hidden.

smustgrave changed the visibility of the branch 3549134-deprecate-text-with-summary-missing to hidden.

smustgrave’s picture

@catch https://git.drupalcode.org/project/drupal/-/merge_requests/16927 is a small MR where I missed 2 tests with ignore. They doesn't trigger issues just noticed it.

smustgrave’s picture

Issue tags: +no-needs-review-bot

Just incase the bot gets confused this evening.

dcam’s picture

Per @catch's request in #45 I reviewed the backport. I mainly noticed the same things that were mentioned: updating Update and Migration tests. I also saw that the article_content_type and page_content_type recipes were updated. I'm assuming that's OK, but I don't actually know. I seem to recall recipe changes causing issues. So I figured I would note them. I'm not going to change the RTBC for it. Maybe a committer will have a better memory about it. Otherwise, all the same changes that were committed to main were added.

dcam’s picture

And it looks like MR 16927 brings main up to date with a couple of changes to 11.x.

catch’s picture

Went ahead and committed 16927 to main.

On the recipes, could we add text_with_summary as a dependency to those recipes in 11.x instead of changing the field type? That might be less of a bc break. There definitely was an issue updating a recipe in 11.x but I can't remember what it was. Don't really think we should treat recipes as API but it's a bit undefined so far.

  • catch committed 863dd3d0 on main
    task: #3549134 Move text_with_summary to its own module
    
    By: smustgrave...
smustgrave’s picture

done!

  • longwave committed daa66786 on 11.x
    task: #3549134 Move text_with_summary to its own module
    
    By: smustgrave...
longwave’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +11.5.0 release notes

Committed and pushed daa66786d24 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

smustgrave’s picture

Status: Fixed » Reviewed & tested by the community

Small typo and version

  • catch committed 2dbbdd8e on main
    task: #3549134 Move text_with_summary to its own module
    
    By: smustgrave...
catch’s picture

Status: Reviewed & tested by the community » Fixed

@smustgrave realised that we'd committed a 12001 update to 11.x. We could have renamed the 11.x version and used equivalent updates, but since text has no updates at all at the moment, we can just change it to 11001 in both versions.

Going ahead here so it definitely goes out before the beta.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • catch committed 94d3cee1 on 11.x
    task: #3549134 Move text_with_summary to its own module
    
    By: smustgrave...
gábor hojtsy’s picture

Issue summary: View changes

Adding release notes snippet. The removal to contrib with 12.0.0 which is in the deprecation is somewhat contradictory to @catch's suggestion in #39 to suggest users to update to 11.5 first before updating to 12.0. If there is a contributed module then the contrib module would/should also carry the update path no?

Either way, please review suggested release notes and adjust as appropriate.

catch’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

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

rozzi’s picture

What's the long-term plan for this field? We migrated from Drupal 6 to 11 not too long ago and now we have hundreds of nodes using the text_with_summary field format. Though the contrib mode will help once we upgrade to 12, as with every contrib module, it's not a given that it will be maintained for long. It's strange that Drupal is deprecating important components like this one, Search, Contact and so on.

smustgrave’s picture

FWIW I’m not retiring anytime soon

nicxvan’s picture

@rozzi the long term plan is for it to be in contrib. It's a field that the majority of users don't utilize and carried a fair amount of technical load evidenced by how complex it was to move to contrib.

For example I can't remember the last site I maintained that utilized it.

There are issues for the two modules you mentioned if you're interested, but the short answer is that they are features that have more powerful options in contrib already that see more use and with recipes it's easier than ever to manage.