Fix querying for maxFileSize of uploaded files

Created on 3 October 2024, 4 months ago

Problem/Motivation

Currently, the maximum file size limits are not respected in the right way. The ManagedFileTest illustrates this in a clear way: WebformElementManagedFile's maxFilesize is always at least 2 MB, even when setting it much lower (for example, 80 KB).

In this issue, it's also planned to handle the edge case when there's no max file size configured. Currently, the module returns null for the maxFilesize field. It should return the default PHP/Drupal max file size limit.

Proposed resolution

  • adapt $registry->addFieldResolver('WebformElementManagedFileBase', 'maxFilesize'', $callback) field resolver
  • Write a new test for the edge case when no file size limit is set

API changes

None

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024