Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues reported for v1.8.1 release #318

Merged
merged 6 commits into from
Sep 20, 2024
Merged

Conversation

sudar
Copy link
Contributor

@sudar sudar commented Sep 9, 2024

Description of the Change

This PR fixes some of the issues reported in #313

The following are the two issues that are fixed in this PR.

  1. In the settings for each Podcast you can set a Podcast cover image. Within each Podcast block, you can also set an episode image. The preview within the editor always shows the Podcast cover image, not the Podcast block episode image. It does show properly on the front-end though.
  2. I'm getting a PHP warning on the front-end: Attempt to read property "term_id" on string, pointing to includes/blocks/podcast/markup.php:43

Partially Closes #313

How to test the Change

Here are the steps to test the first change

  • Create a Podcast show term
  • Assign an image to the podcast show
  • Create a new post
  • Add the Podcast show term to the post
  • Add a new Podcast block
  • Enable the 'Show Display Art' checkbox
  • The Podcast block will show the Podcast show image
  • Now add a new episode image
  • The preview should change and then show the episode image instead of the podcast show image

Here are the steps to test the second change

  • Create a new post
  • Don't add any Podcast term to the post
  • Add a new Podcast block
  • Save the post and view it in the frontend
  • There should not be any PHP warnings

Changelog Entry

  • Fixed - Show the preview of the episode image if set at block level
  • Fixed - PHP warning when an episode is not associated with any Podcast show

Credits

Props @sudar

Checklist:

@sudar sudar requested a review from a team as a code owner September 9, 2024 16:22
@sudar sudar requested review from Sidsector9 and removed request for a team September 9, 2024 16:22
@github-actions github-actions bot added the needs:code-review This requires code review. label Sep 9, 2024
@jeffpaul jeffpaul added this to the 1.8.1 milestone Sep 9, 2024
@jeffpaul jeffpaul mentioned this pull request Sep 9, 2024
15 tasks
assets/js/edit.js Outdated Show resolved Hide resolved
includes/blocks/podcast/markup.php Outdated Show resolved Hide resolved
@@ -40,7 +40,11 @@
$episode_type = get_post_meta( $post_id, 'podcast_episode_type', true );
$episode_number = get_post_meta( $post_id, 'podcast_episode_number', true );
$season_number = get_post_meta( $post_id, 'podcast_season_number', true );
$term_image_id = get_term_meta( $podcast_show->term_id, 'podcasting_image', true );
if ( is_a( $podcast_show, 'WP_Term' ) ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this solves the undefined issue but doesn't actually solve the root problem, where the proper data isn't actually set on any existing blocks, even if the data was there before. I'm fine with adding this defensive check but just want to ensure we don't lose the thread on the larger issue

@dkotter dkotter self-requested a review September 10, 2024 20:57
Copy link
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to the requested changes but there was a PHPCS error that wasn't failing the GitHub Action. I've gone ahead and updated that check to use the latest version of our PHPCS library and have fixed all existing PHPCS errors

@dkotter dkotter requested a review from jeffpaul as a code owner September 10, 2024 21:10
@dkotter dkotter removed the request for review from jeffpaul September 10, 2024 21:11
@dkotter dkotter merged commit 48bf448 into develop Sep 20, 2024
13 checks passed
@dkotter dkotter deleted the fix/release-1.8.1-issues-313 branch September 20, 2024 19:43
@dkotter dkotter modified the milestones: 1.8.1, 1.9.0 Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release version 1.9.0
4 participants