0

[Resolved]: Drupal 8 block content disappeared after update Drupal core to 8.5.x

Drupal 8 block content disappeared after update Drupal core to 8.5.x

Overview.

For same reasons, after make update the Drupal core from 8.4.x to 8.5.x version, some of custom blocks will be disapeared for anonymous users.

The cause of problem is, block status field has been set to NULL in database and there is no option to change it in block edit/settings page.

Solutions.

You can follow the step below to resolve the issue. There is no PHP error and no prolem with the user permissions.

  • Install module Devel
  • Go to http://yoursite/devel/php
  • Enter PHP code below and execute it.

    $query = \Drupal::entityQuery('block_content');
    //Select blocks with status field is NULL
    $query->notExists('status');
    $block_ids = $query->execute();
    foreach($block_ids as $block_id){
      $block = \Drupal\block_content\Entity\BlockContent::load($block_id);
        //Update block status
      $block->set('status', 1)->save();
    };
    
  • Flush Drupal Cache.
  • Done

Comments

aadilkhan9409

The IT sector has developed the best ever game for the enjoyment and you all will feel with full of enjoyment bloons tower defense 5 online this maximum played game many person can play it same on time to enjoyed it.

kaicoe

The content of the resolved site is removed for the convenience of the newcomers of the community. The aspects of the society and https://www.resumeshelpservice.com/resumesplanet-com-review/ have been punctuated for the use of the tings for the candidates. The solved content is precious for the beginners of the community.