diff --git a/diff.install b/diff.install index d29d97d..556fc82 100644 --- a/diff.install +++ b/diff.install @@ -133,3 +133,12 @@ function diff_update_8007() { $config->set('general_settings.visual_inline_theme', 'standard'); $config->save(); } + +/** + * Update settings, renamed 'standard' to 'default'. + */ +function diff_update_8008() { + $config = \Drupal::configFactory()->getEditable('diff.settings'); + $config->set('general_settings.visual_inline_theme', 'default'); + $config->save(); +} diff --git a/src/Form/GeneralSettingsForm.php b/src/Form/GeneralSettingsForm.php index 9227dda..0aadbd1 100644 --- a/src/Form/GeneralSettingsForm.php +++ b/src/Form/GeneralSettingsForm.php @@ -175,10 +175,10 @@ class GeneralSettingsForm extends ConfigFormBase { '#type' => 'select', '#title' => $this->t('Theme'), '#options' => [ - 'standard' => $this->t('Standard'), + 'default' => $this->t('Default'), 'admin' => $this->t('Admin'), ], - '#description' => $this->t('Use Standard to display the comparison as %default theme, or Admin as %admin theme.', [ + '#description' => $this->t('Use Default to display the comparison as %default theme, or Admin as %admin theme.', [ '%default' => $default_theme_name, '%admin' => $admin_theme_name, ]), diff --git a/src/VisualDiffThemeNegotiator.php b/src/VisualDiffThemeNegotiator.php index 54216c8..7fa4534 100644 --- a/src/VisualDiffThemeNegotiator.php +++ b/src/VisualDiffThemeNegotiator.php @@ -18,7 +18,7 @@ class VisualDiffThemeNegotiator extends AdminNegotiator { public function applies(RouteMatchInterface $routeMatch) { if ($routeMatch->getParameter('filter') === 'visual_inline') { if ($this->isDiffRoute($routeMatch)) { - if ($this->configFactory->get('diff.settings')->get('general_settings.visual_inline_theme') === 'standard') { + if ($this->configFactory->get('diff.settings')->get('general_settings.visual_inline_theme') === 'default') { return TRUE; } } diff --git a/tests/src/Unit/VisualDiffThemeNegotiatorTest.php b/tests/src/Unit/VisualDiffThemeNegotiatorTest.php index 600768d..87d4da0 100644 --- a/tests/src/Unit/VisualDiffThemeNegotiatorTest.php +++ b/tests/src/Unit/VisualDiffThemeNegotiatorTest.php @@ -85,7 +85,7 @@ class VisualDiffThemeNegotiatorTest extends UnitTestCase { $diff_config = $this->prophesize(ImmutableConfig::class); $this->configFactory->get('diff.settings') ->willReturn($diff_config->reveal()); - $diff_config->get('general_settings.visual_inline_theme')->willReturn('standard'); + $diff_config->get('general_settings.visual_inline_theme')->willReturn('default'); \Drupal::setContainer($container->reveal()); // Check if applies function returns true.