... because otherwise this results in an obscure SQL syntax error.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: DELETE FROM {field_collection_item} WHERE (item_id IN ()) ; Array ( ) in EntityAPIController->delete() (line 399 of /home/klausi/workspace/entity/includes/entity.controller.inc).

Patch attached.

CommentFileSizeAuthor
#1 entity_delete.patch968 bytesfago
entity-delete-robust.patch552 bytesklausi

Comments

fago’s picture

StatusFileSize
new968 bytes

Makes sense. However, if we do checking, let's also check whether there is any entity to delete at all. Updated patch attached.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

fago’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

klausi’s picture

Status: Fixed » Reviewed & tested by the community

Can't see the commit, forgot to push?

fago’s picture

Status: Reviewed & tested by the community » Fixed

Looks like that, sry - pushed it now.

Status: Fixed » Closed (fixed)

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