When a file is deleted, it is still present in the index.
When searching something this file is indexed for, This error shows:
* warning: filectime() [function.filectime]: stat failed for C:/xampp/htdocs/drupal/sites/default/files/my_deleted_file.pdf in C:\xampp\htdocs\drupal\sites\all\modules\search_files\search_files.module on line 832.
* warning: filesize() [function.filesize]: stat failed for C:/xampp/htdocs/drupal/sites/default/files/my_deleted_file.pdf in C:\xampp\htdocs\drupal\sites\all\modules\search_files\search_files.module on line 834.
The deleted file is still listed in the search results with no number of bytes and no date.
Comments
Comment #1
leszek.hanusz commentedWhen the site is reindexed (by clicking on Reindex site and running cron jobs manually), the file does not appear in the results anymore and there is no errors anymore.
Comment #2
mradcliffeI ran into this bug as well, and can confirm it in search_files-6.x-1.6
There should be a test to confirm if the file exists or not. Here is what I did. This displays a watchdog notice if it doesn't exist.
Comment #3
thl commentedSee http://www.lotterer.net/blog/en/165-drupal-search_filesmodule-118thl1
The last one of these three bugfixes exactly handles the problem described in this thread.
bugfix
there is a functional gap where vanished files were not handled at all. Regularly compare database to filesystem and remove vanished files from database.
bugfix
while indexing files, skip over files which vanished before being indexed. Otherwise helper applications will get passed a nonexistent file name and fail.
bugfix
while preparing search results, skip over files which vanished after being indexed. Otherwise functions like filectime() will get passed a nonexistent file name and fail.
Comment #4
avpadernoComment #5
thl commentedThis is fixed on HEAD and will appear on >6.x-1.6, if someone releases any - James? I won't, so assign to jrglasgow. He should either roll a 6.x-1.7, find someone else who's doing it or set status to "won't fix". Sorry and best wishes.
Comment #6
avpadernoI am closing this issue, which is for a not supported Drupal version.