Enforce default currency to tick when no value is present
dejamuse - May 11, 2009 - 02:13
| Project: | Money CCK field |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
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.

#1
Ideally, 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.
#2
Postponing until I have the time, or someone else can come with a patch we can review.
#3
Duplicate: #479982: When value not required, accept missing value when currency is set
#4
Attached 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.