How to disable multiple cardinality for a custom field I've made a custom module that creates a new field type. Any single-cardinality instances of this field work fine.  However, multi-cardinality instances of this field will not pass my #element_validate function; see https://drupal.stackexchange.com/questions/86745/element-validate-function-is-called-on-sub-elements-of-a-form-form-items-are-c

Since I don't need this field to ever be multi-value, I want to disable multiple values for this field entirely.

Is there a way to do this?
Just alter the cardinality selection with this hook and provide only one value:

function &lt;my_module&gt;_form_field_ui_field_edit_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form['#field']['type'] == '&lt;my_field_type&gt;') {
    $form['field']['cardinality']['#options'] = array(1);
  }
}