Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jan 2010 at 10:02 UTC
Updated:
29 Jul 2014 at 18:37 UTC
Jump to comment: Most recent file
Comments
Comment #1
stborcherttagging
Comment #4
aschiwi commenteduser_picture_dimensions.patch queued for re-testing.
Comment #6
aspilicious commentedreroll of first patch, hopefully without errors
Comment #7
aspilicious commentedLooks good for me now.
Can someone else review this.
Comment #8
aspilicious commentedStill applies, rtbc
Comment #9
yoroy commentedAgreed this is better
Comment #10
stborchertQuick question for later patches: does the first line in my patch break the bot?
I can't find any other difference than this
? .project(apart from the file dates).Comment #11
aspilicious commentedNo idea
Comment #12
dries commentedDoes this patch introduce a dependency on image module (for user module)? _image_field_resolution_validate() is only available when image module is enabled AFAIK.
Comment #13
stborchertUh, good catch.
If you disable image.module there is no error on save but the dimension values aren't saved.
Ok, I'll rewrite the patch later today.
Hm, do we want to duplicate
_image_field_resolution_validate()in user.module (no real API change) or do I need to move this function out of image into some other file (file.inc?)?Comment #14
stborchertHere is a new version of this patch.
I've simply copied (and renamed)
_image_field_resolution_validate()to user.module.Comment #15
amc commented#14: user_picture_dimensions-14.patch queued for re-testing.
Comment #16
stborchertRe-roll of the patch against latest HEAD.
Comment #17
joachim commentedI'm away from my test copy of D7, but I just want to say that this should look identical to the FieldAPI image uploader.
Comment #18
stborchertUnfortunately it does :) (see screenshot).
Due to an other bug (#758996: Suffixes not displaying for max/min resolution fields) the fields for width and height aren't rendered by a theme function so the labels and field suffixes are missing.
Comment #19
stborchertNew try with inline fields and with working suffix and prefix.
Comment #21
stborchertUh, hm. Simply forgot one test.
Next try.
Comment #22
tstoecklerIf we can't do it in Drupal 7, there should at least be a @todo that this should be turned into a proper Image field in Drupal 8.
Comment #23
amc commented#21: 686528-user_picture_dimensions-21.patch queued for re-testing.
Comment #24
idflood commentedThe patch seems to be working well on my setup and the code looks good (apply with offset).
Little reroll with a minor change. I reverted the default values back to 85x85 instead of 0x0.
Comment #25
tstoecklerTo be consistent I think this function should be called _user_picture_field_max_resolution_validate (with MAX in the middle).
Also, is there really a need for the leading underscore here?
More importantly, if this is still on the table for D7, then we need an upgrade path, for people who already have the existing variable set to something other than the default. Should be nothing more than a variable_get() and two variable_set()'s.
Powered by Dreditor.
Comment #26
tstoecklerNeeds work.
Comment #27
idflood commentedHere is a patch with the suggestions from #25. I'm not the sure about the explode and check in the update hook, maybe there is a better way to do this.
Comment #28
tstoecklerWhile I personally like the text change, I don't think we can get this in D7, if we make this string change.
If there was no validation, I guess we should also be checking
is_numeric($dimensions[0]) && is_numeric($dimension[1])Since the defaults haven't changed we should wrap this in a
if ($dimensions[0] != 85 && $dimensions[1] != 85) { }so that people who haven't ever submitted the settings form don't get an unneeded variable in their DB.
Since this is still being used to generate the user pictures, this would be a regression for upgraders, as they would have to resubmit the settings page.
Instead of checking is_numeric above and then doing intval() here, can we not simply do is_int() in the first place?
I'll see if I can reroll later.
Powered by Dreditor.
Comment #29
tstoecklerSomething like this.
Comment #30
tstoecklerI moved the validation handler into user.admin.inc
Also, this still violates string freeze because of the error message. That's basically a bug fix, though. At least it seems unnecessarily fragile to not validate this.
Comment #32
yoroy commentedAn old CVS patch, how cute :)
Comment #33
Niklas Fiekas commentedThis might be obsolete after #1292470: Convert user pictures to Image Field. We could move it back to D7 then. Not sure if we can change the UI there, but at least there should be validation to not allow any input.
Making a bug report and adding Needs tests.
Comment #34
swentel commentedUser picture is a field, don't think we'll get this into D7