Hello,
I'm getting a blank page with this error when trying to access the main RedHen activity stream page or a contacts activity stream tab:
Fatal error: Cannot access empty property in /.../sites/all/modules/redhen/modules/redhen_activity/redhen_activity.module on line 685
I'm checked the error logs and found these three errors were created at the same time as the above:
Notice: Undefined variable: source in redhen_activity_activity_page() (line 587 of /Users/curtis/Dropbox/WEBWORK/_LOCAL/AMPPS/www/sirc/sites/all/modules/redhen/modules/redhen_activity/redhen_activity.module).
Notice: Undefined variable: ref_entity_type in redhen_activity_source_entity() (line 685 of /Users/curtis/Dropbox/WEBWORK/_LOCAL/AMPPS/www/sirc/sites/all/modules/redhen/modules/redhen_activity/redhen_activity.module).
Notice: Undefined variable: ref_field in redhen_activity_source_entity() (line 685 of /Users/curtis/Dropbox/WEBWORK/_LOCAL/AMPPS/www/sirc/sites/all/modules/redhen/modules/redhen_activity/redhen_activity.module).
I'm running Drupal 7.26 with RedHen and Drupal Commerce installed. Anyone else getting these errors? Any help or guidance would be greatly appreciated.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#4 | redhen-activity_stream_error-ALT-2211525-4.patch | 544 bytes | jwjoshuawalker |
#4 | redhen-activity_stream_error-2211525-4.patch | 571 bytes | jwjoshuawalker |
Comments
Comment #1
hommesreponse CreditAttribution: hommesreponse commentedAfter fleshing out some of the Contacts with Organization connections and adding memberships the errors magically went away!
Comment #2
BillMounce CreditAttribution: BillMounce commentedI have filled out every category of information, all the types, and include sample Contacts and Organizations. When I try to go to the Activity stream for the site, I used to get this message (above), and now I get a generic:
Error
The website encountered an unexpected error. Please try again later.
Comment #3
jwjoshuawalker CreditAttribution: jwjoshuawalker commentedThis will happen if you have defined other message types (message.module).
The RedHen "activity stream" loads all message types/bundles, regardless of if RedHen defined them, then attempts to access an entity reference field that only exists on its RedHen message bundles (by default).
That part of line 685 in redhen_activity.module:
Where $ref_field =
message_redhen_contact
ormessage_redhen_org
I have a few ideas for solutions. The most appropriate I think will be changing function
redhen_activity_activity_page()
to only look for RedHen message types.For a quick fix, to rid the error, you can add a "default" case to the
in
redhen_activity_source_entity()
that just returns nothing. Note that non-RedHen messages will still show up in the RedHen activity log if you go this quick route.Comment #4
jwjoshuawalker CreditAttribution: jwjoshuawalker as a volunteer commentedI do still think the function
redhen_activity_source_entity()
could gracefully handle if a different bundle is coming through, or the ref field isn't present/is empty.Here are 2 patches, 2 slightly different options. Take your pick.
Comment #5
CountPacMan CreditAttribution: CountPacMan at ThinkShout commentedUnable to replicate error. Defined new message type and viewed the main RedHen Activity stream. Code in patch 1 is clean and introduces no errors. Just based on redhen_activity_source_entity(), I can see how this can be an issue in some cases, but was not able to replicate the error. I will try to get the first patch committed.
Comment #6
levelos CreditAttribution: levelos at ThinkShout commentedThanks for the help gang. Fixed the underlying issue by only returning RedHen message types. Ref #65edbd7ebc43152a1e0d38b948bdbd1e688f0932.