function field_valid_language


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 field_valid_language($langcode, $default = TRUE)
cle7 field_valid_language($langcode, $default = TRUE)
elmsmedia7 field_valid_language($langcode, $default = TRUE)
icor7 field_valid_language($langcode, $default = TRUE)
meedjum_blog7 field_valid_language($langcode, $default = TRUE)
mooc7 field_valid_language($langcode, $default = TRUE)

Ensures that a given language code is valid.

Checks whether the given language is one of the enabled languages. Otherwise, it returns the current, global language; or the site's default language, if the additional parameter $default is TRUE.


$langcode: The language code to validate.

$default: Whether to return the default language code or the current language code in case $langcode is invalid.

Return value

A valid language code.

Related topics

7 calls to field_valid_language()
ctools_entity_field_value_ctools_access_settings in sites/all/modules/ulmus/ctools/plugins/access/
Settings form for the 'by entity_bundle' access plugin
ctools_entity_field_value_ctools_access_settings_submit in sites/all/modules/ulmus/ctools/plugins/access/
Compress the entity bundles allowed to the minimum.
editableviews_entity_form in sites/all/modules/ulmus/editableviews/editableviews.module
Form builder for an editable view.
editableviews_handler_field_field_edit::edit_form in sites/all/modules/ulmus/editableviews/handlers/
Add the form element for this handler's field to the form.
entity_metadata_field_get_language in sites/all/modules/ulmus/entity/modules/
Helper for determining the field language to be used.

... See full list


modules/field/, line 228
Functions implementing Field API multilingual support.


function field_valid_language($langcode, $default = TRUE) {
  $enabled_languages = field_content_languages();
  if (in_array($langcode, $enabled_languages)) {
    return $langcode;
  global $language_content;
  return $default ? language_default('language') : $language_content->language;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.