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

Issue #3151759: Enable Simple Workflow for all content types on new Varbase...

Issue #3151759: Enable Simple Workflow for all content types on new Varbase Installations  by Varbase Workflow and update Automated Functional Acceptance Testing
parent 35377bd2
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ So that will ease the work of adding internal links in the rich text editor fiel
When I select "full_html" from "Text format"
And I fill in "Linking to internal content #1 title" for "Title"
And I fill in the rich text editor field "Body" with "Linking to internal content #1 body"
And I select "published" from "edit-moderation-state-0-state"
And I press "Save"
And I wait
And I should see "Linking to internal content #1 body"
......@@ -36,4 +37,4 @@ So that will ease the work of adding internal links in the rich text editor fiel
And I wait for AJAX to finish
Then I should see "Linking to internal content #1 title"
When I click "Linking to internal content #1 title" in the "ul" element with the "class" attribute set to "ui-autocomplete"
Then I should not see "Linking to internal content #1 title"
Then I should not see "Linking to internal content #1 title"
\ No newline at end of file
......@@ -43,6 +43,30 @@ function varbase_install() {
// Set front page to "node".
\Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save(TRUE);
// Enable Simple Workflow for all content types on new Varbase Installations.
if (\Drupal::moduleHandler()->moduleExists('varbase_workflow')) {
$node_types = \Drupal\node\Entity\NodeType::loadMultiple();
foreach ($node_types as $node_type) {
$config_factory = \Drupal::service('config.factory');
$workflow_type_settings = $config_factory->getEditable('workflows.workflow.varbase_simple_workflow')->get('type_settings');
if (isset($workflow_type_settings['entity_types'])) {
if (isset($workflow_type_settings['entity_types']['node'])) {
if (!in_array($node_type, $workflow_type_settings['entity_types']['node'])) {
$workflow_type_settings['entity_types']['node'][] = $node_type->id();
}
}
else {
$workflow_type_settings['entity_types']['node'] = [];
$workflow_type_settings['entity_types']['node'][] = $node_type->id();
}
$config_factory->getEditable('workflows.workflow.varbase_simple_workflow')->set('type_settings', $workflow_type_settings)->save(TRUE);
}
}
}
// 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::classResolver()
......
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