- ivnish Kazakhstan
Drupal 7 is EOL. Issue will be closed, but patches are still here
We use the Entitycache module, and noticed the Flag module occasionally generates errors when a comment is deleted.
It seems as though Entitycache has not yet flushed all deleted items, and Flag is referencing it in the get_flagging_record
function. This happens when the deleted comment is the first comment on a new page.
The error messages received are as follows. These will be logged until entitycache gets cleared:
Notice: Trying to get property of non-object in flag_entity->applies_to_entity() (line 131 of /sites/all/modules/flag/includes/flag/flag_entity.inc).
Notice: Trying to get property of non-object in flag_comment->get_flagging_record() (line 85 of /sites/all/modules/flag/includes/flag/flag_comment.inc).
Notice: Trying to get property of non-object in flag_comment->get_flagging_record() (line 102 of /sites/all/modules/flag/includes/flag/flag_comment.inc).
Notice: Trying to get property of non-object in flag_comment->get_flagging_record() (line 144 of /sites/all/modules/flag/includes/flag/flag_comment.inc).
I've created a patch to check for an empty entity, and return NULL or FALSE if it is.
Maybe the thought would be this issue should be handled in Entitycache, and technically it is... there is a support module called Entitycache Flush that can be used to more actively flush entitycache content.
However, the module is not extensively used, and I think it's acceptable and good practice to check for the existence of object content anyway.
Review the attached patch and let me know your thoughts. Thanks.
Closed: outdated
3.0
Flag core
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Drupal 7 is EOL. Issue will be closed, but patches are still here