Problem/Motivation

Since upgrading from 7.7 to 7.8, all attempts to save comments result in the following:

Warning: array_shift() expects parameter 1 to be array, null given in _drupal_log_error() (line 266 of includes/errors.inc).
_drupal_log_error(Array, 1)
_drupal_exception_handler(Object)
Warning: Invalid argument supplied for foreach() in _drupal_log_error() (line 269 of includes/errors.inc).
_drupal_log_error(Array, 1)
_drupal_exception_handler(Object)
EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7389 of includes/common.inc).

I suspect that this may be related to #1067750: Let Field API fail in a tale-telling way on invalid $entity.

Proposed resolution

Unknown

Remaining tasks

Unknown

User interface changes

none

API changes

Unknown

Comments

marcingy’s picture

Status: Active » Postponed (maintainer needs more info)

I can't recreate what other modules beyond core do you have installed?

ktleow’s picture

Me too getting this error reported by my users.

From my watchdog:

EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() (line 7389 of /home/abc/public_html/includes/common.inc).

Steps to reproduce:
1. Add comment to a node.
2. Boom, u will goto error page.

Comment is still added though.

Happens on random nodes, some doesn't trigger the error. Unsure whats wrong.

marcingy’s picture

Again what contrib modules do have installed - I can not recreate on a clean install of drupal.

smscotten’s picture

This is up on my production site, so the list of modules is extensive. It is also a site that was upgraded from Drupal 6.22 to Drupal 7.4, then to 7.7 and most recently to 7.8. I've had other issues where the upgrade path got in the way.

I'll have to set up a new instance and start disabling modules, see what I can find that conflicts.

Contrary to ktleow's experience though, my comments are being created, but with blank bodies. So I end up with comments that look like this:

http://splicer.com/comment/4604#comment-4604

The email I get that notifies me of the comment has the text of the comment, but the comment itself has no body.

Actually, ktleow, if you could post your list of contrib modules, we can narrow down the list of ones to look at, by which ones we both have enabled. (I'm including Core modules in my list.)

I see a couple of red flags that came up while typing out the list, but I'll disable those and report on the results in a separate comment.

Core:
Aggregator 7.8
Block 7.8
Comment 7.8
Contact 7.8
Contextual links 7.8
Dashboard 7.8
Database logging 7.8
Field 7.8
Field SQL storage 7.8
Field UI 7.8
File 7.8
Filter 7.8
Image 7.8
List 7.8
Menu 7.8
Node 7.8
Number 7.8
OpenID 7.8
Options 7.8
Path 7.8
PHP Filter 7.8
Profile 7.8
Search 7.8
Statistics 7.8
System 7.8
Taxonomy 7.8
Text 7.8
Toolbar 7.8
Tracker 7.8
Trigger 7.8
Update Manager 7.8
User 7.8

Administration:
Admin block 7.x-3.0-beta2
Fasttoggle 7.x-1.0-beta2
Adsense Click Tracking 7.x-1.x-dev
Adsense Core 7.x-1.x-dev
Amazon API 7.x-1.0-rc1
Amazon field 7.x-1.0-rc1
Amazon filter 7.x-1.0-rc1

Autolink:
Autolink 7.x-2.0-beta5
Autolink Keyword Links 7.x-2.0-beta5

CCK:
Content Migrate 7.x-2.x-dev
Content Templates 7.x-1.0-alpha2
Location CCK 7.x-3.x-dev

Chaos tool suite:
Chaos tools 7.x-1.0-rc1
Custom content panes 7.x-1.0-rc1
Page manager 7.x-1.0-rc1
Views content panes 7.x-1.0-rc1

Date/Time:
Date 7.x-2.0-alpha4
Date API 7.x-2.0-alpha4
Date popup 7.x-2.0-alpha4
Date tools 7.x-2.0-alpha4

Facebook Social Plugins:
fb social 7.x-2.0-alpha3

Fields:
Content Taxonomy 7.x-1.0-beta1
Content Taxonomy Autocomplete 7.x-1.0-beta1
Content Taxonomy Migrate 7.x-1.0-beta1

Input filters:
Pathologic 7.x-1.3
Typogrify 7.x-1.0-rc2

Linkit:
Linkit 7.x-1.2
Linkit Node 7.x-1.2

Location:
GMap 7.x-1.x-dev
Location 7.x-3.x-dev
User Locations 7.x-3.x-dev

Media:
Imagepicker: 7.x-1.4

Other:
Advanced help 7.x-1.0-beta1
AJAX Comments 7.x-1.0-beta1
Browscap 7.x-1.x-dev
Comment notify 7.x-1.0-beta2
Entity API 7.x-1.0-beta10
Google Plus One +1 7.x-1.1
Libraries 7.x-1.0
LoginToboggan 7.x-1.2
Mollom 7.x-1.1
Node Convert 7.x-1.0
Pathauto 7.x-1.0-rc2
Pullquote 7.x-1.2
Quote 7.x-1.1-alpha1
Quotes 7.x-1.x-dev
Read More link 7.x-1.x-dev
Real name 7.x-1.0-rc2
Related Links 7.x-1.x-dev
Submitted by 7.x-1.x-dev
Token 7.x-1.x-dev
Twitter 7.x-3.x-dev

Panels:
Panels 7.x-3.0-alpha3
Panels In-place Editor 7.x-3.0-alpha3

Statistics:
Piwik Web analytics 7.x-2.2

Styles:
File Styles 7.x-2.0-alpha8
Styles 7.x-2.0-alpha8
Styles UI 7.x-2.0-alpha8

Taxonomy:
Tagadelic 7.x-1.x-dev

Trackfield:
Track CSV (version not reported on /admin/modules)
Track GPX (version not reported on /admin/modules)
Trackfield (version not reported on /admin/modules)

User Interface:
jQuery Update 7.x-2.2
Wysiwyg 7.x-2.1

Views:
Views 7.x-3.0-rc1
Views Bulk Operations 7.x-3.0-beta2
Views UI 7.x-3.0-rc1

XML sitemap:
XML sitemap 7.x-2.0-beta3
XML sitemap engines 7.x-2.0-beta3
XML sitemap node 7.x-2.0-beta3

smscotten’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (duplicate)

Disabled AJAX Comments (I can't tell what that's supposed to do anyway) and got no change.
Disabled Comment Notify, and saving comments works again.

It appears that this is a duplicate of #1273256: EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() which is itself a duplicate (though not with the same symptoms) of #1255250: Remove some internal helper functions, add data to comment_load, fully load comments before alerting.

Applied patch found at http://drupal.org/node/1255250#comment-4944710 which corrected the problem.

In my defense, #1273256: EntityMalformedException: Missing bundle property on entity of type comment. in entity_extract_ids() was posted at roughly the same time I posted this, and the specific error is not listed in #1255250: Remove some internal helper functions, add data to comment_load, fully load comments before alerting. My searches therefore didn't find either of these issues.

I'm therefore closing this as duplicate. I'm leaving "component" as comment.module because the comment.module queue is a natural place to look to find the solution to this issue. Changing category to "support request" since the bug is not in comment.module. If my thinking is wrong about that I apologize and leave it to the maintainer to move it to the Comment Notify queue and/or change the category back to "bug report".

ayalon’s picture

This happend to me when my anonymous user in the table "users" did not have the id 0! This can happen if you import a backup sql file. Try setting it to 0.