magento2-inventory-log icon indicating copy to clipboard operation
magento2-inventory-log copied to clipboard

Cant disable other extension via ssh because of error InventoryLog

Open HRR1337 opened this issue 1 year ago • 2 comments

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.

HRR1337 avatar Jul 29 '23 14:07 HRR1337

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 avatar Feb 14 '24 09:02 vasilii-b

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

vasilii-b avatar Feb 14 '24 09:02 vasilii-b