If you try to instantiate a EntityDrupalWrapper object without pass the $info array an Unsupported operand types error occurred.

Steps to repeat:
$wrapper = new EntityDrupalWrapper('node');

Expected Results:
Instantiate the object

Actual Results:
PHP Fatal error: Unsupported operand types in .../sites/all/modules/entity/includes/entity.wrapper.inc on line 33

In attachment a patch.

CommentFileSizeAuthor
entity.wrapper.inc_.patch1.02 KBlucor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Status: Active » Fixed

thanks, the references are indeed left-over and not needed any more - that did not fix the problem though. The problem was wrong default for $info being NULL instead of array(). I fixed both by aligning all constructors to the function signature of entity_metadata_wrapper(). Anyway, using the factory function entity_metadata_wrapper() is the preferred way to instantiating wrapper objects.

Status: Fixed » Closed (fixed)

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