Commit d5671222 authored by catch's avatar catch

Issue #2991902 by amateescu: Fix block_content_update_8400() and...

Issue #2991902 by amateescu: Fix block_content_update_8400() and taxonomy_update_8601() to not rely on the module handler anymore

(cherry picked from commit df1de903)
parent 49c3ed28
......@@ -8,22 +8,6 @@
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Implements hook_update_dependencies().
*/
function block_content_update_dependencies() {
// The update function that adds the status field must run after
// content_translation_update_8400() which fixes NULL values for the
// 'content_translation_status' field.
if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
$dependencies['block_content'][8400] = [
'content_translation' => 8400,
];
return $dependencies;
}
}
/**
* Add 'revision_translation_affected' field to 'block_content' entities.
*/
......@@ -110,7 +94,7 @@ function block_content_update_8400() {
->setTranslatable(TRUE)
->setDefaultValue(TRUE);
$has_content_translation_status_field = \Drupal::moduleHandler()->moduleExists('content_translation') && $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content');
$has_content_translation_status_field = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content');
if ($has_content_translation_status_field) {
$status->setInitialValueFromField('content_translation_status', TRUE);
}
......
......@@ -159,7 +159,7 @@ function taxonomy_update_8601() {
->setTranslatable(TRUE)
->setDefaultValue(TRUE);
$has_content_translation_status_field = \Drupal::moduleHandler()->moduleExists('content_translation') && $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'taxonomy_term');
$has_content_translation_status_field = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'taxonomy_term');
if ($has_content_translation_status_field) {
$status->setInitialValueFromField('content_translation_status', TRUE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment