From d82b83eebb558534de3cb04277dd0b9d8d00fdf8 Mon Sep 17 00:00:00 2001 From: David Valdez Date: Fri, 19 Jul 2019 14:32:08 -0500 Subject: [PATCH] Migrate the image styles to preserv the images. Also, it was added the following things in the settings file to allow the inline images: $config['image.settings']['suppress_itok_output'] = TRUE; $config['image.settings']['allow_insecure_derivatives'] = TRUE; --- .../migrations/upgrade_d7_image_styles.yml | 37 +++++++++++++++++++ web/sites/default/settings.ddev.php | 25 +++++++++---- web/sites/default/settings.php | 24 ------------ 3 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 web/modules/custom/geo_upgrade/migrations/upgrade_d7_image_styles.yml diff --git a/web/modules/custom/geo_upgrade/migrations/upgrade_d7_image_styles.yml b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_image_styles.yml new file mode 100644 index 0000000..0017a21 --- /dev/null +++ b/web/modules/custom/geo_upgrade/migrations/upgrade_d7_image_styles.yml @@ -0,0 +1,37 @@ +uuid: 477a3fef-10c8-43e9-8e89-707878735663 +langcode: en +status: true +dependencies: { } +id: upgrade_d7_image_styles +class: Drupal\migrate\Plugin\Migration +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - 'Drupal 7' + - Configuration +migration_group: migrate_drupal_7 +label: 'Image styles' +source: + plugin: d7_image_styles +process: + name: + - + plugin: get + source: name + label: + - + plugin: get + source: label + effects: + - + plugin: sub_process + source: effects + process: + id: name + weight: weight + data: data +destination: + plugin: 'entity:image_style' +migration_dependencies: + required: { } + optional: { } diff --git a/web/sites/default/settings.ddev.php b/web/sites/default/settings.ddev.php index ac9dc6d..4dbfa77 100644 --- a/web/sites/default/settings.ddev.php +++ b/web/sites/default/settings.ddev.php @@ -1,12 +1,5 @@ "", ); +$databases['drupal7']['default'] = [ + 'database' => "drupal7", + 'username' => "db", + 'password' => "db", + 'host' => $host, + 'driver' => "mysql", + 'port' => $port, + 'prefix' => "", +]; + ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); ini_set('session.gc_maxlifetime', 200000); @@ -50,3 +53,11 @@ $settings['trusted_host_patterns'] = ['.*']; // better performance. $settings['class_loader_auto_detect'] = FALSE; +$config['image.settings']['suppress_itok_output'] = TRUE; +$config['image.settings']['allow_insecure_derivatives'] = TRUE; + + +// This specifies the default configuration sync directory. +if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) { + $config_directories[CONFIG_SYNC_DIRECTORY] = '../config/sync'; +} diff --git a/web/sites/default/settings.php b/web/sites/default/settings.php index 341bf32..57b9c14 100644 --- a/web/sites/default/settings.php +++ b/web/sites/default/settings.php @@ -4,27 +4,3 @@ if (file_exists($app_root . '/' . $site_path . '/settings.ddev.php')) { include $app_root . '/' . $site_path . '/settings.ddev.php'; } -$host = "db"; -$port = 3306; - -// If DDEV_PHP_VERSION is not set, it means we're running on the host, -// so use the host-side bind port on docker IP -if (empty(getenv('DDEV_PHP_VERSION'))) { - $host = "127.0.0.1"; - $port = 32768; -} - -$databases['drupal7']['default'] = [ - 'database' => "drupal7", - 'username' => "db", - 'password' => "db", - 'host' => $host, - 'driver' => "mysql", - 'port' => $port, - 'prefix' => "", -]; - -// This specifies the default configuration sync directory. -if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) { - $config_directories[CONFIG_SYNC_DIRECTORY] = '../config/sync'; -}