Convert field_storage_config and field_config's form validation logic to validation constraints

Created on 28 November 2022, about 2 years ago
Updated 13 March 2024, 9 months ago

Problem/Motivation

As long as field_storage_config and field_config are not validatable (see #2164373-28: [META] Untie config validation from form validation โ€” enables validatable Recipes, decoupled admin UIs โ€ฆ โ†’ , it will be difficult to build a "Field UI 2.0" with confidence, and we definitely won't be able to create such a thing as a decoupled JS application.

This would also allow us to remove the following in \Drupal\Tests\field\Kernel\FieldStorageCrudTest:

  // TODO : test creation with
  // - a full fledged $field structure, check that all the values are there
  // - a minimal $field structure, check all default values are set
  // defer actual $field comparison to a helper function, used for the two cases above

Proposed resolution

Remove form-coupled validation logic from:

โ€ฆ and keep the existing test coverage the same, at most expand it.

Note that additional validation constraints will be necessary beyond what already exists, because a form-based UI only allows certain inputs, not arbitrary inputs, which are possible via an API.

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Fieldย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024