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!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danreb’s picture

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

danreb’s picture

Title: Error with Authors Pane » Notice: Undefined variable: relationship in user_relationships_preprocess_author_pane() (line 70

change title...

fraweg’s picture

Hello,

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

best regards

Frank

mrf’s picture

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).
Scyther’s picture

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.

mrf’s picture

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().

Hardik C’s picture

Hi,

Please apply the attached patch file to get desired results.

Regards,
Hardik

Hardik C’s picture

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.

Scyther’s picture

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.

Hardik C’s picture

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

drupalina’s picture

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.