Created
June 21, 2013 09:23
-
-
Save opalsignum-snippets/5830025 to your computer and use it in GitHub Desktop.
Drupal: Change Multiple Field Values bigger than 10 and smaller unlimited
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
/** | |
* Implements hook_form_alter(). | |
*/ | |
function MODULENAME_form_alter(&$form, $form_state, $form_id) { | |
if ($form_id == 'field_ui_field_edit_form') { | |
$max_values = 20; | |
$form['field']['cardinality']['#options'] = array('-1' => t('Unlimited')) + drupal_map_assoc(range(1, $max_values)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment