0

I am trying to make a patch for a private method from the core of the magento/module-configurable-product module. I followed the instructions from here: https://magento.stackexchange.com/a/256580/6204 but when i run composer install, I simply get: Cannot apply patch .....

This is my patch file:

diff --git a/Model/ResourceModel/Product/Indexer/Price/Configurable.php b/Model/ResourceModel/Product/Indexer/Price/Configurable.php
index 3ee2rd..8349152 111644
--- a/Model/ResourceModel/Product/Indexer/Price/Configurable.php
+++ b/Model/ResourceModel/Product/Indexer/Price/Configurable.php
@@ -200,14 +200,14 @@
         );
         // Does not make sense to extend query if out of stock products won't appear in tables for indexing

-        if ($this->isConfigShowOutOfStock()) {
-            $select->join(
-                ['si' => $this->getTable('cataloginventory_stock_item')],
-                'si.product_id = l.product_id',
-                []
-            );
-            $select->where('si.is_in_stock = ?', Stock::STOCK_IN_STOCK);
-        }
+//        if ($this->isConfigShowOutOfStock()) {
+//            $select->join(
+//                ['si' => $this->getTable('cataloginventory_stock_item')],
+//                'si.product_id = l.product_id',
+//                []
+//            );
+//            $select->where('si.is_in_stock = ?', Stock::STOCK_IN_STOCK);
+//        }

         $select->columns(
             [

Can you advice why my patch is not working ? :) what did i do wrongly ? Thank you

  • What is the error message after 'Cannot apply patch'? – Toan Tam Apr 22 at 4:04
  • @ToanTam just that cannot apply patch { the patch name} I did a composer install -vvv and I figureed it out that the patch was incorrect. I ended up probably with some extra spaces and the patch was invalid. So I regenerated the patch using the diff -u and it worked. – Attila Naghi Apr 22 at 7:16

Your Answer

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

Browse other questions tagged or ask your own question.