Skip to content

Allow multiple FAQ blocks and fix FAQ and How To markup#21402

Merged
enricobattocchi merged 2 commits intorelease/22.8from
fix/allow-multiple-faq-blocks
May 23, 2024
Merged

Allow multiple FAQ blocks and fix FAQ and How To markup#21402
enricobattocchi merged 2 commits intorelease/22.8from
fix/allow-multiple-faq-blocks

Conversation

@enricobattocchi
Copy link
Copy Markdown
Member

@enricobattocchi enricobattocchi commented May 23, 2024

Context

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug preventing multiple FAQ blocks from being added to a post/page.
  • Fixes a bug where a class was missing in the output of the FAQ and How-To blocks.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Important: test using an artifact instead of just building from the source, since there is an integral part of this PR that is related to copying the blocks JSON to a dist dir and finding it there.

1. Multiple FAQ blocks

New blocks
  • create a post and add two or more FAQ blocks
    • add some questions and answers
    • publish it and check the Schema: the page should be a FAQPage with mainEntity set to all the Question pieces from all the FAQ blocks combined
Upgrading
  • on another site, install Free 22.6
  • create a post and add two or more FAQ blocks
  • add some questions and answers and publish
    * if you now upgrade to 22.7 and edit the post you'll see a warning telling you that you cannot use the block twice.
  • upgrade to the zip containing this fix
  • edit the post and see that there is no warning now
  • inspect the Schema and check it's right
  • edit the FAQ blocks again and verify everything's working

2. Block markup

New blocks
  • create a post and add a FAQ block and a How To block, with some content
  • publish it and inspect the source of the page in the frontend
  • check that the FAQ block is outputted as <div class="schema-faq wp-block-yoast-faq-block"> and the How-to block as <div class="schema-how-to wp-block-yoast-how-to-block">
Upgrading from 22.6 or earlier
  • on another site, install Free 22.6
  • create a post and add a FAQ block and a How To block, with some content
  • publish it
  • upgrade to this version
  • edit the post and see that you don't get any warning
  • apply a small change somewhere in the content and save
  • check that the FAQ block is outputted as <div class="schema-faq wp-block-yoast-faq-block"> and the How-to block as <div class="schema-how-to wp-block-yoast-how-to-block">
Upgrading from 22.6 or earlier
  • on another site, install Free 22.7
  • create a post and add a FAQ block and a How To block, with some content
  • publish it
  • upgrade to this version
  • edit the post and see that you get warning like these ones:
    Screenshot 2024-05-23 at 13-04-33 Edit Post “Blocks” ‹ Become Church — WordPress
  • click on the "Attempt recovery" buttons and see they are restored
  • update the post and inspect the frontend
  • check that the FAQ block is outputted as <div class="schema-faq wp-block-yoast-faq-block"> and the How-to block as <div class="schema-how-to wp-block-yoast-how-to-block">

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #21401
Fixes #21403

@enricobattocchi enricobattocchi force-pushed the fix/allow-multiple-faq-blocks branch 2 times, most recently from 1914e7b to 237f6bf Compare May 23, 2024 08:29
@enricobattocchi enricobattocchi added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label May 23, 2024
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 39be37fc0bdbedb5afc04e0672a06a1815dd0166

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 48.302%

Totals Coverage Status
Change from base Build 5ccfd2603220c02e5d11fd1608b7ae9f1994dda0: 0.0%
Covered Lines: 24971
Relevant Lines: 53561

💛 - Coveralls

@enricobattocchi enricobattocchi changed the base branch from trunk to release/22.8 May 23, 2024 14:41
@enricobattocchi enricobattocchi force-pushed the fix/allow-multiple-faq-blocks branch from 573feee to 552c540 Compare May 23, 2024 14:42
@enricobattocchi enricobattocchi merged commit 7921432 into release/22.8 May 23, 2024
@enricobattocchi enricobattocchi deleted the fix/allow-multiple-faq-blocks branch May 23, 2024 14:55
@enricobattocchi enricobattocchi changed the title Allow multiple FAQ blocks Allow multiple FAQ blocks and fix FAQ and How To markup May 23, 2024
@enricobattocchi enricobattocchi added this to the 22.8 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog

Projects

None yet

2 participants