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.
PHP Fatal error: Call to a member function userHasAccess() on a non-object in modules/chatroom/chatroom.module on line 587
Whenever i try to use the chatroom I get this error.
Comments
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThe chatroom variable looks like it could either be an array or object. I think it should be restricted to the object.
I think you just want the object passed down.
I did a little debugging and found:
. (Object) Chatroom
changedAttributes:protected (Array, 0 elements)
format:protected (String, 21 characters ) panopoly_wysiwyg_text
allowedRids:protected (Array, 2 elements)
allowedUids:protected (Array, 0 elements)
archived:protected (String, 1 characters ) 0
cid:protected (String, 1 characters ) 2
uid:protected (Integer) 0
public:protected (String, 1 characters ) 0
title:protected (String, 0 characters )
latestMessage:protected (Object) stdClass
onlineUsers:protected (Array, 0 elements)
Krumo version 0.2.1a | http://krumo.sourceforge.net Click to expand. Double-click to show path. Called from modules/all/chatroom/chatroom.module, line 587
... (Array, 8 elements)
chatroom_title (String, 0 characters )
chatroom_public (Integer) 0
chatroom_cid (String, 1 characters ) 2
chatroom_read_only_roles (Array, 1 element)
chatroom_write_roles (Array, 1 element)
chatroom_delete (Integer) 0
chatroom_archived (Integer) 0
chatroom_format (String, 21 characters ) panopoly_wysiwyg_text
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI would get the error when creating or editing the chatroom node and hitting save.
Is the chatroom field becoming the $chatroom variable somewhere?
Comment #4
glekli CreditAttribution: glekli commentedI'm not experiencing this problem. $chatroom should indeed be an object in any case, so I'm not sure what is being passed in here. Could you please
- give us the steps to reproduce on a clean Drupal install?
- describe how you got the debug printouts above?
- tell us what version of chatroom you have installed?
- could you print out $chatroom in line 587 when it is not an object?
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedit's above... it's an array:
I enabled devel
I put a dpm statement at just above line 587