function ViewsConfigUpdater::processBlockContentListingEmptyUpdate

Processes area plugins and removes block_content_listing_empty.

Parameters

\Drupal\views\ViewEntityInterface $view: The view entity.

Return value

bool Whether the handler was updated.

2 calls to ViewsConfigUpdater::processBlockContentListingEmptyUpdate()
ViewsConfigUpdater::needsBlockContentListingEmptyUpdate in core/modules/views/src/ViewsConfigUpdater.php
Checks if 'block_content_listing_empty' needs to be removed.
ViewsConfigUpdater::updateAll in core/modules/views/src/ViewsConfigUpdater.php
Performs all required updates.

File

core/modules/views/src/ViewsConfigUpdater.php, line 372

Class

ViewsConfigUpdater
Provides a BC layer for modules providing old configurations.

Namespace

Drupal\views

Code

public function processBlockContentListingEmptyUpdate(ViewEntityInterface $view) : bool {
  $changed = FALSE;
  $displays = $view->get('display');
  foreach ($displays as &$display) {
    foreach ($display['display_options']['empty'] ?? [] as $id => $emptyOptions) {
      if ($emptyOptions['id'] === 'block_content_listing_empty') {
        $changed = TRUE;
        unset($display['display_options']['empty'][$id]);
      }
    }
  }
  if ($changed) {
    $view->set('display', $displays);
  }
  $deprecations_triggered =& $this->triggeredDeprecations['block_content_listing_empty'][$view->id()];
  if ($this->deprecationsEnabled && $changed && !$deprecations_triggered) {
    $deprecations_triggered = TRUE;
    @trigger_error(sprintf('The update to remove the block_content_listing_empty plugin from view "%s" is deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Profile, module and theme provided configuration should be updated. See https://www.drupal.org/node/3336219', $view->id()), E_USER_DEPRECATED);
  }
  return $changed;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.