After exporting and importing a node with money cck field, the default value is not shown correctly. Instead of "EUR" it is "1".
Here's the exported data:
$content[fields] = array (
0 =>
array (
'label' => 'Normal price',
'field_name' => 'field_price_normal',
'type' => 'money',
'widget_type' => 'money_widget',
'change' => 'Basisinformation ändern',
'weight' => '-3',
'currency_select_mode' => 'code',
'currency_display_mode' => 'a|+|c',
'allowed_currencies' =>
array (
'EUR' => true,
0 => 1,
'AFA' => false,
'ALL' => false,
'DZD' => false,
--snip--
--snap--
'ZMK' => false,
'ZWD' => false,
),
'description' => 'The tickets price <b>without</b> reduction.',
'default_value' =>
array (
0 =>
array (
'amount' => '',
'currency' => 'EUR',
'_error_element' => 'default_value_widget][field_price_normal][0][amount',
),
),
'default_value_php' => '',
'default_value_widget' => NULL,
'group' => false,
'required' => 1,
'multiple' => '0',
'precision' => '6',
'decimals' => '2',
'op' => 'Feldeinstellungen speichern',
'module' => 'money',
'widget_module' => 'money',
'columns' =>
array (
'amount' =>
array (
'type' => 'numeric',
'precision' => '6',
'scale' => '2',
'not null' => false,
'sortable' => true,
'views' => true,
),
'currency' =>
array (
'type' => 'varchar',
'length' => 3,
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'token' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
.
.
.
That seems to be allright, doesn't it?
I had a look to the database but don't realy know where default values are saved. Maybe I could find an indication where the problem lies.
Comments
Comment #1
haggins commentednote: this issue is not related to the dev-version. It happens also at the official release.
Comment #2
markus_petrux commentedI was able to reproduce this. Also noticed that the selected currencies are not reflected in the widget settings panel after importing.
I'll look into this. Thanks for the report.
Comment #3
markus_petrux commentedPlease, apply the following patch or wait for the next nightly snapshot. Then, update the field settings in the original field, then try exporting the type again. I believe this patch will fix the issue.
Comment #4
haggins commentedThanks for the patch. Unfortunately it doesn't change anything.
I created a new node type with an extra money field and exported it. Then I deleted the node type and created it again without money field. By importing the exported data the field was automatically created. Default currency value is still '1'.
Comment #5
markus_petrux commentedhmm... I have committed a small change to CVS. It will be available in the next nightly snapshot. Hope that fixes the issue.
Comment #6
markus_petrux commentedPlease, re-open if it doesn't fixe the problem.