Problem/Motivation
As part of being able to deprecate and eventually remove text_with_summary, we need to stop calling node_add_body_field() in a number of places. One of the best places to start would be NodeTypeForm.
Proposed resolution
Remove all calls to node_add_body_field() from NodeTypeForm
User interface changes
When a user creates a content type in the UI, that content type will no longer have a body field automatically attached to it.
API changes
None.
Data model changes
None.
Release notes snippet
TBD
Issue fork drupal-3488742
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:
- 3488742-stop-calling-nodeaddbodyfield
changes, plain diff MR !10275
Comments
Comment #2
phenaproximaComment #3
phenaproximaAlright, started an MR. Let's see what breaks.
Comment #5
catchDiscussed this briefly with @Gábor Hojtsy in slack and he approved this change from a product manager perspective. It changes what happens with the form, but since the field is already deletable it doesn't affect other expectations outside the UI.
Comment #6
phenaproximaComment #7
phenaproximaOK, so all PHP tests are now passing but Nightwatch tests are failing because they need to manually add the body field after creating a new content type. I have no Nightwatch experience.
Comment #8
catchTried clicking the button in a different way etc. but did not really get anywhere.
Comment #9
gábor hojtsyI think this makes sense, it fits into the philosophy we are taking Drupal core towards, being more of an enabler that other layers can rely on, not trying to be a complete solution.
Comment #10
alexpottCan we get a follow-up to fix the nightwatch tests. I will do that but after we land this.
We also need a change record so we can highlight the behaviour change in the 11.1 release. Drupal has added a body field for you for a very long time.
Comment #11
phenaproximaWell that certainly is a workaround. :) I feel okay RTBCing this because it's different than the approach I took. Effectively a different patch.
This is important for the future of Drupal CMS so, knowing that we have follow-up issues in place to address this properly and to deprecate/remove this accursed function, and that if we don't do this now, we won't get another chance until 11.2...
...let it fly.
Comment #12
catchHere's the follow-up #3489266: Deprecate node_add_body_field().
I can draft the CR now too.
Comment #13
alexpottAdding issue credit.
Comment #14
alexpottCommitted and pushed dd2982b5324 to 11.x and c4e3cfcfe05 to 11.1.x. Thanks!
Comment #18
acbramley commentedCreated those follow ups for Nightwatch tests which are needed now for #3489266: Deprecate node_add_body_field()
#3517023: Convert ckEditor5CodeSyntaxTest to WebDriver test
#3517024: Convert ckEditor5EditorHeightTest to WebDriver test