Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
varbase
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
varbase
Commits
36cedfbe
Commit
36cedfbe
authored
4 years ago
by
Rajab Natshah
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3122672
: Start a 9.0.x branch for Varbase and Varbase Project to integrate with Drupal 9
parent
2c2fb677
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configbit/default.components.varbase.bit.yml
+2
-1
2 additions, 1 deletion
configbit/default.components.varbase.bit.yml
varbase.profile
+43
-25
43 additions, 25 deletions
varbase.profile
with
45 additions
and
26 deletions
configbit/default.components.varbase.bit.yml
+
2
−
1
View file @
36cedfbe
...
...
@@ -20,7 +20,8 @@ config_bit:
-
varbase_webform
-
varbase_workflow
-
varbase_page
-
varbase_landing
-
varbase_layout_builder
-
vlplb
-
varbase_total_control
-
varbase_default_content
-
varbase_tour
...
...
This diff is collapsed.
Click to expand it.
varbase.profile
+
43
−
25
View file @
36cedfbe
...
...
@@ -13,6 +13,7 @@ use Drupal\varbase\Form\ConfigureMultilingualForm;
use
Drupal\varbase\Form\AssemblerForm
;
use
Drupal\varbase\Form\DevelopmentToolsAssemblerForm
;
use
Drupal\varbase\Entity\VarbaseEntityDefinitionUpdateManager
;
use
Drupal\node\Entity\Node
;
/**
* Implements hook_form_FORM_ID_alter() for install_configure_form().
...
...
@@ -23,7 +24,7 @@ function varbase_form_install_configure_form_alter(&$form, FormStateInterface $f
// Add a placeholder as example that one can choose an arbitrary site name.
$form
[
'site_information'
][
'site_name'
][
'#attributes'
][
'placeholder'
]
=
t
(
'My Official Site Name'
);
// Default site email noreply
@
vardot.com
.
// Default site email noreply
(at)
vardot.com.
$form
[
'site_information'
][
'site_mail'
][
'#default_value'
]
=
'noreply@vardot.com'
;
$form
[
'site_information'
][
'site_mail'
][
'#attributes'
][
'style'
]
=
'width: 25em;'
;
...
...
@@ -224,6 +225,21 @@ function varbase_assemble_extra_components(array &$install_state) {
// Uninstall list of not needed modules after the config had been loaded.
// To be loaded from a ConfigBit yml file.
$uninstall_components
=
[
'varbase_default_content'
];
if
(
isset
(
$selected_extra_features
[
'varbase_heroslider_media'
])
&&
$selected_extra_features
[
'varbase_heroslider_media'
]
==
TRUE
)
{
$batch
[
'operations'
][]
=
[
'varbase_install_component'
,
(
array
)
'enabled_varbase_heroslider_media_content'
];
$uninstall_components
[]
=
'enabled_varbase_heroslider_media_content'
;
}
else
{
$batch
[
'operations'
][]
=
[
'varbase_install_component'
,
(
array
)
'disabled_varbase_heroslider_media_content'
];
$uninstall_components
[]
=
'disabled_varbase_heroslider_media_content'
;
}
// Reset timestamp for nodes.
$node_ids
=
[
1
];
$batch
[
'operations'
][]
=
[
'varbase_reset_timestamp_for_nodes'
,
(
array
)
$node_ids
];
if
(
count
(
$uninstall_components
)
>
0
)
{
foreach
(
$uninstall_components
as
$uninstall_component
)
{
$batch
[
'operations'
][]
=
[
'varbase_uninstall_component'
,
(
array
)
$uninstall_component
];
...
...
@@ -415,6 +431,18 @@ function varbase_config_bit_for_multilingual($enable_multilingual) {
// Each module will manage its multilingual config.
}
/**
* Batch function to Install needed modules.
*
* @param string|array $install_component
* Name of the extra component.
*/
function
varbase_install_component
(
$install_component
)
{
if
(
!
\Drupal
::
moduleHandler
()
->
moduleExists
(
$install_component
))
{
\Drupal
::
service
(
'module_installer'
)
->
install
([
$install_component
],
FALSE
);
}
}
/**
* Batch function to Uninstall list of not needed modules.
*
...
...
@@ -429,6 +457,20 @@ function varbase_uninstall_component($uninstall_component) {
}
}
/**
* Batch to reset timestamp for selected nodes.
*
* @param int|array $nid
* The Node ID.
*/
function
varbase_reset_timestamp_for_nodes
(
$nid
)
{
$node
=
Node
::
load
(
$nid
);
if
(
isset
(
$node
))
{
$node
->
created
=
\Drupal
::
time
()
->
getCurrentTime
();
$node
->
save
();
}
}
/**
* Varbase after install finished.
*
...
...
@@ -458,30 +500,6 @@ function varbase_after_install_finished(array &$install_state) {
$config_factory
->
setData
(
$config_data
)
->
save
(
TRUE
);
}
// Enable Simple Workflow for all content types on new Varbase Installations.
if
(
\Drupal
::
moduleHandler
()
->
moduleExists
(
'varbase_workflow'
))
{
$node_types
=
\Drupal
::
entityTypeManager
()
->
getStorage
(
'node_type'
)
->
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment