Problem/Motivation

In the schema, max_filesize has the type set as a string, however in file_entity.settings, it's being cast as an integer.

Steps to reproduce

When installing the config for the file_entity module inside of a kernel test (like so $this->installConfig('file_entity')), we are being presented with the error:

Exception: Exception when installing config for module file_entity, message was: Schema errors for file_entity.settings with the following errors: file_entity.settings:max_filesize variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData

Proposed resolution

To fix the issue, change max_filesize in file_entity.settings.yml to be a string.

Remaining tasks

  • Create and add the patch.
  • Test the updated module thoroughly to ensure that the fix is working as intended.

User interface changes

There are no user interface changes with this fix.

API changes

There are no API changes with this fix.

Data model changes

There are no data model changes with this fix.

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

hoffismo created an issue. See original summary.

hoffismo’s picture

Title: file_entity.settings:max_filesize variable type is boolean but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData » The max_filesize variable type is boolean but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData
hoffismo’s picture

Title: The max_filesize variable type is boolean but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData » The module settings has max_filesize cast as a boolean, but the schema for it is expecting a string
Issue summary: View changes
hoffismo’s picture

Title: The module settings has max_filesize cast as a boolean, but the schema for it is expecting a string » The module settings has max_filesize cast as an integer, but the schema for it is expecting a string
Issue summary: View changes

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

sijumpk’s picture

Status: Active » Needs review

The max_filesize field value inside file_entity.settings.yml is update to string value, so that the default value will match the type declared in schema. Please check it.

joseph.olstad’s picture

Status: Needs review » Fixed
joseph.olstad’s picture

sijumpk’s picture

Status: Fixed » Closed (fixed)
joseph.olstad’s picture

fyi for next time @sijumpk , the issue was going to automatically close tomorrow, lol, after 2 weeks of no-activity a Fixed issue automatically is closed to Closed (fixed). This is to allow others the time necessary to report regressions without having to open a new issue.

It was 13 days today, so you closed it 1 day early.

sijumpk’s picture

Okay @joseph.olstad, next time :)