Mercurial > hg > isophonics-drupal-site
view core/modules/comment/comment.post_update.php @ 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 | af1871eacc83 |
line wrap: on
line source
<?php /** * @file * Post update functions for the comment module. */ use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\InstallStorage; /** * Enable the comment admin view. */ function comment_post_update_enable_comment_admin_view() { $module_handler = \Drupal::moduleHandler(); $entity_type_manager = \Drupal::entityTypeManager(); // Save the comment delete action to config. $config_install_path = $module_handler->getModule('comment')->getPath() . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; $storage = new FileStorage($config_install_path); $entity_type_manager ->getStorage('action') ->create($storage->read('system.action.comment_delete_action')) ->save(); // Only create if the views module is enabled. if (!$module_handler->moduleExists('views')) { return; } // Save the comment admin view to config. $optional_install_path = $module_handler->getModule('comment')->getPath() . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY; $storage = new FileStorage($optional_install_path); $entity_type_manager ->getStorage('view') ->create($storage->read('views.view.comment')) ->save(); }