I have a quicktabs block of 3 blocks tabs loaded with ajax. the initial tab loads fine but clicking on any of the other tabs gives me this:

Error: Call to undefined method Drupal\Core\Entity\EntityTypeManager::loadEntityByUuid() in Drupal\quicktabs\Plugin\TabType\BlockContent->render() (line 68 of C:\www\d8dev\modules\contrib\quicktabs\src\Plugin\TabType\BlockContent.php)

Ive tried with other blocks and I get the same error every time.

Comments

loze created an issue. See original summary.

promo-il’s picture

+1 The website encountered an unexpected error. Please try again later.
PHP:7.2 D:8.9.3
Change please priority to Critical

promo-il’s picture

I place code to /quicktabs/src/Plugin/TabType/BlockContent.php from 8.x-3.0-alpha2

  public function render(array $tab) {
    $options = $tab['content'][$tab['type']]['options'];
    if (strpos($options['bid'], 'block_content') !== FALSE) {
      $parts = explode(':', $options['bid']);
/* */ 
      /*$entity_manager = \Drupal::service('entity_type.manager');
      $block = $entity_manager->loadEntityByUuid($parts[0], $parts[1]);
      $block_content = BlockContent::load($block->id());*/
/*code from 8.x-3.0-alpha2*/
      $entity_manager = \Drupal::service('entity.manager');
      $block = $entity_manager->loadEntityByUuid($parts[0], $parts[1]);
      $block_content = \Drupal\block_content\Entity\BlockContent::load($block->id());
/*<<<*/
      $render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block_content);
    }
promo-il’s picture

loze Do you use https://www.drupal.org/project/tvi on a site where there is this error?

loze’s picture

No, I am not using tvi

manojbisht_drupal’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.12 KB

Below patch fixes above issue.

shelane’s picture

StatusFileSize
new1.12 KB

shelane’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

BlondeSwan’s picture

Version: 8.x-3.x-dev » 8.x-3.0-alpha3

This error still exists on 3.0 Alpha3