diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature index fb3431c1f352b2952001304ffdc39a346b37e2e0..8c800848378713c28997c7fc2de8289249ad1cfd 100644 --- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature +++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature @@ -27,6 +27,16 @@ So that the "Landing page" will show up having paragrpahs of different types Then I should see "Embed Flag Earth" #----------------------------------------------------------------------------- + @javascript @local @development @staging @production + Scenario: Check Varbase Bootstrap Paragraphs settings, and colours. + Given I am a logged in user with the "webmaster" user + When I go to "/admin/config/varbase/varbase-bootstrap-paragraphs" + And I wait + Then I should see "Varbase Bootstrap Paragraphs settings" + And I should see "Available CSS styles (classes) for Varbase Bootstrap Paragraphs" + And I press "Save configuration" + Then I should see "The configuration options have been saved." + @javascript @local @development @staging @production Scenario: Check if a user with a permission to manage "Landing page" content type can add paragraphs of type "Drupal Block" Given I am a logged in user with the "test_site_admin" user diff --git a/varbase.install b/varbase.install index 8f1cfb057e8636f3ffed97741dd305f03d24b9da..9d672248305e30a66e507b9d0f4b31b22c639dcb 100644 --- a/varbase.install +++ b/varbase.install @@ -83,7 +83,17 @@ function varbase_install() { // Entity updates to clear up any mismatched entity and/or field definitions // And Fix changes were detected in the entity type and field definitions. \Drupal::entityDefinitionUpdateManager()->applyUpdates(); - + + // Activate Varbase Bootstrap Paragraphs Settings in the active config. + if (\Drupal::moduleHandler()->moduleExists('varbase_bootstrap_paragraphs')) { + $profile_path = drupal_get_path('profile', 'varbase') . '/config/optional/'; + $config_path = $profile_path . 'varbase_bootstrap_paragraphs.settings.yml'; + $config_content = file_get_contents($config_path); + $config_data = (array) Yaml::parse($config_content); + $config_factory = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings'); + $config_factory->setData($config_data)->save(TRUE); + } + // If Varbase Tour were enabled then redirect to the homepage with activ tour. if (isset($GLOBALS['homepage_with_varbase_tour']) && $GLOBALS['homepage_with_varbase_tour'] == TRUE) { @@ -494,11 +504,15 @@ function varbase_update_8039() { * Add Color Configs to the Available styles for Varbase Bootstrap Paragraphs. */ function varbase_update_8040() { - $profile_path = drupal_get_path('profile', 'varbase') . '/config/install/'; - $config_path = $profile_path . 'varbase_bootstrap_paragraphs.settings.yml'; - $data = (array) Yaml::parse($config_path); - $config = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings'); - $config->setData($data)->save(TRUE); + // Activate Varbase Bootstrap Paragraphs Settings in the active config. + if (\Drupal::moduleHandler()->moduleExists('varbase_bootstrap_paragraphs')) { + $profile_path = drupal_get_path('profile', 'varbase') . '/config/optional/'; + $config_path = $profile_path . 'varbase_bootstrap_paragraphs.settings.yml'; + $config_content = file_get_contents($config_path); + $config_data = (array) Yaml::parse($config_content); + $config_factory = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings'); + $config_factory->setData($config_data)->save(TRUE); + } } /** diff --git a/varbase.profile b/varbase.profile index edbee8549ffda9c4e3df96125ce8fb79c27195f5..13ed6df1e098273f501834d9c348ae17da679e64 100644 --- a/varbase.profile +++ b/varbase.profile @@ -5,6 +5,7 @@ * Enables modules and site configuration for a Varbase site installation. */ +use Symfony\Component\Yaml\Yaml; use Drupal\Core\Form\FormStateInterface; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\varbase\Config\ConfigBit; @@ -453,6 +454,17 @@ function varbase_uninstall_component($uninstall_component) { * A renderable array with a redirect header. */ function varbase_after_install_finished(array &$install_state) { + + // Activate Varbase Bootstrap Paragraphs Settings in the active config. + if (\Drupal::moduleHandler()->moduleExists('varbase_bootstrap_paragraphs')) { + $profile_path = drupal_get_path('profile', 'varbase') . '/config/optional/'; + $config_path = $profile_path . 'varbase_bootstrap_paragraphs.settings.yml'; + $config_content = file_get_contents($config_path); + $config_data = (array) Yaml::parse($config_content); + $config_factory = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings'); + $config_factory->setData($config_data)->save(TRUE); + } + global $base_url; // After install direction.