Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Dear friends i searched alot to solve this problem.but no one has given proper answer. after trying one hour i found two problems
one is in user relationships they have given wrong variable name
at 72 line change $relationship to $rtype means
$css_class = array(str_replace(' ', '-', $relationship->name) change to $css_class = array(str_replace(' ', '-', $rtype->name)
and in authorpane module in author-pane.tpl.php file change at replace $user_relationships_api with $user_relationships
then it will work fine.thanks to michelle for great module
Comment | File | Size | Author |
---|---|---|---|
#4 | undefined_variable-1217908-4.patch | 855 bytes | Scyther |
Comments
Comment #1
Scyther CreditAttribution: Scyther commentedAdded tag
Comment #2
zuzu83 CreditAttribution: zuzu83 commentedthanks @mannejkumar
works for me
Comment #3
Desi Raaj CreditAttribution: Desi Raaj commentedyour solution worked really well, thanks :)...I ran into another problem though, once the requestee has accepted the relationship, it still shows "Add as friend" on their profile page.
for example:
I visited another users profile and clicked on "add as friend" and sent the invite, once he/she accepted the invite and I visited the profile again, it still says "add as friend" instead of "remove friend", but if the requestee visits the requester's profile it shows "remove friend" as expected, so the problem is from the requestee side.
any suggestions?
I use author pane dev version with panels and user_view page.
Comment #4
Scyther CreditAttribution: Scyther commentedError in Author Pane fixed, see this commit.
*Moved to User Relatioships to get the error in that module also fixed.*
@Maintainers of User Relationships: Could the error in User Relationships also be fixed? Patch provided.
Comment #5
Scyther CreditAttribution: Scyther commentedStripped a tag.
Comment #6
mrf CreditAttribution: mrf commentedClosed #1412276: Notice: Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 70 as a duplicate of this issue.
Patch looks good to me, but will leave this one for Berdir to commit.
Comment #7
BerdirThanks for the patch and reviews, commited.
Comment #9
liquidlight CreditAttribution: liquidlight commentedI know this is closed as "fixed" but i still have this issue, and the patch and all isnt working.. code error: "Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 78 " This only pops up when visiting the posting of someone who I have no relationship with. Please have another look at this.
Comment #10
liquidlight CreditAttribution: liquidlight commentedNudge Nudge?
Comment #11
fraweg CreditAttribution: fraweg commentedHello,
I have the same issue (like liquidlight) with the latest dev version.
Here is my output:
Notice: Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 71 of /.../sites/all/modules/user_relationships/user_relationships.author-pane.inc).
and
Notice: Trying to get property of non-object in user_relationships_type_get_name() (line 1072 of /.../sites/all/modules/user_relationships/user_relationships.module).
Did anyone solve this issue? Maybe liquidlight?
I really need help in that.
Best regards
Frank
Comment #12
drupalina CreditAttribution: drupalina commentedI had the same problem: these errors would show up when I visited the pages of someone I had no replationship with.
This is what I did:
change
array('@name' => format_username($account)) + user_relationships_type_translations($relationship))
to
array('@name' => format_username($account)) + user_relationships_type_translations($rtype))
and the errors disappeared for me. Hope this helps.
Comment #13
giuseppecardaci CreditAttribution: giuseppecardaci commentedhttp://drupal.org/node/1553202#comment-7056876
Comment #14
jainmca4444 CreditAttribution: jainmca4444 commented4: undefined_variable-1217908-4.patch queued for re-testing.