It's due to parameters in the constructor
public function __construct(){}
replace
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, AccountInterface $current_user){}
with
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, LoggerInterface $logger, AccountInterface $current_user = NULL) {}
The changes are: LoggerInterface $logger
and AccountInterface $current_user = NULL
in the constructor.
During Drupal upgrade to 9, you will see a file InlineBlock.php.rej (core/modules/layout_builder/src/Plugin/Block/InlineBlock.php.rej) which provides detail to fix the issue.
JFI: I did the change directly to the InlineBlock.php, please suggest if there is an alternative way to patch it.
InlineBlock.php.rej file contains:
***************
*** 81,90 ****
* The entity type manager service.
* @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository
* The entity display repository.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, AccountInterface $current_user = NULL) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
--- 89,100 ----
* The entity type manager service.
* @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository
* The entity display repository.
+ * @param \Psr\Log\LoggerInterface $logger
+ * A logger instance.
* @param \Drupal\Core\Session\AccountInterface $current_user
* The current user.
*/
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, LoggerInterface $logger, AccountInterface $current_user = NULL) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
***************
*** 98,103 ****
$current_user = \Drupal::currentUser();
}
$this->currentUser = $current_user;
}
/**
--- 108,118 ----
$current_user = \Drupal::currentUser();
}
$this->currentUser = $current_user;
+ if (!$logger) {
+ @trigger_error('The logger service must be passed to InlineBlock::__construct(). It was added in drupal:9.2.0 and will be required before drupal:10.0.0.', E_USER_DEPRECATED);
+ $logger = \Drupal::service('logger.channel.layout_builder');
+ }
+ $this->logger = $logger;
}
/**