Enforce the default selection of currency to stick even when no amount is entered.
I noticed that if the money field is not marked required and if there is no value entered, the form throws a warning on form save telling the user:
A valid amount is required when a currency is specified
Sometimes there is no value to be entered, yet we still want the default currency to be shown.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | money.module.patch | 1.12 KB | Bodo Maass |
Comments
Comment #1
markus_petrux commentedIdeally, it should be implemented as an option in the widget settings, where the default makes the widget work as it does now, so that we don't break the current functionality of the sites that are using this module.
I'm pretty busy, so I'm not sure to have the time to work on this. I would be open to review patches, though.
Comment #2
markus_petrux commentedPostponing until I have the time, or someone else can come with a patch we can review.
Comment #3
markus_petrux commentedDuplicate: #479982: When value not required, accept missing value when currency is set
Comment #4
Bodo Maass commentedAttached is a patch that addresses this problem.
Specifically:
1. The selected default currency is shown when existing nodes are edited. Previously, the default currency was shown only for new nodes, but not when editing existing nodes
2. The warning message that a valid amount is required when the currency is specified is not shown when a currency is selected but the value is empty.
Comment #5
markus_petrux commentedI think this change could break existing sites, so there should be an option to enable the new behavior explicitly.
Comment #6
colanSubscribe
Comment #7
davidwhthomas commentedHere's a node form form_alter snippet to set the default currency value
It doesn't fix the issue when no value is entered for amount and the currency is set as default though.. but may help.
Comment #8
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.