Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
filefield_get_file_reference_count() counts references. If I understand the API right, we only need to report if there are any references, exact number doesn't matter. Thus we must be able to use range query with LIMIT 1
instead of COUNT which is painfully slow on innodb.
Comment | File | Size | Author |
---|---|---|---|
#2 | filefield_get_file_reference_count_1189932.patch | 2.36 KB | crea |
Comments
Comment #1
crea CreditAttribution: crea commentedApproach is already implemented in D7
http://drupal.org/node/747464
Comment #2
crea CreditAttribution: crea commentedComment #3
quicksketchHmm, I don't know about this. This is a pretty major change to the API that has existed for almost 3 years, I don't think we can change it at this point to have a different return value. Who knows how other modules have been using these functions?
Comment #4
crea CreditAttribution: crea commentedWe can keep this function, but implement a copy with a different name which uses the new approach, and use it everywhere in this module (such as inside hook_file_references()). It's then a problem in calling module, if it calls the old function.
Comment #5
crea CreditAttribution: crea commentedtagging
Comment #6
pwolanin CreditAttribution: pwolanin as a volunteer and at Acquia commentedBased on comments above, this is needs work to add a new function and convert internal uses.