This is currently something of a bug in both File and in the current CCK UI. The problem in File arises with the following situation:

- Edit a file field and upload a default file.
- Save the configuration, now edit the file field again and remove the default file (optionally upload a different one).

Now File module *should* compare the value of that field before and after the change, and delete the file from disk (if it's not in use elsewhere). However, it currently does not because there's no #submit handler accessible to File module that CCK makes available. The only solution for File would be to hook_form_alter() the form, check if it's a File field that's been edited, then do the comparison that way.

What would be preferable would be if CCK would either A) have a _submit() hook for editing field settings or B) make the $form variable available to the field module, so it could put a #submit handler on it manually.

Comments

quicksketch’s picture

Project: File » Drupal core
Version: 7.x-1.x-dev » 7.x-dev
Component: Code » file.module

The File module was added to core with this bug in place as part of #391330: File Field for Core. Moving the the core queue.