salsadigitalauorg / merlin-framework

Merlin - migration framework
GNU General Public License v3.0
16 stars 3 forks source link

Media attributes do not flow through to MediaTrait #23

Closed stooit closed 5 years ago

stooit commented 5 years ago

When using an image processor as follows:

      -
        processor: media
        data_embed_button: media_entity_embed
        data_entity_embed_display: 'view_mode:media.embed'

The options are added to attributes in src/Processor/Media.php, but these do not flow through to MediaTrait.

Also there is a bug in Media.php:

diff --git a/src/Processor/Media.php b/src/Processor/Media.php
index ee6fbb3..a91e0f1 100644
--- a/src/Processor/Media.php
+++ b/src/Processor/Media.php
@@ -51,7 +51,7 @@ class Media extends ProcessorOutputBase implements ProcessorInterface
         $this->config['attributes'] = [];

         $this->config['attributes']['data_embed_button']         = !empty($config['data_embed_button']) ? $config['data_embed_button'] : 'tide_media';
-        $this->config['attributes']['data_entity_embed_display'] = !empty($config['data_entity_embed_display']) ? $config['data_embed_button'] : 'view_mode:media.embedded';
+        $this->config['attributes']['data_entity_embed_display'] = !empty($config['data_entity_embed_display']) ? $config['data_entity_embed_display'] : 'view_mode:media.embedded';
         $this->config['attributes']['data_entity_type']          = !empty($config['data_entity_type']) ? $config['data_entity_type'] : 'media';