Right now we have a set of public API functions in field_file.inc, which is nearly equivalent to hook_file() in Drupal 7. The general File API is quite good, but FileField itself doesn't provide any useful APIs.

Some API functions that would be useful:

We've already got this last option, but it's not in the FileField name-space: the field_file_references() function. This function shouldn't be FileField specific, since the field_file.inc file is meant to be File API functions and be independent from FileField itself.

This patch makes a place for us to put public API functions in filefield.module, and moves the filefield_file_references() code to the new location in a new function filefield_get_file_reference_count().

CommentFileSizeAuthor
filefield_api_start.patch5.13 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Needs review » Fixed

After checking that all our tests still pass, I committed this version of the patch. This should open the door for the other API functions that people have suggested.

Status: Fixed » Closed (fixed)

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