Closed (fixed)
Project:
User Relationships
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 May 2009 at 03:36 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alex.k commentedI'm not planning to integrate with Rules, as it's not a priority. FL needs Rules to send out emails, while UR has the Mailer submodule to take care of that. So for UR, Rules would be more of an add-on than a necessity.
Comment #2
henrijs.seso commentedthanks for info alex. for me rules seems to be necessity so ill try to come up with nice and clean ur.rules.inc file and I hope you could at least take a look at code and comment on it when its ready...
my idea is that rules (via flags and tokens) may provide a way for commenter and node author to establish relationships with one click on node page (well, the other way around in my case). first draft is working well.
also user_relationships_api.actions.inc has large part of code for actions commented out and it seems it contains reusable material. what happened to that code? any history? is this code animated, does it do something?
Comment #3
alex.k commentedThis would be a great addition, let's see what you come up with.
also user_relationships_api.actions.inc has large part of code for actions commented out and it seems it contains reusable material. what happened to that code? any history? is this code animated, does it do something?
Somebody asked me this a while ago as well... The code was commented out when I inherited it from the original author - so I don't know what state it is in. It does look pretty good at a glance. Please uncomment it, and see how it works. It would certainly be advantageous to use actions, rather than one-off code.
Comment #4
henrijs.seso commentedI have a question about
user_relationships_delete_relationship(&$relationship, &$deleted_by, $op = 'remove');and in particular about $relationship. It has to be "object of the relationship". How do I load such object if I have 2 UIDs. Handbook (http://drupal.org/node/203396) says i could use
user_relationships_load($param = array(), $count = FALSE, $sort = 'rid', $order = NULL, $limit = NULL, $include_user_info = FALSE)and that special key
array("between" => array($uid1, $uid2))will return all relationships between the two user ids. Im trying to get it to work but not with much luck so far. Ideally id like to receive only relationships of particular type.Is handbook up to date? Maybe you could write some EXAMPLE parameters of that you THINK should work?
Comment #5
alex.k commentedIf you already know the relationship type id, then you could simply add it to the $param array, like so:
The book pages you reference are for 5.x-2.x, actually... I added a note in them. The most up to date documentation on the API are comments in front of each function in user_relationships_api.api.inc
Comment #6
henrijs.seso commentedThanks for the tip. Im getting error with this code:
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\test02\sites\all\modules\user_relationships\user_relationships_api\user_relationships_api.api.inc on line 36.
It looks like first line does the magic and I get $relationships =
Array ( [26] => stdClass Object ( [rid] => 26 [requester_id] => 1 [requestee_id] => 3 [rtid] => 1 [approved] => 1 [created_at] => 1243971262 [updated_at] => 1243971262 [flags] => 0 [name] => friend [plural_name] => friends [is_oneway] => 0 [requires_approval] => 0 [expires_val] => 0 ) )
maybe second line
$relationship = $relationships[$rtid][0];does not work?Any ideas?
Comment #7
najibx commentedwithout Rules modules, could UR send email only to his manager (already established one way relationship) when he submitted a node, for his manager's approval? i.e change cck field from draft to live state?
Or else, without using Rules, could this be achieve with workflow module as well? Or friendlist is better option?
Comment #8
msmccask commentedHey - I have run into a situation where rules integration into user relationships would help me as well. Just curious if you were able to make any headway on this type of thing. If so, I'd be happy to help test/move forward.
Thanks.
Comment #9
henrijs.seso commentedyes, i need it too, but there is something not right, as explained in #6
Comment #10
Bilmar commentedI would truly appreciate Rules integration with User Relationships as well. Currently working on a website and I have hit a roadblock that requires this integration. Thank you.
Comment #11
henrijs.seso commentedNow iv got some time on my hands and will try to look into this.
with just first line of #5 code i get error
warning: Attempt to assign property of non-object in C:\xampp\htdocs\test02\sites\all\modules\user_relationships\user_relationships_api\user_relationships_api.api.inc on line 257.Comment #12
henrijs.seso commentedfirst steps in rules integration - adding and deleting relationships
It's alive!attached you will find .zip file, expand it in user_relationships_api folder in user_relationships module folder (there are 2 files in archive). You will need token and rules modules of course. This will give you new actions in rules - "Request relationships between users" and "Delete relationships between users".
I created flag "Add author as friend" and if node is flagged with it action "Request relationships between users" happens and if node is unflagged action "Delete relationships between users" happens.
As for configuration of ADD actions I set [flagging_user:user-id] as Requester, [node:author-uid] as Requestee, 1 as Relationship type (maybe this can be made into drop down list with proper relationship type names), something as Message (for elaboration, you can use tokens for all kinds of custom messages, does not work yet, i think) and Require confirmation checkbox if it is needed (does not work yet, i think). For DELETE action I set remove as Op.
Voila! When you flag node, you become friend with its author, unflag and your friendship is gone with wind.
here is code, please suggest how to make it better, you know i am not coder :)
Comment #13
henrijs.seso commentedComment #14
electricmonk commentedHi all,
We've had a need for hooking into the different UR events, so we've taken the patch above, made it a full module (user_relationship_rules) and added event integration for request/approve/deny/remove actions.
This module is far from complete, for instance lacking a condition to narrow the relationship type, but it's a start. I strongly suggest that it be committed into the UR codebase.
- Shai
Comment #15
drupov commentedSubscribe
Comment #16
henrijs.seso commentedthanks monk,i definetly have no skills yet to take it that far. great job.
Comment #17
Michsk commentedI to would love this , UR and rules. When a members registers you can imidalty make a friendship with the admin. What i also would love to see is that when a member registers they imidiatly get a PM message
Comment #18
alex.k commented@lasac
Have you tried the module in #14? Please test and comment with your feedback. Thanks!
Comment #19
Michsk commentedYes i have seen it and am going to test. Will get back to you asap.
Comment #20
Michsk commentedFirst off.
This is exactly what i need! Keep on developing!
First thing:
1) I created a relationship, gave it the requester and requestee id and the id for the relationship. When the user has registered it shows the ids in the message
96
115
1
You have reggisterd for more info look at email etc etc etc...
- Debug rule evaluation
- Show fixed rules and rule sets
Above are turned off.
2) The relationship is not active even though i have NOT checked Require confirmation.
(Maybe because the relationship settings need confirmation? I would like relationships to set without needing to confirm when activating a relationship trough rules)
3) A e-mail is being send with the aproval link for the relationship. This is confusing. Because members gets two email first is activation for account and second for relationship. Make it a option to send the email? Or automaticly not send a email when the above (2) is done. So when the relationship doesnt need confirmation then just dont send the email.
4) The PM is not recieved. Look like it even isn't send out. PM settings for new users are accept PM from everybody, so that can;t be the problem.
Al with all. the module doesnt quite work YET. When more testing is needed contact me. I will be following this topic.
Comment #21
geraldito commentedThanks electricmonk for this patch. Works for my approach to detect new UR approve event and create a new node using the $requester->uid as node author.
Comment #22
mortenson commentedIs there a way I can send email to my related users when content is created?
I tried with rules and actions but it seems not possible.
thanks for you work!
Comment #23
Michsk commentedalex.k any news on this???
Comment #24
d4rkngel commentedhi mortenson
i have did it, but i don't know if is the best way to do it (i'm not a coder), if somebody can find a better way please post it. I have 2 types of relationships, two way (friends) and one way (followers), so when a user create new content an e-mail is sent to all his followers.
Modules: rules, tokens.
You need to create a new rule with the following:
Condition: (Execute custom PHP code):
Action: (Execute custom PHP code):
Comment #25
DrakeRemory commentedI implemented a condition to check for a specific relationship type. I also added a drop down for selecting from the available types. I put the same form element in the already existing forms that were using this as well. There's still some work to do but this is getting close.
Comment #26
Michsk commentedgoing to test it out, thanks drakeremory!
Comment #27
Bilmar commentedDrakeRemory - thank you for the great work!
I tested your User Relationships Rules module and all the events worked perfectly!
Only request I have is for the 'request expired' event to be added.
For each relationship type there is 'Request expires in:' setting that is available. Would this event be possible?
Again, awesome work!
Comment #28
DrakeRemory commentedI'm sorry but this couldn't be done easily at least not by using hook_user_relationships because there is no such operation as "expire". I'm not quite sure how expiration is implemented in user relationships (and I don't have the time right now to dig into this) but I'm guessing it is just done by limiting sql queries. Therefore the event doesn't exist.
Comment #29
gallamine commentedAny status on getting this committed to the project, or perhaps turned into a completely separate project?
Comment #30
Bilmar commentedHello everyone,
Attached is a User Relationship Rules module that was being developed but not completed.
I would really appreciate it if someone could take a look and clean it up to be used by the community.
The structure is different from the one in #25 and I'm not sure which is better. If #25 is the correct way then maybe the 'A user relationship has expired' from the attached module can be implemented into #25? Thanks very much in advance.
Events
1) A user relationship has been approved [works]
2) A user relationship has been disapproved [does not currently work]
3) A user relationship has been canceled [works]
4) A user relationship has expired [works]
Comment #31
rburgundy commentedconfirmed #30 all works except for Disapproved relationship and #25 all works except for expired relationship.
can anyone take a look into combining into one awesome User Relationships Rules module for everyone to use?
Comment #32
rburgundy commentedIt looks like 'Relationship request has expired' comes from event:
Would anyone be able to add this to the module in #25?
Comment #33
d4rkngel commentedI have a problem.. I have two relationship types 'friend' and 'follower', I'm trying to send an email when a relationship is requested... with 'friend' works fine but when I try with 'follower' this message is shown:
warning: array_shift() [function.array-shift]: The argument should be an array in /home/hamster5/public_html/sites/all/modules/user_relationships/user_relationships_rules/user_relationships_rules.rules.inc on line 176.
This is with #25
Comment #34
DrakeRemory commentedI added the missing events for request expired and relationship deleted. I haven't tested the expired one but if it worked in the one from #30 it should work in this one as well.
I wasn't able to reproduce the issue in #33. Can you give me further information about your settings for the follower relationship type and the event on which this happens.
Comment #35
d4rkngel commentedRelationship Configuration:
Requires Approval: no
This is a one way relationship: yes
This one-way relationship can be reciprocated: yes
Rules:
Event:
A user relationship has been requested (I've tried 'A user relationship has been approved' but not email is sent)
Condition:
Relationship has type
Arguments configuration
User who initiated the request:
same
User whos relationship is requested:
same
Relationship:
The relationship object
Relationship type:
follower
Action:
Send a email to a user:
User whos relationship is requested
I get this error over and over again I'm trying different ways but is always the same, maybe I'm doing something wrong?
Comment #36
Bilmar commentedThanks DrakeRemory! I will be testing this weekend.
fyi - I came across an issue with requests not expiring with User Relationships module (not related to this custom module; this module can be turned off and still same issue) and looks to be discussed here http://drupal.org/node/681094 If anyone can look into it or subscribe to show interest please visit the link. Thought this info might be helpful so people don't think the fault is with this user relationships rules module.
Comment #37
DrakeRemory commented@Hamster5: I still can't reproduce this. It's working fine for me. What version of user relationships are you using?
Comment #38
d4rkngel commentedmm, that's weird I'm using 6.x-1.0-rc3 or should I use the dev version?
I've tried to make a condition where I execute php code using
And the error is gone, and works fine but when I approve a 'friend' relationship, it send two e-mails, the one for 'friend request' and 'follower approved', I'm still proving
Sorry but I'm not a coder... so i don't know what i have to do...
Comment #39
Babalu commentedsubscribe
Comment #40
Bilmar commented#34 (combining #25 and #30) looks to be working great.
One small thing is to set "Rules module" and "User Relationships" as a dependencies for enabling the custom module.
For people who are testing, if you are experiencing problems with expiring requests (all requests after the first request not expiring) please subscribe and share info at #681094: Relationship Request not Expiring as per settings
Comment #41
YK85 commented+1 subscribing
Comment #42
robby.smith commentedHello everyone following UR-Rules Integration,
I wanted to bring to you attention this feature request I opened #678806: Admin exception for 'Restrict Private Messaging to only related users', which expands on the UR-Privatemsg integration to give admin a level of privilege to still be able to send messages to any user. This is refering to the setting at www.example.com/admin/user/relationships/settings for "Allow sending messages only to confirmed relationships".
I believe this will be needed if we want a system message sent to the user notifying them of notifications using Rules, but still only wanting users to be able to message each other if they have a relationship. I am currently trying to set this up and hit this roadblock. I have no programming skills and would appreciate the help of the community =) Thanks!
Comment #43
Bilmar commentedSuggestion for additional Actions:
1) Create relationship between users
2) Approve relationship between users
3) Cancel relationship between users
Already existing Actions:
1) Delete relationships between users
2) Message user via messaging
3) Request relationships between users
Comment #44
DrakeRemory commentedI'll look into this this afternoon.
Concerning #42 I suggest a condition checking the setting.
Comment #45
robby.smith commentedhey DrakeRemory,
Please let me clarify #42. The setting at http://www.example.com/admin/user/relationships/settings for UR-Privatemsg integration works as the setting implies.."Allow sending messages only to confirmed relationships", and a Rule to send a privatemsg to a user from Admin is Denied because of it (Admin is treated as any other user). But I think that Admin should be able to have an exception (especially beneficial for UR-Rules integration!). I posted #42 hoping that someone may help with a patch that allows Admin to be given an exception.
I started the post [#678809] at privatemsg queue but the maintainer said that the setting lives in the User Relationship module so it should be asked here.
Hope you or someone in the community will be able to help. Your work with UR-Rules integration has been really great. Many thanks!
Comment #46
DrakeRemory commentedOk, I just finished implementing the new features.
Concerning #45: There are two new conditions now. The first one checks for one or more specific relationships between users. The other one checks the setting of a specified user, in this case the user who is supposed to receive the message. Using them both should give you what you want. If admins should be able to always send messages you can add another or block checking for the permisssion.
Concerning #43: Most of it was already implemented. I changed some labels to make it easier to see what each action can do.
I also removed this modules send message action. Rules integration was commited to the new dev of privatemsg.
Please test this!
Cheers
Comment #47
Bilmar commentedAwesome! I will be testing tonight and return with feedback.
Thanks for the great work!
Comment #48
robby.smith commentedHello DrakeRemory,
I have tested the newest version of your UR-Rules integration module and tried the new conditions to achieve a “Welcome Message”. (Note: I have the "Allow sending messages only to confirmed relationships" setting turned ON at http://www.example.com/admin/user/relationships/settings because I want to restrict users to be able to only send messages to their ‘friends”. I am able to achieve the send welcome message via rules with the above setting turned OFF)
Below are the conditions I created and I hoped this will block checking for the permission and allow the Admin to send a message to the new user but it was unsuccessful.
Is the "Allow sending messages only to confirmed relationships" setting unable to be blocked for the admin? It would be awesome if someone could take a look at the code. Your help is much appreciated!
(1) Condition: Allow private messages only to relationships
User whose setting you want to check: acting user
Negate (checked)
Weight: 0
(2) Condition: Check if two users are related
User A: Acting user
User B: Registered user
Negate (checked)
Relationship Types: Friend (checked)
Weight: 0
(3) Condition: Allow private messages only to relationships
User whose setting you want to check: registered user
Negate (checked)
Weight: 0
I first tried with only (1), then only (2), then (1) and (2), then finally (1) and (2) and (3).
I was unable to have a “Welcome Message” be sent to a newly registered user.
Again, thanks for your great work and I look forward to helping get UR-Rules fully integrated!
Comment #49
Bilmar commentedHi DrakeRemory,
Great work with developing the UR-Rules Integration!
I tested the actions:
Request, create or approve relationships between users [worked great!]
Delete, cancel or disapprove relationships between users [worked great!]
I was a little confused by the below in Action - "Delete, cancel or disapprove relationships between users",
Replacement patterns for updated user
Replacement patterns for unchanged user
Replacement patterns for acting user [this is clear]
The conditions I am not clear on how to use, but would really like to learn how to use.
It seems like from your explanation in #45, we should be able to checking Event: "A message is sent" (Privatemsg) and set a condition for if the users does not have a relationship to one another to not allow the message to be sent. Is my understanding correct (this would be awesome)? and could you please explain how this can be done?
Thanks!
Comment #50
Bilmar commentedAnother thing I just noticed:
In a Rules set: Rule: Action there are no "Token replacement patterns" available for Requester and Requestee.
I made sure to add Relationship as an argument in the Rule set. I see the "Token replacement patterns" in Triggered rule but not Rules set=>Rule=>Action.
Thanks!
Comment #51
d4rkngel commentedStill the same problem here :( I think that I'll have to return using UR Mailer...
Comment #52
rburgundy commentedI look forward to the next version of the User Relationships-Rules module.
Any updates?
Comment #53
DrakeRemory commentedHi folks,
I'm pretty busy right now so I won't be able to spend time on this in the next 2 weeks.
Comment #54
Bilmar commentedWe all understand. Your work has been awesome and we hope to hear from you again in the next several weeks.
If anyone else can continue DrakeRemory's work and add the last missing features it would be much appreciated.
Thanks!
Comment #55
Bilmar commentedThe issue with requests not expiring has been fixed by alex.k #681094: Relationship Request not Expiring as per settings
However, with this fix and further testing I have found a problem with an event in this custom module:
The event A user relationship request has expired does not work as it should. It gets triggered without any problems but the Event cannot differentiate between one request expiring and multiple requests expiring for the logged in user.
For example: User A sends 3 relationship requests within 5 minutes. One day later they all expire (during the same cron cycle as the requests were close to one another). The Event is triggered only once(!) and not per expired request. This is an issue as I am aiming to set off an Action per request that is expired.
Please let me know if more details are needed in the above explanation.
Thanks!
Comment #56
2ndChanceTech commentedso I've installed the package and not sure if it's working correctly.
I have dev version of User Relationships.
Here's what I'm trying to do (if possible).
I'm using the invite module to auto create a relationship between inviter and invitee (works fine).
I called this relationship "Affiliate"
Now what I'd like is.
When User is granted points (event, works fine)
Load User Account -> Affiliate Requester (can't find proper token, or make work).
So I guess the question is, can the ID of a user be loaded based on their relationship to the current user?
-----------------------
I tried to find a work around using event "when user relationship is requested".
Load content profile of requestee
populate field w/ Requesters ID
I figured by making an affiliate field in the content profile, I could populate it with the ID of the requester and hide it.
The work around would of done what I needed, however the event doesn't trigger!
Comment #57
YK85 commentedHello, I was wondering if there has been any further development in this UR-Rules integration?
Can anyone else in the community help to finalize this module that integrates these two awesome modules? Many thanks!
Comment #58
robby.smith commentedit would be really nice if someone with programming knowledge would be able to spend a little time to finish cleaning up the language and look into fixing/removing the "request has expired" event as it doesn't seem to work properly.
@maitainers of User Relationships - is it still not possible to include this rules integration with the core module?
Comment #59
okday commentedsubscribing
Comment #60
Johnny vd Laar commentedsubscribing
Comment #61
sashainparisline 183: variable should not have & when you use it - only when you declare it.
Comment #62
robby.smith commented@bloggybusiness - i dont think there is anyone maintaining this
would you be able to kindly go through the current version at #46 and update it?
as per #55 the event: request has expired does not work. i confirmed this with testing
thank you!
Comment #63
gorgo commentedHi,
This seems really awesome!
I'm new to rules in drupal and I'm having a hard time using this...
I am using the Ucreate module to allow certain roles to create users. I'm trying to get this rule to automatically create a 1way relationship between the logged in user (who created the new user) and the new user (which I'm not sure how to get his newly created ID...) once the account is created.
Is this at all possible? could anybody please explain to me how I can go about it?
Thank you!
Guy
Comment #64
gorgo commentedok I ALMOST got it!
I managed to get rules working to set the relationship the only problem I'm having is getting the variable for the new created used id... tried [user_added:uid] but that didn't work. anybody?!
Comment #65
Bilmar commentedSummary of UR-Rules Integration module
Below is a breakdown of what this module offers for UR-Rules integration and changes needed for someone that could take the time to run through and finalize the work. The most recent version of the module is available at #46 (http://drupal.org/node/468764#comment-2486950)
Events
1. A user relationship has been approved
2. A user relationship has been cancelled
3. A user relationship has been denied
4. A user relationship has been removed
5. A user relationship has been requested
6. A user relationship request has expired [This needs to be removed from the module or the label renamed to say something like 'User Relationships expire request task has run' and add warning on the use] - The User Relationships module request expiration is triggered on cron run, but maximum once per 24hrs, and the task will expire all requests queued for expiration in one batch. Therefore, the rule event will be triggered only once even if 2+ requests are being expired. If you need a rule to be trigger for each request expiration, this functionality can be achieved using rules scheduling.
Conditions
1. Allow private messages only to relationships [I am not sure how to use this. Maybe not needed?]
- The settings to allow this functionality is at www.example.com/admin/user/relationships/settings
2. Check if two users are related
3. Relationship has type
Actions
1. Delete, cancel or disapprove relationships between users
2. Request, create or approve relationships between users
Regards
Comment #66
Bilmar commentedBringing the current state of the UR-Rules module up to the front.
I made minor changes:
1) the word 'denied' changed to 'disapproved' in order to be in line with the UR module
2) added dependencies to user_relationships and rules in .info file
I don't know programming so this is as much as I can do =)
Comment #67
mstef commentedNot sure how this red flag went unnoticed...
When confirming a friendship with a rule from this being triggered:
Anyone else?
Comment #68
mstef commented@66: I don't want to sound rude, but if you don't know how to program, don't try to. Your .info file was wrong. The module required is supposed to be user_relationships_api.
Comment #69
mstef commentedProblem stemmed from a bug in UR itself, regarding Token evaluation. I posted a patch.
See: #811222: Incorrect Parameter inside user_relationships_api_token_values()
Comment #70
Bilmar commentedIf no one is going to work on it (for half a year), I'd rather try and fail than sit around and do nothing.
All changes were documented in #66 (nothing left out). If the changes were incorrect, someone can fix it and upload a correct version. I do appreciate you working on it and will support by helping test the module.
Thanks
Comment #71
DrakeRemory commentedSummary of UR-Rules Integration module and new Version
Below is a breakdown of what this module offers for UR-Rules integration. I think this is pretty close to what this module should be.
Events
Conditions
Actions
Changes
Comment #72
Bilmar commentedThank you very much DrakeRemory!
Comment #73
jthomasbailey commentedIt works!
Comment #74
blueblade commentedsubscribe
Comment #75
joostvdl commentedsubscribe
Comment #76
mstef commentedPretty sure Line 16 in .module should be
NOT
Comment #77
joostvdl commentedThe Elaboration text is not available in the $relationship. I want to use it to send an e-mail.
It looks like if the rules are invoked even before the elaboration module can save the elaboration text to the database.
Is there a way in getting the text?
Comment #78
joostvdl commented@ #76
It's NOT working for me!
Comment #79
mstef commentedWell it works fine for me and fixes some bugs. One being that no data is returned on the action of a relationship being removed.
Comment #80
joostvdl commentedThis is the Rules evaluation:
#
* 0 ms "A user relationship has been requested" has been invoked.
* 0.088 ms Executing the rule "Send e-mailnotification to editors after Liefdespartner is requested" on rule set "A user relationship has been requested"
* 1.168 ms Condition "Relationship has type" evaluated to FALSE.
* 1.226 ms Evaluation of "A user relationship has been requested" has been finished.
It looks like that the Relationship Type is not evaluated correctly with your solution.
Comment #81
mstef commentedIt works perfectly for me. There's a bug in UR too which I had to patch. Probably why it's not working for you..
I'll post that issue here in a minute.
Comment #82
mstef commentedThis is what was needed: http://drupal.org/node/811222#comment-3146010
A few comments below that is a patch.
Comment #83
joostvdl commentedAfter applying Patch it still didn't worked. When I removed the Condition to check on Relationship Type. It worked.
Patch made also the complete $relationship object available, so the elaboration text is now also available. Only problem remains that checking on Relationship type failes.
Comment #84
joostvdl commentedI found why the check is not working:
In the function: user_relationships_rules_condition_relationship_has_type($relationship, $settings) (file: user_relationships_rules.rules.inc) it uses an array_shift call.
But the $relationship is an object. Therefore it doesn't work.
There are two ways to solve this:
1. convert $relationship in the user_relationships_rules_condition_relationship_has_type to an array before the array shift
2. Convert the object to an array in calling the invoke.
What is preferable?
Comment #85
mstef commentedWhatever works..
I came across these issues because 1) the relationship type token wasn't making it to rules, 2) i was getting the php errors listed on that issue 3) removing a relationship wasn't invoking the rules
Comment #86
joostvdl commentedAre there no other functions that thinks they are getting an array instead of an object (fired by the invoke function)?
Or do you need an object for the stuff you need? Otherwise I think that converting to an array with the invoke is the safest solution.
Comment #87
joostvdl commentedA patch....
I removed the array_shift because it isn't necessary at all. I added the line from #76
Comment #88
mstef commentedThis should be made into a separate project, no?
Comment #89
joostvdl commentedIf more people can test this functionality, I think it can be part of the UR as a submodule like all other parts. But that's up to the maintainers ....
Comment #90
YK85 commentedIt would be awesome if someone could take this into a separate project or if it could be added into UR module (preferably the later). Thank you
Comment #91
BenK commented+1 for adding this directly to User Relationships (as a sub-module).
Comment #92
berdirLooks like this is even part of Drupal commons.. :)
See http://cyrve.com/commons
Can someone verify that it is the same module and if there are any changes compared to the version here?
Also, a re-roll with the patch in #87 applied would be nice, I can try to review this then.
Comment #93
jazzdrive3 commentedYes, a re-roll with all of the patches applied would be very much appreciated!
Comment #94
Michsk commentedHow is this module going to life on? Will it be committed as a sub module or as a own module? Mikestefff: have you got any plans with this?
Comment #95
mstef commented@Berdir: Yes it is in Drupal Commons - not with the patch from comment 87. Along with my patch of UR_API ( http://drupal.org/node/811222#comment-3157674 ).
Comment #96
mstef commentedThis seriously needs to be a contrib module separate. There are about 3 separate threads I have to bounce around on for this module. Who's going to step up to the plate? I only patched it up - I don't want to take credit for writing it.
Comment #97
BenK commented@mikestefff: Do you mean that patch of UR_API (http://drupal.org/node/811222#comment-3157674) is included in Drupal Commons?
Also, I'm not convinced this should be a separate module so long as we can get alex.k to commit it. The reason is that Berdir and I have been working on the D7 port of User Relationships and I'd like to get in Rules support to the D7 port. I think this might create an unnecessary obstacle if we move this to a separate module.
--Ben
Comment #98
Bilmar commented@mikestefff - could you please re-roll for Berdir to give a final review. It will be awesome to get this into the D7 port and into D6 version.
@Berdir - would you be able to commit this as a submodule to UR in the future as I'm sure D7 version will want it? =)
I have started to write up documentation on use-cases with UR-Rules + Privatemsg + Userpoints similar to Userpoints-Rules at http://drupal.org/node/873386
Comment #99
mstef commented@BenK: Yes. Download Commons and view PATCHES.txt in profiles/drupal_commons/modules/
@trupal218: Re-roll what exactly?
Comment #100
Bilmar commentedHi mikesteff,
Is the patch at #87 needed after your patch at http://drupal.org/node/811222#comment-3157674 ?
Thanks
Comment #101
mstef commentedIt may help - I haven't yet looked at it - so no, it's not needed.
Comment #102
manuj_78 commentedDoes the Drupal_commons implement the UR_Rules integration?
And can someone please clarify what all patches need to be implemented to get the UR_rules working with User relationship
Comment #103
Michsk commented#102: yes commons implements this. And use the patch of #87
Comment #104
manuj_78 commentedAnd would it be a drop in replacement for User relationship module? I mean if I were to replace the User Relationship module from drupal.org with the user relationship module from drupal commons...will that work for any drupal site?
Comment #105
Michsk commentedand you would do that because? But to awnser your question, i guess it would work tough i dont know for sure.
Comment #106
manuj_78 commentedI had no idea why I asked that ..maybe because it was too late...
So as a summary I am assuming I need to apply the patches at
http://drupal.org/node/811222#comment-3157674 and
http://drupal.org/node/468764#comment-3169784
as well as
http://drupal.org/node/468764#comment-3029508 to get UR + Rules functionality
Is that correct or did I miss something?
Comment #107
chuckbar77 commentedThis is very exciting development! Can someone please re-roll the module with the patches required?
(subscribing)
Comment #108
manuj_78 commentedI applied the above patches..however I am not able to create a trigger for sending mails to all related users when someone adds a node..can someone point me in the right direction please
Comment #109
henrijs.seso commentedremoving myself since development has gone viral...
manuj, you need to create php function to gather and return email addresses of all friends in comma separated string. You have to write php for this, since there is no action "load all friends" and probably never will. But it would be cool, I had to write my own php to send email to all people that has tagged node with term that is applied for user too... but anyways, thats another issue.
Comment #110
rschwab commentedSubscription Activation Go!
Comment #111
secoif commentedSubscribing
Comment #112
jazzdrive3 commentedSo is anyone close to rerolling all the patches into a coherent module? I can't understand where most of the paths lead. Plus any patch tool I try to use on Windows never, ever works.
Comment #113
secoif commented@jazzdrive3 OT RE: windows patch tools: use cygwin.
Comment #114
tinohuda commentedsubcribing
Comment #115
henrijs.seso commentedThis is awesome. Tested high and low. Thank you DrakeRemory and mikestefff and everybody for great input. Code looks beautiful :) Here is patched files again, final working version in one peace. All you have to do to make it work is patch from here http://drupal.org/node/811222#comment-3157674 and that is already contributed.
Alex? IMO its contrib time!
Comment #116
henrijs.seso commentedone more thing...
Warning: Call-time pass-by-reference has been deprecated in sites/all/modules/user_relationships_rules/user_relationships_rules.rules.inc on line 165
Comment #117
YK85 commentedHi LavaMeTender - does you comment in #116 mean there might be a problem with the patch?
#811222: Incorrect Parameter inside user_relationships_api_token_values() looks to have already been committed so no need to apply that other patch as indicated in #115 right?
Very exciting to see this Rules integration wrap up and looking forward to seeing ship with UR.
Thanks!
Comment #118
YK85 commentedIn the Rules: Replacement patterns for logged in user I only see the following available:
Is this strange?
Have been using this module on my live site and it works great!
Comment #119
henrijs.seso commented#116 means minor fix is needed for php5 compability. As for 'is it strange?' it depends :) What action do you use? If you need some more replacement patterns, maybe you need to add load something action, like 'load user/node by ID' or something like that.
Comment #120
mstef commented#116: Sounds like a php 5.3 issue
#119: What is strange?
Comment #121
YK85 commentedWith the "Request has been sent" rule event, I schedule a request reminder Rule Set with identifier "request reminder uid [requester:uid] to [requestee:uid]"
If the requestee logs into his/her account, I want to delete this scheduled rule but I am not able to get the [requester:uid] to [requestee:uid] as replacements in the action to delete the scheduled rule when user logs into account. I can get [requestee:uid] as the replacement with [account:uid] but unable to pull [requester:uid]. Is there a way to load the variables needed?
Thank you!
Comment #122
henrijs.seso commentedYou need to load user by ID and ID is [requester:uid]. This question does not belong here. Please read rules documentation.
Comment #123
YK85 commentedI thought it to be relevant here as those tokens are not available in Rules as instructed in #122, and this issue queue looks to be development towards Rules integration. If it's just my lack of understanding than I apologize in advance.
Comment #124
Tafa commentedHello all,
As with #116, I am getting an error message at the top of the Rules page. Basically, it reads :
Warning: Call-time pass-by-reference has been deprecated in ...modules/user_relationships_rules_0_0/user_relationships_rules/user_relationships_rules.rules.inc on line 183 Warning: Call-time pass-by-reference has been deprecated in .../user_relationships_rules_0_0/user_relationships_rules/user_relationships_rules.rules.inc on line 183
After a bit of research, it appears that I have an old version of something lying somewhere. Can anyone help me with this?
Essentially, what I am using UR rules with is to send a tokenised email to users to request a relationship. In doing so, I hope to insert a link which users can use to accomplish more actions.
Let me know what you think.
Thanks,
T
Comment #125
mstisubscribe...
Comment #126
henrijs.seso commentedFixed #116. Works flawlessly now.
Comment #127
imDhaval commentedlove to sub.
Comment #128
alex.k commentedThank you tremendously to coders and testers for rounding this up. Committed in http://drupal.org/cvs?commit=449492.
Comment #129
henrijs.seso commentedwicked