Problem/Motivation

Drupal 11.5 deprecated the text_with_summary field type and moved it to a deprecated core module, which is removed from Drupal 12 (change record). It continues as the contrib project Text with Summary.

The product body field uses text_with_summary, so on Drupal 12 every test installing commerce_product fails with "The text_with_summary plugin does not exist". The summary is not even used: the field has display_summary: false.

Core made the same move: body fields created by core (block content, BodyFieldCreationTrait) use text_long.

Proposed resolution

  • New installs: switch the product body field storage/config to text_long, with the text_textarea widget.
  • commerce_product_add_body_field(): reuse the type of the existing body field storage when there is one, so new product types on existing sites keep working; only use text_long when the storage is created.

Existing sites: no Commerce update needed. Drupal core 11.5 already installs the text_with_summary module when such fields exist. Before upgrading to Drupal 12, sites need the contrib module (composer require drupal/text_with_summary), just like for their node body fields. This goes in the 4.0.0 release notes.

Remaining tasks

  • Update config and commerce_product_add_body_field().
  • Add a release note.

User interface changes

None (the summary was already hidden).

API changes

None.

Data model changes

New installs get a text_long product body field instead of text_with_summary. Existing fields are unchanged.

Issue fork commerce-3638856

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

jsacksick created an issue. See original summary.

  • jsacksick committed acf85723 on 4.x
    chore: #3638856 Use text_long for the product body field on new installs
    
jsacksick’s picture

Status: Active » Fixed

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.