Problem/Motivation

The default values of text fields do not use the text_format schema type which was introduced in #2144413: Config translation does not support text elements with a format. This means that the default value of text fields can not be properly translated currently.

Note that this is not only a UX problem (i.e. no CKEditor for translators) but can also lead to security problems.

Proposed resolution

Use the text_format schema type where appropriate.

The text_with_summary field type has a slightly different structure (i.e. it has an additional summary key) so a dedicated schema type is introduced for that. In order to leverage that, a dedicated Config Translation form element is added, to allow that to be translated. Note that this could be split off and handled in a follow-up.

Remaining tasks

User interface changes

Default values of text fields can be translated using a text editor.

API changes

The schema structure of text fields changes (specifically of the default value declaration). Note that the config structure itself does not change!

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because default values of text fields cannot be translated with the Config Translation module without this
Issue priority Normal
Unfrozen changes Not unfrozen
Prioritized changes The main goal of this issue is usability and security.
Disruption Because the actual config structure does not change I cannot possibly fathom whom this would "disrupt". Because the configuration schema structure changes, it is an API change, however, strictly speaking.
Files: 
CommentFileSizeAuthor
#4 config-translation-text-with-summary.png61.3 KBtstoeckler
#4 2381147-3-text-field-default-value-schema-text-format.patch7.43 KBtstoeckler
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,742 pass(es). View

Comments

tstoeckler’s picture

Assigned: Unassigned » tstoeckler

I'm actually working on this. If I haven't managed to post a patch in ~3 days or something feel free to take this over.

tstoeckler’s picture

Issue tags: +D8MI, +language-config, +sprint
Gábor Hojtsy’s picture

Changes config schema, so D8 upgrade path tag should be on.

tstoeckler’s picture

Status: Active » Needs review
FileSize
7.43 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 81,742 pass(es). View
61.3 KB

Here we go.

Some problems:

  1. This can not be tested currently with the text field type (only the text_long and text_with_summary types) due to #2348459: Fields of type 'Text (formatted)' do NOT save values..
  2. Configuration Translation's form generation is broken for sequences with multiple items. I will open a separate issue for that.
  3. We do not currently generate any sensible labels for sequences, we just duplicate the same one each time. I will open a separate issue for that.
  4. The Hide summary/Show summary link should not be displayed for a disabled textarea it makes no sense. Will open a separate issue for that.

See also the attached screenshot for some context:
A screenshot of the Configuration Translation UI to translate the default value of a text field with a summary

Re #3: How specifically is this related to the upgrade path, I don't understand that?

Edit: Duplicate post

Gábor Hojtsy’s picture

Issue tags: -D8 upgrade path

Ok this does not actually change the config data structure like #2144505: Views does not use the text format type for formatted text, so this does not need the D8 upgrade path tag. I assumed it will change the data structure, but looks like it does not.

Gábor Hojtsy’s picture

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

#2348459: Fields of type 'Text (formatted)' do NOT save values. landed. Should be possible to write tests for this now?

Gábor Hojtsy’s picture

Title: Use 'text_format' schema type for text field default values » Text and text with summary field default value config does not use the text_format schema type
Gábor Hojtsy’s picture

@tstoeckler: still working in this one or should we look for someone else to finish?

Gábor Hojtsy’s picture

Issue tags: -sprint

Unfortunately not being actively worked on so removing from sprint.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.