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

Error handling for the property "name" in /public_html/wp-content/plugins/wordpress-seo/src/integrations/watchers/primary-term-watcher.php on line 124 #21311

Open
7 tasks
metricmediabob opened this issue Apr 11, 2024 · 5 comments

Comments

@metricmediabob
Copy link

  • [x ] I've read and understood the contribution guidelines.
  • [ x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

Server log files contain many instances of the following error:

PHP Warning: Attempt to read property "name" on bool in /public_html/wp-content/plugins/wordpress-seo/src/integrations/watchers/primary-term-watcher.php on line 124

To Reproduce

Step-by-step reproduction instructions

  1. Use Yoast SEO - no special configuration
  2. Log into WordPress as a public WooCommerce user and attempt to update your name
  3. Function errors due to $taxonomy not being an object instance

Expected results

  1. Function type-checks $taxonomy before attempting to extract a property from it.

Actual results

  1. Warning is generated

Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

PHP Warning: Attempt to read property "name" on bool in /public_html/wp-content/plugins/wordpress-seo/src/integrations/watchers/primary-term-watcher.php on line 124

Technical info

  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • [x ] Other: WooCommerce "My Account" profile editor.
  • Which browser is affected (or browsers):
  • Chrome
  • [x ] Firefox
  • Safari
  • Other:

Used versions

  • Device you are using:
  • Operating system:
  • PHP version:
  • WordPress version: Current
  • WordPress Theme: Custom
  • Yoast SEO version: Current
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
@josevarghese
Copy link
Contributor

josevarghese commented Apr 22, 2024

Hi @metricmediabob

Thanks for using the Yoast SEO plugin and also for creating the issue.

I tried reproducing this issue on my lab site after enabling the WP_DEBUG. However, I cannot see the error you mentioned while updating the name from the public WooCommerce page. So, can you please try this on a new WP installation and let us know whether the issue persists there or not? If yes, could you please share a screencast of it and share it with us to confirm that we didn't miss any steps in replicating it?

@metricmediabob
Copy link
Author

metricmediabob commented Apr 22, 2024 via email

@josevarghese
Copy link
Contributor

Hi Bob,

Thanks for getting back to us. Can you please let us know whether you are using the latest version of the Yoast SEO plugin, 22.5, on the website and the WooCommerce plugin, 8.8.2? I'm asking this because you haven't filled in those version details while submitting the issue.

We look forward to hearing from you.

@metricmediabob
Copy link
Author

metricmediabob commented May 2, 2024 via email

@josevarghese josevarghese changed the title primary-term-watcher.php save_primary_term() needs to type-check $taxonomy parameter Error handling for the property "name" in /public_html/wp-content/plugins/wordpress-seo/src/integrations/watchers/primary-term-watcher.php on line 124 May 6, 2024
@josevarghese
Copy link
Contributor

Thanks for letting us know. I changed the title of the issue to incorporate your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants