Skip to content
Snippets Groups Projects
Commit 9e4858c4 authored by Ilias Dimopoulos's avatar Ilias Dimopoulos
Browse files

Merge branch 'ISAICP-7723' into 'master'

ISAICP-7723: Attempt to fix the field by re-installing it.

See merge request !107
parents 1cab288f d29677ab
No related branches found
No related tags found
1 merge request!107ISAICP-7723: Attempt to fix the field by re-installing it.
......@@ -105,5 +105,25 @@ function joinup_core_deploy_109201(): string {
function joinup_core_deploy_109202(): string {
$entityTypeManager = \Drupal::entityTypeManager();
$entityTypeManager->clearCachedDefinitions();
return 'Entity definition cache cleared.';
// Install the field_discussion_logo field to the discussion node bundle.
try {
$fieldStorage = $entityTypeManager->getStorage('field_storage_config')->load('node.field_discussion_logo');
$fieldStorage->setTranslatable(TRUE);
$fieldStorage->save();
}
catch (\Exception $e) {
return 'Could not install discussion logo field storage.';
}
try {
$field = $entityTypeManager->getStorage('field_config')->load('node.discussion.field_discussion_logo');
$field->setTranslatable(TRUE);
$field->save();
}
catch (\Exception $e) {
return 'Could not install discussion logo field instance.';
}
return 'Entity definition cache cleared. Discussion logo installed.';
}
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