Problem/Motivation
Putting an incorrect float value results with an error that will erase all the previous values in the DB.
Steps to reproduce
1. Visit /admin/commerce/config/exchange-rates
2. Create an entity with plugin: 'Manual' and set up some non-zero currency rates values, then save the entity
3. Edit the newly created entity
4. Put an incorrect float for one of the rates values (e.g. use comma as a delimiter: '0,1' or just put an empty string)
5. Save the entity and you'll see the WSOD
6. Also check the db, all the previous values will be zeroed out
Proposed resolution
Implement a ExchangeRatesForm:validateForm() method that will check if the values are actually valid float values
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screencast From 2025-09-01 22-10-34.gif | 280.09 KB | valic |
Issue fork commerce_exchanger-3541154
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
juliusz_cheddar commentedComment #5
valicTnx.
I did update as well validation on \Drupal\commerce_exchanger\ExchangerManager::setLatest if someone is doing direct updates, that we adhere to some structure with `.` as delimiter.
And in addition added states logic on form, that manual value can be entered without needed to check it first, than save, than edit
Comment #7
valicTnx