Closed (fixed)
Project:
Fancy File Delete
Version:
7.x-1.0-beta9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 May 2016 at 16:57 UTC
Updated:
30 May 2016 at 14:46 UTC
Jump to comment: Most recent
I'm in the process of cleaning up roughly 17,000 old file records and I noticed that when I try to manually delete multiple records in the 'Manual' tab with the fid's only the last fid supplied is deleted. I believe the issue was in the fancy_file_delete.batch.inc file lines 20-21. All the $fid's being supplied were failing the is_numeric check, and I believe because it has to do with line endings. So what I did was just wrap the $fid with (int) so it now passes the is_numeric check and file_load is also working. I've attached the patch for review.
| Comment | File | Size | Author |
|---|---|---|---|
| fancy_file_delete_allow_manual_deletion_multiple_records_20160505.patch | 650 bytes | smustgrave |
Comments
Comment #2
labboy0276 commentedThanks for this, just getting caught up post Drupalcon and will look at this and add it in if it looks good.
Comment #4
labboy0276 commentedOK
Thanks for this. When type casting a string, if it fails, it returns 0. So putting a type cast in is_numeric will always pass. So I changed the code up some to reflect this and to remove the line endings as well (str_replace is faster than preg_replace):
Also, when creating a patch, don't do it from root, your patch failed on my system. Gave you credit and again thanks for this.