PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'in_group' in 'field list': INSERT INTO {heartbeat_activity} (message_id, nid, uid, nid_target, uid_target, cid, access, timestamp, language, variables, in_group) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => heartbeat_edit_node [:db_insert_placeholder_1] => 41 [:db_insert_placeholder_2] => 9 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 4 [:db_insert_placeholder_7] => 1333334063 [:db_insert_placeholder_8] => zh-hans [:db_insert_placeholder_9] => !username=|=红叶-|-!node_type=|=help_c2c-|-!node_title=|=帮助测试,帮忙xxxx-|-node_type=|=help_c2c-|-node_status=|=1-|-node_uid=|=9-|- [:db_insert_placeholder_10] => 0 ) in HeartbeatActivity->log_message() (line 528 of /opt/development/yourhelps/sites/all/modules/heartbeat/includes/heartbeatactivity.inc).
dd

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rogical’s picture

Status: Active » Needs review
FileSize
1.81 KB
sw3b’s picture

Status: Needs review » Reviewed & tested by the community

Work and solve the problem for me !

Stalski’s picture

Status: Reviewed & tested by the community » Closed (fixed)

this is solved in another issue

cwithout’s picture

Status: Closed (fixed) » Active

Stalski, could you point to the issue this is solved in? The only similar one I found was #1511930: Implements hook_modules_enabled($modules) for field 'in_group' on OG enablation, which was committed, but I'm still seeing this issue after upgrading to the current dev when not using OG.

The patch in #1 does fix the error.

Stalski’s picture

Status: Active » Needs review

So for your case specific, if you still getting the error, that means that the in_group field does not exists in your set-up.
The reason why is because an update hook did not run properly or something. I made sure if you run update.php after a repulling the code from git (or download dev version tomorrow) the field will be created for everyone who did not have it yet.
solution pushed to git.

- Edit - I changed the code , some reverted from #1511930: Implements hook_modules_enabled($modules) for field 'in_group' on OG enablation ... It should be the best way now.

oystercrackher’s picture

Status: Needs review » Active
FileSize
148.79 KB

Hi,

After upgrading from recommended release to dev release, I am seeing the same error above. I applied the patch listed above but it failed with the following error:

error: patch failed: includes/hearbeatactivity.inc:511
error: includes/heartbeatactivity.inc: patch does not apply

Screenshot is attached for reference.

Please advise on next steps.

Thanks

cwithout’s picture

oystercrackher, the patch in #1 doesn't use the same solution Stalski added to the dev. Since you posted within 10 minutes of Stalski's post, you probably didn't get a version that had the changes in it. You might want to download dev and try again.

Stalski, obviously the error was from the field not being in the database. It actually makes sense for it not to be there if you don't have the Heartbeat Organic Groups sub module installed. I'm curious what the reasoning is for having Heartbeat add that field rather than the sub module. Without looking at the code, I had expected that the sub module would add that field. Having the field added by the sub module and using rogical's method to check the field makes more sense to me. (His patch checks for the existence of the field in the database, but I'm not sure whether that or module_exists on the sub module would be more efficient given that case.)

oystercrackher’s picture

I downloaded latest version of dev and it fixed the issue.

Thank you so much :)

cwithout’s picture

Status: Active » Fixed

Just installed the new dev also, and the error is solved.

Thanks, Stalksi. If it's not too much trouble, I wouldn't mind some detail on the reason you have the in_group field added by the main module instead of the sub module. Is it used even when the Heartbeat OG submodule is not install? Or are there any Drupal best practices, performance reasons, etc. Just a matter of personal preference?

Status: Fixed » Closed (fixed)

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