Skip to content
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

Orphaned ACL resource exceptions are now logged only in developer mode #3642

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

empiricompany
Copy link
Contributor

@empiricompany empiricompany commented Nov 10, 2023

Description (*)

more details here:
#3625

Revert
https://github.com/OpenMage/magento-lts/pull/2339/files#diff-1048571d4baf38d246708d5953af464948b5591c2c8d648036394d6101ba8022

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes A lot of exceptions after login in backend  #3625

Manual testing scenarios (*)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Admin Relates to Mage_Admin label Nov 10, 2023
@sreichel
Copy link
Contributor

This code is not complete.
Its not that easy to solve for disabled modules.

Better delete orphan records (and maybe add log otation, or patch it away?)

I see more pros then cons with logging.

@empiricompany
Copy link
Contributor Author

Sorry @sreichel this is not intended to resolve the orphan data but only to not log an exception every time i log in in the backend until we have a solution

@Flyingmana
Copy link
Contributor

I recommend to apply this change temporarily via the composer patcher if this causes you problems.
Iam against merging it, as logging this inconsistency is a good method the get aware of it.
And yes we should have a way to clean these up, maybe a script is ok?

The original code also had a (commented out) part in, which automatically cleans it up. Iam not a fan of this, but making it configurable would also be an option.

Would one of these options be acceptable?

@fballiano
Copy link
Contributor

I agree with @Flyingmana that logging is a good way to find and cleanup problems, and I agree with the sentiment of the original PR thus I'd leave it as it is, cleanup should be quite easy and there's #3647 on the way

@empiricompany
Copy link
Contributor Author

what if we wrap the exception in this if statement?

if (Mage::getIsDeveloperMode()) {
   Mage::logException($e);
}

@Flyingmana
Copy link
Contributor

what if we wrap the exception in this if statement?

if (Mage::getIsDeveloperMode()) {
   Mage::logException($e);
}

acceptable for me

@sreichel
Copy link
Contributor

what if we wrap the exception in this if statement?

if (Mage::getIsDeveloperMode()) {
   Mage::logException($e);
}

Perfect for me. It does not fill logs in production, but pops up in local env ... @Sdfendor

@Sdfendor
Copy link
Contributor

Sdfendor commented Nov 14, 2023

I agree, it's acceptable.
The necessity for a cleanup/deletion mechanism for orphaned entries meanwhile stays the same. But this of course doesn't need to happen in this PR.

@m-overlund
Copy link
Contributor

Perfect!

@Flyingmana
Copy link
Contributor

can please someone provide a better title for the PR based on the new changes?

@empiricompany empiricompany changed the title Revert PR 2339 orphaned acl resource exceptions logged only in developer mode Nov 15, 2023
@fballiano fballiano changed the title orphaned acl resource exceptions logged only in developer mode Orphaned ACL resource exceptions are now logged only in developer mode Nov 15, 2023
@fballiano fballiano merged commit b6bb243 into OpenMage:main Nov 15, 2023
17 checks passed
@empiricompany
Copy link
Contributor Author

can please someone provide a better title for the PR based on the new changes?

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Admin Relates to Mage_Admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A lot of exceptions after login in backend
7 participants