10up / simple-podcasting

A simple podcasting solution for WordPress.
https://wordpress.org/plugins/simple-podcasting/
GNU General Public License v2.0
185 stars 30 forks source link

Ensure Podcast block updates are backward compatible. #320

Closed iamdharmesh closed 2 months ago

iamdharmesh commented 2 months ago

Description of the Change

PR fixes the first issue reported in https://github.com/10up/simple-podcasting/issues/313#issuecomment-2304843986

I tested on an existing post that already had a Podcast block in it and I got the dreaded Block recovery error. Luckily clicking that recovery button did work but it would be ideal if this didn't happen. I know we made some big changes to the block but would be great if those changes could be made backwards compatible.

The issue occurred due to changes in the block markup. PR #272 adds a class to the figcaption and moves its position above the audio control.

This PR resolves the issue by adding deprecated block markup using the block deprecation feature.

An alternate solution would be to keep the block markup as it is, since we didn't make major changes—just moved the caption above the audio control. Keeping it as is would prevent the invalid content error.

How to test the Change

  1. Check out the 1.8.0 release tag.
  2. Create a post with a Podcast block and save it.
  3. Check out the develop branch, visit the edit post page, and notice the invalid content error on the block.
  4. Check out this PR branch, visit the edit post page, and verify that there is no invalid content error on the block.

Changelog Entry

Developer - Ensure Podcast block updates are backward compatible.

Credits

Props @dkotter @iamdharmesh

Checklist: