Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#5417 closed defect (bug) (fixed)

Avatar upload error mesage

Reported by: stefwilliams Owned by: boonebgorges
Priority: low Milestone: 2.0
Component: Media Version: 1.9.2
Severity: normal Keywords:
Cc:

Description

When an avatar image is uploaded to a profile or BP group, if the filename is too long (I think), the crop fails, with a generic message: "There was a problem cropping the avatar".
The image is still uploaded but the crop fails, saying the image is not found.
A more helpful error message would be good.
(As an example, the attached image fails as an avatar upload. Rename it to something shorter, and it should work.)

Attachments (1)

32203c6ae1bc3723a3432a38b1185490-bpthumb.jpg (2.6 KB ) - added by stefwilliams 12 years ago.
failed avatar upload

Download all attachments as: .zip

Change History (5)

#1 @boonebgorges
12 years ago

  • Component CoreAvatars
  • Milestone Awaiting Review2.0
  • Priority normallow
  • Type enhancementdefect (bug)

Thanks for the report. Actually, in your case, the file length is not the problem. The problem is the fact that you're uploading a file whose file is formatted like a BP avatar image file. When processing the crop, BuddyPress deletes all existing avatars before cropping and re-saving the new avatar. But because your new filename looked like an old avatar from BP's point of view, it was getting deleted too; as a result, there was nothing to crop, and BP threw an error.

It's an edge case to be sure, but we can work around it by ensuring that the existing file is not named the same as the uploaded file before deleting the existing one.

#2 @boonebgorges
12 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 7943:

Sanity check before deleting old avatar files before cropping new ones

Previously, if a user uploaded a new avatar file that had a name format like
an existing BP avatar file, BP would accidentally wipe that file out before
cropping. This would result in a failed crop, because the just-uploaded image
would be gone. This changeset introduces a sanity check: only delete existing
avatar files if the filename for those files is not the same as the uploaded
file.

Fixes #5417

This ticket was mentioned in IRC in #buddypress-dev by svn-b896. View the logs.


12 years ago

#4 @DJPaul
10 years ago

  • Component API - AvatarsMedia
Note: See TracTickets for help on using tickets.