I'm trying to upgrade CCK file fields on a D6 site to file fields and I have Media installed to migrate a couple of emfields. After completing the migration lots of EntityMalformedException start to be thrown as the 'type' field has not been populated.

It would be really useful if File entity could integrate with Content migrate to populate the 'type' field when the file is created.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
FileSize
1.28 KB
Dave Reid’s picture

How are records getting saved to {file_managed} without going through the API of file_save() ?

plach’s picture

IIRC the record is written directly to the db...

aaron’s picture

what version of the migrate module are you using? From what I can tell, file_save() is called properly from sites/all/modules/migrate/plugins/destinations/file.inc, approximately line 268.

aaron’s picture

oh wait, I see now that you are pulling data from embedded media Field. I did not even know that migrate supports that module. I would say that if it is writing directly to the database, however, that it exposes a bug with the migrate module.

aaron’s picture

and now, I see that you are actually talking about the content migrate module, and not the migrate module. That's what I get for trying to review issues when I am tired.

aaron’s picture

Status: Needs review » Postponed (maintainer needs more info)

okay, so now I'm looking in the embedded media Field, and see at http://drupalcode.org/project/emfield.git/blob/refs/heads/7.x-1.x:/emfie... that the module properly calls $provider->save(), which in turn calls file_save() at http://drupalcode.org/project/media.git/blob/refs/heads/7.x-2.x:/modules...

So again, I need to ask what versions of what modules you are using.

plach’s picture

Status: Postponed (maintainer needs more info) » Needs review

@aaron:

Thanks for looking into this. I'm using the latest 7.x dev snapshot of CCK, see content_migrate.filefield.inc. It's an issue wth cck itself not emfield.

Not sure whether we should file a bug report in the CCK queue because they are not using the API, but I suspect this is intentional.

aaron’s picture

Title: Integrate with Content migrate to avoid EntityMalformedException being thrown » Implement file_save() to avoid EntityMalformedException being thrown
Project: File Entity (fieldable files) » Content Construction Kit (CCK)
Component: Code » upgrade path
Status: Needs review » Active

yes, that does appear to be a bug to me. Moving to the CCK project.

aaron’s picture

Category: feature » bug