Jump to content

Update Prestashop to 8.1.6 and php8


KobusB

Recommended Posts

Hi

Our web hosting comapny have performed the above. In testing I found I am unable to create any new orders and found the following 2 errors:

CRITICAL 08:14:07phpFatal Compile Error: Declaration of PaymentModule::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null) must be compatible with PaymentModuleCore::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null, ?string $order_reference = null)

{ "exception": {} }

 

CRITICAL 08:14:07requestUncaught PHP Exception Symfony\Component\ErrorHandler\Error\FatalError: "Compile Error: Declaration of PaymentModule::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null) must be compatible with PaymentModuleCore::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null, ?string $order_reference = null)" at /home/bikeorguk/shop.bike.org.uk/override/classes/PaymentModule.php line 40

{ "exception": {} }

 

How can I fix it please?

Link to comment
Share on other sites

The error you're facing indicates a mismatch between the method signature in your "PaymentModule class" and the "PaymentModuleCore class". Specifically, the "validateOrder" method in your PaymentModule class is missing a parameter that is present in the "PaymentModuleCore" class.

To resolve this issue, you need to update the method signature in your PaymentModule class to match the one in PaymentModuleCore. Here's how:

  • Locate the PaymentModule class file:

The error message points to the file at /home/bikeorguk/shop.bike.org.uk/override/classes/PaymentModule.php.

  • Edit the PaymentModule class:

Open /home/bikeorguk/shop.bike.org.uk/override/classes/PaymentModule.php in a text editor.

  • Update the validateOrder method signature:

Find the validateOrder method, which should look like this:

public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null)

Modify it to include the missing parameter ?string $order_reference = null:

public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = [], $currency_special = null, $dont_touch_amount = false, $secure_key = false, ?Shop $shop = null, ?string $order_reference = null)

Finally save the changes and start testing, let me know if it works.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...