Problem/Motivation

#3386719: Fatal error when viewing a static_page revision due to core type upcasting change
While testing StaticPageTest::testNodeRevisionRouteParameterIsHandled, a schema validation error occurs:

Drupal\Core\Config\Schema\SchemaIncompleteException: No schema for static_page.fields

This indicates that configuration data for static_page.fields exists but has no corresponding schema definition.

Having missing schema causes test failures when ConfigSchemaChecker is enabled and can lead to misinterpretation of configuration in strict environments.

Steps to reproduce

See https://git.drupalcode.org/issue/static_page-3386719/-/jobs/7655691

Proposed resolution

Define a schema entry for static_page.fields in config/schema/static_page.schema.yml.
The schema should describe the expected structure and data types of the fields configuration.
This will allow ConfigSchemaChecker to validate the configuration correctly and resolve the test failure.

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

joelpittet created an issue. See original summary.

joelpittet’s picture

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

dww’s picture

Title: Fix SchemaIncompleteException in tests » Missing config schema and default config
Category: Task » Bug report

Thanks for opening this issue and providing the fix! Title that more directly describes the actual bug (the fact tests fail because of it is a side effect). I also realized we're not shipping a default config for this module, either. That's probably a good idea. Pushed commit for that. Also added a Kernel test that fails locally if I revert the schema fix.

If the pipeline is green, I'll merge this.

dww’s picture

p.s. Yeah, sequence is the right approach here. That's what I was gonna do when I first saw the test failure, before I had opened your MR.

  • dww committed 10dc3088 on 8.x-1.x authored by joelpittet
    fix: #3563033 Missing config schema and default config
    
    Co-authored-by:...
dww’s picture

Status: Needs review » Fixed

Merged to 8.x-1.x. Thanks again!

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.

Status: Fixed » Closed (fixed)

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