From 2005fcbee60a310c1dfc757678d8eba9a343150a Mon Sep 17 00:00:00 2001
From: Aaron Christian <aaronc@imagexmedia.com>
Date: Thu, 23 Apr 2026 16:07:37 -0700
Subject: [PATCH 1/2] 3586602: Trying to fix Unknown column
 'field_body_summary' after field body type change.

---
 .../ixm_blocks_ping_pong.install              | 84 +++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install

diff --git a/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install b/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install
new file mode 100644
index 0000000..5dbceb2
--- /dev/null
+++ b/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @file
+ * Install, update, and schema repair hooks for IXM Ping-Pong Block.
+ */
+
+/**
+ * Repair body field schema for text_long → text_with_summary migration.
+ *
+ * Ensures body_summary and body_format columns exist on the body field tables.
+ * Safe to call multiple times — detects state and only adds missing columns.
+ */
+function ixm_blocks_ping_pong_repair_body_schema() {
+  $database = \Drupal::database();
+  $schema = $database->schema();
+
+  $tables = [
+    'block_content__body',
+    'block_content_revision__body',
+  ];
+
+  foreach ($tables as $table) {
+    if (!$schema->tableExists($table)) {
+      continue;
+    }
+
+    if (!$schema->fieldExists($table, 'body_summary')) {
+      $schema->addField($table, 'body_summary', [
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ]);
+    }
+
+    if (!$schema->fieldExists($table, 'body_format')) {
+      $schema->addField($table, 'body_format', [
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => FALSE,
+      ]);
+    }
+  }
+}
+
+/**
+ * Implements hook_install().
+ */
+function ixm_blocks_ping_pong_install() {
+  ixm_blocks_ping_pong_repair_body_schema();
+}
+
+/**
+ * Fix missing summary column for ping pong body field.
+ */
+function ixm_blocks_ping_pong_update_11002() {
+  ixm_blocks_ping_pong_repair_body_schema();
+
+  // Backfill format on rows that were created before migration.
+  $database = \Drupal::database();
+  $tables = [
+    'block_content__body',
+    'block_content_revision__body',
+  ];
+
+  foreach ($tables as $table) {
+    if (!$database->schema()->tableExists($table)) {
+      continue;
+    }
+    $database->update($table)
+      ->fields(['body_format' => 'basic_html'])
+      ->isNull('body_format')
+      ->execute();
+  }
+}
+
+/**
+ * Implements hook_modules_installed().
+ *
+ * Defensive safety net: re-verify schema on any module install / cache rebuild.
+ */
+function ixm_blocks_ping_pong_modules_installed() {
+  ixm_blocks_ping_pong_repair_body_schema();
+}
\ No newline at end of file
-- 
GitLab


From 33d81354a2a6b3157f90d10b91a6731babf0d9a9 Mon Sep 17 00:00:00 2001
From: Aaron Christian <aaronc@imagexmedia.com>
Date: Thu, 23 Apr 2026 16:20:17 -0700
Subject: [PATCH 2/2] 3586602: Trying to fix Unknown column
 'field_body_summary' after field body type change.

---
 ...h.ixm_blocks_ping_pong_item.field_body.yml |  2 +-
 .../ixm_blocks_ping_pong.install              | 37 +++++++++++++++++--
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/modules/ixm_blocks_ping_pong/config/optional/field.field.paragraph.ixm_blocks_ping_pong_item.field_body.yml b/modules/ixm_blocks_ping_pong/config/optional/field.field.paragraph.ixm_blocks_ping_pong_item.field_body.yml
index 45d5145..6c88d68 100644
--- a/modules/ixm_blocks_ping_pong/config/optional/field.field.paragraph.ixm_blocks_ping_pong_item.field_body.yml
+++ b/modules/ixm_blocks_ping_pong/config/optional/field.field.paragraph.ixm_blocks_ping_pong_item.field_body.yml
@@ -19,4 +19,4 @@ default_value_callback: ''
 settings:
   display_summary: false
   required_summary: false
-field_type: text_long
+field_type: text_with_summary
diff --git a/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install b/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install
index 5dbceb2..9b44e68 100644
--- a/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install
+++ b/modules/ixm_blocks_ping_pong/ixm_blocks_ping_pong.install
@@ -8,19 +8,20 @@
 /**
  * Repair body field schema for text_long → text_with_summary migration.
  *
- * Ensures body_summary and body_format columns exist on the body field tables.
+ * Covers both block_content body tables and paragraph field_body tables.
  * Safe to call multiple times — detects state and only adds missing columns.
  */
 function ixm_blocks_ping_pong_repair_body_schema() {
   $database = \Drupal::database();
   $schema = $database->schema();
 
-  $tables = [
+  // block_content body field: columns are prefixed with 'body_'.
+  $block_tables = [
     'block_content__body',
     'block_content_revision__body',
   ];
 
-  foreach ($tables as $table) {
+  foreach ($block_tables as $table) {
     if (!$schema->tableExists($table)) {
       continue;
     }
@@ -41,6 +42,34 @@ function ixm_blocks_ping_pong_repair_body_schema() {
       ]);
     }
   }
+
+  // paragraph field_body tables: columns are prefixed with 'field_body_'.
+  $paragraph_tables = [
+    'paragraph__field_body',
+    'paragraph_revision__field_body',
+  ];
+
+  foreach ($paragraph_tables as $table) {
+    if (!$schema->tableExists($table)) {
+      continue;
+    }
+
+    if (!$schema->fieldExists($table, 'field_body_summary')) {
+      $schema->addField($table, 'field_body_summary', [
+        'type' => 'text',
+        'size' => 'big',
+        'not null' => FALSE,
+      ]);
+    }
+
+    if (!$schema->fieldExists($table, 'field_body_format')) {
+      $schema->addField($table, 'field_body_format', [
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => FALSE,
+      ]);
+    }
+  }
 }
 
 /**
@@ -53,7 +82,7 @@ function ixm_blocks_ping_pong_install() {
 /**
  * Fix missing summary column for ping pong body field.
  */
-function ixm_blocks_ping_pong_update_11002() {
+function ixm_blocks_ping_pong_update_11001() {
   ixm_blocks_ping_pong_repair_body_schema();
 
   // Backfill format on rows that were created before migration.
-- 
GitLab

