-
Type:
Bug
-
Status: CLOSED
-
Priority:
Should have
-
Resolution: Merged
-
Affects Version/s: None
-
Fix Version/s: 2.58.2
-
Labels:None
-
Story Points:5
-
Sprint:Sprint #163
-
Section:Block: Media
-
Track:Development
-
P4 Test Environment:uranus
-
Repositories:planet4-plugin-gutenberg-blocks
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