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

Calling wc_get_template with null value for $args causes problems with other plugin(s) #226

Open
woutervanvliet opened this issue May 27, 2023 · 0 comments

Comments

@woutervanvliet
Copy link

Describe the bug
wc_get_template gets called with a null value, rather than array, a few places in the code. This causes problems with another plugin that has a strict type declaration, expecting $args to be an array.

To Reproduce
Steps to reproduce the behavior:

  • Have Reepay Checkout Gateway installed
  • Open an order in WooCommerce
  • Click the button to print an invoice, receipt or delivery note
  • Experience that an error is thrown expecting $args to be an array

Expected behavior
No error ;).

Isolating the problem (mark completed items with an [x]):

  • [ - ] This bug happens with only WooCommerce Print Invoice & Delivery Note plugin active
  • [ x ] This bug happens with a default WordPress theme active, or [Storefront]
  • [ x ] I can reproduce this bug consistently using the steps above

Additional context
I'm not sure which plugin actually is doing something wrong, but my best guess is actually both. I feel confident that $args should be an array, thus making null not a valid value (see https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-core-functions.html). But perhaps a type declaration is a bit too strict for the WordPress ecosystem.

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

No branches or pull requests

1 participant