Created
May 29, 2013 12:43
-
-
Save amitaibu/5670004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dummy_form_state = $form_state; | |
if (empty($form_state['rebuild'])) { | |
// Form is "fresh" (i.e. not call from field_add_more_submit()), so | |
// re-set the items-count, to show the correct amount for the mocked | |
// instance. | |
$dummy_form_state['field'][$field_name][LANGUAGE_NONE]['items_count'] = !empty($dummy_entity->{$field_name}[LANGUAGE_NONE]) ? count($dummy_entity->{$field_name}[LANGUAGE_NONE]) : 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment