Hello,

I am getting the below fatal error when requesting a relationship.

Fatal error: Unsupported operand types in /srv/www/example.com/public_html/includes/common.inc on line 1592

The URL to send the request is http://example.com/relationship/4/request/1?destination=user/4

I get the same fatal error with 1.0 and the latest dev version.

Is this a known issue with the latest versions?

Can someone please assist?

Thank you!

Comments

YK85’s picture

I posted this after hours of testing, and after I posted I checked one more thing and figured out what was going on.

The user sending the request is not an 'authenticated' user yet.
I'm using logintoboggan module to set a temporary role 'non-authenticated'.

However, is there anyway not to show this scary fatal error to users that have not yet gained the role 'authenticated'?

Thank you very much for your time.

Berdir’s picture

This is obviously a bug that needs to be fixed.

To make it easier to reproduce, can you list the UR related permissions which those roles have/not have?

YK85’s picture

Hi Berdir,

Below are the permissions:

user_relationships_api module
can have relationships [ ] anonymous user, [x], authenticated user, [ ] non-authenticated

user_relationships_ui module
administer user relationships [ ] anonymous user, [ ] authenticated user, [ ] non-authenticated
maintain own relationships [ ] anonymous user, [x] authenticated user, [ ] non-authenticated
view user relationships [ ] anonymous user, [ ] authenticated user, [ ] non-authenticated

Thank you

Berdir’s picture

Hm, sounds like a bug we have probably fixed in 7.x-1.x already. That link shouldn't be displayed if you don't have permission to create relationships in the first place.

I'll try to look at it. If you have the time, it would be great if you could confirm my assumption (That the link isn't visible and there is no error when visiting the page manually in Drupal 7).

mrf’s picture

Status: Active » Postponed (maintainer needs more info)

If this is a custom link its up to the site developer to put in the proper access checks before it is displayed, if it is generated by UR somehow then this is definitely a bug. Please provide more info on where this link is being displayed.