Hello,

I have this error (when I go to a profile with no relationship) in combination with Authors Pane:

    Notice: Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 70 of /...../sites/all/modules/user_relationships/user_relationships.author-pane.inc).
    Notice: Trying to get property of non-object in user_relationships_preprocess_author_pane() (line 70 of /...../sites/all/modules/user_relationships/user_relationships.author-pane.inc).

I still have this problem until I have a relationship to the depend user.

I use:
Drupal 7.10
UR 7.x-1.x-dev
The newest Author Pane 7.x-2.0-alpha2

Thanks for any Help!

Comments

Change $relationship to $rtype in line 70
$css_class = array(str_replace(' ', '-', $relationship->name)

change to

$css_class = array(str_replace(' ', '-', $rtype->name)

Check this similar problem -> http://drupal.org/node/1217908

Title:Error with Authors PaneNotice: Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 70

change title...

Hello,

THANKS for your fast answer.. this seems to work for me.

best regards

Frank

Issue tags:+6.x-1.2

This issue (or something very similar) is present in 6.x as well.

    Notice: Undefined offset: 0 in user_relationships_api_preprocess_author_pane() (line 36 of /drupal6/sites/all/modules/user_relationships/user_relationships_api/user_relationships_api.author-pane.inc).
    Notice: Trying to get property of non-object in user_relationships_api_preprocess_author_pane() (line 40 of /drupal6/sites/all/modules/user_relationships/user_relationships_api/user_relationships_api.author-pane.inc).

Patch for this issue can be found in #1217908: Undefined variable: relationship in user_relationships_preprocess_author_pane().

Sorry for making duplicated issues, but I moved the other issue from Author Pane.

Status:Active» Closed (duplicate)
Issue tags:-6.x-1.2

Drupal 6 issue was actually not related and is now fixed.

Closing this as a duplicate since we have a patch at #1217908: Undefined variable: relationship in user_relationships_preprocess_author_pane().

Hi,

Please apply the attached patch file to get desired results.

Regards,
Hardik

StatusFileSize
new4.03 KB

Hi,

In add to the previous comment I had posted,

Also, you have to apply the code of user_relationships.author-pane.inc needs to be replaced with the code in attachment.

If you have read the latest comment before you posted this issue is a duplicate of this http://drupal.org/node/1217908 and if you check that issue, you can see that is has been fixed.

Hi Christoffer,

As per my knowledge, both are similar issues but not the same.Both have the different reasons to occur different problems. So,both have different solutions,too.

And only because of it, this issue has been posted as different post, not on the same post... :) :) :)

Anyway, thanks for you time and suggestions!!

Regards,
Hardik

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.