I have a content type "event" which has an image field.
I tried to deleted the nodes, but I got the repeated errors when deleted the nodes.
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of D:\xampp\htdocs\mysite\includes\entity.inc).
I did not use any hook to delete nodes. I just deleted the nodes from the page "admin/content" by selecting "Delete selected nodes" in the UPDATE OPTIONS.
I checked the node related tables including field tables and I found that they were deleted as expected. When I tried to query the file tables, I found that some records were not deleted and the files in the file directory were not deleted too.
BEFORE DELETE
mysql> select * from file_usage where id = 41 order by fid;
+--+--+--+--+--+--+--+--+--+--+--+--+--++
| fid | module | type | id | count |
+--+--+--+--+--+--+--+--+--+--+--+--+--++
| 30 | file | node | 41 | 1 |
| 31 | file | node | 41 | 1 |
| 32 | file | node | 41 | 1 |
| 172 | file | node | 41 | 1 |
+--+--+--+--+--+--+--+--+--+--+--+--+--++
mysql> select fid, filename, uri from file_managed where fid in (30,31,32,172);
+-----+------------------------------------+-----------------------------------------------+
| fid | filename | uri |
+-----+------------------------------------+-----------------------------------------------+
| 30 | Festival.jpg | public://Festival_0.jpg |
| 31 | Festival.jpg | public://Festival_1.jpg |
| 32 | Festival.jpg | public://Festival_2.jpg |
| 172 | Festival_465x350.jpg | public://Festival_465x350_0.jpg |
+-----+------------------------------------+-----------------------------------------------+
AFTER DELETE
mysql> select count(*) from node where type = 'event';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
mysql> select * from file_usage where id = 41 order by fid;
+--+--+--+--+--+
| fid | module | type | id | count |
+--+--+--+--+--+
| 30 | file | node | 41 | 1 |
| 31 | file | node | 41 | 1 |
| 32 | file | node | 41 | 1 |
+--+--+--+--+--+
mysql> select fid, filename, uri from file_managed where fid in (30,31,32);
+-----+---------------------+-------------------------------+
| fid | filename | uri |
+-----+---------------------+-------------------------------+
| 30 | Festival.jpg | public://Festival_0.jpg |
| 31 | Festival.jpg | public://Festival_1.jpg |
| 32 | Festival.jpg | public://Festival_2.jpg |
+-----+------------------------------------+----------------+
They became orphan. What could that be why they are not deleted as expected?
Is there any fix for this?
My Drupal version is 7.15.