From c1805e53643cd01bf2d4b8c940a9d56ee281a8c8 Mon Sep 17 00:00:00 2001
From: Sakthi Shanmuga Sundaram M
 <62943-sakthi_dev@users.noreply.drupalcode.org>
Date: Fri, 16 Feb 2024 08:36:25 +0000
Subject: [PATCH 1/2] Issue #3411013 by sakthi_dev, aman_lnwebworks: Problem
 with access the blocks

---
 list_inline_block.module     |   2 +-
 src/Controller/ListBlock.php | 104 +++++++++++++++++++----------------
 2 files changed, 57 insertions(+), 49 deletions(-)

diff --git a/list_inline_block.module b/list_inline_block.module
index 217b61e..4043d5b 100644
--- a/list_inline_block.module
+++ b/list_inline_block.module
@@ -27,7 +27,7 @@ function list_inline_block_help($route_name, RouteMatchInterface $route_match) {
       return $output;
 
     case 'list_inline_block.get_block':
-      $output = '<p>' . t('Blocks belong to <a href="/block-content/types">Custom block types</a>, but Inline Blocks are those added through Layout Builder.') . '</p>';
+      $output = '<p>' . t('Blocks belong to <a href="/admin/structure/block-content">Custom block types</a>, but Inline Blocks are those added through Layout Builder.') . '</p>';
       return $output;
 
   }
diff --git a/src/Controller/ListBlock.php b/src/Controller/ListBlock.php
index e9b49da..2a7e6ce 100644
--- a/src/Controller/ListBlock.php
+++ b/src/Controller/ListBlock.php
@@ -80,56 +80,64 @@ class ListBlock extends ControllerBase {
       ]);
     $result = $query->execute()->fetchAll();
 
-    $header = [
-      [
-        'data' => $this->t('Block Type'),
-        'field' => 'blockType',
-        'sort' => 'asc',
-      ],
-      'Title' => $this->t('Title'),
-      'url' => $this->t('Link'),
-    ];
-    $output = [];
-
-    // Use the PagerManager to handle pagination.
-    $pager = $this->pagerManager->createPager(count($result), 25);
-    $pager->getCurrentPage();
-    $chunks = array_chunk($result, 25);
-    $current_page_items = $chunks[$pager->getCurrentPage()];
-    $k = 0;
-    foreach ($current_page_items as $record) {
-      $block = $this->entityTypeManager->getStorage('block_content')->load($record->block_content_id);
-      $blockType = $block->type->entity->label();
-      $node = $this->entityTypeManager->getStorage('node')->load($record->layout_entity_id);
-      $link = $this->t('<a href=/@type/@id/layout>Edit</a> (@title)', [
-        '@type' => $record->layout_entity_type,
-        '@id' => $record->layout_entity_id,
-        '@title' => $node->label(),
-      ]);
-      $title = $this->t('<a href=/@type/@id>@title</a>', [
-        '@type' => $record->layout_entity_type,
-        '@id' => $record->layout_entity_id,
-        '@title' => $block->info->value,
-      ]);
-      $output[$k] = [
-        'blockType' => $blockType,
-        'Title' => $title,
-        'url' => $link,
+    if (!empty($result)) {
+      $header = [
+        [
+          'data' => $this->t('Block Type'),
+          'field' => 'blockType',
+          'sort' => 'asc',
+        ],
+        'Title' => $this->t('Title'),
+        'url' => $this->t('Link'),
+      ];
+      $output = [];
+  
+      // Use the PagerManager to handle pagination.
+      $pager = $this->pagerManager->createPager(count($result), 25);
+      $pager->getCurrentPage();
+      $chunks = array_chunk($result, 25);
+      $current_page_items = $chunks[$pager->getCurrentPage()];
+      $k = 0;
+      foreach ($current_page_items as $record) {
+        $block = $this->entityTypeManager->getStorage('block_content')->load($record->block_content_id);
+        $blockType = $block->type->entity->label();
+        $node = $this->entityTypeManager->getStorage('node')->load($record->layout_entity_id);
+        $link = $this->t('<a href=/@type/@id/layout>Edit</a> (@title)', [
+          '@type' => $record->layout_entity_type,
+          '@id' => $record->layout_entity_id,
+          '@title' => $node->label(),
+        ]);
+        $title = $this->t('<a href=/@type/@id>@title</a>', [
+          '@type' => $record->layout_entity_type,
+          '@id' => $record->layout_entity_id,
+          '@title' => $block->info->value,
+        ]);
+        $output[$k] = [
+          'blockType' => $blockType,
+          'Title' => $title,
+          'url' => $link,
+        ];
+        $k = $k + 1;
+      }
+      $output = $this->sortList($output, $header, $request);
+  
+      $form['table'] = [
+        '#type' => 'table',
+        '#header' => $header,
+        '#rows' => $output,
+        '#empty' => $this->t('No blocks found'),
+      ];
+  
+      $form['pager'] = [
+        '#type' => 'pager',
+      ];
+    }
+    else {
+      $form['not-found'] = [
+        '#type' => 'markup',
+        '#markup' => $this->t('<h4>There is no Layout Builder Blocks created. Please create one in any Layout Builder page.</h4>')
       ];
-      $k = $k + 1;
     }
-    $output = $this->sortList($output, $header, $request);
-
-    $form['table'] = [
-      '#type' => 'table',
-      '#header' => $header,
-      '#rows' => $output,
-      '#empty' => $this->t('No blocks found'),
-    ];
-
-    $form['pager'] = [
-      '#type' => 'pager',
-    ];
 
     return $form;
   }
-- 
GitLab


From 570cbd46ec055eceb865ecc77cbc7032d6816322 Mon Sep 17 00:00:00 2001
From: chandansha fakir <chandansha.f@cmsminds.com>
Date: Fri, 27 Dec 2024 17:24:21 +0530
Subject: [PATCH 2/2] 3496190-add-gitlabci-template: Added Gitlab CI

---
 .gitlab-ci.yml | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c6cd69a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,29 @@
+################
+# GitLabCI template for Drupal projects.
+#
+# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification.
+# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
+# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your
+# pipelines automatically. However, you can modify this template if you have additional needs for your project.
+# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/
+################
+
+# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/
+# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml
+include:
+  - project: $_GITLAB_TEMPLATES_REPO
+    ref: $_GITLAB_TEMPLATES_REF
+    file:
+      - '/includes/include.drupalci.main.yml'
+      - '/includes/include.drupalci.variables.yml'
+      - '/includes/include.drupalci.workflows.yml'
+#
+################
+# Pipeline configuration variables are defined with default values and descriptions in the file
+# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
+# Uncomment the lines below if you want to override any of the variables. The following is just an example.
+################
+# variables:
+#   SKIP_ESLINT: '1'
+#   OPT_IN_TEST_NEXT_MAJOR: '1'
+#   _CURL_TEMPLATES_REF: 'main'
-- 
GitLab