Active
Project:
CCK Currency
Version:
6.x-1.0
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2008 at 03:36 UTC
Updated:
3 Nov 2008 at 16:24 UTC
Here is the documentation on defaults:
return array(
0 => array('currency' => value for currency),
// You'll usually want to stop here. Provide more values
// if you want your 'default value' to be multi-valued:
1 => array('currency' => value for currency),
2 => ...
);
This is confusing because 'value for currency' is ambiguous. Looking at the currency API, we could try (1):
array('currency' => 'USD')
or (2):
array('currency' => array('USD' => 'U.S. Dollar' (USD)'))
or (3):
array('currency' => 'U.S. Dollar' (USD)')
or even 4:
array('currency' => array('#value' => 'USD'))
The only one that doesn't throw an error is (1). On the other hand, that doesn't work: I get a NULL value from the currency dropdown in a post.
What am I doing wrong? Thanks!
Comments
Comment #1
shunting commentedTypo. #2 should read:
(extra single quote)
Comment #2
shunting commentedHere is the value that works in the default PHP field for managing the currency field type:
However, the drop down on the admin page does not take, nor does the dropdown when the field appears on the edit page for a post. The first value on the list, Afghanistan, always appears.