tim1983 Posted July 19, 2021 Share Posted July 19, 2021 Hello Help would be very much appreciated I migrated from presta 1.6 to 1.7 using the migration module transferring data and orders. I can access old orders but not orders since doing the new website Type error: Argument 3 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderStatusForViewing::__construct() must be of the type string, null given, called in /home/customer/www/sasautocustoms.co.uk/public_html/src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php on line 366 [Symfony\Component\Debug\Exception\FatalThrowableError 0] Link to comment Share on other sites More sharing options...
PrestaServicePro Posted July 19, 2021 Share Posted July 19, 2021 Hello, Could you share exact PS and PHP version of shop? Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 (edited) 1.7.7.5 tried 7.3 and 7.4 php Edited July 19, 2021 by tim1983 (see edit history) Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 In debug mode, even the old orders that open fine, show that error. When not in debug mode they open fine. Only new orders show that error as well but dont open Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 Are you working on your PC or on a Server, if later which OS. Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 (edited) working on pc, windows 10, prestashop installation is on a server Edited July 19, 2021 by tim1983 (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 5 minutes ago, tim1983 said: prestashop installation is on a server Ok what Server? Windows, Linux, if later which distro, version of the distro? PS requirements checked? Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 2 minutes ago, Crezzur said: Run this query and you will be fine 😉 # 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; many thanks, how or where do I run the query? Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 3 minutes ago, Nickz said: Ok what Server? Windows, Linux, if later which distro, version of the distro? PS requirements checked? Server information Linux #1 SMP PREEMPT Wed Jun 9 16:10:01 EEST 2021 x86_64 Server software version: Apache PHP version: 7.4.21 Memory limit: 768M Max execution time: 120 Upload Max File size: 256M Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 Sweet How about those: Quote SSL certificate if you plan to process payments internally (not using PayPal for instance) Must have PHP extensions: CURL, DOM, Fileinfo, GD, Intl, Mbstring, Zip, Json, iconv To improve performances: MemCached, Apcu, OpCache Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 4 minutes ago, Crezzur said: In your MYSQL databank, after a backup of your database. SQL query: Copy # 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 MySQL said: #1146 - Table 'dbvimqeneofcht.ps_address' doesn't exist Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 5 minutes ago, Nickz said: Sweet How about those: I have SSL certificate installed, The prestashop was installed by my host memcache enabled as as well, all flushed. no option for Apcu, OpCache Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 6 minutes ago, tim1983 said: memcache enabled as as well, all flushed. no option for Apcu, OpCache CURL, DOM, Fileinfo, GD, Intl, Mbstring, Zip, Json, iconv < those are important. Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 1 hour ago, Crezzur 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 i provided no other tricks will help for resolving your issue in the correct way. my prefixes are "soft" Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 15 minutes ago, Crezzur said: Replaces all ps_ with soft_ and run the query all done, new orders still same error Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 25 minutes ago, tim1983 said: all done, new orders still same error Next step: CURL, DOM, Fileinfo, GD, Intl, Mbstring, Zip, Json, iconv < are installed? Do you have access via root or cpanel? Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 Just now, Nickz said: Next step: CURL, DOM, Fileinfo, GD, Intl, Mbstring, Zip, Json, iconv < are installed? Do you have access via root or cpanel? thanks I have access via root, no c panel Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 The current curl version: Curl version7.66.0 Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 " Are GD, DOM/XML and iconv libraries supported by SiteGround? Yes, the above libraries are included in our PHP installations." Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 composer is installed? Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 1 minute ago, Nickz said: composer is installed? yes Link to comment Share on other sites More sharing options...
Nickz Posted July 19, 2021 Share Posted July 19, 2021 Reboot the server and try again. Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 I've found the issue, but not sure how to solve it new orders create a id_order_state of 33 if i changed to 4 , the order opens fine in back office. Now , how do I make new orders never have that number? any number over 30 makes the error appear Link to comment Share on other sites More sharing options...
tim1983 Posted July 19, 2021 Author Share Posted July 19, 2021 (edited) SOLVED The statuses seemed to have replicated when doing the migration Basically it entered several duplicate statuses on the end of the `soft_order_state_lang` 30 onwards were set to the wrong language Language changed i.e from 2 to 1 Everything works perfect now Thanks for all your help, Ive learnt a lot about sql etc today haha Edited July 19, 2021 by tim1983 (see edit history) 1 Link to comment Share on other sites More sharing options...
CatchMeZZo Posted August 13, 2021 Share Posted August 13, 2021 Zitat 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; UPDATE ps_product_attribute SET location = '' WHERE location is NULL Wer diese Probleme hat, kann meine überarbeitete Abfrage versuchen. Bei mir hat es das Problem gelöst und auch noch einen beim manuellen erstellen von Bestellungen. 1 Link to comment Share on other sites More sharing options...
Bill Dalton Posted October 2, 2021 Share Posted October 2, 2021 CatchMeZZo, thanks, your query worked for me. 1 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