I recently upgraded from 7.x-1.0-rc3 to 7.x-1.0 and I started having issues with a sandbox project that I use and contribute to. The module I'm using is Commerce Quickbooks Webconnect. When the module calls entity_save():
http://drupalcode.org/sandbox/stephen.colson/1100862.git/blob/HEAD:/comm...

It throws an exception in the Entity Controller's save() function @ line 447:
http://drupalcode.org/project/entity.git/blob/6fd5aa2a678de549f6e6e674c2...

Attempt to assign property of non-object in EntityAPIController->save() (line 447 of entity.controller.inc)

Reverting to Entity API 7.x-1.0-rc3 "resolved" the issue for me.

Any advice on what I might look at to resolve this issue?

Comments

dmducc’s picture

I can confirm that this happens.

Same module (drupal_commerce_quickbooks_webconnect);

same error (Warning: Attempt to assign property of non-object in EntityAPIController->save() (line 447 of /home/drupalpro/websites/localhost.gruh3/sites/default/modules/entity/includes/entity.controller.inc).).

From entity.info:
version = "7.x-1.0+5-dev"

I need this version of entity for a patch I am using: 1780646-entity-api-node-access.patch, so reversion might not be possible.

SOLUTION:
Entity was being created poorly.
In commerce_qb_webconnect.module, the function commerce_qb_webconnect_qb_export_save(), we had this:

  // write a new record
  $entity = entity_save('commerce_qb_webconnect_qb_export', $export);

I replace with:

$entity = entity_create('commerce_qb_webconnect_qb_export', $export);
entity_save('commerce_qb_webconnect_qb_export', $entity);

And now I am successively saving items to the commerce_qb_exports table!
dmduke

mattreba’s picture

Status: Active » Closed (works as designed)

Based on dmduke's findings I'm marking this closed and will instead follow up with an issue on the Commerce Quickbooks Webconnect module.