Commit b05897e9 authored by xjm's avatar xjm
Browse files

Issue #2896427 by marcoscano, Wim Leers, xjm, Berdir, slashrsm: Prevent...

Issue #2896427 by marcoscano, Wim Leers, xjm, Berdir, slashrsm: Prevent enabling the "media" module if "media_entity" contrib 1.x is already enabled
parent 7d1c57aa
...@@ -68,6 +68,21 @@ function media_requirements($phase) { ...@@ -68,6 +68,21 @@ function media_requirements($phase) {
$requirements['media']['severity'] = REQUIREMENT_ERROR; $requirements['media']['severity'] = REQUIREMENT_ERROR;
} }
} }
// Prevent installation if the 1.x branch of the contrib module is enabled.
if (\Drupal::moduleHandler()->moduleExists('media_entity')) {
$info = system_get_info('module', 'media_entity');
if (version_compare($info['version'], '8.x-2') < 0) {
$requirements['media_module_incompatibility'] = [
'title' => t('Media'),
'description' => t('The Media module is not compatible with contrib <a href=":url">Media Entity</a> 1.x branch. Please check the 2.x branch of that module for an upgrade path.', [
':url' => 'https://drupal.org/project/media_entity',
]),
'severity' => REQUIREMENT_ERROR,
];
}
} }
}
return $requirements; return $requirements;
} }
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