On a content profile admin page I get this error:
warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/iwd/includes/form.inc on line 1211.
This is because the line '#default_value' => content_profile_get_settings($type, 'autoassignrole_use') line 448 autoassignrole.module doesn't have a value as autoassignrole_use is not set on the content_profile_.$type variable yet. On saving the form the value is not updated either.
On the registration page for an autoassignrole path content_profile_get_settings($type, 'autoassignrole_use') on line 461 of the same file also causes this error:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /Applications/MAMP/htdocs/iwd/sites/all/modules/contrib/autoassignrole/autoassignrole.module on line 461.
The patch below fixes both these errors and allows the content_profile admin page to be updated correctly.
Comment | File | Size | Author |
---|---|---|---|
autoassignrole_content_profile_registration.patch | 2.83 KB | jethro | |
Comments
Comment #2
cyberswat CreditAttribution: cyberswat commented@jethro tyvm for the patch! I think this particular issue is resolved in the 6.x-2.0-beta1 branch though ... we went around with this for a while trying to resolve it #761748: warning: Invalid argument supplied for foreach() and #699888: Auto Assign Role paths is broken
Could you try the 2.0 beta and see if it fixes your problem? If I can get a few more people to confirm 2.0 is working for them I'll make it into an official release. I'm marking this one as postponed until you confirm that this has or has not been fixed already.
Thanks
Comment #3
cyberswat CreditAttribution: cyberswat commentedforgot to switch the status
Comment #4
jethro CreditAttribution: jethro commentedYes, this appears to be working in the 2.0 branch. The only change I would make is on line 480 when autoassignrole_use is initialized: $autoassignrole['autoassignrole_use'] = array_keys(user_roles((TRUE)));
It would be better if this were set to an empty array:
$autoassignrole['autoassignrole_use'] = array();
As is, all roles are selected for aar on the content profile settings pages initially for aar paths even if the user doesn't visit the content profile settings page. The content profile is automatically used on the aar path page which would be confusing and unexpected. Better just to start with them unchecked.
I'd roll a patch but I don't know why my last one was rejected as I'm new to the simple test thing. I created it with git.
Comment #5
liquidcms CreditAttribution: liquidcms commentedi agree that the module does not work correctly as discussed here - all content profile nodes are added to every registration form regardless of role.
The 2.0 branch with the change in #4 seems to make this part work..
although i am still having issue that ALL roles get assigned to my new account #769046: auto assign role is assigning too many roles on registration - but maybe unrelated
Comment #6
kmstf CreditAttribution: kmstf commentedautoassignrole_content_profile_registration.patch queued for re-testing.
Comment #8
Dave KopecekTried applying patch against autoassignrole 6.x-2.0-beta1 It fails for me.
Comment #9
Dave KopecekOk, it fails against beta because as it pretty clearly says at the top of the thread, we're talking about 6.x-1.2 here.
I was able to apply the patch against 6.x-1.2 and it fixed the foreach() error. Note that this patch will conflict with changes made to the October 10 autoassignrole 6.x-2.0-beta1 version at line 462. The beta version looks like it has also fixed the foreach() error, but it has introduced a new error: http://drupal.org/node/986792
Comment #10
cubeinspire CreditAttribution: cubeinspire commentedautoassignrole_content_profile_registration.patch queued for re-testing.
Comment #12
demonrage CreditAttribution: demonrage commentedthis patch worked for me perfectly. thx
Comment #13
upupax CreditAttribution: upupax commentedAutoassignrole 6.x-1.2.
Patch seems working for me.
Comment #14
newnewuser CreditAttribution: newnewuser commentedworks for me on 6x-1.2 too
Comment #15
millenniumtreeLooks good