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

Better admin/config validation for allowed currencies #2597

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Better admin/config validation for allowed currencies #2597

merged 2 commits into from
Sep 14, 2022

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Sep 14, 2022

Description (*)

  • fixes an error that allows to save no allowed currencies set.
  • added some depends nodes to config fields

Manual testing scenarios (*)

  1. go to admin, system, config, currencies
  2. unselect all allowed currencies
  3. try to save
Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /var/www/html/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php:44
Stack trace:
#0 /var/www/html/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php(44): in_array('EUR', '')
#1 /var/www/html/app/code/core/Mage/Core/Model/Abstract.php(334): Mage_Adminhtml_Model_System_Config_Backend_Currency_Default->_afterSave()
Fatal error:  Uncaught Exception: User Error: Some transactions have not been committed or rolled back  in /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4063 in /var/www/html/app/code/core/Mage/Core/functions.php:194

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)

@github-actions github-actions bot added Component: Adminhtml Relates to Mage_Adminhtml Component: Directory Relates to Mage_Directory translations Relates to app/locale labels Sep 14, 2022
@sreichel sreichel added the bug label Sep 14, 2022
@ADDISON74
Copy link
Contributor

I confirm this bug, here is what appears in the browser window:

screenshot

I checked locally the PR and this appears in browser window when I want to save the list and there is no currency selected:

screenshot-2

IMO the changes look fine. I didn't stop to analyze in detail what those additional dependencies bring, quite a lot in number.

@sreichel
Copy link
Contributor Author

sreichel commented Sep 14, 2022

@ADDISON74 "depends" tag is to hide some options if "enabled" is set to "no".

Check Fixer.iO section before and after.

Edit: flushed cache?

@fballiano fballiano merged commit bbe1184 into OpenMage:1.9.4.x Sep 14, 2022
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
7 runs  ±0  5 ✔️ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit bbe1184. ± Comparison against base commit 71a2751.

@sreichel sreichel deleted the hotfix/admin-currencies branch September 14, 2022 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: Adminhtml Relates to Mage_Adminhtml Component: Directory Relates to Mage_Directory translations Relates to app/locale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants