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 row.

Schema in place
Please refer core/modules/views/config/schema/views.row.schema.yml
Fields.php

Schema not yet in place
RssFields.php
EntityRow.php derivatives: CommentRow.php, NodeRow.php and UserRow.php

Steps to review

Check Steps to check on meta.

Files: 
CommentFileSizeAuthor
#24 Screen Shot 2013-12-08 at 18.25.20.png53.74 KBvijaycs85
#24 2019091-config-schema-views-row-24.patch2.82 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 59,316 pass(es). View
#24 2019091-diff-20-24.txt2.19 KBvijaycs85
#20 2019091-config-schema-views-row-19.patch2.56 KBianthomas_uk
PASSED: [[SimpleTest]]: [MySQL] 59,257 pass(es). View
#20 2019091-15-19-interdiff.txt2.01 KBianthomas_uk
#15 2019091-diff-14-15.txt794 bytesvijaycs85
#15 2019091-views-row-15.patch1.04 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] 59,093 pass(es), 2 fail(s), and 1 exception(s). View
#14 2019091-config-schema-views-row-14.patch1.42 KBianthomas_uk
PASSED: [[SimpleTest]]: [MySQL] 59,364 pass(es). View
#14 2019091-11-14-interdiff.txt1.39 KBianthomas_uk
#11 2019091-config-schema-views-row-11.patch1.48 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 57,523 pass(es). View
#11 2019091-diff-9-11.txt493 bytesvijaycs85
#9 2019091-config-schema-views-row-9.patch1.48 KBvijaycs85
FAILED: [[SimpleTest]]: [MySQL] 56,083 pass(es), 37 fail(s), and 9 exception(s). View
#5 views-row-configuration-schemas-for-views-row-2019091-4.patch1.47 KBashwinikumar
FAILED: [[SimpleTest]]: [MySQL] 55,872 pass(es), 37 fail(s), and 9 exception(s). View
#3 views_row-configuration-schemas-for-views-row-2019091-#3.patch1.47 KBashwinikumar
FAILED: [[SimpleTest]]: [MySQL] Fetch test patch: failed to retrieve [views_row-configuration-schemas-for-views-row-2019091-#3.patch] from [drupal.org]. View

Comments

manu4543’s picture

Assigned: Unassigned » manu4543
manu4543’s picture

Assigned: manu4543 » Unassigned
ashwinikumar’s picture

Assigned: Unassigned » ashwinikumar
Status: Active » Needs review
FileSize
1.47 KB
FAILED: [[SimpleTest]]: [MySQL] Fetch test patch: failed to retrieve [views_row-configuration-schemas-for-views-row-2019091-#3.patch] from [drupal.org]. View

I have added configuration of EntityRow.php and RssFields.php in core/modules/views/config/schema/views.row.schema.yml

Status: Needs review » Needs work

The last submitted patch, views_row-configuration-schemas-for-views-row-2019091-#3.patch, failed testing.

ashwinikumar’s picture

Status: Needs work » Needs review
FileSize
1.47 KB
FAILED: [[SimpleTest]]: [MySQL] 55,872 pass(es), 37 fail(s), and 9 exception(s). View

Patch updated. Please review.

Status: Needs review » Needs work
Issue tags: -Configuration system, -D8MI, -language-config, -VDC, -Configuration schema, -views configuration schema

The last submitted patch, views-row-configuration-schemas-for-views-row-2019091-4.patch, failed testing.

ashwinikumar’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Configuration system, +D8MI, +language-config, +VDC, +Configuration schema, +views configuration schema

The last submitted patch, views-row-configuration-schemas-for-views-row-2019091-4.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.48 KB
FAILED: [[SimpleTest]]: [MySQL] 56,083 pass(es), 37 fail(s), and 9 exception(s). View

@ashwinikumar, the problem seems to be tab vs space.

Status: Needs review » Needs work

The last submitted patch, 2019091-config-schema-views-row-9.patch, failed testing.

vijaycs85’s picture

Assigned: ashwinikumar » Unassigned
Status: Needs work » Needs review
Issue tags: +LONDON_2013_JULY
FileSize
493 bytes
1.48 KB
PASSED: [[SimpleTest]]: [MySQL] 57,523 pass(es). View

Updating space issue...

ianthomas_uk’s picture

This config will not exist on a fresh install of Drupal.

The RssFields.php settings can be accessed by editing the feed display of a view, e.g. add /admin/structure/views/view/frontpage/edit/feed_1. Under FORMAT, ensure Format: is RSS Feed, and Show: is Fields. These options are then on the following settings form.

In my testing the options were saved but were not exported, so there may be a bug there.

vijaycs85’s picture

Issue summary: View changes

Updated issue summary.

dawehner’s picture

@ianthomas_uk Can you please verify whether this issue needs some work?

ianthomas_uk’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
1.39 KB
1.42 KB
PASSED: [[SimpleTest]]: [MySQL] 59,364 pass(es). View

I can't reproduce the problem I was having before (I think I meant that my changes were showing in the UI, but had no effect on the config files).

In #11 the schema for views.row.rssfields reflected the types of data that would be returned in the RSS feed, but it should actually represent where this data should come from (so most of the settings are field names). I've attached an updated patch that corrects this.

I'm not sure how to EntityRow, as I couldn't work out how to create an appropriate view. I think it's intended as a base class and doesn't have any implementations in core. The schema's definitely wrong though, as it's based on the variables in init() instead of defineOptions().

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.04 KB
FAILED: [[SimpleTest]]: [MySQL] 59,093 pass(es), 2 fail(s), and 1 exception(s). View
794 bytes

Thanks for the update @ianthomas_uk. Seems EntityRow is a baseClass and it might not have it's own row. So removing it.

ianthomas_uk’s picture

Issue summary: View changes

Thanks @vijaycs85. I thought it should probably just be removed but needed a second opinion. I've updated the summary to reflect this.

I can confirm that #15 is my patch from #14 minus the changes for EntityRow.php.
If you review my changes for RssFields.php are we able to mark this RTBC between us, or do we need a third person?

dawehner’s picture

So, does that mean that something like entity_row:node won't have properties, as it is automatically added via the derivative class?

ianthomas_uk’s picture

Issue summary: View changes
Status: Needs review » Needs work

Thanks dawehner.

Looking at this again, the views module should provide the schema for the view_mode option, and each of the Comment and Node modules should provide the schema for the links option (which they define independently). The action module has an example of a module extending the schema of another.

To expose the configuration for NodeRow I set Format: HTML list, Show: Content.

ianthomas_uk’s picture

Issue summary: View changes

Here's an improved patch: I've corrected the key for rss fields and added the EntityRow schemas. Node and comment seem to be working, but user is still showing as unknown in the config inspector and I'm not sure why. I've also spotted lots more classes that extend RowPluginBase that I think we need to provide schema for (listed in the summary).

ianthomas_uk’s picture

FileSize
2.01 KB
2.56 KB
PASSED: [[SimpleTest]]: [MySQL] 59,257 pass(es). View

The patch files might help...

vijaycs85’s picture

Status: Needs work » Postponed
Related issues: +#2152345: Change views row plugin key to make config schema clean
vijaycs85’s picture

Status: Postponed » Needs review

After the discussion between @ianthomas_uk, @dawehner and @vijaycs85, going to move forward with current implementation (i.e. views.row.entity:node) and will revisit once #2035345: Reconsider whether to use ':' as separator for derivative plugins is in...

vijaycs85’s picture

FileSize
2.19 KB
2.82 KB
PASSED: [[SimpleTest]]: [MySQL] 59,316 pass(es). View
53.74 KB

Few updates and config inspector screenshot...

vijaycs85’s picture

Issue summary: View changes

Will cover below row plugins in it's module specific issue:

Drupal\aggregator\Plugin\views\Rss
Drupal\comment\Plugin\views\row\Rss
Drupal\node\Plugin\views\row\Rss
Drupal\rest\Plugin\views\row\DataEntityRow
Drupal\rest\Plugin\views\row\DataFieldRow
Drupal\search\Plugin\views\row\SearchRow
Drupal\views_test_data\Plugin\views\row\RowTest

ianthomas_uk’s picture

I can't RTBC this patch as I wrote lots of it, but I did want to mention a couple of things in vijaycs85's changes.

  1. --- /dev/null
    +++ b/core/modules/comment/config/schema/comment.view.schema.yml
    

    vijaycs85 explained that this matches the filename convention for schema files. I'm happy to follow the convention, but this is different to the pattern used to provide default config where the filename would start with the name of the module that you were extending and be in the module that is doing the extending, so it is only available if both are installed.

  2. +++ b/core/modules/node/config/schema/node.view.schema.yml
    @@ -0,0 +1,15 @@
    +# Schema for the views plugins of the Views module.
    

    +1 for the comment, but it should be Node module.

dawehner’s picture

Status: Needs review » Needs work

Yeah let's mark this as work, though at the same time think about adding a follow up to support the usecase here for schema as well.

vijaycs85’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2167623: Add test for all default configuration to ensure schema exists and is correct

The patch on this issue has been updated as part of #2167623: Add test for all default configuration to ensure schema exists and is correct. As this issue doesn't have any test to confirm/validate the schema, making this change and closing this issue as duplicate of #2167623: Add test for all default configuration to ensure schema exists and is correct. The contributors of this issue (in commit message) is copied to #2167623: Add test for all default configuration to ensure schema exists and is correct.