Attached is a patch that majorly re-factors this module, as follows:

  • Corrects the name of the module and adds a description in the info file.
  • Removes the separate "user picture field" configuration screen and places all of the settings for the module under "Account settings" where all of the standard user picture settings live.
  • Replaces the bundle and field text fields with drop-downs that automatically refresh via AJAX when the entity type or bundle drop-downs change value, preventing typos when entering bundle and field names. Only "image" fields are available for selection.
  • Hides user picture field settings when user picture support is not enabled.
  • Hides most of Drupal core's picture settings when user picture field support is turned on, and vice-versa.
  • Splits-out Profile2 specific code into its own file, which is also distinct from the logic that deals with fields in the user account.

This should greatly improve the usability of the configuration form for the module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GuyPaddock’s picture

Attached is the patch.

GuyPaddock’s picture

Corrected a subtle typo.

g089h515r806’s picture

It is a big patch, I think it will be better if we create a 7.x-2.x branch and you commit your code to this branch.
I could add you to maintainer of this project.

GuyPaddock’s picture

That works too! The patch is API and data compatible with what's there, it really just cleans-up the UI.

System Lord’s picture

I like this patch. It all makes better sense. Thank you for the effort!

I do have an issue, though, and I'm not sure where to list it. I'm using a Profile2 field for images and it works. However, I need a default image in place until my users upload their own. The Profile2 image field allows for default image (since this module/patch removes the default_image option from admin account settings) and it does displayed in profile view, but it wont display in Private message lists/threads. It's just empty.

The strange part is is when a user actually uploads their own image everything works/looks fine and if they remove their own image (which then causes the default image to be used again) the default image suddenly appears in PM.

Any thoughts?

GuyPaddock’s picture

Assigned: Unassigned » GuyPaddock
Status: Needs review » Needs work

Great timing!

I'm actually working on better default image handling. We're seeing some similarly strange behavior in our sites, and with the patch it's hard to set the default image since it's not based on the default image for the profile field and the default image field gets hidden in account settings when you toggle to use a field.

System Lord’s picture

Sweet! I stand ready for any assistance I can provide. (probably just testing. I don't know php.)

System Lord’s picture

Seeing another related issue to this module or patch. If I have a dozen messages in my list and I preform any action Delete, Mark as read, or Mark as unread, all user pictures disappear with their username put in its place. When I refresh the page all the pictures return.

UPDATE: Sorry, wrong place. Moved to: https://www.drupal.org/node/2402063#comment-9959481

SL

Klinkov’s picture

What to do if my avatar image is a part of Field collection like:

my_site/#overlay=admin/structure/field-collections/field-resume-personal-info/fields/field_resume_photo

And in that case "Source picture field" is empty?