I got this error since the last DEV version. It make the streams unavailable and unusable. Is there a workaround ?!?

Fatal error: Call to a member function getPlugin() on a non-object in /home/sitename/www/www/sites/all/modules/heartbeat/modules/heartbeat_plugins/heartbeat_plugins.module on line 358

The problem occur when you display the page of an heartbeat streams.

Comments

sw3b’s picture

OK, I uninstall alle the module, clear all database that were left, clear all configuration and reinstall all module and still I got the error.

The minute I try to generate some activity the module crash even the stream tab in the user section. If a clear all logs the error is gone and the message "No activity yet" and after an activity is publish the stream crash.

Wish it could help.

Sylense’s picture

+1. I posted an issue with the exact same problem before I saw this.

Stalski’s picture

This is really weird. I don't have that problem at all.
Investigating this ...

Stalski’s picture

Ok, I have the problem on a fresh install. Working on a fix.

Stalski’s picture

Status: Active » Needs review

The fix includes two things:
- An extra check to really see if the pluginWrapper is an object
- The problem with the install was that the default heartbeat templates did not have the correct structure anymore.
Worst case scenario should involve saving all heartbeat templates again.

Since the severity of this bug, I pushed it already.

Sylense’s picture

I uninstalled the previous version, installed the latest dev, cleared cache, updated the database and I'm still getting the same blank screens. Is there something else I need to do?

sw3b’s picture

Status: Needs review » Needs work

OK,
I uninstall the module
Clear cache
Delete folder of old DEV
Delete old entry with heartbeat in database directly
Re-upload the new DEV
Enable the module

1. After installation it work with no activity
2. After activity i'm getting an error

EntityMalformedException : Property bundle is missing on entity of type heartbeat_activity. in entity_extract_ids() (line 7405 in /home/website/www/www/includes/common.inc).

Stalski’s picture

Status: Needs work » Active

This should work, the only thing you did not properly is "Delete old entry with heartbeat in database directly" instead of deleting them so the attachments are removed as well.
Are you sure you uninstalled the module as well? Just removing it after disable leaves the tables behind.
I can only say that this type of error means there is something seriously wrong, like drupal does not find the heartbeat entity anymore.

Stalski’s picture

Could not reproduce this error with same steps.

The bundles are the message template (who are deliverd in heartbeat_defaults). This module is enable, right?

sw3b’s picture

Yes the module is enable ! I tried to remove and reinstall again and again. And i cannot get rid of this error.

I have latest DEV version, latest CTOOLS DEV version also.

sw3b’s picture

I even restore my drupal database to old version where it work and I got the same error...

Stalski’s picture

Can you give more detail on your installation then?

- Which heartbeat submodules do you have enabled?
- Are the message templates showing on the overview of templates?
- Can you manage the fields overview and display overview per template?

Can you reproduce this from scratch on site with only heartbeat and its dependants?

Sylense’s picture

I am going to try a fresh install with only heartbeat and its dependencies and return with my results. But my current install is still not working.

sw3b’s picture

On my side also I currently trying on brand new fresh install. I let you know after.

Sylense’s picture

Ok, I was successful in getting it to work on a fresh install with only the following modules installed and enabled:

heartbeat
ctools
token
pathauto
rules
entity
flag
shoutbox

I even applied your patch here: http://drupal.org/node/1267942 (comment #9 issue_1267942_9.patch) and was able to get polling to work with shoutbox. I do have another question/concern but its best if I address it in another issue.

So now that it's confirmed to work within a new install I'm assuming that the problem I'm having on my production site is within the database tables somewhere.

sw3b’s picture

I found it ! After starting from scrath 5 time, in french, in english I start removing module. It seems there is a conflict with EVA. I'm using EVA to manage the attachement to nodes for an look alike views gallery.

@Sylense do you use EVA on your side ?!?

After removing EVA the module seems to be working correclty.

Sylense’s picture

Yes, EVA seemed to be the problem for me as well

Stalski’s picture

Hmm, So we'll digg into that. I did not know this module so bare with me :)

I installed the dev version of EVA and got the error too. Digging into it...

Stalski’s picture

Status: Active » Needs work

So, the problem is core throws an exception on extract id's. The problem is within "eva" is that it needs to know which is the entity variable in the build array.
The code beneath in eva explains it all, I attached some code to make it work.

/**
 * Extract an actual entity object from its $build array.
 *
 * This is a bit more complicated than it should be, since core entities, contrib
 * entities, and contrib entities based on EntityAPI all store their junk in
 * different slots of the build array. See http://drupal.org/node/1170198.
 *
 * @param $build
 *   The token string defined by the view.
 * @param $entity_data
 *   The token type.
 *
 * I hate you, Milkman Dan.
 */
function _eva_extract_entity_from_build($build) {
  // EntityAPI often sticks stuff in here.
  if (!empty($build['#entity'])) {
    return $build['#entity'];
  }

  // Other entities stick them here!
  elseif (!empty($build['#' . $build['#entity_type']])) {
    return $build['#' . $build['#entity_type']];
  }

  // Some entities are naughty.
  elseif ($build['#entity_type'] == 'user') {
    return $build['#account'];
  }
  elseif ($build['#entity_type'] == 'taxonomy_term') {
    return $build['#term'];
  }
  elseif ($build['#entity_type'] == 'heartbeat_activity') {
    return $build['#message'];
  }

  return FALSE;
}

Ofcourse this is not the right solution. I will look in heartbeat if I could not take #heartbeat_activity instead of #message ...

sw3b’s picture

Do you have an update on this one ?!? I really need EVA and when both are enable the site crash...

Thanks for you work in advance...

sw3b’s picture

By the way, adding the lines solve the problem... for now ! ;)

SocialNicheGuru’s picture

#19 worked for me too

Stalski’s picture

Status: Needs work » Fixed

Hi all, sorry for the delay.
I changed #message in #heartbeat_activity so eva should auto-find the entity.
Feedback would be great.

sw3b’s picture

Thanks so far it look great !

Stalski’s picture

Status: Fixed » Closed (fixed)
Stalski’s picture

Issue summary: View changes

Adding some more info