From a02a96df71597b2e40aaf491474bd1f4b10fa22d Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Sun, 22 Dec 2013 14:09:32 -0800
Subject: [PATCH] Issue #1983902 by vijaycs85, swentel, piyuesh23: Provide
 config schema to field types, widgets and storage in entity_reference module.

---
 .../config/schema/entity_reference.schema.yml | 68 +++++++++++++++++++
 .../schema/views.entity_reference.schema.yml  | 22 ++++++
 2 files changed, 90 insertions(+)
 create mode 100644 core/modules/entity_reference/config/schema/entity_reference.schema.yml
 create mode 100644 core/modules/views/config/schema/views.entity_reference.schema.yml

diff --git a/core/modules/entity_reference/config/schema/entity_reference.schema.yml b/core/modules/entity_reference/config/schema/entity_reference.schema.yml
new file mode 100644
index 000000000000..0abe2b9f9226
--- /dev/null
+++ b/core/modules/entity_reference/config/schema/entity_reference.schema.yml
@@ -0,0 +1,68 @@
+# Schema for the configuration files of the Entity Reference module.
+
+field.entity_reference.settings:
+  type: mapping
+  label: 'Settings'
+  mapping:
+    target_type:
+      type: string
+      label: 'Type of item to reference'
+
+field.entity_reference.instance_settings:
+  type: mapping
+  label: 'Entity reference settings'
+  mapping:
+    handler:
+      type: string
+      label: 'Reference method'
+    handler_settings:
+      type: entity_reference.[%parent.handler].handler_settings
+      label: 'Reference method settings'
+
+field.entity_reference.value:
+  type: sequence
+  label: 'Default value'
+  sequence:
+    - type: mapping
+      label: 'Default'
+      mapping:
+        target_id:
+          type: integer
+          label: 'Value'
+
+entity_reference.default.handler_settings:
+  type: mapping
+  label: 'View handler settings'
+  mapping:
+    target_bundles:
+      type: sequence
+      label: 'types'
+      sequence:
+        - type: string
+          label: 'Type'
+    sort:
+      type: mapping
+      label: 'Sort settings'
+      mapping:
+        field:
+          type: string
+          label: 'Sort by'
+        direction:
+          type: string
+          label: 'Sort direction'
+    filter:
+      type: mapping
+      label: 'Filter settings'
+      mapping:
+        type:
+          type: string
+          label: 'Filter by'
+        role:
+          type: sequence
+          label: 'Restrict to the selected roles'
+          sequence:
+            - type: string
+              label: 'Role'
+    auto_create:
+      type: boolean
+      label: 'Create referenced entities if they don''t already exist'
diff --git a/core/modules/views/config/schema/views.entity_reference.schema.yml b/core/modules/views/config/schema/views.entity_reference.schema.yml
new file mode 100644
index 000000000000..306704139a8b
--- /dev/null
+++ b/core/modules/views/config/schema/views.entity_reference.schema.yml
@@ -0,0 +1,22 @@
+# Schema for the views entity reference selection plugins.
+
+entity_reference.views.handler_settings:
+  type: mapping
+  label: 'View handler settings'
+  mapping:
+    view:
+      type: mapping
+      label: 'View used to select the entities'
+      mapping:
+        view_name:
+          type: string
+          label: 'View name'
+        display_name:
+          type: string
+          label: 'Display name'
+        arguments:
+          type: sequence
+          label: 'View arguments'
+          sequence:
+            - type: string
+              label: 'Argument'
-- 
GitLab