If you use field collection (and probably other similar solutions) and you map the subfields, for file mappings there's a call for setting the allowed extensions that gets the instance and will look for the settings of the instance of the field collection instead of the file field itself.
I think checking the instance from the $entity instead of the source would fix this and work for the regular cases.

Adding a patch for this

Comments

pcambra created an issue. See original summary.

pcambra’s picture

Status: Active » Needs review
Related issues: +#1063434: Add Feeds integration to FieldCollection
StatusFileSize
new557 bytes

Status: Needs review » Needs work

The last submitted patch, 2: 2619788-entity_file_field_mapping-1.patch, failed testing.

The last submitted patch, 2: 2619788-entity_file_field_mapping-1.patch, failed testing.

pcambra’s picture

Status: Needs work » Needs review
StatusFileSize
new749 bytes

Not sure if $entity is not a real Entity for some cases?

megachriz’s picture

Status: Needs review » Fixed

Yes, in D7 entities don't necessary inherit from the class "Entity". All core entity types (like node, user, taxonomy_term and comment) are even generic "stdClass" objects.

Code looks good. I tested the import of a file with a custom entity type that uses the Entity class and with a single bundle and did not notice any errors. Committed #5.

  • MegaChriz committed c11aca0 on 7.x-2.x authored by pcambra
    Issue #2619788 by pcambra: Get instance info from the entity instead of...

Status: Fixed » Closed (fixed)

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