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.
The full error message on a white screen is:
Fatal error: Call to undefined function _flag_content_enabled() in /path/to/all/modules/heartbeat/modules/heartbeat_plugins/plugins/flagattachment.inc on line 79
It is shown after I clicked "user activity" or "user relation activity" on the "/user" page.
Flag version: 7.x-3.0-alpha3+4-dev
Heartbeat version: both 7.x-1.1 and 7.x-1.x-dev
Is that because the current heartbeat plugin only supports to Flag version 7.x-2.x, but not 3.0 yet?
Comments
Comment #1
metakel CreditAttribution: metakel commentedAfter a few operations of enable / disable / enable /disable of various modules, I finally get it back to work.
I cannot explain what the reason is. The "user activity" and "user relation activity" just suddenly work again.
Now it is Heartbeat 7.x-1.1 and Flag 7.x-3.0-alpha3+4-dev
Comment #3
flashwebcenterThe following error comes with white screen when you go to /admin/structure/heartbeat/plugins and enable flagattachment.
Then go to my account and click on user activity or user relations activity
Fatal error: Call to undefined function _flag_content_enabled() in ../sites/all/modules/contrib/heartbeat/modules/heartbeat_plugins/plugins/flagattachment.inc on line 79
I have installed Drupal 7.19, Heartbeat 7.x-1.1, Flag 7.x-3.0-alpha4.
I tested for several times as an admin or authenticated user.
Comment #4
afoone CreditAttribution: afoone commentedSame problem. Any Solutions?
Comment #5
capchicon CreditAttribution: capchicon commentedSame problem here.but after i have installed 'views 3' i am getting this problem.still didn't get a solution for this.please give me a solution for this error..
Thanks in advance
Comment #6
capchicon CreditAttribution: capchicon commentedStill there is no reply...pls someone pls do help me for this problem..:(
Comment #7
prezaeis CreditAttribution: prezaeis commentedanyone? is there any support for this module?
Comment #8
fraweg CreditAttribution: fraweg commentedHello,
I use the actual heartbeat version with this modules and patches an have no problems:
https://drupal.org/node/1700116
flag 7.x-2.1
I hope this helps!
Best regards
Frank
Comment #9
chythar CreditAttribution: chythar commentedI looked into the issue, and the method looks like it is checking to see if the flag is set to be an 'heartbeat_activity' flag. If so, it's added to the list of plugins on the page. If not, it's removed. With this understanding, I have changed line 79 in modules/heartbeat_plugins/plugins/flagattachment.inc from
if ($this->flag && _flag_content_enabled($this->flag, 'heartbeat_activity')) {
To:
if ($this->flag && $this->flag->access_entity_enabled('heartbeat_activity', NULL)) {
This resolves the error for me, and I have not seen any adverse effects yet. As for a permanent fix, it seems like the Flags module should have a method for "_flag_content_enabled()" that performs the check in my fix.
Comment #10
flydragon865 CreditAttribution: flydragon865 commented#9 works for me too. Thanks @chythar
Comment #11
yanniboi CreditAttribution: yanniboi commentedThis is a module port issue.
The function '_flag_content_enabled()' exists only in the flag module for drupal 6, not drupal 7.
I am raising this to critical because it breaks the functionality of the drupal 7 module.
(Note: #9 also works for me...)
Comment #12
Anusha Vasudevan CreditAttribution: Anusha Vasudevan commented#9 works for me too. Thanks
Am using Heartbeat and flag modules.
Comment #13
Anusha Vasudevan CreditAttribution: Anusha Vasudevan as a volunteer and at CodeExpertz commented