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
cannot apply patch { the patch name}I did acomposer install -vvvand 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 thediff -uand it worked. – Attila Naghi Apr 22 '20 at 07:16