dudecorn Posted February 20, 2024 Share Posted February 20, 2024 After importing products from CMS, can't edit any of them. Such a problem: PrestaShop\PrestaShop\Core\Domain\Product\QueryResult\ProductDetails::__construct(): Argument #1 ($isbn) must be of type string, null given, called in /src/Adapter/Product/QueryHandler/GetProductForEditingHandler.php on line 389 [TypeError 0] Prestashop 8.1.4 Also exported products includes size, it is like 101-dm/41 where 41 is size and "/" is the split sign between the model and variable size. However Prestashop treats all imported products separately. When I copy the product, then can edit the copy in back office, but can't add any variables like size and colour. Any help? Link to comment Share on other sites More sharing options...
musicmaster Posted February 28, 2024 Share Posted February 28, 2024 My tools Prestools has under Utilities a function "Convert NULLs into empty strings". You can use that to fix your shop. As with all major changes: make a backup before applying. 3 Link to comment Share on other sites More sharing options...
djo1919 Posted February 28, 2024 Share Posted February 28, 2024 Any update about this problem? Link to comment Share on other sites More sharing options...
djo1919 Posted February 28, 2024 Share Posted February 28, 2024 2 hours ago, musicmaster said: My tools Prestools has under Utilities a function "Convert NULLs into empty strings". You can use that to fix your shop. As with all major changes: make a backup before applying. Hello, Where to find this tool? Regards Link to comment Share on other sites More sharing options...
musicmaster Posted February 28, 2024 Share Posted February 28, 2024 3 minutes ago, djo1919 said: Hello, Where to find this tool? Regards See my forum footer. One potential cause of the problem is that you used Prestashops backup function. This has only recently be repaired. Link to comment Share on other sites More sharing options...
djo1919 Posted February 28, 2024 Share Posted February 28, 2024 (edited) After installing a fresh Prestashop 8.1.4, then I imported all the data using ets migration, I had this problem PrestaShop\PrestaShop\Core\Domain\Product\QueryResult\ProductDetails::__construct(): Argument #2 ($upc) must be of type string, null given, called in /src/Adapter/Product/QueryHandler/GetProductForEditingHandler.php on line 394 PrestaShop\PrestaShop\Core\Domain\Product\QueryResult\ProductDetails::__construct(): Argument #5 ($reference) must be of type string, null given, called in /src/Adapter/Product/QueryHandler/GetProductForEditingHandler.php on line 394 in src/Core/Domain/Product/QueryResult/ProductDetails.php (line 68) * @param string $upc * @param string $ean13 * @param string $mpn * @param string $reference */ public function __construct( string $isbn, string $upc, string $ean13, string $mpn, string $reference Do you know how to solve this? Thank you in advance Edited February 28, 2024 by djo1919 (see edit history) Link to comment Share on other sites More sharing options...
djo1919 Posted February 28, 2024 Share Posted February 28, 2024 No need to answer, I fixed it myself. Thank you for your polite answer. @dudecorn & @SeifF here's the solution below: UPDATE `ps_product` SET reference = '' WHERE reference IS NULL; UPDATE `ps_product` SET isbn = '' WHERE isbn IS NULL; UPDATE `ps_product` SET ean13 = '' WHERE ean13 IS NULL; UPDATE `ps_product` SET upc = '' WHERE upc IS NULL; UPDATE `ps_product` SET mpn = '' WHERE mpn IS NULL; 4 1 Link to comment Share on other sites More sharing options...
musicmaster Posted February 29, 2024 Share Posted February 29, 2024 (edited) ISBN, like many other fields, is in the database defined as "default NULL". However, when those fields are saved in the backoffice they are always saved as empty strings when not set. This has become so common that the software gives warnings when such a value does have NULLs. ISBN is a field that was introduced in Prestashop 1.7. Most likely the software you were using was built for an older Prestashop version and never upgraded to cover this field. And as it was not defined when the ps_product records were created it got the default value of NULL. Edited March 2, 2024 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
Vadimuch Posted April 10, 2024 Share Posted April 10, 2024 On 2/28/2024 at 8:48 PM, musicmaster said: My tools Prestools has under Utilities a function "Convert NULLs into empty strings". You can use that to fix your shop. As with all major changes: make a backup before applying. Дякую за чудове рішення, та софт, який багато разів допомогав. Описану вище проблему саме так і вирішив. Дякую!! Link to comment Share on other sites More sharing options...
Włochaty Posted April 13, 2024 Share Posted April 13, 2024 Migration 1.7.8 to 8.1.5. I have this type of errors too. $isbn fixed like @djo1919 suggest. But also /index.php/sell/catalog/products-v2/1164/edit?_token=*** PrestaShop\PrestaShop\Core\Domain\Product\Supplier\QueryResult\ProductSupplierForEditing::__construct(): Argument #5 ($reference) must be of type string, null given, called in /src/Adapter/Product/AbstractProductSupplierHandler.php on line 83 I think this is for supplier reference in table ps_product_supplier (product_supplier_reference Default=NULL) when I changed to '' or string it works. Are you agree with this? If yes then it is a problem with ETS migration module? 1 Link to comment Share on other sites More sharing options...
bera_ramazan Posted July 8, 2024 Share Posted July 8, 2024 open src/Core/Grid/Data/Factory/AbstractCategoryDataFactory.php edit this code foreach ($records as $key => $record) { $records[$key]['description'] = mb_substr(strip_tags(stripslashes($record['description'])), 0, self::DESCRIPTION_MAX_LENGTH); } change to foreach ($records as $key => $record) { $description = isset($record['description']) ? $record['description'] : ''; $records[$key]['description'] = mb_substr(strip_tags(stripslashes($description)), 0, self::DESCRIPTION_MAX_LENGTH); } Link to comment Share on other sites More sharing options...
McDaim Posted August 16, 2024 Share Posted August 16, 2024 Ramazan kardeş. Benimde benzer sorunum var. Yardımcı olursan minnettar kalırım. Müşteri adresine girmek istediğimde aşağıdaki hatayı veriyor. Hata... beklenmeyen bir hata oluşmuş gibi görünüyor Type error: Argument 2 passed to PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataProvider\AddressFormDataProvider::__construct() must be of the type int, null given, called in /var/www/vhosts/nepasun.com/httpdocs/var/cache/prod/ContainerV8xzzfd/getPrestashop_Core_Form_IdentifiableObject_DataProvider_AddressFormDataProviderService.php on line 8 [Symfony\Component\Debug\Exception\FatalThrowableError 0] Link to comment Share on other sites More sharing options...
Studio Créations Posted April 4 Share Posted April 4 Le 28/02/2024 à 10:44 PM, djo1919 a dit : No need to answer, I fixed it myself. Thank you for your polite answer. @dudecorn & @SeifF here's the solution below: UPDATE `ps_product` SET reference = '' WHERE reference IS NULL; UPDATE `ps_product` SET isbn = '' WHERE isbn IS NULL; UPDATE `ps_product` SET ean13 = '' WHERE ean13 IS NULL; UPDATE `ps_product` SET upc = '' WHERE upc IS NULL; UPDATE `ps_product` SET mpn = '' WHERE mpn IS NULL; Same problem on version 8.2.1, resolved thanks to you. Perfect !! 😊 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