wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
649 stars 130 forks source link

Checkout fails with PHP 8 #554

Closed goransle closed 3 years ago

goransle commented 3 years ago

Describe the bug Calling the checkout mutation results in a Non-static method WPGraphQL\\WooCommerce\\Data\\Mutation\\Checkout_Mutation::process_order_payment() cannot be called statically error.

More output:


  "errors": [
    {
      "debugMessage": "Non-static method WPGraphQL\\WooCommerce\\Data\\Mutation\\Checkout_Mutation::process_order_payment() cannot be called statically",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "checkout"
      ],
      "trace": [
        {
          "file": "/var/www/html/wp.local/wp-content/plugins/wp-graphql-woocommerce-0.10.4/includes/mutation/class-checkout.php",
          "line": 147,
          "call": "WPGraphQL\\WooCommerce\\Data\\Mutation\\Checkout_Mutation::process_checkout()"
        },
        {
          "call": "WPGraphQL\\WooCommerce\\Mutation\\Checkout::WPGraphQL\\WooCommerce\\Mutation\\{closure}()"
        },

To Reproduce Steps to reproduce the behavior:

  1. Add an item to the cart
  2. Run a checkout mutation (via GraphiQL)

Expected behavior The checkout should not fail.

Plugin Versions

Additional context It does seem that setting the process_order_payment method as static resolves the problem.

kidunot89 commented 3 years ago

This was resolved in #566