How to handle media ckeditor in D9

Created on 7 January 2022, over 3 years ago
Updated 1 February 2024, about 1 year ago

Hi team,

We are migrating the site from D7 to D9

In D7, media browser is used to add media in the ckeditor and the format is as below:
[[{"fid":"110376","view_mode":"wysiwyg","fields":{"alt":"balcony","height":"581","width":"870","class":"media-element file-default","data-delta":"2","format":"wysiwyg","alignment":"","field_file_image_alt_text[und][0][value]":"balcony","field_file_image_title_text[und][0][value]":false,"field_file_image_caption[und][0][value]":"%3Cp%3EiStock%26nbsp%3B%3C%2Fp%3E%0A","field_file_image_caption[und][0][format]":"full_html","field_file_image_credit[und][0][value]":"","field_file_image_credit[und][0][format]":"full_html","external_url":""},"link_text":null,"type":"media","field_deltas":{"2":{"alt":"balcony","height":"581","width":"870","class":"media-element file-default","data-delta":"2","format":"wysiwyg","alignment":"","field_file_image_alt_text[und][0][value]":"balcony","field_file_image_title_text[und][0][value]":false,"field_file_image_caption[und][0][value]":"%3Cp%3EiStock%26nbsp%3B%3C%2Fp%3E%0A","field_file_image_caption[und][0][format]":"full_html","field_file_image_credit[und][0][value]":"","field_file_image_credit[und][0][format]":"full_html","external_url":""}},"attributes":{"alt":"balcony","height":"581","width":"870","class":"media-element file-wysiwyg","data-delta":"2"}}]]

In D9, If we use media in ckeditor which is in core, it is in different format like below:
<drupal-media data-align="center" data-entity-type="media" data-entity-uuid="4334dc7d-4764-4435-a993-c59f02ba958d"></drupal-media>

How should we handle this in D9 to make this work in migrated content?

💬 Support request
Status

Active

Version

2.0

Component

Documentation

Created by

🇮🇳India Jabavizhi

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.

Production build 0.71.5 2024