If I use a file widget to link to an existing file using IMCE, then if the file is a replacement for another file, the original file is linked to instead.

Environment:

  • IMCE 7.0-1.8 installed and active.
  • Content type A has field Documents field_documents of type File and widget File.
  • That field allows unlimited files.
  • That field allows file sources of Upload, IMCE file browser, and autocomplete reference textfield.
  • IMCE file browser settings for that field is Full.
  • File system has the following files that were uploaded via content type B to a different directory than is used as content type A's default directory.
    • 1-15-13item10.4mobilefoodfacilitypermitparkingtciiamendment.pdf
    • 1-15-13item10.4mobilefoodfacilitypermitparkingtciiamendment_0.pdf

The _0 file is a later version of the original, _0-less, file. When using the upload button in the file widget, Drupal adds a _0 to the file name of the new version. (Considered a feature rather than a bug.)

Steps:
1. Add content
2. Choose content type A.
3. Go down to field_document
4. Under Add a new file, click File browser
5. Click browse
6. Locate 1-15-13item10.4mobilefoodfacilitypermitparkingtciiamendment_0.pdf in the IMCE browser
7. Click the file name
8. Click Insert file

Actual result: The linked file is 1-15-13item10.4mobilefoodfacilitypermitparkingtciiamendment.pdf

Expected result: The linked file is 1-15-13item10.4mobilefoodfacilitypermitparkingtciiamendment_0.pdf

Comments

ufku’s picture

Project: IMCE » FileField Sources
Version: 7.x-1.8 » 7.x-1.x-dev
Component: Code » General