Skip to content
Snippets Groups Projects
Commit 55223337 authored by catch's avatar catch
Browse files

Issue #1834250 by plach: Hide Content Translation module until we are able to remove it.

parent 0617e701
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -3870,3 +3870,19 @@ function node_library_info() {
return $libraries;
}
/**
* Implements hook_system_info_alter().
*
* The Content Translation module is deprecated in Drupal 8 in favor of the
* Entity Translation and is planned for removal. Until an upgrade path is
* available, it will still be possible to enable it, if necessary, through the
* module API or by tweaking the system module list configuration by hand.
* Morever every D8 site where Content Translation is installed (not necessarily
* enabled) will still be able to see it as usual in the module page.
*/
function node_system_info_alter(&$info, $file, $type) {
if ($type == 'module' && $file->name == 'translation') {
$info['hidden'] = !module_exists('translation') && config('system.module.disabled')->get('translation') === NULL;
}
}
......@@ -20,16 +20,16 @@ public static function getInfo() {
}
/**
* Attempts to enable translation module without language enabled.
* Attempts to enable the Entity Translation module without Language enabled.
*/
function testEnableWithoutDependency() {
// Attempt to enable content translation without language enabled.
// Attempt to enable Entity Translation without Language enabled.
$edit = array();
$edit['modules[Core][translation][enable]'] = 'translation';
$edit['modules[Core][translation_entity][enable]'] = 'translation_entity';
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
$this->assertText(t('Some required modules must be enabled'), 'Dependency required.');
$this->assertModules(array('translation', 'locale', 'language'), FALSE);
$this->assertModules(array('translation_entity', 'language'), FALSE);
// Assert that the language tables weren't enabled.
$this->assertTableCount('language', FALSE);
......@@ -37,7 +37,7 @@ function testEnableWithoutDependency() {
$this->drupalPost(NULL, NULL, t('Continue'));
$this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
$this->assertModules(array('translation', 'language'), TRUE);
$this->assertModules(array('translation_entity', 'language'), TRUE);
// Assert that the language tables were enabled.
$this->assertTableCount('language', TRUE);
......
name = Content Translation
description = Allows content to be translated into different languages.
dependencies[] = node
dependencies[] = language
package = Core
version = VERSION
core = 8.x
; The Content Translation module is deprecated in Drupal 8.
; See node_system_info_alter().
hidden = TRUE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment