Mercurial > hg > isophonics-drupal-site
view core/modules/hal/hal.install @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children | 1fec387a4317 |
line wrap: on
line source
<?php /** * @file * Update functions for the HAL module. */ /** * Move 'link_domain' from 'rest.settings' to 'hal.settings'. */ function hal_update_8301() { $config_factory = \Drupal::configFactory(); // The default value for the 'link_domain' key is `~`, which is the YAML // equivalent of PHP's `NULL`. If the REST module is not installed, this is // the value we will store in 'hal.settings'. $link_domain = NULL; // But if the REST module was installed, we migrate its 'link_domain' setting, // because we are actually moving that setting from 'rest.settings' to // 'hal.settings'. $rest_settings = $config_factory->getEditable('rest.settings'); if ($rest_settings->getRawData() !== []) { $link_domain = $rest_settings->get('link_domain'); // Remove the 'link_domain' setting from 'rest.settings'. $rest_settings->clear('link_domain') ->save(); } $hal_settings = $config_factory->getEditable('hal.settings'); $hal_settings->set('link_domain', $link_domain); $hal_settings->save(TRUE); }