Since
#3097416: When embedding media, don't let authors choose view modes that are not enabled for that media type β
, view modes are filtered before being passed to the drupalElementStyles
plugin.
This happens in \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Media::configureViewModes()
which filters out view modes that are not enabled for at least one Media Type.
As all view modes are available to choose in the media_embed Filter plugin, we can easily have some combinations that leads to only have disabled view modes available. In this case, ckeditor5 fails to load and gives us a nice "TypeError: a is undefined
" unhelpful error.
Improve Embed Media settings form to only allow to select enabled view modes for selected bundles.
Pros: more polished options for site builders
Cons: complex UI to be designed, dependencies management to add in case some selected view mode is deleted
Revert
#3097416: When embedding media, don't let authors choose view modes that are not enabled for that media type β
and allow users to select view modes that are not configured for the given bundle.
Pros: allows to rely on the view modes fallback mechanism
Cons: can confuse users if the selected view mode doesn't have any rendering
Only add a setting to disable the filtering and let the site builder take responsibility.
Pros: easy to implement, current behavior by default, allow option 2 pros
Cons: can still confuse users but it's site builder's responsibility
Active
10.2 β¨
Last updated