global variable/array unset when hook_field_presave() is being called I am trying to pass a global array and work with it in hook_field_presave() but that global array is unset. How do I pass a global array and work with it in presave?

example

function find_feed_field_widget_form(&amp;$form, &amp;$form_state, $field, $instance, $langcode, $items, $delta, $element) {
   etc.
   etc.
global $testvar;
$testvar = $array = array(
    "foo" =&gt; "bar",
    "bar" =&gt; "foo",
    );
}

function find_feed_field_presave($entity_type, $entity, $field, $instance, $langcode, &amp;$items) {
   global $testvar;
   dpm ($tesvar);  // result = NULL
   etc.
   etc.
}
This will never work - global variables only exist in the context of a single page request. Since the form build and presave happen in different requests, you can't use globals in the way you're trying to.

Use a session var instead, that will persist