Closed (fixed)
Project:
Media Migration
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Aug 2020 at 17:09 UTC
Updated:
17 Feb 2021 at 14:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersBy "file type" do you mean the
typecolumn that thefile_entitymodule added to thefile_managedtable?Comment #3
damienmckennaI was thinking it should create separate (D8) Media entity bundles based upon the (D7) File Entity bundles.
Comment #4
huzookaComment #5
huzooka#3159580: Migrate media entities from sources that aren't using Media or File Entity module introduced a plugin system with media type migration support.
The attached patch does the same for File Entity → Media migrations.
I also added media source field widget and media field formatter migrations.
Comment #6
huzookaComment #7
huzookaComment #8
huzookaSame patch as in #5, without extra trailing new line errors.
Comment #9
huzookaComment #10
wim leers🤔 Was this a bug in HEAD?
🤔 I think this can be removed because file entities are not actually fieldable?
👍 This rename makes it clearer that this migration is specific to
file_entitysource data.🤔 But "source field" is a D8 Media-specific concept. So perhaps
d7_file_entity_to_media_source_field_configwould be clearer?(Similar observation for the other migration
.ymlfiles touched by this patch by the way.)🤓 Nit: s/id/ID/
🤔🤩 All of this logic is obsolete because it's being replaced with actual migration definitions, right?
🤓 C/P remnant
🤔 Why not use
FQCN::classhere?🤔 Isn't this identical to\Drupal\media_migration\FileDealerManager::getDefinitionsByFieldTypeAndScheme()?Then why not makeFileEntityDealerManager extends FileDealerManagerand overriding the constructor?Never mind, it's subtly different! For
filethe parameters arestring $scheme, string $mime, here (forfile_entity) they are$type, $scheme. Makes sense.🤔 Why not
?
🤓 Übernit: s/host entity/host entity type/
🤓 s/file-based/file entity-based/
So #3116634: Migrate Drupal 7 remote videos to Drupal 8|9 remote video media entities will not be necessary anymore, because this supports remote video stored as streams (those stream wrappers are provided by https://www.drupal.org/project/media_youtube and https://www.drupal.org/project/media_vimeo), which Media in Drupal 7 stores in
file_entityentities under the hood.So, can you confirm that this patch makes #3116634 obsolete?
If so — wow, this solution is much more elegant than #3116634! The power of iteration and learning! 🤩
Ah, we still have this, which is very similar to what #3116634: Migrate Drupal 7 remote videos to Drupal 8|9 remote video media entities contained.
The code I praised in my previous comment is for migrating the actual media into the media library, from a file entity.
This code on the other hand is for migrating a reference to that media, and ensures it ends up finding (and referencing) the appropriate media ID.
👍
🙏
🤓 s/Type/Item/
Comment #11
huzookaRe #10:
Comment #12
wim leersComment #13
huzookaComment #14
huzookaAddressing everything from #11.
Comment #15
huzookaComment #16
huzookaInterdiff does not contain documentation (README) update.
Comment #17
wim leersThis matches what
core/profiles/standard/config/optional/field.field.media.remote_video.field_media_oembed_video.ymldoes, so 👍Comment #18
huzookaComment #21
wim leersFollow-up at #3198938: Harden \Drupal\media_migration\MigratePluginAlterer::alterFieldMigrations(): dependency on d7_file_entity_type is not always added when necessary to d7_field_instance.