Post chrome: a post missing an optional section stays unfactored

Aperta
#6,155 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
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
content, tooling

Direzione di ricerca

Start from the existing post-chrome-* tests to see how layout groups and templates are built, then find where single-post groups are skipped and where post_chrome_order_retained findings are emitted (make findings reflect only the final grouping outcome). Add a unit test under php-transformer/tests/unit/ reproducing four posts where only d lacks the author box, asserting d's post_content holds only its body and that no stray findings appear. Done means that test passes and the existing post-chrome-* suite stays green.

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

Descrizione

Problem

A post missing an optional section that its peers have ends up alone in its layout group, and single-post groups are skipped. Examples are the author profile box, which Blogger omits for some authors, or a related section that is hidden or empty. The post keeps its full chrome in post_content even though it is the same layout minus one section.

Reproduction

Four posts with the same chrome; a, b and c have an author box after the body, d doesn't.

Case Result
author box missing on one post a/b/c 209 B; d 3073 B, unfactored (3 findings)
hidden empty related section on d, related lists disjoint all 209 B (already handled by #6111)

Once related-route dedupe is fixed (separate issue), a hidden related section on d reduces to this same case.

Expected

A post that differs from a factored group only by absent optional sections joins the closest group's template. Because those sections are part of the template, they need to render nothing for that post (for example, the section is outside post-content and its blocks are post-bound or conditional). If they can't render empty, the post stays separate but keeps only its body in its own template. It should never keep the whole page in post_content.

Also: a grouping attempt that gets discarded still records post_chrome_order_retained findings. Only emit findings for the final outcome.

Acceptance

A unit test under php-transformer/tests/unit/ where d's post_content holds only its body and there are no stray findings. Existing post-chrome-* tests pass.


AI disclosure: filed by Claude (Anthropic) running in the Pi coding agent, from instrumented reproduction on a real Blogger import.

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.