Jump to content

Error when try to acces order


glontz

Recommended Posts

Type error: Argument 9 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderShippingAddressForViewing::__construct() must be of the type string, null given, called in /home/g5mro/public_html/ecommerce/src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php on line 287

[Symfony\Component\Debug\Exception\FatalThrowableError 0]

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

This issue is related to https://github.com/PrestaShop/PrestaShop/issues/22386 and https://github.com/PrestaShop/PrestaShop/issues/22215

You need to update your database with the code provided below, no other tricks will help for resolving your issue in the correct way.

# Crezzur - Fix for: 
# Error: Argument 4 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderCustomerForViewing::__construct()
# must be of the type string, null given, called in ../src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php on line 236
# -----

UPDATE ps_address SET phone = '' WHERE phone IS NULL;
UPDATE ps_address SET phone_mobile = '' WHERE phone_mobile IS NULL;

UPDATE ps_order_detail SET id_order_invoice = '0' WHERE id_order_invoice IS NULL;
UPDATE ps_order_detail SET product_reference = '' WHERE product_reference IS NULL;
UPDATE ps_order_detail SET product_supplier_reference = '' WHERE product_supplier_reference IS NULL;
UPDATE ps_order_detail SET product_isbn = '' WHERE product_isbn IS NULL;
UPDATE ps_order_detail SET product_upc = '' WHERE product_upc IS NULL;
UPDATE ps_order_detail SET product_mpn = '' WHERE product_mpn IS NULL;
UPDATE ps_order_detail SET download_hash = '' WHERE download_hash IS NULL;
UPDATE ps_orders SET gift_message = '' WHERE gift_message IS NULL;

UPDATE ps_order_payment SET transaction_id = '' WHERE transaction_id IS NULL;
UPDATE ps_order_payment SET card_number = '' WHERE card_number IS NULL;
UPDATE ps_order_payment SET card_brand = '' WHERE card_brand IS NULL;
UPDATE ps_order_payment SET card_expiration = '' WHERE card_expiration IS NULL;
UPDATE ps_order_payment SET card_holder = '' WHERE card_holder IS NULL;

UPDATE ps_order_carrier SET tracking_number = '' WHERE tracking_number IS NULL;
UPDATE ps_order_carrier SET id_order_invoice = '0' WHERE id_order_invoice IS NULL;
UPDATE ps_order_carrier SET weight = '0' WHERE weight IS NULL;

UPDATE ps_product SET isbn = '' WHERE isbn IS NULL;
UPDATE ps_product SET upc = '' WHERE upc IS NULL;
UPDATE ps_product SET mpn = '' WHERE mpn IS NULL;
UPDATE ps_product SET unity = '' WHERE unity IS NULL;
UPDATE ps_product SET supplier_reference = '' WHERE supplier_reference IS NULL;
UPDATE ps_product SET location = '' WHERE location IS NULL;
UPDATE ps_product SET redirect_type = '301-category' WHERE redirect_type = '';
UPDATE ps_product SET available_date = '2020-12-01' WHERE available_date IS NULL;
UPDATE ps_product SET cache_default_attribute = '0' WHERE cache_default_attribute IS NULL;
UPDATE ps_product_shop SET unity = '' WHERE unity IS NULL;
UPDATE ps_product_shop SET redirect_type = '301-product' WHERE redirect_type = '';
UPDATE ps_product_shop SET available_date = '2020-12-01' WHERE available_date IS NULL;
UPDATE ps_product_shop SET cache_default_attribute = '0' WHERE cache_default_attribute IS NULL;

 

Link to comment
Share on other sites

  • 1 year later...
On 7/19/2021 at 4:41 PM, Crezzur.com said:

This issue is related to https://github.com/PrestaShop/PrestaShop/issues/22386 and https://github.com/PrestaShop/PrestaShop/issues/22215

You need to update your database with the code provided below, no other tricks will help for resolving your issue in the correct way.

# Crezzur - Fix for: 
# Error: Argument 4 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderCustomerForViewing::__construct()
# must be of the type string, null given, called in ../src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php on line 236
# -----

UPDATE ps_address SET phone = '' WHERE phone IS NULL;
UPDATE ps_address SET phone_mobile = '' WHERE phone_mobile IS NULL;

