Closed (fixed)
Project:
User Relationships
Version:
6.x-1.0-rc4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2010 at 19:15 UTC
Updated:
26 Sep 2010 at 18:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex.k commentedSorry I think it understands both, no?
Comment #2
mstef commentedUntil I fixed it, it was throwing
Comment #3
mstef commentedI don't have time to look into it in more detail. I attached the backtrace from Devel which led me to discover the issue.
Comment #4
alex.k commentedYou can see that $data in user_relationships_api_token_values() is an array of relationship objects, so when it tries to get $r->rtid it is NULL. And user_relationships_type_load does not (and should not) understand NULL. Can you please try the attached patch instead?
Comment #5
mstef commentedYea, I check it out right now. Like I said, I didn't have time to really look into it. I saw that user_relationships_type_load() took an array, so I changed it, and it works, so I was happy..
I'll post back in a few
Comment #6
mstef commentedThat throws the same error as before..
Comment #7
mstef commentedCan we get this reviewed and committed?
Comment #8
mstef commentedWhy was rc4 released without this fix...? The error still exists.
Comment #9
mstef commentedAlright...this is a better fix, and it explains why the is_numeric check wasn't working..
That's the only change needed and it works fine.
Comment #10
mstef commentedThat might not be true..one minute
Comment #11
mstef commentedIt looks like $r ends up being an array with an object - NOT AN OBJECT!
OUTPUT:
So doing $r->rtid will return nothing at all.....
How'd that one go unnoticed..
I guess the problem ISN'T with $r_type = user_relationships_type_load($r->rtid), it's with the LINE BEFORE.
NOW, why is this an array, and is it always?
Comment #12
mstef commentedAlso getting an empty $data when users remove a friendship.
Comment #13
mstef commentedProbably should have mentioned (and realized) that this might be caused by UR rules.
Comment #14
mstef commentedThere's a problem in both UR and UR Rules..
Here's what my function look like now..
See #774538: User Relationship (UR) Rules
Comment #15
alex.k commentedThanks, @mikestefff. Can you post a patch, please?
Comment #16
mstef commentedThis should work. I'm not sure what the convention is to having them apply cleanly in CVS. Made the patch against the module root.
Comment #17
robby.smith commentedthanks for the hard work mike! could you also help fix the UR-Rules module after this is committed? thank you!!
Comment #18
mstef commentedHey,
You're welcome. I've been pretty active on that thread - #774538: User Relationship (UR) Rules - I think my latest fixes are good.
Comment #19
YK85 commentedAlex - could you please check out the patch and commit if possible? Thank you!
Comment #20
YK85 commentedkindly bumping, discussion in #811222: Incorrect Parameter inside user_relationships_api_token_values() looks to have been moved to UR
+1 for commit
Comment #21
chuckbar77 commentedTested and ready for review by Alex. Please commit when you have time.
Comment #22
alex.k commentedCommitted in http://drupal.org/cvs?commit=420346, thanks!