Added follow redirect, added logic to avoid parsing invalid results
Details
Details
- Reviewers
alex - Commits
- rMINC16601: Fixes MINC-194 - Fix ECB currency rate downloader
Preparations
- go to Admin Console
- enable at least 3 currencies (e.g. GBP, EUR, USD) and either of them must be set as primary
Part 1
- go to Admin Console
- go to Configuration → E-commerce → General
- set "Choose the exchange rate source" to "Federal Reserve Bank of New York - www.ny.frb.org"
- press "Save" button
- go to Configuration → E-commerce → Currencies
- press "Update Rates" button
- in the dialog, that appears after "Update Rates" button press, confirm the action so that all and not only active currencies would be updated
- confirm that no errors reported in the Logs & Reports → System Log
Part 2
- go to Admin Console
- go to Configuration → E-commerce → General
- set "Choose the exchange rate source" to "European Central Bank - www.ecb.int"
- press "Save" button
- go to Configuration → E-commerce → Currencies
- press "Update Rates" button
- in the dialog, that appears after "Update Rates" button press, confirm the action so that all and not only active currencies would be updated
- confirm that no errors reported in the Logs & Reports → System Log
- confirm that active currency rates are updated
- edit some of active currency rates to 2x larger value
- select (with checkbox selection) edited currency rate
- press "Update Rates" button
- in the dialog, that appears after "Update Rates" button press, confirm the action so that all and not only active currencies would be updated
- confirm that no errors reported in the Logs & Reports → System Log
- confirm that selected currency rate is updated to normal (not ~2x) value
Part 3
- go to Admin Console
- set "Choose the exchange rate source" to "Bank of Latvia - www.bank.lv"
- press "Save" button
- go to Configuration → E-commerce → Currencies
- press "Update Rates" button
- in the dialog, that appears after "Update Rates" button press, confirm the action so that all and not only active currencies would be updated
- confirm that no errors reported in the Logs & Reports → System Log
Diff Detail
Diff Detail
- Repository
- rINP In-Portal
- Branch
- /in-portal/branches/5.2.x
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 822 Build 822: arc lint + arc unit
Event Timeline
Comment Actions
Updates to test plan:
confirm that no errors reported in the debugger panel
There never will be any errors reported, because a redirect is made after currency update event was executed. Therefore I recommend to check new records in System Log instead.
- go to Configuration → E-commerce → Currencies
- press "Update Rates" button
Also mention, that:
- user needs to enable at least 3 currencies (e.g. GBP, EUR, USD) and either of them must be set as primary
- in the dialog, that appears after Update Rates button press user must confirm the action so that all and not only active currencies would be updated
Notices (not added by this differential, but still bad):
Requested ID for prefix curr not passed
- remove the $object = $event->getObject(); line
- get table name directly from unit config instead of doing $object->TableName
Undefined offset: 0
replace if(is_array($ids) && $ids[0]) + { on the next line with if ( $ids ) {
Undefined variable: iso_list
in the else part of if ( $ids ) { assign an empty array to $iso_list variable
Undefined index: EUR when using ECB
in the ECBCurrencyRates class replace if(!$data_res['EUR']) + { on the next line with if (!isset($data_res['EUR']) ) {