[6.0] Media plugin + valid_elements = "TypeError: rule is undefined"
See original GitHub issueWhat is the current behavior? Describe the bug
Using media plugin with any valid_elements
specification produces TypeError: rule is undefined
Please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tiny.cloud or similar. https://jsfiddle.net/r3c9jLp5/1/
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE? Version 6. Worked in previous version.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Migrating from TinyMCE 5 to TinyMCE 6
Premium Plugins released with TinyMCE 6.0 are not backwards compatible with earlier ... TypeError: Cannot read properties of undefined (reading 'rows') .
Read more >Uncaught TypeError: Cannot read properties of undefined ...
Hi, i have this kind of error in two my site with 6.1 Elementor pro version. Your tool is required for Elments Elementor...
Read more >Uncaught TypeError: Cannot read property 'call' of undefined
Generally speaking this is an error that can be raised if you have set a non valid jQuery validation rule. You can find...
Read more >Resolving TypeError: Cannot Read Property of Undefined ...
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >wp.media Uncaught TypeError: Cannot read properties of ...
But getting this error (Uncaught TypeError: Cannot read properties of undefined (reading 'state')) while submitting the image. constructor ( btn ) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The media elements are listed in the doc I linked, but yes it appears to be missing
embed
sorry. I’ll log an internal docs ticket to get that fixed. So to be clear the elements required by the media plugin areiframe
,video
,audio
,embed
andobject
(similar to how the lists plugin requiresli
,ul
,ol
, etc…). The media plugin itself has no way of blocking certain urls based on the type of URL provided so it needs to have all allowed. If you’d like to have that be customized so that it blocks certain media content that would need to be a separate feature request.The exception looks like it’s coming from this code: https://github.com/tinymce/tinymce/blob/c12fb6af3b6b72886946dd3fb1bb1b8be249949f/modules/tinymce/src/plugins/media/main/ts/core/FilterContent.ts#L20-L29
So for now you need to define
embed
as a valid element.