You are here

function entity_ui_validate_machine_name in Entity API 7

Validation callback for machine names of exportables.

We don't allow numeric machine names, as entity_load() treats them as the numeric identifier and they are easily confused with ids in general.

File

includes/entity.ui.inc, line 752
Provides a controller for building an entity overview form.

Code

function entity_ui_validate_machine_name($element, &$form_state) {
  if (is_numeric($element['#value'])) {
    form_error($element, t('Machine-readable names must not consist of numbers only.'));
  }
}