Commit 2dc22ea5 authored by Nathan Dentzau's avatar Nathan Dentzau Committed by Sascha Grossenbacher
Browse files

Issue #3033976 by nathandentzau: redirect_update_8103() fails when loading YAML config

parent c8e8d6d2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@
 * Update hooks for the Redirect module.
 */

use Drupal\redirect\Entity\Redirect;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Database\Database;
use Drupal\redirect\Entity\Redirect;
use Drupal\system\Entity\Action;
use Drupal\user\Entity\Role;
use Drupal\views\Entity\View;
use Symfony\Component\Yaml\Yaml;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\FileStorage;
use Drupal\user\Entity\Role;

/**
 * Rehash redirects to account for case insensitivity.
@@ -145,7 +145,7 @@ function redirect_update_8103() {
  // Only create if the redirect view doesn't exist and views is enabled.
  if (!View::load('redirect') && \Drupal::moduleHandler()->moduleExists('views')) {
    $config_path = drupal_get_path('module', 'redirect') . '/config/install/views.view.redirect.yml';
    $data = Yaml::parse($config_path);
    $data = Yaml::parse(file_get_contents($config_path));
    \Drupal::configFactory()->getEditable('views.view.redirect')->setData($data)->save(TRUE);
    $message = 'The new redirect view has been created.';
  }