Skip to content
Snippets Groups Projects
Commit 4e720e9f authored by catch's avatar catch
Browse files

Issue #2991902 by amateescu: Fix block_content_update_8400() to not rely on...

Issue #2991902 by amateescu: Fix block_content_update_8400() to not rely on the module handler anymore
parent 2a5888e9
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
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