Commit 3917a3f8 authored by catch's avatar catch
Browse files

Issue #3096676 by quietone, Wim Leers, mikelutz, heddn, gabesullice, alexpott:...

Issue #3096676 by quietone, Wim Leers, mikelutz, heddn, gabesullice, alexpott: system_maintenance migrations uses incorrect maintenance mode variable in Drupal 7 migrations

(cherry picked from commit c494a61e)
parent 40af1480
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -58608,10 +58608,6 @@
  'name' => 'site_name',
  'value' => 's:13:"The Site Name";',
))
->values(array(
  'name' => 'site_offline_message',
  'value' => 's:42:"This is a custom maintenance mode message.";',
))
->values(array(
  'name' => 'site_slogan',
  'value' => 's:10:"The Slogan";',
+11 −1
Original line number Diff line number Diff line
@@ -7,10 +7,20 @@ migration_tags:
source:
  plugin: variable
  variables:
    - maintenance_mode_message
    - site_offline_message
  source_module: system
process:
  message: site_offline_message
  message:
  -
    plugin: callback
    callable: array_filter
    source:
      - maintenance_mode_message
      - site_offline_message
  -
    plugin: callback
    callable: current
destination:
  plugin: config
  config_name: system.maintenance
+12 −0
Original line number Diff line number Diff line
@@ -128,6 +128,18 @@ class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase {
  protected function setUp(): void {
    parent::setUp();

    // The system_maintenance migration gets both the Drupal 6 and Drupal 7
    // site maintenance message. Add a row with the Drupal 6 version of the
    // maintenance message to confirm that the Drupal 7 variable is selected in
    // the migration.
    // See https://www.drupal.org/project/drupal/issues/3096676
    $this->sourceDatabase->insert('variable')
      ->fields([
        'name' => 'site_offline_message',
        'value' => 's:16:"Drupal 6 message";',
      ])
      ->execute();

    $migrations = [
      'd7_system_authorize',
      'd7_system_cron',