I was running the Heartbeat dev release from 2/25/09. I saw there was another dev. release and I wanted to upgrade, so I tried out Drush. Turns out Drush only grabs the "recomended version", so it "upgraded" to the recommended 6.x-3.2 version. I finally figured this out and manually downloaded the latest dev. version and copied the files into the heartbeat folder. I refreshed the site and re-enabled the module, and now I get this error:

Fatal error: Cannot redeclare class rules_data_type_heartbeat_message in C:\xampp\htdocs\drupal\sites\all\modules\heartbeat_rem\user_activity\user_activity.rules.inc on line 27

I can't seem to make it go away (I can remove the module folder, and it goes away, but the error comes back as soon as I add Heartbeat back into the modules directory). The reason why it says "heartbeat_rem" is because I tried renaming the heartbeat directory and creating a completely new one, but it looks like it picked up the folder. Does someone have advice?? Thanks.

Comments

Stalski’s picture

Assigned: Unassigned » Stalski
Status: Active » Needs work

Hey,

I had this error too. I did something to clear the rules cache but appearantly is not enough. As you may have figured out, this error is due to the existence of a rule that uses a heartbeat action. The heartbeat action is gone but the rules still exists.
You can thus disable the rule manually (delete it) . I will look into this further to fully understand how i could clear the rules data so no heartbeat linkage remains stored.

so solution of now is delete the rules that use heartbeat actions and clear all cache.

thx for the report

Stalski

Stalski’s picture

Status: Needs work » Fixed

This should fix it and i did not have the problem anymore. Could you test this again?

function hb_activity_uninstall() {
  // Remove all tables so no need to delete the messages
  drupal_uninstall_schema('hb_activity');
  // This should clear the rules with a linkage to the heartbeat action
  rules_clear_cache();
}

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

portait’s picture

I am getting this error after updating to 6.x-4.0

Fatal error: Cannot redeclare class rules_data_type_heartbeat_message in /var/www/web2/web/sites/all/modules/heartbeat/heartbeat.rules.inc on line 26

Where do I put the function?

Stalski’s picture

Hey,

Well there is no solution to that at the moment. I will have to talk to fago (Rules) how to fix this.
I recommend to totally remove and add the new module again. The branch 4.0 will be the one to go and is not really backwards compatible

Sorry for the inconvenience
PS: removing and reinstalling the module completely will nog have much effect, except that the activity will been deleted. You could have exported your rules AND your heartbeat messages and copy them in a custom module to keep all your site work going.
So your activity streams will be reset as a matter of speaking but your custom configurations will be ok .

Stalski

portait’s picture

Thanks for the fast reply.
I have completely uninstalled the module and reinstalled the 4.0 version like you said and the error message is gone. Now I will only have to set up my rules und messages again (was too late to export).