You are here

function varbase_blog_update_9001 in Varbase Blog (Corporate Blog) 9.0.x

Issue #3222053: Fix to allow content editors to use stored selected layouts.

On the Full content display mode with layout builder.

File

./varbase_blog.install, line 78
Install, update and uninstall functions for the varbase blog module.

Code

function varbase_blog_update_9001() {
  $config_factory = \Drupal::configFactory()
    ->getEditable('core.entity_view_display.node.varbase_blog.full');
  $varbase_blog_full_data = $config_factory
    ->get();
  if (isset($varbase_blog_full_data['third_party_settings']) && isset($varbase_blog_full_data['third_party_settings']['layout_library']) && isset($varbase_blog_full_data['third_party_settings']['layout_library']['enable']) && $varbase_blog_full_data['third_party_settings']['layout_library']['enable'] == FALSE) {
    $varbase_blog_full_data['third_party_settings']['layout_library']['enable'] = TRUE;
    $config_factory
      ->setData($varbase_blog_full_data)
      ->save(TRUE);
  }
}