-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A lot of exceptions after login in backend #3625
Comments
can confirm - having the same issues. |
@sreichel - Could you please check? This report refers to a PR created by you and we honestly appreciate your feedback. |
Here too, exceptions have been introduced that were not there before.
|
If it turns out to be a wrong change then I propose to revert PR #2339. |
Imho it's okay to log it. Just need to add documentation how to remove that orphan entries. |
It's okay if there is a method to clean the database; otherwise, it just unnecessarily fills up the logs. |
I (the team I'm working in) actually really like this change. By that we found a lot of orphans in our DB we could clean up. A script would be nice though. What's the purpose of such exceptions, if higher up they just get ignored (the previous state)? The database fills (slowly) with garbage data and nobody notices it. |
Yes, it would be necessary to implement a cleanup of old entries, but until we have it, it is necessary to remove the exception, otherwise, the exception log will grow. |
The problem i see are the disabled extensions - how to detect them? Just an idea ... if an unused acl is found ...
Any better ideas? |
The priority is to remove the logException ASAP. The main issue is that I can temporarily disable an extension without having to necessarily perform a cleanup of ACL and other orphaned data in the database, including tables like core_resource and core_config_data. As a result, the removal and cleanup of this data should be done explicitly and cannot be automated. |
An idea is to add a menu "Manage Orphaned Resources" to render a grid with collection: $collection = Mage::getResourceModel('admin/rules_collection')
->addFieldToFilter('resource_id', ['nin' => Mage::getModel('admin/roles')->getResourcesList2D()]); And add a mass-action to delete the selected items. |
It also sounds like a typical job for n98-magerun to remove orphaned ACL entries, just throwing it out there. |
Reference PR:
The bug was introduced by this PR in loadRules(): an exception was added instead of this.
https://github.com/OpenMage/magento-lts/pull/2339/files#diff-1048571d4baf38d246708d5953af464948b5591c2c8d648036394d6101ba8022
Possible solution
Rollback and remove
Mage::logException($e);
inapp/code/core/Mage/Admin/Model/Resource/Acl.php::loadRules()
I also recommend including the commented TODO code because it would be a feature to implement (the deletion of old resources),
that was this:
in Mage_Admin_Model_Resource_Acl::loadRules() was added an exception
Preconditions (*)
Install OpenMage 20.2.0 - PHP 7.4 - MySQL 5.7
Install an extension that adds some resources to the admin_rule table (seems like the issue only occurs with deny permission resources).
Disable the previously installed extension from app/etc/modules/Vendor_Extension.xml.
Steps to reproduce (*)
Expected result (*)
Actual result (*)
It seems that this issue also occurs for old deprecated resources (my installation was updated from Magento 1.9.4.5) such as:
The text was updated successfully, but these errors were encountered: