wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Fix custom field replacement variables in social inputs

Open herregroen opened this issue 1 year ago • 0 comments

:warning: First the revert done in https://github.com/Yoast/wordpress-seo/pull/18784 needs to be undone :warning:

This PR also moves the getMemoizedFindCustomFields to a separate file to be reused. So after undoing the above revert this PR should be adapted to make sure only the function from that separate file is used.

Context

  • Fixes the social input fields.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes custom field replacement variables not being available in the social input fields.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • For this PR make sure premium is not active ( for test instructions for premium see )
  • Have a post with multiple meta fields.
  • Try to add those meta fields to the social input fields ( Twitter title for example ).
  • It should work in both classic and Gutenberg.

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
  • [x] Changes should be tested on different editors (Block/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

  • [x] QA should use the same steps as above.

Impact check

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

  • Custom field replacement variables in the social input fields on posts in both classic and Gutenberg.

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.

Quality assurance

  • [x] I have tested this code to the best of my abilities
  • [ ] 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.

herregroen avatar Aug 05 '22 13:08 herregroen

I'm not sure if this is feasable, but if the return of the call is empty, I would recon subsequent calls will never find anything anymore, so it's useless to keep calling the endpoint. Is there a way to detect that and stop the calls after an empty return altogether?

Djennez avatar Aug 16 '22 12:08 Djennez