Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | styling-javascript-lost-on-form-submitted-with-errors-1718252-9.patch | 4.23 KB | alex.skrypnyk |
#5 | 0001-Patch-for-https-drupal.org-node-1718252.patch | 5.46 KB | aklump |
#3 | avatar_selection-1718252-3.patch | 971 bytes | iva2k |
#1 | avatar_selection.module.patch | 1001 bytes | gmoonchild |
Comments
Comment #1
gmoonchild CreditAttribution: gmoonchild commentedHi! 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!
Comment #2
burgs CreditAttribution: burgs commentedThanks Alma, I'll check out your patch.
Comment #3
iva2k CreditAttribution: iva2k commentedI 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.
Comment #4
deanflory CreditAttribution: deanflory commentedGonna 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.
Comment #5
aklump CreditAttribution: aklump commentedHere is a patch that uses #after_build. It will work against the dev branch, not 1.0.
Comment #6
aklump CreditAttribution: aklump commentedComment #7
aklump CreditAttribution: aklump commentedI 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!
Comment #8
luison CreditAttribution: luison commented#5 works perfect.
Thanks.
Comment #9
alex.skrypnykRe #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.
Comment #10
aliciagh CreditAttribution: aliciagh commentedRe #9 thanks, it works for me.
Drupal 7.54 and avatar_selection 7.x-1.1