Views content language field default configuration should use field_language plugin

Created on 6 July 2024, 7 days ago
Updated 10 July 2024, 3 days ago

Problem/Motivation

views.view.content.yml uses 'field' as the plugin for the language field, yet 'field_language' plugin exists for this purpose
(and is used because of overrides in views_data anyways). The config should match the result rather than relying on an
override here (ie, the config should match that field_language plugin is used.

The schema should be updated to match.

This was revealed as a symptom of the problem being addressed in πŸ› Views handler loading should respect configuration Active and was suggested by @catch to tackle in a separate issue.

Steps to reproduce

This was revealed as a symptom of the problem being addressed in πŸ› Views handler loading should respect configuration Active , if the views handler manager respects the configuration, then this view configuration would have issues.

Proposed resolution

Sort out the configuration and schema

Remaining tasks

Merge request review

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

The default view configuration for the Admin > Content view now uses the correct Language field plugin.

Draft change record: https://www.drupal.org/node/3460053 β†’

πŸ› Bug report
Status

Needs review

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom scott_euser

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @scott_euser
  • Status changed to Needs review 7 days ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Not sure if there is a way for the schema of views.field.field_language to just inherit everything from views.field.field? It would make sense to inherit if we can since the 'Language' field plugin extends 'Field' field plugin with nothing other than an access control method (so that the field does not show up in a monolingual site).

  • Pipeline finished with Success
    7 days ago
    Total: 558s
    #217170
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    I wonder if its also worth having an update hook to update the views config of existing sites if its unchanged?

  • πŸ‡¬πŸ‡§United Kingdom catch

    I wonder if its also worth having an update hook to update the views config of existing sites if its unchanged?

    We didn't do that with the original issue (which means a relatively small number of sites will be affected by the fact the shipped config wasn't updated in the original issue) because there's always risk of breaking customisations if the detection goes wrong etc. I think it's fine without. Should probably add a new change record encouraging people to update their admin/content views to get the new behaviour though.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Sounds good, here is a draft change record: https://www.drupal.org/node/3460053 β†’

  • Status changed to RTBC 3 days ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Seems straight forward.

    Applied the MR before doing an install and filter appears to be working.

    Imagine this is one of those views it would be more disruptive to post_update existing sites then to just fix for new ones.

  • Status changed to Needs work 3 days ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    I think we still need feedback on #3 here, adding all that config schema seems like a lot.

  • Status changed to Needs review 3 days ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Okay @alexpott helped solve that extending here https://drupal.slack.com/archives/C1BMUQ9U6/p1720626481941179 (thank you!).

    I tested via πŸ› Views handler loading should respect configuration Active running core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php

    • Without any `views.field.field_language` schema: test fails
    • With it in place and `type: views.field.field` extending: test passes
  • Pipeline finished with Success
    3 days ago
    Total: 457s
    #221097
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Okay added back in field_api_classes - confirmed that the test still passes in πŸ› Views handler loading should respect configuration Active with this.

  • Pipeline finished with Success
    3 days ago
    Total: 445s
    #221103
Production build 0.69.0 2024