Problem/Motivation

After install the module config inspector we detected some issues with the field content_translation_link.
Error on properties:

  • display.default.display_options.fields.translation_link.text
  • display.default.display_options.fields.translation_link.output_url_as_text
  • display.default.display_options.fields.translation_link.absolute

Steps to reproduce

  1. composer require drupal/config_inspector
  2. Enable the content_translation and config_inspector modules.
  3. Enable translation of User entities at /admin/config/regional/content-language.
  4. Add the "Link to translate User" field to the People view at /admin/structure/views/view/user_admin_people and save the change.
  5. Validate the configuration at /admin/reports/config-inspector/views.view.user_admin_people/list.

Proposed resolution

Change the views.field.content_translation_link schema type to views.field.entity_link.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#6 3492882.png685.17 KBbserem

Issue fork drupal-3492882

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

As the \Drupal\content_translation\Plugin\views\field\TranslationLink extends from \Drupal\views\Plugin\views\field\EntityLink it should have the same schema.

eduardo morales alberti’s picture

Status: Active » Needs review

Ready to review

bserem’s picture

Assigned: Unassigned » bserem
Issue tags: +GreeceWinterSprint2024

reviewing

bserem’s picture

Assigned: bserem » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new685.17 KB

Attached screenshot with before and after.

MR !10503 fixes the schema.

Nice find @eduardo

quietone’s picture

Version: 11.1.x-dev » 11.x-dev

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This means we're missing test coverage of this feature because otherwise we'd get the schema errors reported by the test.

dcam made their first commit to this issue’s fork.

dcam changed the visibility of the branch 11.x to hidden.

dcam changed the visibility of the branch 3492882-fix-schema-contenttranslation to hidden.

dcam’s picture

Title: Fix schema content_translation » Fix the views.field.content_translation_link schema
Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests

MR 10503 was opened against the incorrect branch. It had to be rebased manually. So I decided to open a new branch instead and manually copy the changes. I also added a test.

idebr’s picture

Status: Needs review » Reviewed & tested by the community

'Test-only changes' job reports the missing schema correctly, see https://git.drupalcode.org/issue/drupal-3492882/-/jobs/7181313

There was 1 error:
1) Drupal\Tests\content_translation\Functional\Views\TranslationLinkTest::testTranslationLink
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for views.view.test_entity_translations_link with the following errors: views.view.test_entity_translations_link:display.default.display_options.fields.translation_link.output_url_as_text missing schema, views.view.test_entity_translations_link:display.default.display_options.fields.translation_link.absolute missing schema

alexpott’s picture

We test all the config for schema in test automatically - the test changes here are unnecessary - if you only make the changes to the test view and not the schema changes you get

1) Drupal\Tests\content_translation\Functional\Views\TranslationLinkTest::testTranslationLink
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for views.view.test_entity_translations_link with the following errors: views.view.test_entity_translations_link:display.default.display_options.fields.translation_link.output_url_as_text missing schema, views.view.test_entity_translations_link:display.default.display_options.fields.translation_link.absolute missing schema, 0 [display.default.display_options.fields.translation_link] 'output_url_as_text' is an unknown key because display.default.display_options.fields.translation_link.plugin_id is content_translation_link (see config schema type views.field.content_translation_link)., 1 [display.default.display_options.fields.translation_link] 'absolute' is an unknown key because display.default.display_options.fields.translation_link.plugin_id is content_translation_link (see config schema type views.field.content_translation_link).

Going to remove the test class changes and then merge.

alexpott’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed f48a87604dd to 11.x and b11f562bde0 to 11.3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed b11f562b on 11.3.x
    Issue #3492882 by alexpott, eduardo morales alberti, dcam: Fix the views...

  • alexpott committed f48a8760 on 11.x
    Issue #3492882 by alexpott, eduardo morales alberti, dcam: Fix the views...

Status: Fixed » Closed (fixed)

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