[5.x] Fix schema errors

Created on 26 March 2024, 9 months ago

Problem/Motivation

There are currently a couple of schema errors, that didn't come up in our tests, since we do not actively use the photoswipe formatter in our tests:

Drupal\Tests\drowl_media_types\Functional\DrowlMediaTypesGenericTest::testModuleGenericIssues
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for photoswipe.settings with the following errors: photoswipe.settings:options.secondaryZoomLevel variable type is double but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData, photoswipe.settings:options.maxZoomLevel variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData

Interestingly, some of the schema should apply properly, e.g. "secondaryZoomLevel" supports both double values, and strings. To make this work, we simply pass the double as a string. But the Drupal will convert the "double" string value back to a double, even if we pass it as a string.

We need to find how to cast a type inside an installation yml, or see if that is even possible.

Steps to reproduce

  • Actively use the photoswipe formatter with the standard settings applied
  • Check the schema through config inspector

Proposed resolution

Fix the schema errors and write tests using a test module, which actively imports config (e.g. overwrite a core.entity_view_display.xxx config)

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: outdated

Version

5.0

Component

Code

Created by

🇩🇪Germany Grevil

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

Comments & Activities

Production build 0.71.5 2024