Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We have #2695297: Refactor EntityFile and use process plugins instead in core now. But I need to be able to import a base64 encoded string into a file contents for a plone migration.
Proposed resolution
Code it. Model after #2695297: Refactor EntityFile and use process plugins instead
Remaining tasks
Review and test
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff_4-6.txt | 3.58 KB | heddn |
#6 | migrate_plus-fileblob_process_plugin-2795879-6.patch | 4.68 KB | heddn |
Comments
Comment #2
heddnComment #3
heddnComment #4
heddnComment #5
mikeryanWe should assign the result of putFile() to $destination, in case of rename.
Eager to apply #2648050: [policy, no patch] Stop disallowing camelCase for local variables / parameters are we;)? I'm actually for that, but I'd rather keep the module self-consistent for now - if we're going to go all camelCase that should be a distinct issue changing the whole module.
Actually, I don't think displaying the basename adds anything here - better to say something like "Blob data could not be copied...".
Are we sure an existing file is the only reason file_destination might return FALSE?
Not sure it's right to always leave the destination untouched - the D7 FILE_EXISTS_REUSE permitted control over this.
Comment #6
heddnre: #5
1. I removed rename as an option. It doesn't make sense with a blob. If we need to rename it, then use a previous process plugin to rename the destination path before passing into this plugin.
2 & 3. Fixed
4. file_destination does work that way. So the code should function correctly as coded.
Also of note, I changed the default from don't re-use to always replace. It seems to be the default in D7 and D8, so let's not provide any surprises to folks coming from other parts of Drupal.
Comment #7
heddnComment #9
mikeryanCommitted, thanks!