Uploading user selectable avatars fails unless allow_uploaded_avatars is enabled

If the allow_uploaded_avatars Site Setting is not enabled, attempting to upload an image to the selectable_avatars list fails. The message in the upload modal is ‘Uploading 100%’, but no image appears.

The copy for the allow_uploaded_avatars setting is ‘Allow users to upload custom profile pictures.’ Having to enable this when you don’t want to allow users to upload avatar images is counter intuitive.

It is failing here: https://github.com/discourse/discourse/blob/master/app/controllers/uploads_controller.rb#L16. Adding a condition to that line that checks for !params[:for_site_setting] == "true" would allow avatars to be uploaded regardless of the Site Settings.

5 Likes

Fixed by:

https://github.com/discourse/discourse/pull/6728

5 Likes

Can you verify this looks good @simon and close if so?

4 Likes