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

Issue #3051884: Switch to use [Varbase Entity Definition Update Manager] and...

Issue #3051884: Switch to use [Varbase Entity Definition Update Manager] and remove deprecated \Drupal::entityDefinitionUpdateManager()->applyUpdates()
parent 4c831267
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,9 @@ function varbase_install() { ...@@ -48,7 +48,9 @@ function varbase_install() {
// Entity updates to clear up any mismatched entity and/or field definitions // Entity updates to clear up any mismatched entity and/or field definitions
// And Fix changes were detected in the entity type and field definitions. // And Fix changes were detected in the entity type and field definitions.
VarbaseEntityDefinitionUpdateManager::applyUpdates(); \Drupal::classResolver()
->getInstanceFromDefinition(VarbaseEntityDefinitionUpdateManager::class)
->applyUpdates();
// If Varbase Tour were enabled then redirect to the homepage with activ tour. // If Varbase Tour were enabled then redirect to the homepage with activ tour.
if (isset($GLOBALS['homepage_with_varbase_tour']) if (isset($GLOBALS['homepage_with_varbase_tour'])
...@@ -57,7 +59,7 @@ function varbase_install() { ...@@ -57,7 +59,7 @@ function varbase_install() {
$response = new Symfony\Component\HttpFoundation\RedirectResponse($homepage_with_tour); $response = new Symfony\Component\HttpFoundation\RedirectResponse($homepage_with_tour);
$response->send(); $response->send();
exit; exit;
include_once __DIR__ . '/../../core/includes/install.core.inc'; include_once __DIR__ . '/../../core/includes/install.core.inc';
include_once __DIR__ . '/../../core/includes/install.inc'; include_once __DIR__ . '/../../core/includes/install.inc';
install_goto('?tour'); install_goto('?tour');
......
...@@ -220,8 +220,8 @@ function varbase_assemble_extra_components(array &$install_state) { ...@@ -220,8 +220,8 @@ function varbase_assemble_extra_components(array &$install_state) {
$batch['operations'][] = ['varbase_fix_entity_update', (array) TRUE]; $batch['operations'][] = ['varbase_fix_entity_update', (array) TRUE];
} }
// Uninstall list of not needed modules after the config had been loaded. // Uninstall list of not needed modules after the config had been loaded.
// To be loaded from a ConfigBit yml file. // To be loaded from a ConfigBit yml file.
$uninstall_components = ['varbase_default_content']; $uninstall_components = ['varbase_default_content'];
...@@ -229,7 +229,7 @@ function varbase_assemble_extra_components(array &$install_state) { ...@@ -229,7 +229,7 @@ function varbase_assemble_extra_components(array &$install_state) {
foreach ($uninstall_components as $uninstall_component) foreach ($uninstall_components as $uninstall_component)
$batch['operations'][] = ['varbase_uninstall_component', (array) $uninstall_component]; $batch['operations'][] = ['varbase_uninstall_component', (array) $uninstall_component];
} }
return $batch; return $batch;
} }
...@@ -398,7 +398,9 @@ function varbase_configure_language_and_fetch_traslation($language_code) { ...@@ -398,7 +398,9 @@ function varbase_configure_language_and_fetch_traslation($language_code) {
*/ */
function varbase_fix_entity_update($entity_update) { function varbase_fix_entity_update($entity_update) {
if ($entity_update) { if ($entity_update) {
VarbaseEntityDefinitionUpdateManager::applyUpdates(); \Drupal::classResolver()
->getInstanceFromDefinition(VarbaseEntityDefinitionUpdateManager::class)
->applyUpdates();
} }
} }
...@@ -438,7 +440,7 @@ function varbase_uninstall_component($uninstall_component) { ...@@ -438,7 +440,7 @@ function varbase_uninstall_component($uninstall_component) {
* A renderable array with a redirect header. * A renderable array with a redirect header.
*/ */
function varbase_after_install_finished(array &$install_state) { function varbase_after_install_finished(array &$install_state) {
// Activate Varbase Bootstrap Paragraphs Settings in the active config. // Activate Varbase Bootstrap Paragraphs Settings in the active config.
if (\Drupal::moduleHandler()->moduleExists('varbase_bootstrap_paragraphs')) { if (\Drupal::moduleHandler()->moduleExists('varbase_bootstrap_paragraphs')) {
$profile_path = drupal_get_path('profile', 'varbase') . '/config/optional/'; $profile_path = drupal_get_path('profile', 'varbase') . '/config/optional/';
...@@ -448,7 +450,7 @@ function varbase_after_install_finished(array &$install_state) { ...@@ -448,7 +450,7 @@ function varbase_after_install_finished(array &$install_state) {
$config_factory = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings'); $config_factory = \Drupal::configFactory()->getEditable('varbase_bootstrap_paragraphs.settings');
$config_factory->setData($config_data)->save(TRUE); $config_factory->setData($config_data)->save(TRUE);
} }
global $base_url; global $base_url;
// After install direction. // After install direction.
......
...@@ -7,3 +7,6 @@ services: ...@@ -7,3 +7,6 @@ services:
class: '\Drupal\varbase\Config\ConfigBit' class: '\Drupal\varbase\Config\ConfigBit'
arguments: arguments:
- '@element_info' - '@element_info'
varbase.definition_update_manager:
class: '\Drupal\varbase\Entity\VarbaseEntityDefinitionUpdateManager'
arguments: ['@class_resolver', '@entity.definition_update_manager']
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