Needs an integration only

Thanks for this lovely and clean piece of code, all the best

Comments

gkom’s picture

Yes, this is a blocker for me.
+1 for filefield sources integration.

richsky’s picture

FileField Sources API state:

/**
 * Returns a list of widgets that are compatible with FileField Sources.
 *
 * FileField Sources works with the most common widgets used with Drupal (the
 * standard Image and File widgets). Any module that provides another widget
 * for uploading files may add compatibility with FileField Sources by
 * implementing this hook and returning the widgets that their module supports.
 */
function hook_filefield_sources_widgets() {
  // Add any widgets that your module supports here.
  return array('mymodule_file_widgetname');
}

Then in any of your custom module simply add

function mymodule_filefield_sources_widgets() {
  return array('image_miw');
}

But since MFW implements a custom element type - mfw_managed_file -, you need to add to the multiple image field element some information (the same as managed file in file field sources):

function mymodule_element_info() {
  $elements = array();

  $elements['mfw_managed_file']['#process'] = array('filefield_sources_field_process');
  $elements['mfw_managed_file']['#pre_render'] = array('filefield_sources_field_pre_render');
  $elements['mfw_managed_file']['#element_validate'] = array('filefield_sources_field_validate');
  $elements['mfw_managed_file']['#file_value_callbacks'] = array('filefield_sources_field_value');

  return $elements;
}
czigor’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
lameei’s picture

Any progress?

Dandily’s picture

Any news?

fietserwin’s picture

Title: Please try to make it work with Filefield sources module » Add support for Filefield sources module
Status: Closed (duplicate) » Needs review
Parent issue: » #1808540: Make Multiupload compatible with FileField Sources
StatusFileSize
new587 bytes

Reopening, as #1808540: Make Multiupload compatible with FileField Sources needs a few lines of code in this module to work for images as well. To get it working for images, you will need both patches therefore I am tagging that issue as parent of this one.

[note: if you don't want to depend on patches you can put this all in a custom module, the code in the function multiupload_filefield_widget_element_info(), should then be placed in a hook_element_info_alter.]

Abelito’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch. It is working great.

Anonymous’s picture

Agreed. Works well!