From 3021797305f5d2e7806eca553ca27cb56b3012e9 Mon Sep 17 00:00:00 2001
From: Romanos Dodopoulos <romanos.dodopoulos@cern.ch>
Date: Wed, 28 Feb 2018 11:52:06 +0100
Subject: [PATCH] Do not hide Drupal core from the update manager

We wanted to hide Drupal core from the update manager so people are not
notified when there is a Drupal core security update. This works well if
there is no local module. It just prints the following warning:

```
Warning: Invalid argument supplied for foreach() in
template_preprocess_update_report() (line 44 of
/drupal/8.4.5/core/modules/update/update.report.inc) #0
/drupal/8.4.5/core/includes/boot
```

This is the case when using, for instance, the
update_notifications_disable module which the only thing that it does
is:
```
function update_notifications_disable_update_projects_alter(&$projects)
{
  $projects = [];
}
```

Unfortunately, by only disabling centrally managed modules, when there
is a local module installed there is the following error:

```
Notice: Undefined index: drupal in update_requirements() (line 37 of
/drupal/8.4.5/core/modules/update/update.install) #0
/drupal/8.4.5/core/includes/bootstrap.inc(566): _drupal_error_hand
```

That error causes the email notification to be sent. For D8 it does not
state that there is a problem with checking the available updates like
it does for D7. So users get emails that there are available updates
although there is none.

We need to revert that unset until we find a better solution.
---
 cern_integration.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cern_integration.module b/cern_integration.module
index 1b27eba..0ef5210 100644
--- a/cern_integration.module
+++ b/cern_integration.module
@@ -11,7 +11,7 @@ function cern_integration_form_alter(&$form, \Drupal\Core\Form\FormStateInterfac
 function cern_integration_update_projects_alter(&$projects)
 {
     // Remove Drupal core.
-    unset($projects['drupal']);
+    // unset($projects['drupal']);
 
     // Remove all centrally managed modules.
     foreach (system_get_info("module") as $module_name => $module) {
-- 
GitLab