If this form element is empty, i think it will be removed, not display on user profile form.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | fix_user_settings_with_tests.patch | 15.11 KB | berdir |
| #8 | remove-ui-settings-form-if-empty-587646-8.patch | 742 bytes | areynolds |
| #4 | remove-ui-settings-form-if-empty-587646-4.patch | 827 bytes | areynolds |
| #2 | remove-ui-settings-form-if-empty-587646-2.patch | 0 bytes | areynolds |
Comments
Comment #1
areynolds commentedThis form element should be removed if it's empty (it uses the user_relationships_ui_account_fieldset_remove_if_empty function shown below). However, running version 7.x-1.x-dev on D7.4, I'm still seeing the element. Checking it out.
Line 481
Line 529
Comment #2
areynolds commentedOk, the issue is that the $form['user_relationships_ui_settings'] element counts as a child element; therefore the count is 1 and not equal to zero. The function user_relationships_ui_account_fieldset_remove_if_empty needs to be changed to something like this:
Seems to work; patch is attached.
Comment #3
berdirPatch is empty, can you re-roll?
Comment #4
areynolds commentedSorry about that, must have been a late-night patch. This should do it.
Comment #5
areynolds commentedComment #7
berdirThe patch removes the old patch, which doesn't exist, that's the reason why it fails.
Comment #8
areynolds commentedThird time's the charm!
Comment #9
areynolds commentedComment #10
berdirThe fix is not correct, it hides the mailer setting, because that is controlled through #access.
I have a working version with tests but won't be able to upload it before the weekend.
Comment #11
berdirWeird double post
Comment #12
berdirOk, attaching a new patch.
- The patch goes trough all child elements and checks their #access. It also comes with extensive tests for all the settings and also contains the patch from #1275138: User settings for email notifications are not saved and tests for that.
Comment #13
berdirCommited and pushed.