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

Add defensive check if the list is available in the morphology data before retrieving it #21853

Conversation

FAMarfuaty
Copy link
Contributor

@FAMarfuaty FAMarfuaty commented Nov 21, 2024

Context

  • Premium 23.9 uses English morphology data version 5, while Free 24.0 requires morphology data version 6, where a new list (with a new key) was added. This list is used in the Free 24.0. Hence, since Free 24.0 is trying to use a list that morphology data version 5 doesn't have, the assessments were broken.
  • The solution is adding a defensive coding before retrieving the new list.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes an unreleased bug where the keyphrase assessments were broken when Yoast SEO 24.0 RC was paired with an older version of the premium add-on.

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:

  • Install and activate Free SEO 24.0-RC2 + Premium SEO 23.9
    • If building the plugin, you can pair this free branch with the wordpress-seo-premium main branch
  • Create a new post
  • Add keyphrase and text
  • Check the console, and confirm that you don't get TypeError: Cannot read properties of undefined (reading 'list') (check the screenshot to see how it was before)
  • Check Yoast metabox and sidebar, and confirm that assessments are loaded without error (check the screenshot to see how it was before)
    388558366-e9f9cb94-6375-4096-ab9f-9d957204d7e4

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:

  • No further impact

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 https://github.com/Yoast/plugins-automated-testing/issues/1993

@FAMarfuaty FAMarfuaty added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Nov 21, 2024
@FAMarfuaty FAMarfuaty added this to the 24.0 milestone Nov 21, 2024
@FAMarfuaty FAMarfuaty marked this pull request as ready for review November 22, 2024 08:53
@mykola mykola merged commit dbbcd8d into release/24.0 Nov 22, 2024
16 checks passed
@mykola mykola deleted the 1993-240-new-free-old-premium-typeerror-cannot-read-properties-of-undefined-reading-list-assessments-are-broken branch November 22, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants