Commit a24390f2 authored by webchick's avatar webchick

Issue #1757504 by Maxtorete, boran: Fixed Regression: language field is not...

Issue #1757504 by Maxtorete, boran: Fixed Regression: language field is not visible on manage display.
parent c63f99d6
......@@ -679,21 +679,19 @@ function node_field_extra_fields() {
// bundle has multilingual support.
// Visibility of the ordering of the language selector is the same as on the
// node/add form, i.e. node_type_language_hidden_TYPE variable.
if ($module_language_enabled) {
if (!variable_get('node_type_language_hidden_' . $bundle->type, TRUE)) {
$extra['node'][$bundle->type]['form']['language'] = array(
'label' => t('Language'),
'description' => $description,
'weight' => 0,
);
}
$extra['node'][$bundle->type]['display']['language'] = array(
if ($module_language_enabled && !variable_get('node_type_language_hidden_' . $bundle->type, TRUE)) {
$extra['node'][$bundle->type]['form']['language'] = array(
'label' => t('Language'),
'description' => $description,
'weight' => 0,
'visible' => FALSE,
);
}
$extra['node'][$bundle->type]['display']['language'] = array(
'label' => t('Language'),
'description' => $description,
'weight' => 0,
'visible' => FALSE,
);
}
return $extra;
......@@ -1172,18 +1170,6 @@ function node_view(Node $node, $view_mode = 'full', $langcode = NULL) {
// Populate $node->content with a render() array.
node_build_content($node, $view_mode, $langcode);
// Add language text element on node view if language module is enabled.
if (module_exists('language')) {
$node->content['language'] = array(
'#type' => 'item',
'#title' => t('Language'),
'#markup' => language_name($langcode),
'#weight' => 0,
'#prefix' => '<div id="field-language-display">',
'#suffix' => '</div>'
);
}
$build = $node->content;
// We don't need duplicate rendering info in node->content.
unset($node->content);
......@@ -1286,6 +1272,16 @@ function node_build_content(Node $node, $view_mode = 'full', $langcode = NULL) {
'#attributes' => array('class' => array('links', 'inline')),
);
// Add Language field text element to node render array.
$node->content['language'] = array(
'#type' => 'item',
'#title' => t('Language'),
'#markup' => language_name($langcode),
'#weight' => 0,
'#prefix' => '<div id="field-language-display">',
'#suffix' => '</div>'
);
// Allow modules to make their own additions to the node.
module_invoke_all('node_view', $node, $view_mode, $langcode);
module_invoke_all('entity_view', $node, $view_mode, $langcode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment