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.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3549134
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:
- 3549134-typo
changes, plain diff MR !16960
- 3549134-deprecate-text-with-summary-backport2
changes, plain diff MR !16925
- 3549134-deprecate-text-with-summary-missing
changes, plain diff MR !16927
- 3549134-deprecate-text-with-summary-backport
changes, plain diff MR !16924
- 11.x
compare
- 3549134-deprecate-text-with-summary
changes, plain diff MR !14415
- 3549134-p-3-move-textwithsummary
changes, plain diff MR !13329
Comments
Comment #2
smustgrave commentedComment #5
smustgrave commentedComment #7
berdirwe 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.
Comment #8
cilefen commentedI fixed an its vs it’s typo in the title.
Comment #9
smustgrave commentedOnly added field as there is already a contrib module called text_with_summary
Comment #11
smustgrave commentedMost 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.
Comment #12
smustgrave commentedAlso a bunch of update test figures require it ugh, so not sure if we gotta wait for those to update too
Comment #13
smustgrave commentedMigrations have been removed!
Comment #14
smustgrave commentedNow this is postponed on test fixtures being updated.
Comment #15
smustgrave commentedThis actually isn't postponed.
Comment #16
smustgrave commentedThis is ready for eyes.
Comment #17
dcam commentedI 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:
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.
Comment #18
smustgrave commentedPushed an upgrade path test, apparently the text_post_update_update_field_storage_dependencies needed more work and was causing the others to fail.
Comment #19
smustgrave commented>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.
Comment #20
dcam commentedThanks 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.
Comment #21
catchCouple of questions on the MR.
Comment #22
smustgrave commentedFeedback addressed, free to RTBC?
Comment #23
dcam commentedThe 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.
Comment #24
catchHelpNoSearchUpgradeTest 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.
Comment #25
smustgrave commentedI 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
Comment #26
smustgrave commentedWill update the fixtures in the morning, leaving assigned to myself.
Comment #27
mradcliffeI un-gzipped
drupal-11.3.0-filled.standard.phpon 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
bodytofield_bodyin the dump, which made it hard to review the changes. Should that field name have changed if testing from 11.3.0?Comment #28
smustgrave commentedHad to use drush commands to delete the storage config for body as they use to persist.
Comment #29
smustgrave commented@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
Comment #30
ironnuts commentedMade a couple of additions to the CR. Added a few words for clarity.
Comment #31
nicxvan commented@oily, I'm a little confused by your CR edit:
It's not a contrib module, it's a core module that will be deprecated and moved to contrib at some point.
Comment #32
needs-review-queue-bot commentedThe 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.
Comment #33
smustgrave commentedComment #34
dcam commentedI 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:
The "filled" dump file has different issues. The field storage tables for the old text-with-summary fields,
block_content__bodyandnode__bodyare 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 wasfield_test_14on 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.Comment #35
catchThat sounds like it would be absolutely fine.
Comment #36
smustgrave commentedWith the updates fixtures ticket in this should be purely the move now.
Comment #37
dcam commentedI 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.
Comment #39
catchGave 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
Comment #42
smustgrave commentedOkay 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
Comment #43
xmacinfoWho will move the code to the
text_with_summaryproject?Comment #44
smustgrave commentedI’ll do the subtree split if it lands in 11.x and already have the namespace in contrib
Comment #45
catchBackport 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.
Comment #49
smustgrave commented@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.
Comment #50
smustgrave commentedJust incase the bot gets confused this evening.
Comment #51
dcam commentedPer @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.
Comment #52
dcam commentedAnd it looks like MR 16927 brings main up to date with a couple of changes to 11.x.
Comment #53
catchWent ahead and committed
16927to 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.
Comment #55
smustgrave commenteddone!
Comment #57
longwaveCommitted and pushed daa66786d24 to 11.x. Thanks!
Comment #60
smustgrave commentedSmall typo and version
Comment #62
catch@smustgrave realised that we'd committed a
12001update 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.
Comment #65
gábor hojtsyAdding 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.
Comment #66
catchComment #68
rozzi commentedWhat'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.
Comment #69
smustgrave commentedFWIW I’m not retiring anytime soon
Comment #70
nicxvan commented@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.