Change file validation order

Created on 20 May 2016, over 8 years ago
Updated 23 February 2023, over 1 year ago

Problem/Motivation

When I upload an image whose file size is greater than the allowed one, I get the The image was resized to fit within the maximum allowed dimensions of 85x85 pixels. message and an error message about the file size being bigger than the allowed one.

Steps to reproduce

  • Upload an image whose file size is bigger than the allowed one, in a form requiring an image, for example the account edit form, which has a form element for the account virtual face
  • Submit the form
  • See the messages shown after the form is validated

Proposed resolution

The code should first validate the file size. When the file size isn't bigger than the allowed one, the image should be resized.

Remaining tasks

User interface changes

No changes to the user interface are necessary.

API changes

No changes to the API are requested.

Data model changes

No data model changes are necessary.

Release notes snippet

🐛 Bug report
Status

Needs work

Version

10.1

Component
File system 

Last updated about 12 hours ago

Created by

🇮🇳India visabhishek Hyderabad

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India DeepaliJ

    @bsuttis I was trying to apply the patch on Drupal 10.1.x-dev

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    Tried replicating on D10.1 but was not able to trigger the resize.

    Current patch does not include tests either.

Production build 0.71.5 2024