Loading src/LayoutBuilderBlockDeleteBatch.php +26 −5 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { protected $layoutBuilderBlockDeleteManager; /** * Constructs a new SanitizerForm object. * Constructs a new LayoutBuilderBlockDeleteBatch object. */ public function __construct(LayoutBuilderBlockDeleteManager $layout_builder_block_delete_manager) { $this->layoutBuilderBlockDeleteManager = $layout_builder_block_delete_manager; } /** * Create method. * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( Loading @@ -38,6 +38,11 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Kick off batch process to delete blocks on all nodes for content types. * * @param array $content_types * The content types. * @param string|null $block_type * The block type. */ public function batchStart(array $content_types, string $block_type = NULL) { $nodes = []; Loading Loading @@ -73,8 +78,14 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Load nodes in batch process progressively to delete all blocks. * * @param array $data * Additional parameters specific to the batch. These are specified in the * array passed to batch_set(). * @param array $context * The batch context array, passed by reference. */ public static function batchDeleteAllBlocks(array $data, &$context) { public static function batchDeleteAllBlocks(array $data, array &$context) { $nids = $data['nids']; if (empty($context['sandbox'])) { Loading Loading @@ -129,10 +140,20 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Callback for batch processing completed. * * @param bool $success * A boolean indicating whether the batch has completed successfully. * @param array $results * The value set in $context['results'] by callback_batch_operation(). * @param array $operations * If $success is FALSE, contains the operations that remained unprocessed. * @param string $elapsed * A string representing the elapsed time for the batch process, e.g., * '1 min 30 secs'. */ public static function batchCompleted($success, $results, $operations) { public static function batchCompleted(bool $success, array $results, array $operations, string $elapsed) { $messenger = \Drupal::messenger(); if ($success == TRUE) { if ($success) { $messenger->addMessage(t('@count nodes were processed.', [ '@count' => count($results), ])); Loading src/LayoutBuilderBlockDeleteManager.php +16 −1 Original line number Diff line number Diff line Loading @@ -84,6 +84,16 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { /** * Constructs a new LayoutBuilderBlockSanitizerManager object. * * @param \Drupal\block_content\BlockContentUuidLookup $block_content_uuid_lookup * The block content uuid lookup. * @param \Drupal\layout_builder\SectionStorage\SectionStorageManager $plugin_manager_layout_builder_section_storage * The plugin manager layout builder section storage. * @param \Drupal\layout_builder\LayoutTempstoreRepository $layout_builder_tempstore_repository * The layout builder tempstore repository. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Messenger\MessengerInterface $messenger * The messenger. * @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher. * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory Loading @@ -103,7 +113,7 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { } /** * Create method. * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( Loading Loading @@ -189,6 +199,11 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { /** * Delete all blocks for a node. * * @param int $nid * The node ID. * @param string|null $block_type * The block type. */ public function deleteBlocks(int $nid, string $block_type = NULL) { try { Loading src/Event/OverrideNodesForContentType.php +1 −1 File changed.Contains only whitespace changes. Show changes Loading
src/LayoutBuilderBlockDeleteBatch.php +26 −5 Original line number Diff line number Diff line Loading @@ -21,14 +21,14 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { protected $layoutBuilderBlockDeleteManager; /** * Constructs a new SanitizerForm object. * Constructs a new LayoutBuilderBlockDeleteBatch object. */ public function __construct(LayoutBuilderBlockDeleteManager $layout_builder_block_delete_manager) { $this->layoutBuilderBlockDeleteManager = $layout_builder_block_delete_manager; } /** * Create method. * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( Loading @@ -38,6 +38,11 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Kick off batch process to delete blocks on all nodes for content types. * * @param array $content_types * The content types. * @param string|null $block_type * The block type. */ public function batchStart(array $content_types, string $block_type = NULL) { $nodes = []; Loading Loading @@ -73,8 +78,14 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Load nodes in batch process progressively to delete all blocks. * * @param array $data * Additional parameters specific to the batch. These are specified in the * array passed to batch_set(). * @param array $context * The batch context array, passed by reference. */ public static function batchDeleteAllBlocks(array $data, &$context) { public static function batchDeleteAllBlocks(array $data, array &$context) { $nids = $data['nids']; if (empty($context['sandbox'])) { Loading Loading @@ -129,10 +140,20 @@ class LayoutBuilderBlockDeleteBatch implements ContainerInjectionInterface { /** * Callback for batch processing completed. * * @param bool $success * A boolean indicating whether the batch has completed successfully. * @param array $results * The value set in $context['results'] by callback_batch_operation(). * @param array $operations * If $success is FALSE, contains the operations that remained unprocessed. * @param string $elapsed * A string representing the elapsed time for the batch process, e.g., * '1 min 30 secs'. */ public static function batchCompleted($success, $results, $operations) { public static function batchCompleted(bool $success, array $results, array $operations, string $elapsed) { $messenger = \Drupal::messenger(); if ($success == TRUE) { if ($success) { $messenger->addMessage(t('@count nodes were processed.', [ '@count' => count($results), ])); Loading
src/LayoutBuilderBlockDeleteManager.php +16 −1 Original line number Diff line number Diff line Loading @@ -84,6 +84,16 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { /** * Constructs a new LayoutBuilderBlockSanitizerManager object. * * @param \Drupal\block_content\BlockContentUuidLookup $block_content_uuid_lookup * The block content uuid lookup. * @param \Drupal\layout_builder\SectionStorage\SectionStorageManager $plugin_manager_layout_builder_section_storage * The plugin manager layout builder section storage. * @param \Drupal\layout_builder\LayoutTempstoreRepository $layout_builder_tempstore_repository * The layout builder tempstore repository. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Messenger\MessengerInterface $messenger * The messenger. * @param \Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher * The event dispatcher. * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory Loading @@ -103,7 +113,7 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { } /** * Create method. * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( Loading Loading @@ -189,6 +199,11 @@ class LayoutBuilderBlockDeleteManager implements ContainerInjectionInterface { /** * Delete all blocks for a node. * * @param int $nid * The node ID. * @param string|null $block_type * The block type. */ public function deleteBlocks(int $nid, string $block_type = NULL) { try { Loading
src/Event/OverrideNodesForContentType.php +1 −1 File changed.Contains only whitespace changes. Show changes