This is a sub-issue of #1910606: Improve the configurations schemas for Views significantly.

Problem/motivation

#1866610: Introduce Kwalify-inspired schema format for configuration introduced some config schema coverage for views and #1910606: Improve the configurations schemas for Views significantly extended it, but it is not complete. The changelog leads to (hopefully extensive) documentation on the format at http://drupal.org/node/1905070. While there are little cleanups planned for the format overall, the current format is a result of months of back and forths, so it should be perfectly fine to apply it more widely to core.

Proposed solution

Figure out the missing pieces that are not yet covered. Write schema file sections for them. Clean up / fix any issues in current schema.

Create a configuration schema for missing view relationship.

Schema in place
Please refer core/modules/views/config/schema/views.relationship.schema.yml
Standard.php

Schema not yet in place
Broken.php
GroupwiseMax.php

Files: 
CommentFileSizeAuthor
#4 2019087-4-add-missing-schema-for-views-relationship.patch1012 bytesdropfen
PASSED: [[SimpleTest]]: [MySQL] 58,580 pass(es).
[ View ]

Comments

Assigned:Unassigned» gobilo

Assigned:gobilo» dropfen

We (dropfen & gobilo) are working on this, as we understand it right, we just need to add the following to the views.relationship.schema.yml file:

# Schema for the views relationship.
views.relationship.standard:
  type: views_relationship
  label: 'Standard'
//// THIS IS WHAT WE ADDED
views.relationship.broken:
  type: views_relationship
  label: 'Broken'
views.relationship.groupwise_max:
  type: views_relationship
  label: 'Groupwise Max'
  mapping:
    subquery_sort:
      type: string
      label: 'Representative sort criteria'
    subquery_order:
      type: string
      label: 'Representative sort order'
    subquery_regenerate:
      type: boolean
      label: 'Generate subquery each time view is run.'
    subquery_view:
      type: string
      label: 'Representative view'
    subquery_namespace:
      type: string
      label: 'Subquery namespace'

Can we get short feedback, so we can create the patch?

StatusFileSize
new1012 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,580 pass(es).
[ View ]

Here's the patch.
From dropfen & gobilo

Status:Active» Needs review

Change status.

+++ b/core/modules/views/config/schema/views.relationship.schema.yml
@@ -3,3 +3,27 @@
+    subquery_sort:
+      type: string
+      label: 'Representative sort criteria'
+    subquery_order:
+      type: string
+      label: 'Representative sort order'
+    subquery_regenerate:
+      type: boolean
+      label: 'Generate subquery each time view is run'
+    subquery_view:
+      type: string
+      label: 'Representative view'
+    subquery_namespace:
+      type: string
+      label: 'Subquery namespace'

Do you know whether these options has to be in the same order as the actual form?

Status:Needs review» Reviewed & tested by the community

@dawehner, it would be nice, if we can have same order, but IMHO, config changes the order of fields on update. It should be fine, until the keys are in the proper intention. It looks good to me.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

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