Skip to content

Added log when currency rates import fail #3616

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

Closed
wants to merge 5 commits into from

Conversation

kyrena
Copy link
Contributor

@kyrena kyrena commented Oct 27, 2023

Description

When currency cron "Scheduled Import Settings" is enabled, in System > Configuration > Currency Setup, when there is an import error, errors are not logged.

With this PR, error is logged in exception.log (Mage::logException), cron job is marked as "error" ($cron->setIsError), and cron message contains the error log.

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: Directory Relates to Mage_Directory translations Relates to app/locale labels Oct 27, 2023
@kyrena kyrena changed the title Currency rates log Added log when currency rates import fail Oct 27, 2023
* @throws Mage_Core_Exception
*/
public function scheduledUpdateCurrencyRates()
public function scheduledUpdateCurrencyRates($cron = null)
Copy link
Contributor

@sreichel sreichel Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls dont change signatures of used methods. Better implement new ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this?

if (func_num_args() && func_get_args()[0] instanceof Mage_Cron_Model_Schedule) {
    $schedule = func_get_args()[0];
    //....
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a new method w/ parameter and all logic in and forward to this method. Similiar i did with #2940.

@kiatng
Copy link
Contributor

kiatng commented Oct 28, 2023

For BC, it's tricky to remove entries in the translation file Mage_Directory.csv.

@fballiano
Copy link

Since the original author didn't answer any of the notes I'll close this PR.
@kyrena feel free to reopen if you're willing to fix it :-)

@fballiano fballiano closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Directory Relates to Mage_Directory phpstan translations Relates to app/locale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants