I'm in the process of upgrading the download_count module to d7, and the meta data tracked for file downloads includes the entity from which the file was downloaded. The problem is, 'reference existing' files are reporting the original entity to which they are attached instead of the current entity.

From what I can see it's because the _filefield_sources_field_access function doesn't include the entity in its field_access call. I'm trying to come up with a patch, but any pointers/suggestions would be very welcome (i'm still finding my way around the file api in d7).

Thanks.

Comments

WorldFallz’s picture

i just realized (duh), that the field_access check is only for the 'edit' op-- so back to the drawing board!

quicksketch’s picture

Title: 'reference existing' files showing as downloaded from original entity not currently the attached entity » Auto-complete widget doesn't match on filename
Status: Active » Fixed
StatusFileSize
new787 bytes

Looks like autocomplete is totally bunk because it's not even including the file name in the query! This patch fixes the problem, though it's still case-sensitive as noted in #1568588: Case sensitve on autocomplete field since drupal 7.14

quicksketch’s picture

Title: Auto-complete widget doesn't match on filename » 'reference existing' files showing as downloaded from original entity not currently the attached entity
Status: Fixed » Closed (cannot reproduce)

Oh, nevermind, I'm totally wrong here. In any case the adding of db_like() is a good thing to handle. I've added this patch over in #1704932: Wrap autocomplete widget query in db_like() to escape special symbols. As for your original problem, I haven't been able to confirm it and we haven't had any other reports in 9 months. If the problem is still happening and you can provide a description of how to reproduce the problem, please reopen.

quicksketch’s picture

Issue summary: View changes

small correction