Problem/Motivation

File entity to media migration derivatives have IDs like d7_file_entity:image:public, while plain file to media migrations IDs look like this: d7_file_plain:public:image.

Proposed resolution

Change _plain file to media_ migration derivative IDs to make the file scheme the last piece of the derivative ID.

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Active » Needs review
StatusFileSize
new13.32 KB
  1. +++ b/src/Plugin/migrate/D7FileDeriver.php
    @@ -55,12 +55,12 @@ class D7FileDeriver extends D7FileConfigDeriver {
                 $derivative_id = implode(PluginBase::DERIVATIVE_SEPARATOR, [
    -              $scheme,
                   $mime,
    +              $scheme,
                 ]);
    

    These are the lines which actually change the derivation of "plain" file to media entity migration IDs from d7_file_plain:<scheme>:<mime> to d7_file_plain:<mime>:<scheme>, so we will have e.g d7_file_plain:image:public instead of d7_file_plain:public:image.

  2. Every other change is a test update, or fixes my bugs made in sprintf() calls.

  3. +++ b/src/MediaWysiwygPluginBase.php
    @@ -90,7 +90,7 @@ abstract class MediaWysiwygPluginBase extends PluginBase implements MediaWysiwyg
                   [
    -                'd7_file_plain:public:image',
    +                'd7_file_plain:image:public',
                     'd7_file_entity:image:public',
    

    Much better this way!

huzooka’s picture

Issue summary: View changes
Status: Needs review » Fixed

  • huzooka committed 1965440 on 8.x-1.x
    Issue #3210177 by huzooka: Standardize derivation strategy of file...
wim leers’s picture

🤩

Status: Fixed » Closed (fixed)

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