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.
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
Comment #1
YK85 CreditAttribution: YK85 commentedI 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.
Comment #2
BerdirThis 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?
Comment #3
YK85 CreditAttribution: YK85 commentedHi 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
Comment #4
BerdirHm, 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).
Comment #5
mrf CreditAttribution: mrf commentedIf 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.