Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Scenario:
- Anonymous user is able to post nodes.
- Two custom text formats are configured:
format1
andfromat2
. - Only
format1
is usable by Anonymous - Limit allowed text formats is checked. Both and only,
format1
andformat2
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
andformat2
(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
- Fix the bug.
- Add also the missed schema for field config.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2894822-7.patch | 4.3 KB | claudiu.cristea |
| |||
#7 | 2894822-7.interdiff.txt | 1.09 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaAdding the test-only patch. Also, the schema was missed for the field 3rd party settings.
Comment #3
claudiu.cristeaIn the previous patch the test namespace was wrong.
Here's the complete patch and the test-only patch.
Comment #4
claudiu.cristeaComment #5
claudiu.cristeaComment #6
claudiu.cristeaAn item from
allowed_formats
can be a string or an integer. Fix the schema.Comment #7
claudiu.cristeaAlso the weight has problems.
Comment #8
claudiu.cristeaHm. 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.