Problem/Motivation

Scenario:

  • Anonymous user is able to post nodes.
  • Two custom text formats are configured: format1 and fromat2.
  • Only format1 is usable by Anonymous
  • Limit allowed text formats is checked. Both and only, format1 and format2 text formats are configured as Allowed formats in the node body field.
  • The anonymous user goes to add node form. Based on above configuration, is expected that the text format selector is hidden because, for anonymous, there are only only 2 eligible text formats, format1 and format2 (Better Formats field setting), and from the two, anonymous can access only one: format1. One format available means no selector. The selector is correctly hidden.
  • When the user post the form he'll get validation error: The value you selected is not a valid choice.

This bug is revealed by the attached test-only patch.

Proposed resolution

  1. Fix the bug.
  2. Add also the missed schema for field config.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
3.53 KB

Adding the test-only patch. Also, the schema was missed for the field 3rd party settings.

claudiu.cristea’s picture

In the previous patch the test namespace was wrong.

Here's the complete patch and the test-only patch.

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

An item from allowed_formats can be a string or an integer. Fix the schema.

claudiu.cristea’s picture

FileSize
1.09 KB
4.3 KB

Also the weight has problems.

claudiu.cristea’s picture

Status: Needs review » Postponed (maintainer needs more info)
Related issues: +#2895045: Provide config schema for field 3rd party settings

Hm. I'm not sure anymore about the solution here. Postponing this but the field config 3rd party settings are still needed, so I split that into #2895045: Provide config schema for field 3rd party settings.