3

I am attempting a simple task, to sort the product filter in the admin panel page but I am receiving the error:

Something went wrong with processing the default view and we have restored the filter to its original state.

I have looked at the server logs and the following PHP error is being thrown up when I attempt to sort/filter in the product page of admin panel.

AH01071: Got error 'PHP message: PHP Fatal error: 
Method Magento\\Ui\\TemplateEngine\\Xhtml\\Result::__toString() must not 
throw an exception, 
caught TypeError: Argument 1 passed to 
Magento\\InventorySalesAdminUi\\Model\\GetSalableQuantityDataBySku::
execute() must be of the type string, null given, called in 
/var/www/vhosts/mywebsitehere.com/vendor/magento/module-inventory-sales- 
admin-ui/Ui/Component/Listing/Column/SalableQuantity.php on line 70 in 
/var/www/vhosts/mywebsitehere.com/vendor/magento/module- 
ui/Controller/Adminhtml/Index/Render.php on line 0\n'

This is a clean install of Magento 2.3.0 with only my Magento 1 migrated products added. Using PHP 7.2.15, Plesk Onyx v17.8.11_build1708180301.19 os_CentOS 7.

Any assistance is much appreciated.

  • Can you write detail how you generate this? – Sohel Rana Feb 22 at 15:06
  • Hi @SohelRana simply go to (in admin panel) catalog > products and attempt to use any of the filtering options (e.g. in my case to sort the ID). – YorkieMagento Feb 22 at 15:07
  • It sounds like something might have gone wrong in your data migration. If you look at SaleableQuantity.php where it calls GetSalableQuantityDataBySku::execute() it's trying to pass $row['sku'], but it's passing that value as NULL. You could first try clearing all cache and generated files to see if it's an issue there. If it's not that then my guess is it's related to the migration. – rain2o Feb 22 at 15:33
  • All those quantities are '0' so do you think that could be it? Perhaps if I change them all to 1? – YorkieMagento Feb 22 at 15:36
7

SKU should be empty or string. In your case, it is null or not a string.

Run follwoing query will resolve your issue if it is null sku related error:


UPDATE catalog_product_entity SET sku='' WHERE sku IS NULL;

You can check your corrupted sku and fix that.

  • Hi @SohelRana I don't get any affected rows for that query... wondering if it's to do with the new inventory management 2.3 has? – YorkieMagento Feb 22 at 15:52
  • Definitely, your SKU has some corrupted data. I created this error with default fresh installation. So check your corrupted sku that is not a string. – Sohel Rana Feb 22 at 15:55
  • Or you can replace by: public function execute(?string $sku): array – Sohel Rana Feb 22 at 15:58
  • Genius.. there was one product (on page 346 of 346... of course) that had no SKU value. Really appreciate the help @SohelRana – YorkieMagento Feb 22 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.