Jump to content

Unable to view orders in back office


KillStreak

Recommended Posts

I'm running a 1.7.7.1 install on PHP 7.4 (fresh install, not an upgrade) 

When in the back office I can see the order list, but when I try to view the order (either through clicking the order or the quick view) I get the following error: 

Quote

 

Type error: Argument 2 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderProductCustomizationForViewing::__construct() must be of the type string, null given, called in /homepages/7/d847506733/htdocs/clickandbuilds/MumandCoSoaps/src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php on line 118

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

 

I've seen a few posts with the same issue but showing different line errors in the same file - has anyone got a fix for this yet? Granted I can download the delivery note to see whats on the order for packing but this is less than an ideal way to go about it.....

 

Thanks in advance

Link to comment
Share on other sites

Install was without test data - these are all products that have been added to the site since. 

I only noted the fault about 3 days ago - it may have been there prior to that but I have no idea as it wasn't yet part of the testing phase. Theres been a very similar fault noted on GitHub - people are saying its to do with null values populating the database but as yet theres no fix. Wondering if its the case in this - but I'm not entirely comfortable editing tables. 

Link to comment
Share on other sites

1 hour ago, joseantgv said:

If you check /src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php on line 118, it seems there is a problem with customization data.

Have you created a product with customization fields?

Yes - but there's only one product in the whole site that uses this - its a gift voucher. 

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
En 10/6/2021 a las 1:07 AM, Calebopeko dijo:

I also have the same issue: ps1.7.7.0 with php 7.3. When a product has a customization field, then in the BO the order page throws the above error, name is NULL. I would be interested in a solution.

Could you please upload a screenshot of your error?

Link to comment
Share on other sites

  • 2 weeks later...

Hello, PS 1.7.7.5, product with customization cause error 500 when I try to open order detail. If there is an order without this product, no error. 

Type error: Argument 2 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderProductCustomizationForViewing::__construct() must be of the type string, null given, called in /www/hosting/activityboardshop.pl/www/src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php on line 118

 

error_ps.mhtml

Link to comment
Share on other sites

Hi, 

debug info: 

 

Array ( [122] => Array ( [64] => Array ( [datas] => Array ( [1] => Array ( [0] => Array ( [id_customization] => 64 [id_address_delivery] => 122 [id_product] => 158 [id_customization_field] => [id_product_attribute] => 0 [type] => 1 [index] => 16 [value] => leontyna [id_module] => 0 [name] => ) ) ) [quantity] => 8 [quantity_refunded] => 0 [quantity_returned] => 0 [id_customization] => 64 ) ) )

Link to comment
Share on other sites

The rest of the structure is filled correctly. Only the name is empty.

Check the  ps_customization_field_lang table that the name is filled in for all active languages in your shop for this customization.

You could use the "solution" below as a quick fix to work around the problem.

ddebug.thumb.jpg.bc6b2a1476bc67acae760726cf31a1cd.jpg

 

Link to comment
Share on other sites

  • 5 months later...

Hi!

I have the same problem but in another line:

Type error: Argument 6 passed to PrestaShop\PrestaShop\Core\Domain\Order\QueryResult\OrderProductForViewing::__construct() must be of the type string, null given, called in /www/src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php on line 247

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

I can't reach orders wich contain pack item. All pack items have default settings

Line 247 is: (bool) Product::isAvailableWhenOutOfStock(StockAvailable::outOfStock($pack_item['id_product']))

Link to comment
Share on other sites

  • 6 months later...

in case someone else happens...

There are two possible solutions and it usually occurs at two specific points.

First point: when you open a paid order to add some other product because the customer has requested it... If you try to search for the product, no results appear (the internal search does not work) --> then it must go to your database in the ps_products_attribute table, edit the "REFERENCE" section of one of the products and then edit the line inline so that it reads this command: UPDATE `ps_product_attribute` SET `reference` = ''" all references must be empty or full, not you can mark NULL.

The second point where it happens is when you try to create an order from a customer abandoned order, you try to "USE" the abandoned order to load the product(s)... but it doesn't work... it also doesn't let you add it manually... at this point you go to the product and modify one letter of the name by adding a space to fix it and it will work again.

Captura de pantalla 2022-06-16 a las 4.38.44.png

Edited by AleluÁ (see edit history)
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...