glontz Posted March 2, 2021 Share Posted March 2, 2021 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 More sharing options...
PrestaServicePro Posted April 14, 2021 Share Posted April 14, 2021 Hi, It looks like you have an address with undefined phone so the Order cannot be displayed. PS version? Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 19, 2021 Share Posted July 19, 2021 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 More sharing options...
Yulia Vitun Posted September 13, 2022 Share Posted September 13, 2022 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; 2 Link to comment Share on other sites More sharing options...
unikum Posted February 16, 2023 Share Posted February 16, 2023 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 Link to comment Share on other sites More sharing options...
NPO Posted February 16, 2023 Share Posted February 16, 2023 (edited) 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 February 16, 2023 by NPO (see edit history) Link to comment Share on other sites More sharing options...
unikum Posted March 3, 2023 Share Posted March 3, 2023 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now