Closed (won't fix)
Project:
FileField Upload Limit
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 14:49 UTC
Updated:
29 Sep 2010 at 16:01 UTC
This in filefield_upload_limit_filefield() looks wrong to me:
foreach ($user->roles as $rid => $name) {
$uploadsize = variable_get("upload_uploadsize_$rid", variable_get('upload_uploadsize_default', 1)) * 1024 * 1024;
}
There's no max here. We're just clobbering the variable each time and so the value that gets used is simply the last role in the array. Can't be right surely?
Comments
Comment #1
greg.harveyYou're right, it isn't. The problem was knowing WHICH of the user's roles to pick, if they have many. I guess it makes sense to check all the roles and use the highest limit, but I was pushed for time and lazy, so I didn't do that (and then forgot all about it). Need to write the code that checks which role has the highest limit.
Comment #2
joachim commentedI don't know when I'll have time to look into this -- not till after conference, I'd say.
Should we make a release with the existing fixes and leave this until either of us has a spare few hours?
Plus I reckon we could do to refactor the code so filefield_upload_limit_get_field_upload_limit() is always used, in which case filefield_upload_limit_is_set() becomes a helper function for that alone.
Comment #3
greg.harveyI agree, let's make a release now.
And starting another issue for the refactoring would seem sensible to me - here it is:
#555688: Refactor the code so filefield_upload_limit_get_field_upload_limit() is always used
Comment #4
greg.harveyClosing this, as realistically this will never happen - D5 end of life imminent, no further support will be given unless someone else takes it over.