While trying to generate content with Devel, I began receiving this error during the generation process:

Fatal error: Call to a member function save() on a non-object in /modules/field_collection/field_collection.module on line 598

The error disappeared after I removed the field collection from by content type.

Comments

yarroha’s picture

Can't get the same error. Could you please post what fields do You use in the field collection entity?

thierry.beeckmans’s picture

I'm having the same problem.

The fields in the collection entity are:

  • List (text)
  • Text
  • Date (Unix timestamp)
    • Collect an end date *set required
  • Integer
autopoietic’s picture

I am also experiencing this problem

Ehud’s picture

Solved it by adding the field collection entity id. Here is an example for loading, changing and saving field collection entity item:

$ent_id = $node->field_invitee_collection['und'][0]['value'];
$field_collection_item = entity_load('field_collection_item', array($ent_id));
$field_collection_item[$ent_id]->field_example_1['und'][0]['value'] = 'val1';
$field_collection_item[$ent_id]->save();
autopoietic’s picture

@Ehud would you be able to explain how you made use of the above code in connection to the devel generate module?

steve.m’s picture

Quick note: I had this error happen with beta4, and it went away when I got rid of a field collection field that had been set to widget = hidden. The two other collections in my node type with widget = embedded were then created fine, as expected.

SocialNicheGuru’s picture

i experienced the same as in #6

SocialNicheGuru’s picture

Issue summary: View changes

Found error in description.

jmuzz’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Support for devel generate has been added since this issue was opened.

#1236402: Add support for devel generate