From 9b2dec74fc3c0fc31c5434afd275c48bf7cded58 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 12:23:50 +0800 Subject: [PATCH 01/23] New feature: UI to list and remove orphaned ACL resources in backend. --- .phpstorm.meta.php/magento_blocks.meta.php | 1 + .../magento_blocks_methods.meta.php | 2 + .../core/Mage/Admin/Model/Resource/Acl.php | 8 +- .../core/Mage/Admin/Model/Resource/Rules.php | 29 ++++++ .../Block/Permissions/OrphanedResource.php | 39 ++++++++ .../Permissions/OrphanedResource/Grid.php | 92 +++++++++++++++++++ .../OrphanedResourceController.php | 88 ++++++++++++++++++ .../core/Mage/Adminhtml/etc/adminhtml.xml | 7 ++ app/locale/en_US/Mage_Adminhtml.csv | 4 + docs/EVENTS.md | 1 + 10 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php create mode 100644 app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php create mode 100644 app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php diff --git a/.phpstorm.meta.php/magento_blocks.meta.php b/.phpstorm.meta.php/magento_blocks.meta.php index 59f89ae1f4c..6923d7a7b56 100644 --- a/.phpstorm.meta.php/magento_blocks.meta.php +++ b/.phpstorm.meta.php/magento_blocks.meta.php @@ -294,6 +294,7 @@ 'adminhtml/permissions_role' => \Mage_Adminhtml_Block_Permissions_Role::class, 'adminhtml/permissions_role_grid_user' => \Mage_Adminhtml_Block_Permissions_Role_Grid_User::class, 'adminhtml/permissions_roles' => \Mage_Adminhtml_Block_Permissions_Roles::class, + 'adminhtml/permissions_orphanedResource' => \Mage_Adminhtml_Block_Permissions_OrphanedResource::class, 'adminhtml/permissions_tab_roleinfo' => \Mage_Adminhtml_Block_Permissions_Tab_Roleinfo::class, 'adminhtml/permissions_tab_rolesedit' => \Mage_Adminhtml_Block_Permissions_Tab_Rolesedit::class, 'adminhtml/permissions_tab_rolesusers' => \Mage_Adminhtml_Block_Permissions_Tab_Rolesusers::class, diff --git a/.phpstorm.meta.php/magento_blocks_methods.meta.php b/.phpstorm.meta.php/magento_blocks_methods.meta.php index fbd2099a5da..bb0f06ba1d5 100644 --- a/.phpstorm.meta.php/magento_blocks_methods.meta.php +++ b/.phpstorm.meta.php/magento_blocks_methods.meta.php @@ -294,6 +294,7 @@ 'adminhtml/permissions_role' => \Mage_Adminhtml_Block_Permissions_Role::class, 'adminhtml/permissions_role_grid_user' => \Mage_Adminhtml_Block_Permissions_Role_Grid_User::class, 'adminhtml/permissions_roles' => \Mage_Adminhtml_Block_Permissions_Roles::class, + 'adminhtml/permissions_orphanedResource' => \Mage_Adminhtml_Block_Permissions_OrphanedResource::class, 'adminhtml/permissions_tab_roleinfo' => \Mage_Adminhtml_Block_Permissions_Tab_Roleinfo::class, 'adminhtml/permissions_tab_rolesedit' => \Mage_Adminhtml_Block_Permissions_Tab_Rolesedit::class, 'adminhtml/permissions_tab_rolesusers' => \Mage_Adminhtml_Block_Permissions_Tab_Rolesusers::class, @@ -554,6 +555,7 @@ 'adminhtml/sales_order_view_tab_history' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_History::class, 'adminhtml/sales_order_view_tab_info' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_Info::class, 'adminhtml/sales_order_view_tab_invoices' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_Invoices::class, + 'adminhtml/sales_order_view_tab_prova' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_Prova::class, 'adminhtml/sales_order_view_tab_shipments' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_Shipments::class, 'adminhtml/sales_order_view_tab_transactions' => \Mage_Adminhtml_Block_Sales_Order_View_Tab_Transactions::class, 'adminhtml/sales_order_view_tabs' => \Mage_Adminhtml_Block_Sales_Order_View_Tabs::class, diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 89d810e3971..7a0eb2b7319 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -132,7 +132,13 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) $acl->deny($role, $resource, $privileges, $assert); } } catch (Exception $e) { - Mage::logException($e); + Mage::getSingleton('adminhtml/session')->addNotice( + Mage::helper('adminhtml')->__( + 'Resource %s not found. You can delete it by clicking here.', + $resource, + Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') + ) + ); } } return $this; diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index c22327d671b..96befb25673 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -80,4 +80,33 @@ public function saveRel(Mage_Admin_Model_Rules $rule) Mage::logException($e); } } + + /** + * Delete orphaned resources + * + * @param array $orphanedIds + * @return int + * @throws Mage_Core_Exception + */ + public function deleteOrphanedResources(array $orphanedIds) + { + if (empty($orphanedIds)) { + return 0; + } + + $resourceIds = Mage::getModel('admin/roles')->getResourcesList2D(); + // Validate orphaned IDs are not in the list of valid resource IDs. + $validIds = array_intersect($orphanedIds, $resourceIds); + if (!empty($validIds)) { + throw new Mage_Core_Exception( + Mage::helper('adminhtml')->__( + 'The following resource(s) are not orphaned: %s', + implode(', ', $validIds) + ) + ); + } + + return $this->_getWriteAdapter() + ->delete($this->getMainTable(), ['resource_id IN (?)' => $orphanedIds]); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php new file mode 100644 index 00000000000..3fe27c3d1c2 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -0,0 +1,39 @@ +_controller = 'permissions_orphanedResource'; + $this->_headerText = Mage::helper('adminhtml')->__('Orphaned Resources'); + $this->_removeButton('add'); + parent::__construct(); + } + + /** + * @return string + */ + protected function _toHtml() + { + Mage::dispatchEvent('permissions_orphanedresource_html_before', ['block' => $this]); + return parent::_toHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php new file mode 100644 index 00000000000..9a2c77679ee --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -0,0 +1,92 @@ +setId('permissionsOrphanedResourceGrid'); + $this->setDefaultSort('resource_id'); + $this->setDefaultDir('asc'); + } + + /** + * @inheritdoc + */ + protected function _prepareCollection() + { + /** @var Mage_Admin_Model_Resource_Rules_Collection */ + $collection = Mage::getResourceModel('admin/rules_collection') + ->addFieldToFilter('resource_id', ['nin' => Mage::getModel('admin/roles')->getResourcesList2D()]) + ->addFieldToSelect('resource_id'); + $collection->getSelect()->group('resource_id'); + + /** + * In order for mass action selection to work properly, we need to overwrite + * the model resource $_idFieldName, from the default 'rule_id' to 'resource_id'. + * @see Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract::getGridIdsJson() + */ + $resource = $collection->getResource(); + $setIdFieldName = function($idFieldName) { + /** @var Mage_Core_Model_Resource_Db_Abstract $this */ + return $this->_idFieldName = $idFieldName; + }; + $setIdFieldName->call($resource, 'resource_id'); + + $this->setCollection($collection); + return parent::_prepareCollection(); + } + + /** + * @inheritdoc + */ + protected function _prepareColumns() + { + $this->addColumn('resource_id', [ + 'header' => Mage::helper('adminhtml')->__('Orphaned Resource'), + 'index' => 'resource_id' + ]); + + return parent::_prepareColumns(); + } + + /** + * @inheritdoc + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('resource_id'); + $this->getMassactionBlock()->setFormFieldName('resource_id'); + + $this->getMassactionBlock()->addItem('delete', [ + 'label' => Mage::helper('adminhtml')->__('Delete'), + 'url' => $this->getUrl('*/*/massDelete'), + 'confirm' => Mage::helper('adminhtml')->__('Are you sure you want to do this?') + ]); + + return $this; + } + + public function getRowUrl($row) + { + return ''; + } +} diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php new file mode 100644 index 00000000000..f0e5a2842e9 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php @@ -0,0 +1,88 @@ +loadLayout() + ->_setActiveMenu('system/acl') + ->_addBreadcrumb($this->__('System'), $this->__('System')) + ->_addBreadcrumb($this->__('Permissions'), $this->__('Permissions')) + ->_addBreadcrumb($this->__('Orphaned Resources'), $this->__('Orphaned Resources')); + return $this; + } + + /** + * Index action + */ + public function indexAction() + { + $this->_title($this->__('System')) + ->_title($this->__('Permissions')) + ->_title($this->__('Orphaned Resources')); + + /** @var Mage_Adminhtml_Block_Permissions_OrphanedResource $block */ + $block = $this->getLayout()->createBlock('adminhtml/permissions_orphanedResource'); + $this->_initAction() + ->_addContent($block) + ->renderLayout(); + } + + /** + * Mass delete action + */ + public function massDeleteAction() + { + $resourceIds = $this->getRequest()->getParam('resource_id'); + try { + $deletedRows = Mage::getResourceSingleton('admin/rules')->deleteOrphanedResources($resourceIds); + $this->_getSession()->addSuccess($this->__('Total of %d record(s) have been deleted.', $deletedRows)); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($e->getMessage()); + } catch (Exception $e) { + $error = Mage::getIsDeveloperMode() + ? $e->getMessage() + : $this->__('An error occurred while deleting record(s).'); + $this->_getSession()->addError($error); + Mage::logException($e); + } + + $this->_redirect('*/*/'); + } + + /** + * @inheritdoc + */ + public function preDispatch() + { + $this->_setForcedFormKeyActions('massDelete'); + return parent::preDispatch(); + } +} diff --git a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml index a48db6818a6..671c7cef8a6 100644 --- a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml +++ b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml @@ -91,6 +91,10 @@ Blocks adminhtml/permissions_block + + Orphaned Resources + adminhtml/permissions_orphanedResource + @@ -145,6 +149,9 @@ Blocks + + Orphaned Resources + diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index 61a65307dcc..026b6947296 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -708,6 +708,8 @@ "Order Updated Date report is real-time, does not need statistics refreshing.","Order Updated Date report is real-time, does not need statistics refreshing." "Orders","Orders" "Original Magento attribute names in first row:","Original Magento attribute names in first row:" +"Orphaned Resource","Orphaned Resource" +"Orphaned Resources","Orphaned Resources" "Out of stock","Out of stock" "PDT (Payment Data Transfer) Only","PDT (Payment Data Transfer) Only" "Pages","Pages" @@ -879,6 +881,7 @@ "Reset Password","Reset Password" "Reset a Password","Reset a Password" "Resize","Resize" +"Resource %s not found. You can delete it by clicking here.","Resource %s not found. You can delete it by clicking here." "Resource Access","Resource Access" "Resources","Resources" "Results","Results" @@ -1025,6 +1028,7 @@ "The CatalogInventory Stock Status has been rebuilt.","The CatalogInventory Stock Status has been rebuilt." "The Comment Text field cannot be empty.","The Comment Text field cannot be empty." "The Flat Catalog Product was rebuilt","The Flat Catalog Product was rebuilt" +"The following resource(s) are not orphaned: %s","The following resource(s) are not orphaned: %s" "The JavaScript/CSS cache has been cleaned.","The JavaScript/CSS cache has been cleaned." "The JavaScript/CSS cache has been cleared.","The JavaScript/CSS cache has been cleared." "The Layered Navigation indexing has been queued.","The Layered Navigation indexing has been queued." diff --git a/docs/EVENTS.md b/docs/EVENTS.md index 8557533c0d8..2ce02cba6a8 100644 --- a/docs/EVENTS.md +++ b/docs/EVENTS.md @@ -257,6 +257,7 @@ | paypal_prepare_line_items | 1.9.4.5 | | pdf_item_draw_after | 1.9.4.5 | | permissions_block_html_before | 1.9.4.5 | +| permissions_orphanedresource_html_before | 20.2.1 | | permissions_user_html_before | 1.9.4.5 | | permissions_variable_html_before | 1.9.4.5 | | poll_vote_add | 1.9.4.5 | From b30afd04881992da4d48cd4c4ed6614a8b39fdea Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 13:06:13 +0800 Subject: [PATCH 02/23] Fixed bug on add button removal. --- .../core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index 3fe27c3d1c2..1adb02a35f9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -24,8 +24,8 @@ public function __construct() { $this->_controller = 'permissions_orphanedResource'; $this->_headerText = Mage::helper('adminhtml')->__('Orphaned Resources'); - $this->_removeButton('add'); parent::__construct(); + $this->_removeButton('add'); } /** From f3b94adb2288b8b908ee85102c29beffa206134b Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 13:27:53 +0800 Subject: [PATCH 03/23] Fixed phpcs and phpstan complains. --- app/code/core/Mage/Admin/Model/Resource/Rules.php | 12 ++++++++++++ .../Block/Permissions/OrphanedResource/Grid.php | 7 ++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index 96befb25673..6e3b5272e24 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -81,6 +81,18 @@ public function saveRel(Mage_Admin_Model_Rules $rule) } } + /** + * Set resource ID as ID field name + * @see Mage_Adminhtml_Block_Permissions_OrphanedResource_Grid::_prepareCollection() + * + * @return $this + */ + public function setResourceIdAsIdFieldName() + { + $this->_idFieldName = 'resource_id'; + return $this; + } + /** * Delete orphaned resources * diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 9a2c77679ee..74982d615e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -43,13 +43,10 @@ protected function _prepareCollection() * In order for mass action selection to work properly, we need to overwrite * the model resource $_idFieldName, from the default 'rule_id' to 'resource_id'. * @see Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract::getGridIdsJson() + * @var Mage_Admin_Model_Resource_Rules $resource */ $resource = $collection->getResource(); - $setIdFieldName = function($idFieldName) { - /** @var Mage_Core_Model_Resource_Db_Abstract $this */ - return $this->_idFieldName = $idFieldName; - }; - $setIdFieldName->call($resource, 'resource_id'); + $resource->setResourceIdAsIdFieldName(); $this->setCollection($collection); return parent::_prepareCollection(); From b7a21ca515ad39301dd1034a35e385d8664a3886 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 13:57:07 +0800 Subject: [PATCH 04/23] Avoid duplicates in notice messages. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 17 +++++++++++++++-- app/locale/en_US/Mage_Adminhtml.csv | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 7a0eb2b7319..b8108ec6a84 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -23,6 +23,8 @@ class Mage_Admin_Model_Resource_Acl extends Mage_Core_Model_Resource_Db_Abstract { public const ACL_ALL_RULES = 'all'; + protected $_orphanedResources = []; + /** * Initialize resource * @@ -131,11 +133,22 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) } elseif ($rule['permission'] == 'deny') { $acl->deny($role, $resource, $privileges, $assert); } + } catch (Zend_Acl_Exception $e) { + if ( + !in_array($resource, $this->_orphanedResources) + && strpos($e->getMessage(), "Resource '$resource' not found") !== false + ) { + $this->_orphanedResources[] = $resource; + } } catch (Exception $e) { + Mage::logException($e); + } + + if ($this->_orphanedResources) { Mage::getSingleton('adminhtml/session')->addNotice( Mage::helper('adminhtml')->__( - 'Resource %s not found. You can delete it by clicking here.', - $resource, + 'The following resources are no longer available in the system: %s. You can delete them by clicking here.' . "\n", + implode("\n", $this->_orphanedResources), Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') ) ); diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index 026b6947296..cc08a9b5f78 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -881,7 +881,6 @@ "Reset Password","Reset Password" "Reset a Password","Reset a Password" "Resize","Resize" -"Resource %s not found. You can delete it by clicking here.","Resource %s not found. You can delete it by clicking here." "Resource Access","Resource Access" "Resources","Resources" "Results","Results" @@ -1065,6 +1064,7 @@ "The email template has been deleted.","The email template has been deleted." "The email template has been saved.","The email template has been saved." "The flat catalog category has been rebuilt.","The flat catalog category has been rebuilt." +"The following resources are no longer available in the system: %s. You can delete them by clicking here.","The following resources are no longer available in the system: %s. You can delete them by clicking here." "The group node name must be specified with field node name.","The group node name must be specified with field node name." "The image cache was cleaned.","The image cache was cleaned." "The image cache was cleared.","The image cache was cleared." From fa65743b68ae115b41f878fa7ee842a70009fc6b Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:05:00 +0800 Subject: [PATCH 05/23] Fixed notice message. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index b8108ec6a84..a94446c043d 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -147,8 +147,8 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) if ($this->_orphanedResources) { Mage::getSingleton('adminhtml/session')->addNotice( Mage::helper('adminhtml')->__( - 'The following resources are no longer available in the system: %s. You can delete them by clicking here.' . "\n", - implode("\n", $this->_orphanedResources), + 'The following resources are no longer available in the system: %s. You can delete them by clicking here.', + implode(', ', $this->_orphanedResources), Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') ) ); From 2c2c56285b273d89a45c1f846183e846604b5be5 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:14:14 +0800 Subject: [PATCH 06/23] Update app/code/core/Mage/Admin/Model/Resource/Rules.php Co-authored-by: Sven Reichel --- app/code/core/Mage/Admin/Model/Resource/Rules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index 6e3b5272e24..8d93fc4cc9f 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -100,7 +100,7 @@ public function setResourceIdAsIdFieldName() * @return int * @throws Mage_Core_Exception */ - public function deleteOrphanedResources(array $orphanedIds) + public function deleteOrphanedResources(array $orphanedIds): int { if (empty($orphanedIds)) { return 0; From 66baaf5398e30adecb25f40a76178a6df6c8b05b Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:14:55 +0800 Subject: [PATCH 07/23] Update app/code/core/Mage/Admin/Model/Resource/Rules.php Co-authored-by: Sven Reichel --- app/code/core/Mage/Admin/Model/Resource/Rules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index 8d93fc4cc9f..3ee2364ed31 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -102,7 +102,7 @@ public function setResourceIdAsIdFieldName() */ public function deleteOrphanedResources(array $orphanedIds): int { - if (empty($orphanedIds)) { + if ($orphanedIds === []) { return 0; } From 533d261511bcd6f62eed1fa4cad2c80835725620 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:15:10 +0800 Subject: [PATCH 08/23] Update app/code/core/Mage/Admin/Model/Resource/Rules.php Co-authored-by: Sven Reichel --- app/code/core/Mage/Admin/Model/Resource/Rules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index 3ee2364ed31..f4bedfaf092 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -109,7 +109,7 @@ public function deleteOrphanedResources(array $orphanedIds): int $resourceIds = Mage::getModel('admin/roles')->getResourcesList2D(); // Validate orphaned IDs are not in the list of valid resource IDs. $validIds = array_intersect($orphanedIds, $resourceIds); - if (!empty($validIds)) { + if ($validIds !== []) { throw new Mage_Core_Exception( Mage::helper('adminhtml')->__( 'The following resource(s) are not orphaned: %s', From bf96a9f8c1045b7f7d3d3c3789d8822c02a3042e Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:19:09 +0800 Subject: [PATCH 09/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php Co-authored-by: Sven Reichel --- .../Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 74982d615e1..893aeed943d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -82,7 +82,7 @@ protected function _prepareMassaction() return $this; } - public function getRowUrl($row) + public function getRowUrl($row): string { return ''; } From 1b86eed56e8a07e3e9970785f3fa6fd7cbdb4166 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Sun, 12 Nov 2023 14:19:36 +0800 Subject: [PATCH 10/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php Co-authored-by: Sven Reichel --- .../core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index 1adb02a35f9..68e9c7b4438 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -31,7 +31,7 @@ public function __construct() /** * @return string */ - protected function _toHtml() + protected function _toHtml(): string { Mage::dispatchEvent('permissions_orphanedresource_html_before', ['block' => $this]); return parent::_toHtml(); From 7aea5c43af3617a68b53ce3b43cea19a781b01c5 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Mon, 13 Nov 2023 08:00:39 +0800 Subject: [PATCH 11/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php Co-authored-by: Fabrizio Balliano --- .../core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index 68e9c7b4438..d18012cbd0c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -8,7 +8,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org) + * @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ From e7c4ad289087c43d12b455a547adbb770716a0d4 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Mon, 13 Nov 2023 08:00:54 +0800 Subject: [PATCH 12/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php Co-authored-by: Fabrizio Balliano --- .../Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 893aeed943d..0c3afe65bfe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -8,7 +8,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org) + * @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ From 2b62e7896b0e8cee5eefbc1827484da397d8c745 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Mon, 13 Nov 2023 08:54:51 +0800 Subject: [PATCH 13/23] Fixed PSR2 CS. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index a94446c043d..383c74d03e4 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -134,10 +134,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) $acl->deny($role, $resource, $privileges, $assert); } } catch (Zend_Acl_Exception $e) { - if ( - !in_array($resource, $this->_orphanedResources) - && strpos($e->getMessage(), "Resource '$resource' not found") !== false - ) { + if (!in_array($resource, $this->_orphanedResources) && strpos($e->getMessage(), "Resource '$resource' not found") !== false) { $this->_orphanedResources[] = $resource; } } catch (Exception $e) { From cb2caa8e75cb7b00c67eaf7f1f80545d9288ebdf Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Mon, 13 Nov 2023 09:41:40 +0800 Subject: [PATCH 14/23] Fixed bug on multiple notices. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 383c74d03e4..b25dd50fca5 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -140,8 +140,9 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) } catch (Exception $e) { Mage::logException($e); } + } - if ($this->_orphanedResources) { + if ($this->_orphanedResources !== []) { Mage::getSingleton('adminhtml/session')->addNotice( Mage::helper('adminhtml')->__( 'The following resources are no longer available in the system: %s. You can delete them by clicking here.', @@ -150,7 +151,6 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) ) ); } - } return $this; } } From a9dfee4b51e50a10bdeb00c8b2c525c2f1c5c799 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Mon, 13 Nov 2023 10:20:51 +0800 Subject: [PATCH 15/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php Co-authored-by: Sven Reichel --- .../Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 0c3afe65bfe..14158b06dbf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -1,4 +1,7 @@ Date: Mon, 13 Nov 2023 10:21:02 +0800 Subject: [PATCH 16/23] Update app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php Co-authored-by: Sven Reichel --- .../controllers/Permissions/OrphanedResourceController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php index f0e5a2842e9..b20939d5cd1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php @@ -1,4 +1,7 @@ Date: Mon, 13 Nov 2023 10:26:06 +0800 Subject: [PATCH 17/23] Added strict type for new class. --- .../core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index d18012cbd0c..3d831959c9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -1,4 +1,7 @@ Date: Mon, 13 Nov 2023 13:31:55 +0800 Subject: [PATCH 18/23] CS fixer. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index b25dd50fca5..7ac1c3f515b 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -143,14 +143,15 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) } if ($this->_orphanedResources !== []) { - Mage::getSingleton('adminhtml/session')->addNotice( - Mage::helper('adminhtml')->__( - 'The following resources are no longer available in the system: %s. You can delete them by clicking here.', - implode(', ', $this->_orphanedResources), - Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') - ) - ); - } + Mage::getSingleton('adminhtml/session')->addNotice( + Mage::helper('adminhtml')->__( + 'The following resources are no longer available in the system: %s. You can delete them by clicking here.', + implode(', ', $this->_orphanedResources), + Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') + ) + ); + } + return $this; } } From 5517fd5068ed2f029d7748cac2952fac78ebca6a Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 8 Feb 2024 15:40:29 +0800 Subject: [PATCH 19/23] Change label Resources to Role Resources. --- app/code/core/Mage/Admin/Model/Resource/Acl.php | 2 +- app/code/core/Mage/Admin/Model/Resource/Rules.php | 2 +- .../Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 2 +- .../Adminhtml/Block/Permissions/OrphanedResource/Grid.php | 2 +- .../Permissions/OrphanedResourceController.php | 4 ++-- app/code/core/Mage/Adminhtml/etc/adminhtml.xml | 4 ++-- app/locale/en_US/Mage_Adminhtml.csv | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 7ac1c3f515b..7d2dffa9fd7 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -145,7 +145,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr) if ($this->_orphanedResources !== []) { Mage::getSingleton('adminhtml/session')->addNotice( Mage::helper('adminhtml')->__( - 'The following resources are no longer available in the system: %s. You can delete them by clicking here.', + 'The following role resources are no longer available in the system: %s. You can delete them by clicking here.', implode(', ', $this->_orphanedResources), Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') ) diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index f4bedfaf092..4888387285c 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -112,7 +112,7 @@ public function deleteOrphanedResources(array $orphanedIds): int if ($validIds !== []) { throw new Mage_Core_Exception( Mage::helper('adminhtml')->__( - 'The following resource(s) are not orphaned: %s', + 'The following role resource(s) are not orphaned: %s', implode(', ', $validIds) ) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index 3d831959c9c..11c52aa2bf4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -26,7 +26,7 @@ class Mage_Adminhtml_Block_Permissions_OrphanedResource extends Mage_Adminhtml_B public function __construct() { $this->_controller = 'permissions_orphanedResource'; - $this->_headerText = Mage::helper('adminhtml')->__('Orphaned Resources'); + $this->_headerText = Mage::helper('adminhtml')->__('Orphaned Role Resources'); parent::__construct(); $this->_removeButton('add'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 14158b06dbf..2c40bce12b3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -61,7 +61,7 @@ protected function _prepareCollection() protected function _prepareColumns() { $this->addColumn('resource_id', [ - 'header' => Mage::helper('adminhtml')->__('Orphaned Resource'), + 'header' => Mage::helper('adminhtml')->__('Orphaned Role Resource'), 'index' => 'resource_id' ]); diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php index b20939d5cd1..4c46cc8d5d6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php @@ -38,7 +38,7 @@ protected function _initAction() ->_setActiveMenu('system/acl') ->_addBreadcrumb($this->__('System'), $this->__('System')) ->_addBreadcrumb($this->__('Permissions'), $this->__('Permissions')) - ->_addBreadcrumb($this->__('Orphaned Resources'), $this->__('Orphaned Resources')); + ->_addBreadcrumb($this->__('Orphaned Resources'), $this->__('Orphaned Role Resources')); return $this; } @@ -49,7 +49,7 @@ public function indexAction() { $this->_title($this->__('System')) ->_title($this->__('Permissions')) - ->_title($this->__('Orphaned Resources')); + ->_title($this->__('Orphaned Role Resources')); /** @var Mage_Adminhtml_Block_Permissions_OrphanedResource $block */ $block = $this->getLayout()->createBlock('adminhtml/permissions_orphanedResource'); diff --git a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml index 671c7cef8a6..3d05467b27c 100644 --- a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml +++ b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml @@ -92,7 +92,7 @@ adminhtml/permissions_block - Orphaned Resources + Orphaned Role Resources adminhtml/permissions_orphanedResource @@ -150,7 +150,7 @@ Blocks - Orphaned Resources + Orphaned Role Resources diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv index cc08a9b5f78..c85c5f04c78 100644 --- a/app/locale/en_US/Mage_Adminhtml.csv +++ b/app/locale/en_US/Mage_Adminhtml.csv @@ -708,8 +708,8 @@ "Order Updated Date report is real-time, does not need statistics refreshing.","Order Updated Date report is real-time, does not need statistics refreshing." "Orders","Orders" "Original Magento attribute names in first row:","Original Magento attribute names in first row:" -"Orphaned Resource","Orphaned Resource" -"Orphaned Resources","Orphaned Resources" +"Orphaned Role Resource","Orphaned Role Resource" +"Orphaned Role Resources","Orphaned Role Resources" "Out of stock","Out of stock" "PDT (Payment Data Transfer) Only","PDT (Payment Data Transfer) Only" "Pages","Pages" @@ -1027,7 +1027,7 @@ "The CatalogInventory Stock Status has been rebuilt.","The CatalogInventory Stock Status has been rebuilt." "The Comment Text field cannot be empty.","The Comment Text field cannot be empty." "The Flat Catalog Product was rebuilt","The Flat Catalog Product was rebuilt" -"The following resource(s) are not orphaned: %s","The following resource(s) are not orphaned: %s" +"The following role resource(s) are not orphaned: %s","The following role resource(s) are not orphaned: %s" "The JavaScript/CSS cache has been cleaned.","The JavaScript/CSS cache has been cleaned." "The JavaScript/CSS cache has been cleared.","The JavaScript/CSS cache has been cleared." "The Layered Navigation indexing has been queued.","The Layered Navigation indexing has been queued." @@ -1064,7 +1064,7 @@ "The email template has been deleted.","The email template has been deleted." "The email template has been saved.","The email template has been saved." "The flat catalog category has been rebuilt.","The flat catalog category has been rebuilt." -"The following resources are no longer available in the system: %s. You can delete them by clicking here.","The following resources are no longer available in the system: %s. You can delete them by clicking here." +"The following role resources are no longer available in the system: %s. You can delete them by clicking here.","The following role resources are no longer available in the system: %s. You can delete them by clicking here." "The group node name must be specified with field node name.","The group node name must be specified with field node name." "The image cache was cleaned.","The image cache was cleaned." "The image cache was cleared.","The image cache was cleared." From 868676fa0e9a14a3b95c0ebf8f81a0f02699e521 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 8 Feb 2024 19:52:41 +0800 Subject: [PATCH 20/23] Update app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php Co-authored-by: Fabrizio Balliano --- .../controllers/Permissions/OrphanedResourceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php index 4c46cc8d5d6..f8dfd83949b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php @@ -11,7 +11,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) + * @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ From 33b5d5e1175591835e6efca0fe79ba21e791f53e Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 8 Feb 2024 19:52:54 +0800 Subject: [PATCH 21/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php Co-authored-by: Fabrizio Balliano --- .../Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php index 2c40bce12b3..042bb052ccf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php @@ -11,7 +11,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) + * @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ From fc7f02b609f03fb8c47d12c1810a76af53304649 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 8 Feb 2024 19:53:05 +0800 Subject: [PATCH 22/23] Update app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php Co-authored-by: Fabrizio Balliano --- .../core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php index 11c52aa2bf4..ab529bf7470 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource.php @@ -11,7 +11,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org) + * @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ From 4f6d8e2de1d45c13deda97e2856cba94811a3556 Mon Sep 17 00:00:00 2001 From: Ng Kiat Siong Date: Thu, 8 Feb 2024 19:56:20 +0800 Subject: [PATCH 23/23] Update OrphanedResourceController.php Delete unnecessary docblock --- .../controllers/Permissions/OrphanedResourceController.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php index f8dfd83949b..3ca9ccece9e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/OrphanedResourceController.php @@ -14,13 +14,6 @@ * @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Class Mage_Adminhtml_Permissions_OrphanedResourceController - * - * @category Mage - * @package Mage_Adminhtml - */ class Mage_Adminhtml_Permissions_OrphanedResourceController extends Mage_Adminhtml_Controller_Action { /**