Follow up for #1953404: Add config schema to field and instance config entities

Problem/motivation

#1866610: Introduce Kwalify-inspired schema format for configuration introduced the idea of config schema. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. As a part of schema addition to field module(#1953404: Add config schema to field and instance config entities), found that we have to provide schema for field types, field widgets and field storage.

Proposed solution

Create a configuration schema for field types, field widget and field storage (if applicable) defined in options module.
Schema in place

Schema not yet in place
field.list_integer.settings
field.list_integer.instance_settings
field.list_integer.value

field.list_float.settings
field.list_float.instance_settings
field.list_float.value

field.list_text.settings
field.list_text.instance_settings
field.list_text.value

field.list_boolean.settings
field.list_boolean.instance_settings
field.list_boolean.value

field_widget.options_select.settings
field_widget.options_buttons.settings
field_widget.options_onoff.settings
field_widget.options_list.settings

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Component: field system » options.module
vijaycs85’s picture

vyasamit2007’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
26.66 KB
29.1 KB
37.92 KB
  • The Patch applied properly.
  • The Patch changes are and working as expected.
  • The listed screenshots above are working fine.
  • The new screenshots below are for list_text, datetime and File fields.
Gábor Hojtsy’s picture

Issue tags: +sprint

Putting on sprint for tracking :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wow. This was a much bigger patch than I was picturing when I clicked into this issue. :) Nevertheless, looks good in my quick eyeball, and it looks like it was very thoroughly tested, so good job for that.

Committed and pushed to 8.x. Thanks!

yched’s picture

Thanks @vijaycs85 !

+++ b/core/modules/options/config/schema/options.schema.ymlundefined
@@ -0,0 +1,174 @@
+    allowed_values_function_display:
+      type: string
+      label: 'Allowed values function display'

This doesn't correspond to any actual setting.
Did you include it because you find it saved in actual CMI files ? That would be a bug...

yched’s picture

Status: Fixed » Needs review
FileSize
1.43 KB

Hm, right, 'allowed_values_function_display' is just an informational '#type' => 'item' element in the field settings $form, but this ends up as an empty string in the submitted form values.

I opened #1985386: Crufty 'allowed_values_function_display' ends up in list field stored config for this. Meanwhile, we should remove those entries.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Good to go.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

The role of the schema is to describe the data format as is available, not to describe what we want it to be. The schema sections should be removed as the data itself is fixed in #1985386: Crufty 'allowed_values_function_display' ends up in list field stored config . Removing it prior would leave that unexplained. I'm going to upload this patch there so it can continue from there.

Gábor Hojtsy’s picture

@vyasamit2007: can you help review the numerous other schema issues for fields at http://drupal.org/project/issues/search/drupal?issue_tags=Field%20config...? That would be amazing! Thanks!

Gábor Hojtsy’s picture

Issue tags: -sprint

Remove sprint tag.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.