I'm not 100% sure this is the right place for this, but the functionality seems sufficiently different from what media_feeds does. When #1033202: [Meta] Generic entity processor is accepted, it would be nice if the file_entity module supported importing files by URL strings (similar to how file fields work).

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

elliotttf’s picture

Status: Active » Needs review
FileSize
2.67 KB
elliotttf’s picture

Updated patch to include a mapper for flie mimetype.

jrbeeman’s picture

While I believe the existing patch still successfully applies against 7.x-2.x, I've attached a new one, re-rolled against latest 7.x-2.x. The related issue is still open, therefore this issue depends on it. That said, we've been running this patch and it's sister (against Feeds), successfully for a while now. I'll post back here when there's an update in the related issue.

derekw’s picture

I've got the feeds-entity-processor-1033202-116.patch installed, and created a feed of Entity processor: File. Setting is set to File, type Image. (In the Entity Processor: File Settings form the entity type dropdown doesn't stay set, but the following fields are correct for File.)

Also tried patched file entity with #2 or #3 above, but no joy. In my feed mapping, my custom file fields for Image show up (Credit, Description) but no URL, Local or MimeType targets. GUID, FID... no way to have the feed grab and save the file.

Do I have the wrong expectations of how this is supposed to work?

ParisLiakos’s picture

wroxbox’s picture

I have attached generic entity processor patch and the patch from #3. In my testings those URL, Local or Mimetypes are not available as targets.

Entity Processor

Entity Processor Mappings

The hook "file_entity_feeds_processor_targets_alter" seems correct, but it is never called in mappings page? Should it be.

olli’s picture

Have you tried uncommenting drupal_alter like #1033202-119: [Meta] Generic entity processor?

wroxbox’s picture

Kiitos @Olli!

After uncommenting the line in FeedsEntityProcessor.inc the mapper looks much better :)

   // Let other modules expose mapping targets.
    self::loadMappers();
    $type = $this->entityType();
    drupal_alter('feeds_processor_targets', $targets, $type, $info['bundle']);

entity-processor-mapper-fixed.png

olli’s picture

Great!

About the patch:

  1. +++ b/file_entity.feeds.inc
    @@ -0,0 +1,95 @@
    +    // TODO - figure out how to avoid this.
    +    unset($targets['type']);
    

    What happens if we don't unset this?

  2. +++ b/file_entity.feeds.inc
    @@ -0,0 +1,95 @@
    +  // TODO - are destinations configurable?
    +  $dest = file_build_uri('');
    

    Do you mean like my_module_form_callback ?

mErilainen’s picture

For me the patch in #3 works nicely when combined with the mentioned Feeds patch. I had to uncomment the drupal_alter() as well.

It would be cool to be able to give a prefix for the File URI because I have to use often Feeds Tamper rewrite plugin to add a prefix to local or remote source when the imported path only includes the file name.

rwohleb’s picture

FYI, I've created the Feeds Files module to handle file processing until it it properly baked into Feeds. Once it is, I'll take down the Feeds Files module.

aaron’s picture