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

Fix exception logged when no Category image is uploaded #3086

Merged
merged 2 commits into from
Mar 15, 2023

Conversation

elidrissidev
Copy link
Member

@elidrissidev elidrissidev commented Mar 14, 2023

Description (*)

As @luigifab pointed out in #3025 (comment), updating a Category without an image keeps logging an exception "No file was uploaded" in exception.log.

This error is normally being ignored by checking $e->getCode() because the Category image is optional, but the new error handling introduced in #2902 isn't passing the error code with the Exception object making the exception be logged.

Related Pull Requests

Manual testing scenarios (*)

  1. Make sure logs are enabled.
  2. Go to Catalog -> Categories and try to save any category, then check exception.log file.

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 Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* labels Mar 14, 2023
@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label Mar 15, 2023
@elidrissidev
Copy link
Member Author

Got rid of the devil number ;), now TMP_NAME_EMPTY is deprecated and replaced with UPLOAD_ERR_NO_FILE so not breaking BC as long as extensions are using the constant.

@fballiano fballiano merged commit 089c00c into OpenMage:1.9.4.x Mar 15, 2023
@fballiano
Copy link
Contributor

merged and 20ed

@elidrissidev elidrissidev deleted the fix/image-upload-exception branch March 15, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Relates to Mage_Catalog Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants