hi i am using the following modules:

- FileField
- ImageField
- IMCE
- FileField Sources

all in the current stable version on D6.

if i upload an image using imce and pick it afterwards user FileField Sources, the file is reference by FileField. But if i remove it again the reference is not deleted as i can see when i call

module_invoke_all('file_references', $file);

this causes the issue that i cannot delete these files through imce anymore. it gives me the notice that the file is used by another module.

ideas?

thanks

lukas

Comments

quicksketch’s picture

if i upload an image using imce and pick it afterwards user FileField Sources, the file is reference by FileField. But if i remove it again the reference is not deleted as i can see when i call

IMCE now implements hook_file_references() also, so the only way you can delete that image is to delete it through IMCE.

quicksketch’s picture

Category: bug » support
luksak’s picture

on line 405 in imce.page.inc you do the following:

$refs = array_filter(module_invoke_all('file_references', $file));
//file is in use
if (!empty($refs)) {
  drupal_set_message(t('%filename is in use by another application.', array('%filename' => $file->filename)), 'error');
  return FALSE;
}

$refs contains an array:

Array
(
    [0] => filefield
)

or something similar.

this shouldnt be the case since i removed the file from all nodes before.

thanks

lukas

quicksketch’s picture

Did you remove the file from all the *revisions* of all the nodes? Since a file is still in use by FileField if it's in use by any revisions.

luksak’s picture

thanks quicksketch, this resolved the issue.

quicksketch’s picture

Status: Active » Fixed

Sweet. Good to know FileField and IMCE are starting to play nicely together finally.

luksak’s picture

true

thanks for the great work!

i have another small bug: when i open IMCE some of the buttons at the top are not showing up.

quicksketch’s picture

You should file an issue with the IMCE module.

Status: Fixed » Closed (fixed)

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