Problem/Motivation

After upgrading to Drupal 11 saving a view with a duplicate link displays an warning message.

The warning is also displayed when running the database update "views_post_update_table_css_class" after a fresh D11 upgrade.

[notice] Update started: views_post_update_table_css_class
 [warning] Schema errors for views.view.my_view_name with the following errors: views.view.my_view_name:display.page_1.display_options.fields.clone_link.text missing schema. These errors mean there is configuration that does not comply with its schema. This is not a fatal error, but it is recommended to fix these issues. For more information on configuration schemas, check out <a href="https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-schemametadata">the documentation</a>.

Steps to reproduce

  • Upgrade Drupal 11
  • Run drush updb
  • Create a view
  • Add the field "Add clone link"
  • Save the view

Proposed resolution

Add a schema for the field to "quick_node_clone/config/schema/quick_node_clone.schema.yml"

views.field.quick_node_clone_link:
  type: views_field
  label: 'Quick Node Clone link'
  mapping:
    text:
      type: label
      label: 'Text to display'

Comments

electric.larry created an issue. See original summary.

electric.larry’s picture

Status: Active » Needs review
StatusFileSize
new536 bytes

I created a patch that adds the missing schema for the views field.
It adds the following code to quick_node_clone/config/schema/quick_node_clone.schema.yml

views.field.quick_node_clone_link:
  type: views_field
  label: 'Quick Node Clone link'
  mapping:
    text:
      type: label
      label: 'Text to display'
csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new254.43 KB
new234 KB

Environment

  • Drupal: 11.4.4
  • PHP: 8.5.5
  • Database: MariaDB 10.11.16
  • DDEV: v1.25.2
  • Quick Node Clone: 8.x-1.22
  • Browser: Chrome

Prerequisites

  • Enable quick_node_clone and views_ui.
  • Config schema errors are only reported when the core schema checker is active. Register it in web/sites/default/services.yml and rebuild caches:
services:
  testing.config_schema_checker:
    class: Drupal\Core\Config\Development\ConfigSchemaChecker
    arguments: ['@config.typed']
    tags:
      - { name: event_subscriber }
  • Create a view of Content with a page display (used below as qnc_test).

Steps

  1. Apply the fix from the patch in comment #2: add the views.field.quick_node_clone_link schema definition to config/schema/quick_node_clone.schema.yml.
  2. Rebuild caches: ddev drush cr
  3. Go to /admin/structure/views/view/qnc_test.
  4. Next to Fields click Add, search for Add clone link, select it, then Add and configure fields and Apply.
  5. Click Save.
  6. Repeat steps 3–5 without the fix in place to compare the behaviour.

Expected results

  • The view saves without any config schema error.
  • No missing schema report for display.*.display_options.fields.clone_link.text.
  • Running ddev drush updb produces no schema warning for views containing the clone link field.

Actual results

Before the fix, saving the view aborted with Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for views.view.qnc_test with the following errors: views.view.qnc_test:display.default.display_options.fields.clone_link.text missing schema, matching the warning reported during views_post_update_table_css_class. After adding the views.field.quick_node_clone_link schema and rebuilding caches, the same view saves cleanly and a programmatic schema check on views.view.qnc_test returns no errors.


Testing produced with the assistance of an LLM.