diff --git a/core/modules/media/media.install b/core/modules/media/media.install index ef95793b9d8fe5c12c1647e7c80165edc8649f76..7698b18ebf514edf7b36f895a2f432ab45426748 100644 --- a/core/modules/media/media.install +++ b/core/modules/media/media.install @@ -68,6 +68,21 @@ function media_requirements($phase) { $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 Media Entity 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; }