"Maximum upload size" for field not passed to Media Browser

Created on 20 July 2023, over 1 year ago
Updated 26 July 2023, over 1 year ago

Currently, if you set the the "Maximum upload size" on a file field that uses the Media Browser, this limit will not be passed on to the Media Browser, the global limit will be used instead.

This is due to a bug in this code in entity_field.pages.inc:

  if (!empty($options['max_filesize']) && $options['max_filesize'] < $max_filesize) {
    $max_filesize = parse_size($options['max_filesize']);
  }

It's comparing the $options['max_filesize'] (which is a string like "8 MB") with $max_filesize (which is the number of bytes as an integer). This never evaluates to TRUE, so the $options['max_filesize'] is never used.

I'll attach a patch in a moment that fixes this!

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dsnopek USA

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

Comments & Activities

Production build 0.71.5 2024