Footer containing a form is not extracted as a shared template part in device-split captures (shell retained: incomplete)

Aperta
#6,323 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
backend, web-dev

Direzione di ricerca

Start in ShellExtraction.php near line 1737, where an empty footer cluster list produces the incomplete diagnostic. Compare how the reduced fixture’s footer candidates are filtered with and without the form, checking route specific form actions and per device control IDs as the issue suggests. Confirm which detail disqualifies the candidates, then verify equivalent device split footers with forms produce one referenced footer part across the templates.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

A shared footer that contains a form is not extracted as the footer template part when the capture carries desktop and mobile device documents. Extraction reports wordpress_site_plan_shell_retained_incomplete ("footer shell candidates do not establish a dominant semantic cluster", reason incomplete, empty sources). A footer-content part is written but no template references it, so the theme's shared shell fails and each page keeps its own footer. The same two routes without the form extract parts/footer.html and every template references it.

Seen on a real two-device import with a newsletter form in the footer: no footer part, and 13 pages each carry a full copy of the footer in post content (300–870 KB per page). That import's report gave responsive_variant_retained for the footer, the same class of failure.

Reduced fixture

Two routes, index.html and about/index.html, identical except for <title>. Each has a desktop and a mobile device document with the same header and footer:

<!doctype html><html lang="en"><head><meta charset="utf-8"><style data-blocks-engine-capture-device-visibility="">/* standard capture device-visibility stylesheet */</style><title>Home</title><style>body{margin:0;background:#111;color:#fff}header,footer{padding:20px;background:#333}</style></head><body><div class="data-blocks-engine-capture-desktop-document" data-blocks-engine-capture-device-document="desktop" data-blocks-engine-capture-document-scope=""><header id="SITE_HEADER"><nav><a href="/">Home</a> <a href="/about/">About</a></nav></header><main><span id="anchors-ltgwp8xp4" data-blocks-engine-capture-anchor-target="anchors-ltgwp8xp4" data-blocks-engine-capture-anchor-source-id="comp-ltgwp8xo" aria-hidden="true" style="position: absolute;overflow: hidden;pointer-events: none;width: 0px;height: 0px" data-blocks-engine-capture-device-inline="{&quot;tablet&quot;:&quot;position: absolute;overflow: hidden;pointer-events: none;scroll-margin-top: 192px;width: 0px;height: 0px&quot;}"></span><h1>Page</h1><p>Body text.</p></main><footer id="SITE_FOOTER"><p>© 2026 Example Co.</p><form action="/subscribe" method="post"><label for="ed">Email</label><input id="ed" type="email" name="email"><button type="submit">Subscribe</button></form></footer></div><div class="device-mobile-optimized data-blocks-engine-capture-mobile-document" data-blocks-engine-capture-device-document="mobile" data-blocks-engine-capture-document-scope=""><header id="SITE_HEADER--m"><nav><a href="/">Home</a> <a href="/about/">About</a></nav></header><main><h1>Page</h1><p>Body text.</p></main><footer id="SITE_FOOTER--m"><p>© 2026 Example Co.</p><form action="/subscribe" method="post"><label for="em">Email</label><input id="em" type="email" name="email"><button type="submit">Subscribe</button></form></footer></div></body></html>

The control is the same two files with the <form>…</form> removed from both footers.

Observed (studio create --from <dir>, SSI 1.34.104)

parts/ templates reference footer shell diagnostic
Footer with form header.html, footer-content.html (unreferenced) none of 404, index, page, single footer retained / incomplete
Control (no form) header.html, footer.html all footer extracted

block_theme_scorecard.shared_shell: templates_missing_shell: [404, index, page, single], unreferenced_parts: [footer-content].

Root cause (pointer)

ShellExtraction.php (~L1737) finds no footer clusters (array() === $clusters ⇒ incomplete) once a form is present. That means the footer candidates are dropped before clustering, not split by a comparison. Likely suspects: route-specific form identity (the rendered form action follows the current route), or per-device control ids (ed/em) entering the footer fingerprint. Confirm which one disqualifies the candidates.

Expected

Footers that are equivalent across routes and device documents, form included, extract as one footer part that every template references, the same as the control.

Owning stage: WordPress materialization (Blocks Engine shell extraction). Generic; any device-split capture with a footer form hits it.

Reduced and filed with AI assistance (Claude, via coding agent).

Lingua principale
PHP
Stelle
28
Fork
5
Merge medio
2h 59m
PR unite (30g)
942

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/blocks-engine

Tutte le issue di Automattic/blocks-engine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.