elgentos / magento2-inventory-log

Magento 2 - Inventory Log
29 stars 11 forks source link

Cant disable other extension via ssh because of error InventoryLog #17

Open HRR1337 opened 11 months ago

HRR1337 commented 11 months ago

Magento 2.4.6 Php 8.1

Disable an extension via SSH gives the following error:

Deprecated Functionality: Creation of dynamic property Elgentos\InventoryLog\Plugin\ModuleStatus::$_storeManager is deprecated in ....vendor/elgentos/magento2-inventory-log/Plugin/ModuleStatus.php on line 38

Therefore I cant disable an extension via SSH.

vasilii-b commented 5 months ago

The quick fix for that would be to apply a patch

diff --git a/vendor/elgentos/magento2-inventory-log/Plugin/ModuleStatus.php
--- a/vendor/elgentos/magento2-inventory-log/Plugin/ModuleStatus.php
+++ b/vendor/elgentos/magento2-inventory-log/Plugin/ModuleStatus.php
@@ -14,6 +14,7 @@
 namespace Elgentos\InventoryLog\Plugin;

 use Magento\Config\Model\ResourceModel\Config as ConfigResource;
+use Magento\Store\Model\StoreManagerInterface;
 use Elgentos\InventoryLog\Helper\Data as StockMovementHelper;

 class ModuleStatus
@@ -23,6 +24,11 @@
      */
     public $configResource;

+    /**
+     * @var \Magento\Store\Model\StoreManagerInterface
+     */
+    private StoreManagerInterface $_storeManager;
+
     const EXTENSION_NAME = 'Elgentos_InventoryLog';

     /**
vasilii-b commented 5 months ago

The same issue is thrown during the Adobe Commerce cloud deployment pipelines, when running the command bin/magento module:enable --all --ansi --no-interaction