Add wysiwyg plugin for file entities

Created on 15 July 2021, over 3 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

I just ran into this warning message:
Could not find a MediaWysiwyg plugin for field 'field_whatever_text' used in source entity type 'file'. You probably need to create a new one. Have a look at \Drupal\media_migration\Plugin\MediaWysiwyg\FieldCollectionItem for an example.

Steps to reproduce

Try to instantiate d7_file_entity migration where the source media entity has a text field.

Proposed resolution

Add wysiwyg plugin for file entities.

Remaining tasks

API changes

πŸ“Œ Task
Status

RTBC

Version

1.0

Component

Documentation

Created by

πŸ‡­πŸ‡ΊHungary huzooka Hungary πŸ‡­πŸ‡ΊπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom very_random_man

    Yep, this works for me. Annoying warnings for unrelated stuff now hidden leaving me in a blissful state of ignorance. Thanks. :-)

  • πŸ‡³πŸ‡ΏNew Zealand xurizaemon Ōtepoti, Aotearoa 🏝

    I addressed this by creating a couple of dummy process plugins to silence it.

    
    namespace Drupal\example\Plugin\MediaWysiwyg;
    
    use Drupal\media_migration\MediaWysiwygPluginBase;
    
    /**
     * Field collection Media WYSIWYG plugin.
     *
     * This plugin targets field collection content entity types.
     *
     * @MediaWysiwyg(
     *   id = "field_collection_item",
     *   label = @Translation("Field Collection Item"),
     *   entity_type_map = {
     *     "field_collection_item" = "node",
     *   },
     * )
     *
     * @see \Drupal\media_migration\MediaWysiwygInterface
     */
    class FieldCollectionItem extends MediaWysiwygPluginBase {}
    
    namespace Drupal\example\Plugin\MediaWysiwyg;
    
    use Drupal\media_migration\MediaWysiwygPluginBase;
    /**
     * File Media WYSIWYG plugin.
     *
     * This plugin targets file content entity.
     *
     * @MediaWysiwyg(
     *   id = "file",
     *   label = @Translation("File"),
     *   entity_type_map = {
     *     "file" = "media",
     *   },
     * )
     *
     * @see \Drupal\media_migration\MediaWysiwygInterface
     */
    class File extends MediaWysiwygPluginBase { }
    
Production build 0.71.5 2024