myparcelnl / prestashop

PrestaShop module to integrate with MyParcel NL and BE
https://developer.myparcel.nl/nl/documentatie/11.prestashop.html
10 stars 5 forks source link

[PS8] HTTP 500 errors #217

Closed AaronTajriba closed 9 months ago

AaronTajriba commented 1 year ago

Module version

1.8.2

PrestaShop version

8.0.1

PHP version

8.1.16

What went wrong?

When you go and try to make an order via frontoffice you get an fatal error:

Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given in /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php:1735 Stack trace: #0 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(1735): method_exists() #1 [internal function]: MyParcelNL\Sdk\src\Support\Collection::MyParcelNL\Sdk\src\Support\{closure}() #2 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(1745): array_map() #3 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/DeliveryOptions/DeliveryOptionsMerger.php(30): MyParcelNL\Sdk\src\Support\Collection->toArrayWithoutNull() #4 [internal function]: Gett\MyparcelNL\DeliveryOptions\DeliveryOptionsMerger::Gett\MyparcelNL\DeliveryOptions\{closure}() #5 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(937): array_map() #6 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/DeliveryOptions/DeliveryOptionsMerger.php(31): MyParcelNL\Sdk\src\Support\Collection->map() #7 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/Module/Hooks/OrderHooks.php(51): Gett\MyparcelNL\DeliveryOptions\DeliveryOptionsMerger::create() #8 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(968): MyParcelNL->hookActionValidateOrder() #9 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(407): HookCore::coreCallHook() #10 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(903): HookCore::callHookOn() #11 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/PaymentModule.php(558): HookCore::exec() #12 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/ps_wirepayment/controllers/front/validation.php(63): PaymentModuleCore->validateOrder() #13 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/controller/Controller.php(308): Ps_WirepaymentValidationModuleFrontController->postProcess() #14 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Dispatcher.php(510): ControllerCore->run() #15 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/index.php(28): DispatcherCore->dispatch() #16 {main} thrown in /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php on line 1735

You get also an error in the backoffice when you go to the orders overview page: Non-static method Gett\MyparcelNL\Service\WeightService::convertToGrams() cannot be called statically

I've fixed these errors by calling them dynamically.

Reproduction steps

Go to the front office, place an order (with any paymentmethod) and you see an error appear

Go to the backoffict > orders > orders And you see an error appear.

Relevant log output

Frontoffice:
Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given in /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php:1735 Stack trace: #0 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(1735): method_exists() #1 [internal function]: MyParcelNL\Sdk\src\Support\Collection::MyParcelNL\Sdk\src\Support\{closure}() #2 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(1745): array_map() #3 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/DeliveryOptions/DeliveryOptionsMerger.php(30): MyParcelNL\Sdk\src\Support\Collection->toArrayWithoutNull() #4 [internal function]: Gett\MyparcelNL\DeliveryOptions\DeliveryOptionsMerger::Gett\MyparcelNL\DeliveryOptions\{closure}() #5 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php(937): array_map() #6 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/DeliveryOptions/DeliveryOptionsMerger.php(31): MyParcelNL\Sdk\src\Support\Collection->map() #7 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/src/Module/Hooks/OrderHooks.php(51): Gett\MyparcelNL\DeliveryOptions\DeliveryOptionsMerger::create() #8 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(968): MyParcelNL->hookActionValidateOrder() #9 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(407): HookCore::coreCallHook() #10 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Hook.php(903): HookCore::callHookOn() #11 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/PaymentModule.php(558): HookCore::exec() #12 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/ps_wirepayment/controllers/front/validation.php(63): PaymentModuleCore->validateOrder() #13 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/controller/Controller.php(308): Ps_WirepaymentValidationModuleFrontController->postProcess() #14 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/classes/Dispatcher.php(510): ControllerCore->run() #15 /home/tajribadev/domains/tajriba.dev/public_html/[environment]/index.php(28): DispatcherCore->dispatch() #16 {main} thrown in /home/tajribadev/domains/tajriba.dev/public_html/[environment]/modules/myparcelnl/vendor/myparcelnl/sdk/src/Support/Collection.php on line 1735

BACKOFFICE
Non-static method Gett\MyparcelNL\Service\WeightService::convertToGrams() cannot be called statically

Additional context

No response

AaronTajriba commented 1 year ago

i think this issue is related to #213 in witch it was stated "fixed" and also related to #214

EdieLemoine commented 1 year ago

Hi @AaronTajriba, we don't support PrestaShop 8 yet. We likely will within the next few months, but I can't give you a date yet.

AaronTajriba commented 1 year ago

Hi @EdieLemoine Is there any estimation of when ps 8 is gonna be supported, There are multiple bugs witch are an major deal breakers for our customers.

EdieLemoine commented 1 year ago

Hi @AaronTajriba, we're working on it in the alpha branch, but it's going to be a huge update so it will take a while. What we have right now is nowhere near being usable. Sadly, it's not something we can fix easily in the current version of the plugin.

damienpeerbolte commented 1 year ago

Hi, any updates on this?

AaronTajriba commented 10 months ago

@EdieLemoine is there any information on the update? This is taking way to long? We're waiting for this since March thats more than 7 months! The module is not working for a lot of webshops with PS8.

EdieLemoine commented 10 months ago

@AaronTajriba @damienpeerbolte We're currently working hard on getting the next update ready and expect to release a beta version within the next few weeks. I'm sorry it's taking so long, but it's a big project and we want to do this right.

We've rewritten the plugin from scratch using our Plugin Development Kit, which allows us to have one shared codebase for all functionality that's common across the plugins we have for several e-commerce platforms. The new module (v2.0.0) supports PrestaShop 8, PHP 7.4 to 8.2 and is a vast improvement over the current version. We intend on being able to close all existing issues with this update. The shared codebase is going to make it a lot easier for us to fix bugs and add features in the future as everything we change affects each of our e-commerce platform plugins/modules.

You can track our progress on the beta branch of this repository if you like.

We would be very grateful if you or your clients are willing to help us test the initial release(s).

To try to improve communication on this, I've created a Project for the v2.0.0 release.

EdieLemoine commented 9 months ago

@AaronTajriba @damienpeerbolte the first beta version is out now, which has been tested internally only. There are some open bugs in the shared codebase, but as the module now appears in the same state as our WooCommerce plug-in, we've decided to release it.

Please read this issue for more information and how to report bugs in the new version.