Closed (fixed)
Project:
Auto Assign Role
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2010 at 16:15 UTC
Updated:
5 Sep 2011 at 12:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
jamesmcd commentedComment #2
gidgetk commentedI can confirm I am getting the same error
Comment #3
jamesmcd commentedgidgetk This is appearing on my registration pages, is this the same for you?
*Attached screenshot*
Comment #4
51ucars commentedsame
Comment #5
jamesmcd commentedChanging priority to critical as I need this issue resolved for my site to run successfully
I am willing to sponsor fixing this if it speeds up the process of getting it sorted
Many thanks
Comment #6
weizrd commentedi confirm that patch http://drupal.org/files/issues/autoassignrole-content-profile-settings.p... solves this issue.
see http://drupal.org/node/755308
Comment #7
YK85 commentedHi,
Shouldn't this issue be marked as a duplicate of #755308: Content profile settings are not saved if that patch fixes this issue instead of marking as 'patch (to be ported)'?
Please help test patch located at #755308: Content profile settings are not saved
Setting back to 'active' for now
Comment #8
cyberswat commentedComment #9
zeno129 commentedI am very sure that the patch mentioned before does not fix the error.
First, because it does not affect the line where the error is. Secondly, I tried it just to be sure.
The real problem lies in that Auto Assign Role is calling the function
content_profile_get_settingsin Content Profile with an argument (e.g. 'autoassignrole_use') that is not supported:As you can see in the fraction of code above from Content Profile, the only arguments supported are user_edit, register or weight.
I tried changing the argument from 'autoassignrole_use' to 'register' since the error appeared in the register form. That did not fix it, so I eliminated that second parameter because Content Profile already gives a default value to that parameter in its function. Doing this seemed to fix it.
I'll try to work on making a patch as soon as I can... or if anyone wants to do it that is fine by me. :)
That way, more people could easily test it and see if it works right.
Comment #10
zeno129 commentedSorry, I forgot to say that the file that I edited was autoassignrole.module
Here is the patch.
Comment #11
zeno129 commentedUpdating status.
Comment #12
cledman commentedIt works for me!
Thanks!
Comment #13
akobashikawa commentedHello. Seem patch in #9 and #10 just mask symptom but not cause.
After applied solved issue http://drupal.org/node/755308 I realize that.
Use patch that appear in http://drupal.org/node/755308 instead.
Comment #14
zeno129 commented@akobashikawa - If you read this whole thread, you'll see that the patch you mention did not work for this particular issue.
I downloaded the module after that patch was committed and I still got the error. I even went and double checked that what I downloaded had the line that the patch corrected right.
Having that in mind, I went to the line that the error pointed out and compared the arguments being passed with the valid parameter that the function from the Content Profile module accepts. The REAL problem was that the argument being passed IS NOT a valid option. So, the function was using the default value.
The change that I made was eliminating the wrong argument being passed because it actually DOES NOTHING. This eliminated the error because there were no unnecessary and erroneous arguments being passed. Therefore, I do not think that my patch "masks a symptom".
You are welcome to analyze the error and verify that what I said is correct. Thank you.
[Edited comment to fix typo]
Comment #15
kenorb commentedThe same issue.
Comment #16
sunny.oxide commentedPatch in #10 worked great. Thanks @zeno129.
Comment #17
codeglyph commentedworks for me. thanks zeno129.
Comment #18
emilyf commented#10 works for me as well. thanks.
Comment #19
zeno129 commentedYou're welcome, guys. Thanks for the feedback! :)
Glad to hear it worked for you too.
Comment #20
cyberswat commentedThanks for the work on this ... in the future please follow the patch generation documentation off the project pages as it will make it easier to use your code http://drupal.org/node/138844/cvs-instructions/DRUPAL-6--1 ... I went ahead and rerolled this and committed it. Marking as fixed for now ... re-open if necessary. Thanks for the help!
Comment #21
zeno129 commentedThank you, I will use it as a reference next time. :)
Comment #23
fenstratThe patch in #20 (which is a simple re-roll of the one in #10) is incorrect. It is the cause of a number of bug reports:
#814870: Auto Assign Role - warning: Illegal offset type
#761748: warning: Invalid argument supplied for foreach()
#873380: Auto Assign Role by Path does not work
+ others?
The patch in #20 was made on the assumption (from #9):
This is incorrect. The second parameter to content_profile_get_settings() is an optional array key which will be returned from the $settings array. 'autoassignrole_use' is a perfectly valid key and is the key under which autoassignrole stores the "Use on Auto Assign Role paths" setting.
Most of the confusion around this was introduced in #666288: Introduce static cache which introduced a static cache for autoassigned roles (committed 24th Dec 2009). However it was implemented incorrectly and meant that the 'autoassignrole_use' key returned from content_profile_get_settings() was empty. This was finally fixed in #755308: Content profile settings are not saved which was not committed until 14th May 2010.
Short version: The patch in #20 needs to be rolled back.
Comment #24
fenstratHere's a patch which rolls back #20.
Applied to 6.x-1.x-dev this should fix all issues with "Auto Assign Role paths".
Comment #25
jay_N commented@24: patch works fine for me, thanks!
Demoing this to a client in half an hour so good timing as well! ;)
Comment #26
patcon commentedAwesome! thanks for pointing this out in the other threads, fenstrat :)
Comment #27
chris_getdepth commentedhey sadly i am still experiencing this issue even though the version of auto assign role module i am using has already had #24 patch applied to lines 448 and 461.
any ideas?
drupal version: 6.19
auto assign role version: 6.x-1.2
Comment #28
ocamp commentedanybody got a version of the module with the patch applied that they could upload please?
Comment #29
fenstrat@cnp The patch in #24 is to be applied to autoassignrole-6.x-1.x-dev not 6.x-1.2. Can you try again against the dev version.
@ocamp Patching is a pretty straight forward process, and a great skill to have. Have a look at http://drupal.org/patch/apply and see how you go applying #24
Based on feedback from fm_jay, patcon and others from duplicate issues I'd consider this RTBC
Comment #30
pwilson commentedI was having this issue, as well as the "Use on Auto Assign Role paths: " setting not saving. It would appear that autoassignrole.module's implementation of hook_content_profile_settings is a bit wonky. Seems to return only an array of the available user roles:
array('values' => array(
0,
1, ...etc
));
The problem is that everywhere else, the content_profile_get_settings call is looking for settings with the key "autoassignrole_use". If I change the hook_content_profile_settings implementation to return array('autoassignrole_use' => false) as a sane default, the form will now save the appropriate value in the appropriate variable, and my form shows up on user registration. I'm hoping the developer will see this and make this fix, hopefully based on any insight I have provided.
Comment #31
fenstrat@uncultured autoassignrole.module's implementation of hook_content_profile_settings is perfectly valid. content_profile.module's description of the hook is it "Defines content profile settings and their default value.". The hook simply defines the default values available for aar paths, i.e. make it available for all roles. aar path settings for individual content types are then activated by saving
content_profile_set_settings($type, $settings)where$typeis the individual content type the aar paths should be enabled for.Can you try autoassignrole-6.x-1.x-dev and then apply the patch above in #24. This should solve your issues. I'm using this on multiple sites, and 4 other people have reported this solved their issues.
Comment #32
calefilm commentedUPDATE: Issue Resolved
I got lucky by turning off my localhost acquia drupal control panel and attempted to apply the patch then... I turned off the terminal. Turned it back on again, applied the patch and it works! Thanks for the patch
original issue:
I can't apply the patch. I've installed patches before.. But this doesn't seem to be working for me.
Installed 6.x-1.x-dev
download: autoassignrole-699888-24-fix-role-by-path.patch
Apply it but all i get is no such file or directory
Comment #33
fenstratOk, that's 5 people who have confirmed #24 solves the issue.
This stops "Auto Assign Role paths" from working at all so upping to critical.
Comment #34
ocamp commentedIt stops what from working?
I applied the patch, the error doesnt display anymore, I create 2 new roles - role a and role b, give them 2 paths, signup/a and signup/b. If a user signs up via signup/a they become role a, if they sign up via signup/b they become role b.
Isnt that what its supposed to do?
whats it not doing?
Comment #35
YK85 commentedI'm pretty sure what fenstrat is saying is that the patch at #24 has been reviewed and tested by many and therefore needs to be committed asap to fix the issue in hand of "Auto Assign Role paths" not working properly.
Comment #36
cyberswat commentedWould be great if the automated tests pick up on it and pass it so giving that a go.
Comment #37
pwilson commented@fenstrat Looks like I was applying patch 24 to 6.x-1.2, not 6.x-1.x-dev. Works well now, thanks for the clarification! I have noticed that now when I enable a path I can't set the "Default Registration Page" option to "No". It doesn't appear to actually affect anything as the default registration page appears to be for the first role, which happens to work for my particular case.
Comment #38
maedi commentedsubscribing
Comment #39
cmcintosh commentedHey guys, First off great module. I have a module out that does about what yours does, but works as far as the paths are concerned. its not as graceful as yours, but thought I would link to it here, so that maybe you can take what I did that got the content_profile + paths thing working and maybe integrated into what your doing here. Let me know if you have any questions.
http://drupal.org/project/custom_registration
Comment #40
cyberswat commentedAwesome form ... you've already been pressured on duplicating the modules rather than help by contributing so you take it one step further by using the existing issue queues to advertise?
Comment #41
cmcintosh commented@cyberswat not even, i did not understand where to start with autoassignrole or how to fix it and needed something that worked quickly, so i built it. I would much rather have the functionality I have at custom_registration moved into this module
Comment #42
cyberswat commentedhttp://drupal.org/cvs?commit=414676 per multiple RTBC comments ... apparently test bot is borked
Comment #43
cyberswat commented@cmcintosh Actually, that is exactly what you've done. #891208: What is the difference between this module, and the existing ones?
Comment #44
cyberswat commentedIt sounds like this has been resolved completely by the last commit .. thx @cmcintosh for testing. Can anyone else verify the fix? I'd seriously like to see this issue die for good.
Comment #45
fenstratWe've been using the committed patch in #24 on a number of sites. So I can verify it fixes the issue. Thanks to every for their efforts.
Can we get a new stable release? "Auto Assign Role paths" is totally broken in 1.2.
@cyberswat I assume you didn't get around to implementing tests for this?
Comment #46
fenstratWhoo, somehow the commit in http://drupal.org/cvs?commit=414676 contained 2 php parse errors. This was not in the patch from #24
Attached is the fix.
Comment #47
sammo commentedThanks this works for me
Comment #48
cyberswat commentedhttp://drupal.org/cvs?commit=417348
@fenstrat Nope ... I don't use this functionality at all so am 100% reliant on the community to provide tests. I would love to not accept patches until they have legitimate tests in them but all I seem to have in these queues are users that reiterate that something is broken and aren't exactly forthcoming with patches. As a result there aren't tests that walk through the content_profile integration.
Thanks for your help.
Comment #49
sammo commentedThanks for fixing. I've done some testing with content_profile and I get this error when visiting a custom registration page
warning: in_array(): Wrong datatype for second argument in /usr/home/mysite/my_html/sites/all/modules/contrib/autoassignrole/autoassignrole.module on line 461.
I didn't get this when applying fenstrat's patch #24 before it was committed
Edit: I've reinstalled the module and applied patch from #46 and this now works.
Comment #50
fenstratThanks cyberswat. I generally find that patches speak louder than words here on d.o. I'd like to get to tests for content_profile integration, just need more hours in the day!
Any chance of a new stable release? content_profile integration is pretty broken in 1.2.
Comment #51
cyberswat commented@sammo could you please check out the dev branch from cvs and help verify that what is in cvs solves this problem?
@fenstrat I'd be willing to do a stable release if I could get a couple more people to verify that what is in cvs right now is functional.
Comment #52
cyberswat commentedJust an FYI ... I just did some spring cleaning on the issue queues so everything that needs to be in place for a release is in cvs ... if a few of you can sign off that everything appears to be working and validate content profile integration I'll go ahead and create the release.
Comment #53
sammo commented@cyberswat - I have disabled autoassignrole downloaded the CVS and then enabled autoassign role again. I've not used CVS before but I ran this which I think is correct, at least the .module file was dated sep 8:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-6--1 -d autoassignrole contributions/modules/autoassignrole
I've tested registration with content profile via path and via user selection. This worked fine for me. Is there anything else you want me to test?
Comment #54
cyberswat commented@sammo that is so awesome ... thank you very much! I would prefer to get one more person to validate that the current DRUPAL-6--1 branch works for them before rolling a stable release. I'll give it a few more days and see if anyone else helps ... if not I'll run through some tests over the weekend and see if we can't get something released in the next few days.
Comment #55
sammo commented@cyberswat Thanks and no problem, I'll keep running this version and let you know if I have any issues. I'm actively developing a site so hopefully I will notice pretty quickly if there are any bugs.
Comment #56
fenstratI can also confirm 1.x-dev is working fine.
I haven't explicitly tested the functionality of the latest 2 commits: #830314: You can not replace the user register page with a node if a path has been designated as the user register page. or #688934: autoassignrole_get_roles() is broken, however everything seems to be working well.
Comment #57
dadderley commentedHad the same problem with the 6.x-1.2 release.
The 1.x-dev release from September 8 seems to have cleared it up.
Comment #59
ecksley commentedI am testing the 6.x-1.2 release and am still getting the error noted above:
Perhaps this is noted elsewhere, but the module also seems to throw the following error on my Content Profile configuration page (/admin/content/node-type/my-profile-type/profile)
Although I try to select the option to "Use (The Content Profile Fields) on Auto Assign Role paths:" my change is never recorded.
Some folks have cited a dev release that works, but there no longer seems to be one for Drupal 6.
Comment #60
mhrabovcin commentedThere is wrong value returned in hook_content_profile_settings(). This fix helped me.
Comment #61
Sknight17 commentedError still exists for Drupal 6.20 and Auto Assign Role 6.x-1.2. patch @60 works great so far.
Patch @20 also fixed the issue for me, however, because of the reported errors associated with the fix I neglected to use it.
Comment #62
sayela commentedAutoassignrole 7.x-1.x-dev doesn't appear in user registration forms after creating roles and configuring.
Comment #63
darin73 commentedI have the same problem
Comment #64
fenstratThis issue was fixed by the patch in #24 which was committed on September 1, 2010 in #42.
As autoassignrole-6.x-1.2 does not include this patch and as such you must use the autoassignrole-6.x-dev. This fix will be available in the next stable release (6.x-1.3).
As for 7.x problems in #62: create a new issue, please don't reopen old resolved issues.
Comment #65
fenstratAlso note that this fix was included in autoassignrole 6.x-2.0-beta1
Comment #66
manoloka commentedI can confirm that the patch at http://drupal.org/node/755308 sorted this problem for me
Comment #67
fenstrat@manoloka please see #64
Comment #68
Adèle commentedI installed the version 6.x-1.2 and I tried to use the patch in #24 but the problem isn't fixed. The path is not save.
Could customization of registration template be the source of the problem ?
Otherwise, can anyone help me please ?
Thanks,
Adele
Comment #69
fenstrat@Adèle please try 6.x-1.x-dev or 6.x-2.0-beta1, both of which include the patch from #24. If problems persist please open a new issue.
Comment #70
Adèle commentedThe version 6.x-1.x-dev seems to be not available anymore. I tried the 6.x-2.0-beta1 but the problems persist. I will open a new issue.
Thanks for your answer.
Comment #71
fenstrat.
Comment #72
abcdgeek commentedFYI, applying these patches to version 1.2 works :
http://drupal.org/files/issues/autoassignrole-content-profile-settings.p...
http://drupal.org/files/issues/autoassignrole-699888-24-fix-role-by-path...
I applied them manually and finally got rid of the traditionnal errors and CCK-fields miss
Comment #73
leewoodman commentedCould anybody confirm if auto assign role path for Drupal 7 works? I can't find the administrative option to set the path to my two profiles
thank
L
Comment #74
fenstratSee #69 above.
@alwoodman please open a new issue.