Created
October 25, 2023 04:55
Revisions
-
hgati created this gist
Oct 25, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ From 28b02fb73a5159b1145033cf87927ab5a065917f Mon Sep 17 00:00:00 2001 From: Dennis <cobays@gmail.com> Date: Wed, 25 Oct 2023 13:53:54 +0900 Subject: [PATCH 3/3] Fixed an error : delete operation is forbidden --- Console/Command/DeleteOrdersCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Console/Command/DeleteOrdersCommand.php b/Console/Command/DeleteOrdersCommand.php index e2689fa..793bfd9 100644 --- a/Console/Command/DeleteOrdersCommand.php +++ b/Console/Command/DeleteOrdersCommand.php @@ -35,6 +35,11 @@ class DeleteOrdersCommand extends Command */ protected $helper; + /** + * @var \Magento\Framework\Registry + */ + protected $registry; + /** * Init constructor * @@ -57,6 +62,7 @@ class DeleteOrdersCommand extends Command $this->orderFactory = $orderFactory; $this->order = $order; $this->helper = $helper; + $this->registry = $registry; parent::__construct(); } @@ -91,6 +97,7 @@ class DeleteOrdersCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { $exitCode = 0; + $this->registry->register('isSecureArea', true); // This action (true) must be performed in order to enable the delete action. try { -- 2.34.1