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 image module.
Schema in place
field.image.settings

Note: Part of main field schema patch at #1953404: Add config schema to field and instance config entities
Schema not yet in place
field.image.instance_settings
field.image.value
field_widget.image_image.settings

Files: 
CommentFileSizeAuthor
#27 1973436-config-schema-field-image-27.patch5.07 KBclaudiu.cristea
PASSED: [[SimpleTest]]: [MySQL] 59,300 pass(es).
[ View ]
#27 interdiff.txt1.17 KBclaudiu.cristea
#14 1973436-config-schema-field-image-14.patch4.46 KBclaudiu.cristea
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
#11 1973436-config-schema-field-image-11.patch3.69 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 59,402 pass(es).
[ View ]
#11 1973436-diff-8-11.txt951 bytesvijaycs85
#11 Screen Shot 2013-12-09 at 19.08.19.png61.59 KBvijaycs85
#8 1973436-config-schema-field-image-8.patch3.43 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 59,289 pass(es).
[ View ]
#4 1973436-config-schema-field-image-4.patch3.63 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 54,529 pass(es).
[ View ]
#1 1973436-config-schema-field-image-1.patch1.71 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1973436-config-schema-field-image-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 field.field_.user_picture.form_.png37.75 KBvijaycs85
#1 field.instance.user_.user_.user_picture.form_.png54.03 KBvijaycs85

Comments

Status:Active» Needs review
StatusFileSize
new54.03 KB
new37.75 KB
new1.71 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1973436-config-schema-field-image-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Initial patch...

Status:Needs review» Needs work

The last submitted patch, 1973436-config-schema-field-image-1.patch, failed testing.

Status:Needs work» Postponed

Component:field system» image system
Status:Postponed» Needs review
StatusFileSize
new3.63 KB
PASSED: [[SimpleTest]]: [MySQL] 54,529 pass(es).
[ View ]

Removing image module changes from main issue and adding here...

Title:Provide config schema to field types, widgets and storage for image moduleProvide config schema to field types storage for image module
Status:Needs review» Needs work

Widget needs to go out after #1875992: Add EntityFormDisplay objects for entity forms got in.

Any news here? Is this still needed?

Assigned:Unassigned» claudiu.cristea

Let's rework this.

Issue summary:View changes
Status:Needs work» Needs review
StatusFileSize
new3.43 KB
PASSED: [[SimpleTest]]: [MySQL] 59,289 pass(es).
[ View ]

Updating with re-roll and removed widget...

Issue tags:+LONDON_2013_DECEMBER

Updating with re-roll and removed widget...

Status:Needs review» Needs work
  1. +++ b/core/modules/image/config/schema/image.schema.yml
    @@ -89,3 +83,96 @@ image.settings:
    +    default_image:
    +      type: string
    +      label: 'Default image'
    ...
    +    default_image:
    +      type: boolean
    +      label: 'Default image'

    Default image default_image is no more a simple value (anyway it was wrongly casted here as 'string' and 'bool'). It has been converted to associative array in #1443606: Alt, title, width and height for default images.

  2. +++ b/core/modules/image/config/schema/image.schema.yml
    @@ -89,3 +83,96 @@ image.settings:
    +    user_register_form:
    +      type: boolean
    +      label: 'Display on user registration form.'

    user_register_form has gone along with #2049485: Remove traces of the 'user_register_form' field setting and we shouldn't reintroduce it here.

Status:Needs work» Needs review
StatusFileSize
new61.59 KB
new951 bytes
new3.69 KB
PASSED: [[SimpleTest]]: [MySQL] 59,402 pass(es).
[ View ]

Thanks for the review @claudiu.cristea. Addressing both issues in #10 and attaching verified config_inspector screenshot.

Status:Needs review» Needs work

+    default_image:
+      type: string
+      label: 'Default image'

BUSTED :D, needs to be a mapping

Status:Needs work» Needs review

+++ b/core/modules/image/config/schema/image.schema.yml
@@ -89,3 +83,109 @@ image.settings:
+    default_image:
+      type: mapping
+      label: 'Default image'
+      mapping:
+        fid:
+          type: integer
+          label: 'Image'
+        alt:
+          type: label
+          label: 'Alternate text'
+        title:
+          type: label
+          label: 'Title'
+        width:
+          type: integer
+          label: 'Width'
+        height:
+          type: integer
+          label: 'Height'
+

here is mapping?

StatusFileSize
new4.46 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
new869 bytes

Here :)

Hmm isn't that mapping part of field.image.value ?
(so that we can reference it as image type)

Partly guessing here, not sure how config schemas relate to field defintions

StatusFileSize
new6.78 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
new1.9 KB

Ok, then this looks better

The last submitted patch, 14: 1973436-config-schema-field-image-14.patch, failed testing.

The last submitted patch, 16: 1973436-config-schema-field-image-16.patch, failed testing.

StatusFileSize
new3.99 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
new1.9 KB

Wrong generated patch. Here we go.

+++ b/core/modules/image/config/schema/image.schema.yml
@@ -89,3 +83,105 @@ image.settings:
+field.image.default:

Can we make this as content type by adding in image.data_type.schema.yml with key as field_image_default

+++ b/core/modules/image/config/schema/image.schema.yml
@@ -92,24 +92,8 @@ field.image.settings:
+      type: field.image.default

Not sure we can use type like this. We always keep content type with underscore than schema definition...

StatusFileSize
new5.07 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
new2.8 KB

The last submitted patch, 19: 1973436-config-schema-field-image-19.patch, failed testing.

The last submitted patch, 19: 1973436-config-schema-field-image-19.patch, failed testing.

StatusFileSize
new5.07 KB
PASSED: [[SimpleTest]]: [MySQL] 59,300 pass(es).
[ View ]
new301 bytes

The last submitted patch, 21: 1973436-config-schema-field-image-21.patch, failed testing.

Looks good to me, except one minor suggestion...

+++ b/core/modules/image/config/schema/image.data_types.schema.yml
@@ -0,0 +1,30 @@
+field_image_default:

may be field_default_image?

StatusFileSize
new1.17 KB
new5.07 KB
PASSED: [[SimpleTest]]: [MySQL] 59,300 pass(es).
[ View ]

OK :)

Status:Needs review» Reviewed & tested by the community

Good to go...

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

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