2

I have been facing this issue on my Magento 2.4.6-p1 EE

While trying to create order from admin and when selecting store to create order as an admin below error is generated

Base table or view not found: 1146 Table 'catalog_category_product_index_store0' doesn't exist, query was: SELECT `main_table`.*, IFNULL(wishlist.name, 'Wish List') AS `wishlist_name` FROM `wishlist_item` AS `main_table`
 INNER JOIN `wishlist` ON main_table.wishlist_id = wishlist.wishlist_id
 INNER JOIN `catalog_category_product_index_store0` AS `cat_index` ON cat_index.product_id = main_table.product_id AND cat_index.category_id = '0' AND cat_index.visibility IN (3, 2, 4) WHERE (wishlist.customer_id = 4462) AND (`main_table`.`store_id` IN('0'))

enter image description here enter image description here I have been scratching my head but couldn't figure out what's the root cause of this. The table catalog_category_product_index_store0 doesn't exist at all.

While selecting any store for creating order as an admin, the correct store ID is being passed in the payload but the error is same regardless of any store selection

I have tried to perform reindexing multiple times and all the indexers are in Ready status. I have also tried to debug in the function getItemCollection() inside \Magento\MultipleWishlist\Block\Adminhtml\Sales\Order\Create\Sidebar\Wishlist.php but no luck

Attaching few screenshots for better understanding. Looking for some help. Thanks

P.S. We have migrated from Magento 2.3 EE to Magento 2.4.6-p1 EE

2

1 Answer 1

1

For everyone who is looking for this solution. This is a known bug in Magento 2.4.6

This issue can be resolved by applying following patch

diff --git a/vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js b/vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js
index c09b9dfaa3d94..d3af44ea6c515 100644
--- a/vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js
+++ b/vendor/magento/module-sales/view/adminhtml/web/order/create/scripts.js
@@ -157,8 +157,14 @@
             this.sidebarShow();
             //this.loadArea(['header', 'sidebar','data'], true);
             this.dataShow();
-            this.loadArea(['header', 'data'], true);
-            location.reload();
+            this.loadArea(
+                ['header', 'data'],
+                true,
+                null,
+                function () {
+                    location.reload();
+                }
+            );
         },
 
         setCurrencyId: function (id) {
@@ -1164,7 +1170,7 @@
             }
         },
 
-        loadArea: function (area, indicator, params) {
+        loadArea: function (area, indicator, params, callback) {
             var deferred = new jQuery.Deferred();
             var url = this.loadBaseUrl;
             if (area) {
@@ -1183,6 +1189,9 @@
                     onSuccess: function (transport) {
                         var response = transport.responseText.evalJSON();
                         this.loadAreaResponseHandler(response);
+                        if (callback instanceof Function) {
+                            callback();
+                        }
                         deferred.resolve();
                     }.bind(this)
                 });

Solution: https://github.com/magento/magento2/commit/d6176449f759a8bd535693cdf2971aed5a14e4c3

For more details, original issue was reported here: https://github.com/magento/magento2/issues/37452

I hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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