Mailman form shows in all categories of user edit form.
NigelCunningham - August 20, 2009 - 11:01
| Project: | User mailman register |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The hook_user function currently ignores the category, with the result that the mailing list form appears on every category tab when editing a user.
The following simple fix addresses the issue:
diff -ruN .user_mailman_register/user_mailman_register.module user_mailman_register/user_mailman_register.module
--- .user_mailman_register/user_mailman_register.module 2009-08-14 06:55:49.000000000 +0000
+++ user_mailman_register/user_mailman_register.module 2009-08-20 10:55:54.000000000 +0000
@@ -55,7 +55,8 @@
switch ($op) {
case 'form':
if (!variable_get('user_mailman_register_ownform', 1) && user_access('access user_mailman_register')) {
- return _user_mailman_register_form($edit, $account, FALSE);
+ if ($category == 'account')
+ return _user_mailman_register_form($edit, $account, FALSE);
}
break;
case 'view':
@@ -72,7 +73,8 @@
break;
case 'validate':
if (!variable_get('user_mailman_register_ownform', 1) && ($account->uid > 0 || variable_get('user_mailman_register_registerform', 1))) {
- return _user_mailman_register_required_list($edit);
+ if ($category == 'account')
+ return _user_mailman_register_required_list($edit);
}
break;
case 'register':
#1
Thank, i missed that.
I had to make some changes to your patch: http://drupal.org/cvs?commit=257834
#2
Thanks!
Sorry for the less than perfect patch - pretty new to Drupal.
Nigel
#3
Automatically closed -- issue fixed for 2 weeks with no activity.