The overview at admin/content/file has a column listing "Used in", which says for example, "8 places". The number is the sum of the usage counts of the file, not the number of entities that the file is used in as the name "places" suggests. The latter seems more useful, since the use count can increment to more than the actual usage, e.g. if you add, remove and re-add an item in a body field using the media wysiwyg button.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Category: Bug report » Feature request

This is how the values appear on the admin/content/file listings in Drupal 8 as well, and I think this is largely semantics. The file is technically used in multiple places on the same entity, which I don't think should count as just one.

cdmo’s picture

Status: Active » Needs review
FileSize
639 bytes
55.32 KB

I think the language in the view is such that there's not much ambiguity in what an admin should expect this number means,"Used in X place(s)". Honestly, I'm not sure what the number it's actually showing represents (the times it's been viewed?) because from what I'm seeing it's not the number of times it is referenced on a given node. The example below says "6 places" but this file is referenced only once on one node.

administrative view of files

I'm submitting a patch that should be a simple fix, a count of the entity_ids that reference this file.

Thanks.

askibinski’s picture

Status: Needs review » Reviewed & tested by the community

I support the patch: for example, users do not expect the number to take into account revisions of a node where a file is used.

We have successfully tested and applied the patch for some clients.

koppie’s picture

I can confirm this patch is good. I agree that this should be committed!

joseph.olstad’s picture

joseph.olstad’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

fixed in parent issue

cdmo’s picture

Glad that this appears to be solved. Not sure how this is a duplicate because this issue came first, but that's fine.