-
Bug
-
Resolution: Merged
-
Should have
-
None
-
5
-
Block: Media
-
Sprint #163
It is possible to add a Media block without a media URL specified; this situation will generate a PHP notice
Notice: Undefined index: youtube_id in /app/source/public/wp-content/plugins/planet4-plugin-gutenberg-blocks/classes/blocks/class-media.php on line 92
and display a string false on frontend.
This error is locally available on url planet4.test/testing-all-blocks-default-template/
Tasks:
- For existing content
- Fix Notice (check youtube_id entry, return early when no url is found)
- Fix frontend block (MediaEmbedPreview should not be used if media_url is empty)
- For new content
- Check if the Media URL field should be mandatory for this block
- Add a check on the Post Publish validation