When you save your profile, and have an avatar selected, but another mandatory field not filled out, the new style that removes the radio buttons doesn't apply, and you get a vertical list of radios with the avatars next to them instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gmoonchild’s picture

FileSize
1001 bytes

Hi! I've had the same problem with the website I'm working on.
You can try force the form rebuild using this patch :) It worked for me!

burgs’s picture

Thanks Alma, I'll check out your patch.

iva2k’s picture

Status: Active » Reviewed & tested by the community
FileSize
971 bytes

I reviewed Patch #1. It only fixes the problem with avatar_selection_form_user_register_form_alter() during user registration. Same problem exists on user profile page, but the patch does not fix it. The same $form_state['rebuild'] = TRUE; should be added to avatar_selection_form_user_profile_form_alter().

Also, it is better to move the fix down to the very end of each of the functions (so it is not affecting the forms when there are no avatars or user pictures).

Attached is a new patch that covers both pages. I've tested it and it works.

deanflory’s picture

Gonna try this patch as I just got a "An illegal choice has been detected. Please contact the site administrator." when attempting to save the account form. When the form reloads, as the original poster stated, it does indeed make all avatar options (per page) appear in a vertical column with radio buttons next to each.

When the patch was applied the mis-formatting of the avatar selections does indeed remain formatted so the patch works, but choosing an avatar still doesn't work.

Disabling this module since after applying two different patches it still doesn't work to select an avatar, at least with my module set that is enabled.

aklump’s picture

Here is a patch that uses #after_build. It will work against the dev branch, not 1.0.

aklump’s picture

Version: 7.x-1.0 » 7.x-1.1
Issue summary: View changes
Status: Reviewed & tested by the community » Active
aklump’s picture

I just applied the patch in #5 against 7.x-1.1 and it fixes the issue, please consider merging patching into the next release. Thanks!

luison’s picture

#5 works perfect.
Thanks.

alex.skrypnyk’s picture

Re #5: JS and CSS should be attached to the elements of the form rather then using drupal_add_css()/drupal_add_js() exactly for reasons to have validation re-attaching them on errors. Also, #5 contains JS changes not related to lost JS/CSS assets on re-submission.

Attached patch resolves this issue.

aliciagh’s picture

Re #9 thanks, it works for me.
Drupal 7.54 and avatar_selection 7.x-1.1