As far as I could tell, and I may be wrong, you can't store filefield upload limits for multiple fields in a content type. It seems the code did not allow for a serialised array already being stored using get/set_variable.

So, if you you have a content type with multiple file fields, when you set a limit for one, then set a limit for the other, the first is deleted/overwritten.

I've attached a solution which seemed to solve my issue.

Forgive me if I'm wrong...this is my first issue request.

CommentFileSizeAuthor
fieldfield_upload_limit.patch1.25 KBbendodd

Comments

greg.harvey’s picture

Status: Active » Needs review

Hi there,

You're probably correct. I didn't even consider that eventuality (a mantra of mine - write code you definitely need today, not code you think you might need tomorrow... ;-)

Thanks for the patch. I will review ASAP and commit to HEAD if it's good.

greg.harvey’s picture

Status: Needs review » Fixed

Patch applied! Thank you!

Word of advice... when contributing Drupal code, your SDK should be set to use a double-space instead of a tab for indenting. This was such a small patch it didn't matter, but you'll find larger contributions get rejected by the maintainers if all the indents are tabs instead of double spaces.

See the Drupal coding standards page for more info:
http://drupal.org/coding-standards

And congrats on your first successful contribution! =)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.