Closed (fixed)
Project:
User Relationships
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Dec 2008 at 04:23 UTC
Updated:
31 Mar 2009 at 11:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fred0 commentedI'll second that.
Comment #2
Anonymous (not verified) commentedyess, please!!!
Comment #3
4drian commentedWould love this too. Invite appears to be pretty stable on D6. Is this functionality in the roadmap or would it take a specific requirement and/or sponsorship to complete?
Comment #4
alex.k commentedIt would be nice to do it, especially because 5.2.x branch has it. However, I don't use Invite module, so it is not high on my list... Please vote here if you really need it. If someone can contribute a port, I'd be happy to help out.
But it is on the roadmap to integrate with http://drupal.org/project/ldap_provisioning, which is what I use for inviting users to the site.
Comment #5
SeanBannister commented+1 Yes I'll be needing this feature for 2 clients, 6 sites.
Comment #6
jaydub commentedI'll provisionally assign this to myself. A quick glance at the code from the 5.x branch doesn't look too hard to port.
However the status of the Invite module itself for Drupal 6 looks a bit worrisome. Looks like no activity for going on 2+ months now.
If Invite for Drupal 6 is not working then my work will halt and this issue will stay postponed until Invite moves forward (hopefully this will not be the case).
Comment #7
jaydub commentedOk anyone want to try out this port?
Comment #8
fred0 commentedJust started testing. Didn't get very far before finding that the /admin/user/relationships/settings menu fails to a blank page. Process of elimination (delete functions one at a time and try page load again) leads me to believe that the offending code are the 2 lines that begin at module_load_include of this function:
Comment #9
fred0 commentedMight also be the inclusion of $form_state in the line
Deleting that also seems to fix the blank page problem.
However, deleting it also causes the registration page for the invited user to fail to show the relationship type in the "are you a friend of user" question. It also returns an error on registration:
warning: Invalid argument supplied for foreach() in /sites/all/modules/user_relationships/user_relationships_api/user_relationships_api.api.inc on line 33.
Comment #10
avpaderno$form_stateis an argument passed to any implementation ofhook_form_alter()in Drupal 6, and Drupal 7 (see the documentation); therefore that is not the reason the patch is not working.Comment #11
avpaderno@#8: In the reported code, the line starting with
if (!(module_exists('invite')seems wrong; if the patch should allow to integrate this module with invite.module, then the line should rather start withif ((module_exists('invite').Comment #12
fred0 commentedGood eye!
Thanks Kiam. That seems to solve the blank page issue. I'll test the rest and report back.
Comment #13
avpadernoThe patch need to be changed.
It's not clear why the code is checking if both user_relationships_api.module, and user_relationships_ui.module exist when one module requires the other; in this case, if
module_exists('user_relationships_ui')returnsTRUE, alsomodule_exists('user_relationships_api')returnsTRUEbecause of the dependencies between the two modules.module_exists()doesn't check if a module exists (like the name would make think), but checks if the module is in the list of the loaded modules; that means that if the module file exists but the module is not enabled, the function will returnFALSE.Comment #14
jaydub commentedRegarding a blank page, no such problem here. It would be very helpful if you can have error display turned on or be able to check your logs to see what if any PHP error is reported before you start removing or changing code.
Regarding #11 the line in question is:
If you look closely you can see that the ! negation test is against the 3 module_exists calls. So the negation tests whether all 3 modules exist and thus is in fact not a bug.
Comment #15
avpadernoIt's true. My apologies for reporting something not correct.
Still, the code is calling
module_exists()three times, when it should call it twice; one of the last two modules depend on the other, and it's not possible to load one when the other is not loaded. In this case, as user_relationships_ui depends from user_relationships_api it's enough to writeComment #16
fred0 commentedjaydub: thanks for the clarification.
The blank white screen also occurs on the Add type relationships setting page.
Per your suggestion I enabled error display, but the blank white screen seems to fail enough that no error is displayed. I also checked the logs and there were no relevant entries.
Drupal 6.9
Invite 6.x-2.x-dev (2008-Nov-14)
UR 6.x-1.x-dev (2009-Jan-27) -also tried with 6.x-1.0
The only component of either of the modules I don't have enabled is UR-Node Access.
Since deleting the $form_state from the function like #9, deleting the 2 lines like #8 or deleting the ! like #11 (which causes the function to skip using $form_state['values']) "fixes" the problem, something about that particular variable is causing the issue I am seeing.
Comment #17
fred0 commentedI should add that List and Add default work fine.
Comment #18
jaydub commented#16, deleting the $form_state parameter is a non-starter. That's part of hook_form_alter: http://api.drupal.org/api/function/hook_form_alter/6
#8 & #11, you remove these and don't get a white screen BUT does the module then proceed to do what it's supposed to do which is to integrate Invite with UR? I doubt it since the code you are changing would result in the integration not working.
Can anyone else verify that the code in #7 results in a white screen when visiting the UR settings page or add relationship type page? I do not get a white screen.
if you get a white screen, PHP surely is bombing and the error has to be somewhere. Do you have PHP error logging enabled in your php.ini?
Comment #19
fred0 commentedI did not. Turned it on and got this:
httpd: PHP Fatal error: Cannot redeclare user_relationships_ui_request_validate() (previously declared in /sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.admin_actions.inc:121) in /sites/all/modules/user_relationships/user_relationships_ui/user_relationships_ui.actions.inc on line 47
Comment #20
avpadernoFor what I can see,
$form_state['values']is passed to a form builder function only for multistep forms; normal form builder functions don't get any value for that array key.Comment #21
avpadernoIt's the same function that has been written twice in different files; they are not two different functions with the same name.
Comment #22
jaydub commentedKiam@avpnet.org, do you get a white screen in any situation?
Comment #23
jaydub commented#19 yep looks like a function is declared twice. Not sure which one is the newer implementation. Have to kick this up to alex.k to see if he knows.
In user_relationships_ui.actions.inc
In user_relationships_ui.admin_actions.inc
Comment #24
jaydub commentedThe functions have both been in their respective files since the files were added to CVS for the 6.1 branch so not sure what's the deal here. The original module author is out of the picture now so it's up to us to sort out whether to remove or rename.
Comment #25
avpadernoThe code is the same in both the files, so there isn't a newer version.
Comment #26
jaydub commentedno they aren't the same....look at the code right after the first IF test.
Comment #27
avpadernoNo, I don't get any WSOD. I copied the module contained in the archive attached here, and I don't have any problems using it in the test site I have on my PC.
I don't know if this is related, but in the triggers page for UR-API, I see an empty page.
Comment #28
fred0 commentedWell, as a test, I deleted that function first from one file (then replaced it), then the other. Removing it from user_relationships_ui.admin_actions.inc did nothing (still got WSOD). Removing it from user_relationships_ui.actions.inc allows the pages to load normally.
I'd just like to add here that in any of my posts in this thread I was never advocating removing variables or functions. My descriptions of deleting things was simply as a process of elimination test to see what might be causing the WSOD.
Comment #29
fred0 commentedFollowing up on this, I started with a clean install of Drupal 6.9 to re-test for the WSOD.
After basic install, I enabled Blog, Path, Pathauto and Token modules. Then enabled Invite. Next enabled UR-API and UR-UI and check settings page: all ok. Next enabled UR-Invites and rechecked: still ok. Enabled remaining UR modules 1 by 1 checking every time: ok. Enabled Views and UR-Views: ok.
Added relationships for testing and invited a new user. Everything worked fine.
Logs were clear of errors too.
Next, since Kiam mentioned Triggers, I tried to enable the Trigger module and got a validation error. Immediately went back to UR and started getting the WSOD as I describe above. Triggers had failed to enable so, I tried again and this time it succeeded. The WSOD persisted however. I then disabled and uninstalled Triggers, but the WSOD still persists.
There was no log error to accompany the validation error. The WSOD gives the same log error as I listed in #19.
Comment #30
avpaderno@#26: Yes, I was wrong.
In this case it's enough to see if the code for the form uses a form item named rtid; if that is the case, then the code using rtid is the correct one.
Comment #31
paganwinter commentedSubscribing...
Is this for the D5 ver.?
Comment #32
paganwinter commentedHi all,
I am currently working on a project that needs to go live 5 days back... :P
Is there some hack that I can use in the meanwhile that will alow me to let inviters add invitees as 'friends' (that's the only relationship I am using right now).
I thought of a very basic option of letting the inviter add the invitee as a friend using a link that'll be shown when the invitee joins the site. This link could be placed along with the message that is shown to the user when his invitee joins.
Something like the following:
' () has joined !'
'Add as a friend'
being a link requesting the invitee for a friend relationship.
That is the easier way out.
Instead is there some way I can programatically make the inviter request a friend request to the invitee?
I am right now going through the patch you have submitted. Any help in this regard would be greatly appreciated...
:)
More specifically, is there some way that I can call the menu path (relationship/%user/request) as if the inviter was calling it, upon registration of the invitee?
Or if not this, at least how can I send a mail to the inviter upon joining of the invitee?
Comment #33
jaydub commentedRe-rolled the patch with minor changes.
Use on a freshly updated UR -dev snapshot as the new snapshot has addressed the question of the duplicated function declaration referred to in #23
Comment #34
fred0 commentedSeems to work as advertised.
Comment #35
mariusooms commentedHi Jaydub, would there be any objections to see if this contrib module could be ported to support friendlist as well? Seems like a lot of good effort has gone into this and would a welcome feature for us as well. Just wanted to ask permission without assuming anything. If so, I will make an update we will support the invite module as well in the issue queue (http://drupal.org/node/372404).
Regards,
Marius
Comment #36
jaydub commentedNo problem feel free to use for friendlist. We haven't added to the projet yet but what you see is pretty much ready to go
Comment #37
mariusooms commentedSounds good...thanks for the go ahead.
Marius
Comment #38
fred0 commentedSo, can this be added to the next dev release?
Comment #39
alex.k commentedSeems to be ready to be committed. @jaydub when you have a chance, please add to CVS. Thanks for working on this!
Comment #40
jaydub commentedWill do. Still in DC but will be back tomorrow!
Comment #41
jaydub commentedAdded to CVS
Comment #42
alex.k commentedMany thanks @jaydub!
Regarding #23 and #33 the function has been removed in CVS for good (was commented out previously).