Created
July 17, 2014 16:20
-
-
Save yannickoo/835f1eff883977eab520 to your computer and use it in GitHub Desktop.
Extends Drupal's field cardinality select list 20 values.
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
<?php | |
/** | |
* Implements hook_form_alter(). | |
*/ | |
function mymmodule_form_alter(&$form, $form_state, $form_id) { | |
if ($form_id == 'field_ui_field_edit_form') { | |
$form['field']['cardinality']['#options'] = array('-1' => t('Unlimited')) + drupal_map_assoc(range(1, 20)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment