How to set the default value of a CCK field I got a CCK field to select a currency; this field is not required, and the dropdown displays '-None-'. I want to change that.

There's the option to let PHP-Code return the value. It says:

return array(
    0 =&gt; array('value' =&gt; 'value for value'),
    // You'll usually want to stop here. Provide more values
    // if you want your 'default value' to be multi-valued:
    1 =&gt; array('value' =&gt; 'value for value'),
    2 =&gt; ...
);


So I tried with:

return array(
  0 =&gt; array('value' =&gt; 'my_text'),   
);


Drupal now tells me:



The PHP code for 'default value' returned Array ( [0] =&gt; Array ( [value] =&gt; my_text ) ) , which is invalid.


I got a list of 4 currencies to choose from, which are the allowed values in my dropdown. What do I have to do to replace '-None-' with my own default?
In order for you to use PHP you must return a simpler array:

return array(
  'value' =&gt; 'my_text'
);


Also, if all you want is to set a default value, you don't need to use the PHP option.


First, define the allowed values (manually or via PHP, doesn't matter)
Then click save
Now click edit to go back to the form. Close to the top there will be a "Default Value" fieldset populated with the allowed values. Just select one!