Skip to content
Snippets Groups Projects
Commit d44de2ce authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #2926736 : Changed location of config settings file for [Varbase...

Issue #2926736 : Changed location of config settings file for [Varbase bootstrap paragraphs] from the [install] to the [optional] directory.
parent d40cf3a0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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);
}
}
/**
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment