#14662·wagtail

TypedTableBlock Duplicate changes the caption to literal undefined

Author: DartDoesDataCreated Sep 30, 2026Updated Oct 1, 2026
Labelsstatus:Needs Review

Issue summary

The native StreamField Duplicate action copies a TypedTableBlock's columns and cells but changes its caption to the literal string undefined.

Reproduced with Wagtail 7.4.3, Django 6.0.8 and Python 3.14.6 in Playwright Chromium desktop and phone emulation. Ordinary caption/cell editing, saving and reopening worked before duplication. The duplicate's caption field then contained undefined while its cells retained their values. The strict check stops at the incorrect field value; a successful persisted-duplicate comparison is not claimed.

Reproduction

Add wagtail.contrib.typed_table_block to INSTALLED_APPS and expose a native typed table in a page StreamField:

python
from wagtail import blocks
from wagtail.admin.panels import FieldPanel
from wagtail.contrib.typed_table_block.blocks import TypedTableBlock
from wagtail.fields import StreamField
from wagtail.models import Page


class TablePage(Page):
    body = StreamField(
        [("table", TypedTableBlock([("text", blocks.TextBlock(required=False))]))],
        blank=True,
    )
    content_panels = Page.content_panels + [FieldPanel("body")]
  1. Add a table with a caption, one text column and one row containing text.
  2. Save the page draft and reopen it; confirm the caption and cells are retained.
  3. Use the table block's native Duplicate action.
  4. Inspect the duplicate's caption input.

Expected: the duplicate retains the original caption along with the columns and cells.

Actual: the cells are retained, but the duplicate caption is undefined.

The bounded real-editor browser reproduction failed the caption assertion on both desktop and phone (two failed cases and one successful login setup, 21.6 seconds, exit 1). No custom table JavaScript, mock controller or private registry override was used. The table was temporarily exposed in an actual Reference-page form for the reproduction.

Source evidence

getDuplicatedState() copies columns and rows but omits caption. getState() and getValue() include it. setState() passes the missing state.caption to setCaption(), which assigns it to the field.

The omission remains in 8.0 and the cited main commit by source inspection only; those versions were not run. Searches found the original caption work (#8507 / #8510), but no existing duplication report or released fix.

Including the caption in native duplicated state, with a regression alongside the existing typed-table duplication coverage, appears to address the missing value. Requiring a nonempty caption does not detect this failure because the literal undefined is nonempty.