Problem/Motivation

When uploading a video, this media type have a file limit that could be expressed with string like 100 MB.
However when uploading a video through drag & drop you will encounter an error :

TypeError: Cannot assign string to property Drupal\file\Plugin\Validation\Constraint\FileSizeLimitConstraint::$fileLimit of type int in Symfony\Component\Validator\Constraint->__construct() (line 133 of /opt/www/d10/vendor/symfony/validator/Constraint.php).

Steps to reproduce

- Install the module.
- Set up a file limit for media video, like 100 MB, in /admin/structure/media/manage/video/fields/media.video.field_media_video_file (default install for media video)
- Try to upload a video and nothing will happen
- Check the "Recent log messages" report

Proposed resolution

When using the UI to upload, the constraint validation isn't using the function Bytes::toNumber() to check this file limit.

Remaining tasks

MR to be submitted.

User interface changes

None

API changes

None

Data model changes

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

tostinni created an issue. See original summary.

tostinni’s picture

Status: Active » Needs review

MR submitted switching to "needs review".

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

jmauricio’s picture

Status: Needs review » Reviewed & tested by the community

merged into 1.0.x

jmauricio’s picture

Status: Reviewed & tested by the community » Fixed

released in 1.0.7

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.