Commit dcd1201a authored by Mathieu De Meue's avatar Mathieu De Meue
Browse files

Issue #3307768 by matdemeue: When you start a batch with no existing nodes the page just reloads

parent 4d85f483
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -147,6 +147,10 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface {
    $properties = ['type' => $content_type];
    $nodes = $this->entityTypeManager->getStorage('node')->loadByProperties($properties);

    if (empty($nodes)) {
      $this->messenger->addWarning($this->t('There are no nodes to process.'));
    }

    // Allow other modules to alter the nodes list.
    $overrideNodesForContentType = new OverrideNodesForContentType($nodes, $content_type);
    $this->eventDispatcher->dispatch($overrideNodesForContentType, OverrideNodesForContentType::EVENT_NAME);