UPDATE ps_order_detail SET id_order_invoice = '0' WHERE id_order_invoice IS NULL;
UPDATE ps_order_detail SET product_reference = '' WHERE product_reference IS NULL;
UPDATE ps_order_detail SET product_supplier_reference = '' WHERE product_supplier_reference IS NULL;
UPDATE ps_order_detail SET product_isbn = '' WHERE product_isbn IS NULL;
UPDATE ps_order_detail SET product_upc = '' WHERE product_upc IS NULL;
UPDATE ps_order_detail SET product_mpn = '' WHERE product_mpn IS NULL;
UPDATE ps_order_detail SET download_hash = '' WHERE download_hash IS NULL;
UPDATE ps_orders SET gift_message = '' WHERE gift_message IS NULL;

UPDATE ps_order_payment SET transaction_id = '' WHERE transaction_id IS NULL;
UPDATE ps_order_payment SET card_number = '' WHERE card_number IS NULL;
UPDATE ps_order_payment SET card_brand = '' WHERE card_brand IS NULL;
UPDATE ps_order_payment SET card_expiration = '' WHERE card_expiration IS NULL;
UPDATE ps_order_payment SET card_holder = '' WHERE card_holder IS NULL;

UPDATE ps_order_carrier SET tracking_number = '' WHERE tracking_number IS NULL;
UPDATE ps_order_carrier SET id_order_invoice = '0' WHERE id_order_invoice IS NULL;
UPDATE ps_order_carrier SET weight = '0' WHERE weight IS NULL;

UPDATE ps_product SET isbn = '' WHERE isbn IS NULL;
UPDATE ps_product SET upc = '' WHERE upc IS NULL;
UPDATE ps_product SET mpn = '' WHERE mpn IS NULL;
UPDATE ps_product SET unity = '' WHERE unity IS NULL;
UPDATE ps_product SET supplier_reference = '' WHERE supplier_reference IS NULL;
UPDATE ps_product SET location = '' WHERE location IS NULL;
UPDATE ps_product SET redirect_type = '301-category' WHERE redirect_type = '';
UPDATE ps_product SET available_date = '2020-12-01' WHERE available_date IS NULL;
UPDATE ps_product SET cache_default_attribute = '0' WHERE cache_default_attribute IS NULL;
UPDATE ps_product_shop SET unity = '' WHERE unity IS NULL;
UPDATE ps_product_shop SET redirect_type = '301-product' WHERE redirect_type = '';
UPDATE ps_product_shop SET available_date = '2020-12-01' WHERE available_date IS NULL;
UPDATE ps_product_shop SET cache_default_attribute = '0' WHERE cache_default_attribute IS NULL;

 

+

update ps_address set dni = '' where dni is null;
update ps_address set other = '' where other is null;
update ps_address set address2 = '' where address2 is null;
update ps_address set company = '' where company is null;
update ps_address set vat_number = '' where vat_number is null;

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

i have the same problem. It's just unclear to me how and where I write these lines.
I open the database at Hoster with phpmyadmin.
I'm looking for the database

UPDATE ps_address SET phone = ' 'WHERE phone IS NULL;
UPDATE ps_address SET phone_mobile = '' WHERE phone_mobile IS NULL;

The entry "ps-address" exists. If I open that, then open phone or phone mobile in position 17 and 18 by clicking on "edit". Is that OK ?

Does ' ' mean a space? And where exactly do I have to insert that now? I don't see a field where I could write something.

Can someone please help me ?

Thank you

ps_adress.png

Link to comment
Share on other sites

Hi,

At the bottom of that phpmyadmin screen you have a little tab with "Console" - expand that and you will get a mini 'terminal'.

Copy the code in there and then press Ctrl+Enter to execute the code.

After a few seconds you should see a few screen headers (in green) in the windows above the console telling you the changes were applied and are ok.

All done.  Things should be fine after that.

Edited by NPO (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

I have now solved it completely differently, because the problem only affects old existing customers. I have a module called "Order Manager". I can still open the order with this. To fix the address problem, I go to the "Addresses" menu item and delete the customer's address. Don't worry, it's still in the order.
Now I can open the order again without any problems. The customer will have to enter his address again when placing a new order, but then there shouldn't be any more problems.

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...