If user pictures are enabled and I edit my account, this is what is saved into the 'data' column of my users's db record:
a:4:{s:7:"contact";i:0;s:5:"block";a:0:{}s:14:"picture_delete";i:1;s:14:"picture_upload";s:0:"";}
The picture_delete and picture_upload do not need to be saved and for a site with a lot of users, that's a tiny less amount of processing for unserialize in user_load().
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 343785-picture-upload-delete-values-D7.patch | 3.58 KB | dave reid |
| #4 | 343785-picture-upload-delete-values-D7.patch | 3.62 KB | dave reid |
| #3 | 343785-picture-upload-delete-values-D7.patch | 3.49 KB | dave reid |
| #1 | 343785-picture-upload-delete-values-D7.patch | 3.39 KB | dave reid |
Comments
Comment #1
dave reidAttached patch that sets the values of those two fields to NULL in _edit_user_submit. Also fixed some FAPI code styles in the user picture account form.
Comment #2
dave reidSince this does not implement an API change, a minimal version of this patch should be backported to 6.x.
Comment #3
dave reidEven nicer formatting of the user_picture FAPI fields using #access. Yay FAPI!
EDIT: Patch has passed testingbot:
http://testing.drupal.org/pifr/file/1/2205
Comment #4
dave reidRevised patch that comments why there's #access properties on the form elements. Simply, if the user does not have a current user picture, it hides the picture preview and delete picture checkbox.
Instead of:
With the patch we have:
Much cleaner and easier to understand
Comment #6
dave reidHmm...I tested the patch and it applied cleanly to HEAD (with just a tad bit of offset). Reposting to let testing bot give it another try.
Comment #8
dave reidComment #9
dave reidComment #10
dave reid#357403: Move user picture to managed files fixed this in 7.x, so moving back to 6.x.
Comment #11
dave reidMerging into #173493: User picture fixes and cleanup.