Similar to #2633242: Process plugin for importing/creating terms by name
Problem/Motivation
In D7, there is an option to auto create a file record on the content migration. This feature parity doesn't exist (yet) in D8.
Proposed resolution
Build it. Do it.
Remaining tasks
Write code.
User interface changes
n/a
API changes
Probably
Data model changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | process_plugin_for-2635622-13.patch | 6.74 KB | mikeryan |
| #5 | migrate_plus-file_generate-2635622-5.patch | 2.42 KB | heddn |
Comments
Comment #2
heddnComment #3
heddnComment #4
heddnThis is no longer blocked. But moving over to the migrate_plus issue queue. This isn't a feature that is needed for migrating from another Drupal instance.
Comment #5
heddnBased on top of #2642612: Create Entity Lookup & Generate process Base plugins.
Comment #6
heddnComment #7
heddnComment #8
heddnThis will need more work. Need to parse out the filename to only the base name when creating the new file.
Comment #9
mikeryanI need this on 8.1.x for my current project.
Comment #10
mikeryanWell, it turned out I didn't need it for that project in April - but I do for this week's project, so I'll be seeing if I can complete this patch within the next day.
Comment #11
mikeryanA big piece missing here is actually copying the file into the files directory. Drupal 8.2.x should be introducing a general-purpose file_copy process plugin for this in #2695297: Refactor EntityFile and use process plugins instead - I'm thinking that the best solution here would be to add that plugin to migrate_plus in 8.x-2.x (which will be compatible with core 8.1.x only), and remove in 8.x-3.x (which will be compatible with core 8.2.x and up). Maybe add the urlencode process plugin from that patch as well...
Comment #12
mikeryanI think if we do #2765733: entity_lookup should support file/image destination fields, we won't need the file_generate process plugin, just the file_copy plugin.
Comment #13
mikeryanYes, a combination of #2765733: entity_lookup should support file/image destination fields and the file_copy plugin does the job without a specialized generation plugin. Here's what the relevant parts of my migration look like to leverage this:
Comment #15
mikeryanSigh... Thought I had committed this, so I though it was in beta2...