diff --git a/cern_integration.info b/cern_integration.info index 1103c613d560e1b4fa98514ff5406bc666e24918..3abc8f622b0fc9052af488ef368ea13056ae6247 100644 --- a/cern_integration.info +++ b/cern_integration.info @@ -1,7 +1,7 @@ name = CERN Integration package = CERN description = Provides CERN site integration for Drupal. -version = "7.X-1.8" +version = "7.X-1.9" core = 7.x dependencies[] = shib_auth @@ -9,6 +9,6 @@ files[] = cern_integration.module files[] = cern_integration.install project = "cern_integration" -datestamp = "1455099515" +datestamp = "1493373769" required = TRUE diff --git a/cern_integration.module b/cern_integration.module index 179b6bc407708eb359fcd11c4a53de914bdf2386..7cee31a226e70fbcdf00110682aac8e1b45246ec 100644 --- a/cern_integration.module +++ b/cern_integration.module @@ -555,3 +555,26 @@ function cern_integration_form_domain_301_redirect_admin_form_alter (&$form, &$ } +/** + * Implements hook_update_projects_alter(). + * Remove all centrally managed modules and themes from the Update manager. + */ +function cern_integration_update_projects_alter(&$projects) { + // Remove all centrally managed modules. + foreach (module_list() as $module) { + if (preg_match('/^sites\/all\/modules\//', drupal_get_path('module', $module))) { + // This works only if the module name matches the project name. + unset($projects[$module]); + } + } + // Remove all centrally managed themes. + foreach (list_themes() as $theme_obj){ + // Check if there is a project for that theme. + // This is normally true but not always. + if (isset($theme_obj->info['project'])) { + if (preg_match('/^sites\/all\/themes\//', $theme_obj->filename)) { + unset($projects[$theme_obj->info['project']]); + } + } + } +}