When deleting a node with a field collection that for some reason cannot be loaded, for instance because the id of the FC item point to a row that doesn't exist on the database the module fires a PHP Fatal error and interrupts the execution of the script.

This happen because the variable on $fci on the function field_collection_item_delete() at field_collection.module has a FALSE value and not an object, and in the line after loading $fci there is $fci->delete() without checking that there is an object on the variable...

This could be simply solved by adding an if() else() to the Deletion callback function, function field_collection_item_delete($id).

CommentFileSizeAuthor
#2 patch.txt431 bytescubeinspire
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cubeinspire created an issue. See original summary.

cubeinspire’s picture

FileSize
431 bytes

This is the patch to correct this Fatal Error to happen.

jmuzz’s picture

Status: Active » Fixed

Try the latest dev or beta version.

Status: Fixed » Closed (fixed)

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