I am using Drupal 7.12, PHP 5.3.2, on ubuntu 11.4
This is more about me learning how to use entities so I have tried to keep everything simple yet use practical fields. So here is what I got.
Entity shows up fine and everything is working. I have created a custom save function in the controller class which writes everything to the entity table. This works great.
I then use the field api function to create the fields and instances - field_create_field($field) and field_create_instance($instance). This works great and I can see the field in the "Manage Fields" section of my entity.
So to recap, I have an entity showing up great and an image field showing up great.
So now I go to the form and enter in the info (just as I had done before), upload an image using the sweet image field. It uploads, I can see the thumbnail and I have options to upload more.
Now here is where it breaks down. When I hit submit I get this error:
Warning: Attempt to modify property of non-object in _field_invoke() (line 224 of /var/www/drupal_7x/modules/field/field.attach.inc).
The kicker is that everything is saving like it's supposed to be, I just get this error. To save you guys some looking, here is what is on line 224 (well 223, 224, and 225) of field.attach.inc:
<?php
if ($items !== array() || isset($entity->{$field_name}[$langcode])) {