This module is excellent and I'm very excited about the direction it's going. I'm currently integrating an existing drupal site with my company's internal media software, and have written a couple of custom filefield widgets for the purpose (extending filefield much the same way imagefield does).

Unfortunately I had to hack filefield_sources.module to get my widgets to display the source links. In function filefield_sources_elements, I changed the following, ~ lines 48-52:

  return array(
    'filefield_widget' => $extras,
    'imagefield_widget' => $extras,
  );

I replaced those lines with the following to allow any filefield widget to reference sources:

$filefield_widgets = array();
$widget_types = _content_widget_types();
foreach ($widget_types AS $widget => $values) {
  if (in_array('filefield', $values['field types'])) {
    $filefield_widgets[$widget] = $extras;
  }
}
return $filefield_widgets;

Not sure how safe it is to use _content_widget_types(), but this does seem like an extend-able way to incorporate any and all filefield widgets....

Comments

alan d.’s picture

+1 Getting similar requests for ImageField extended.

#686142: Incompatible with FileField_Sources module

srobert72’s picture

Subscribe

robbertnl’s picture

Subscribing, see also http://drupal.org/node/495210 (image crop)

srobert72’s picture

Any latest news ?

benone’s picture

+1

benone’s picture

I have filefield paths module installed also.
It's working with imagefield crop module after second Save.
need to edit and save again to get the image cropped.

in files/images directory are 4 instances instead of 2. 2x original file name and 2x files with names changed by filefield paths .
2 times because crop is adding secont instance with .crop. in the file name.

thanks

quicksketch’s picture

Status: Needs review » Fixed

A new hook has been added as part of #436174: Configuration Options.

alan d.’s picture

Out of interest, are there any modules that are incompatible with filefield sources? If not, why just not parse the base field type to prevent the need for all other modules to implement the hook? With the file / image in core, and well defined field alter hooks, it would seem very unlikely for any other modules to require this hook in D7.

Status: Fixed » Closed (fixed)

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