FSE Design Pack editor notice never shows on WordPress 6.8+ (core renamed the pattern-inserted notice id)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 77/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, wordpress
- Ambito
- frontend
Direzione di ricerca
Inizia da assets/js/src/components/DesignPackNotice.js e segui il modo in cui legge le notifiche Core dopo l’inserimento di un pattern. Confronta gli ID e il contenuto delle notifiche descritti nell’issue per WordPress 6.7 e 6.8+, assicurandoti che le altre notifiche dell’inserter non attivino la promozione. Il lavoro è completato quando la notifica appare dopo l’inserimento di un pattern in entrambe le versioni e non appare dopo inserimenti non correlati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What's wrong
After you insert a pattern in the editor, Raft is supposed to show its "FSE Design Pack" upsell notice. Since WordPress 6.8 that notice never shows. Nothing errors and nothing is logged. It just doesn't appear.
The cause: assets/js/src/components/DesignPackNotice.js waits for a core notice with the id block-pattern-inserted-notice:
const BLOCK_PATTERN_INSERTED_NOTICE = 'block-pattern-inserted-notice';
// ...
.getNotices().filter( ( n ) => n.id === BLOCK_PATTERN_INSERTED_NOTICE ).length > 0
Core's block editor used that id from WordPress 6.3 to 6.7. From 6.8 onwards it uses inserter-notice for the same pattern-inserted snackbar (checked in the 6.8.1, 7.0.7 and 7.1.5 builds of wp-includes/js/dist/block-editor.js). So the theme waits for a notice that never comes.
Steps to reproduce
The quickest way to see it is side by side: one Playground where the notice works, one where it doesn't. Both sites are fresh, so the FSE Design Pack plugin isn't installed and the notice has never been dismissed.
- ✅ Works (WordPress 6.7): https://playground.wordpress.net/?wp=6.7&theme=raft&login=yes&url=/wp-admin/post-new.php?post_type=page
- ❌ Broken (latest WordPress): https://playground.wordpress.net/?wp=latest&theme=raft&login=yes&url=/wp-admin/post-new.php?post_type=page
In each one:
- Wait for the page editor to load. Collapse Playground's dark toolbar at the bottom (the ⌄ arrow next to "Autosaved"). The notice appears in the bottom-right corner, and the toolbar covers most of it.
- Click the blue + (Block Inserter) at the top left, open the Patterns tab, then pick a pattern category (the theme's own category, or any other).
- Click a pattern to insert it. Click it rather than dragging it onto the canvas: the theme only reacts to core's "pattern inserted" snackbar, and these steps were checked with a click.
On an existing site: the notice is skipped if the FSE Design Pack plugin is active, or once it has been dismissed. Dismissing it sets the option raft-design-pack-dismissed to yes. Delete that option, or use a fresh site.
Expected (what you see on 6.7)
About half a second after you insert the pattern, a white card slides in at the bottom right: the theme logo, "Raft recommends", "FSE Design Pack: Access a collection of 40+ layout patterns ready to import to your website", a blue Learn More button and an ×. Core's black "Block pattern "…" inserted." snackbar shows at the bottom left at the same time.
Actual (WordPress 6.8 and newer)
Core's snackbar shows (on 6.8+ it reads "Pattern "…" inserted."), but the card never appears. Nothing shows in the console, and the notice container (#raft-design-pack-notice) stays empty. The theme does load its script: window.designPackNoticeData is defined.
Found with Jaxon 1.0.13 on WordPress 7.1.5 (wp-env) and checked in Playground on 6.7 against the latest WordPress. Raft 1.1.17 has the same DesignPackNotice.js code on its default branch.
Suggested fix
Accept both ids, so it keeps working on 6.3 to 6.7 as well:
const PATTERN_NOTICE_IDS = [ 'block-pattern-inserted-notice', 'inserter-notice' ];
// ...
.filter( ( n ) => PATTERN_NOTICE_IDS.includes( n.id ) )
⚠️ Caveat: on 6.8+, core also uses inserter-notice for other inserter snackbars, such as "Image inserted.", "Image uploaded and inserted.", "Block "%s" can't be inserted." and the gallery attach/detach messages. Matching the id alone would also show the upsell after inserting an image. If the notice should only follow a pattern insertion, also check the text when the id is inserter-notice. For example, build a matcher from the same translated string core uses (__( 'Pattern "%s" inserted.' ) resolves through the shared default text domain):
const [ before, after ] = __( 'Pattern "%s" inserted.' ).split( '%s' );
const isPatternNotice = ( n ) =>
n.id === 'block-pattern-inserted-notice' ||
( n.id === 'inserter-notice' &&
typeof n.content === 'string' &&
n.content.startsWith( before ) &&
n.content.endsWith( after ) );
Same bug in the other FSE themes
- Codeinwp/neve-fse#214
- Codeinwp/jaxon#119
- Codeinwp/riverbank#132
- Codeinwp/fork#117
- Lingua principale
- PHP
- Stelle
- 8
- Fork
- 4
- Merge medio
- 7h 18m
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Codeinwp/raft
-
feature-request-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
-
Mobile Menu Raft 1.1.5Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
bug customer report
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di Codeinwp/raft
Issue simili
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_ordersApertaconsistency enhancement Orders
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
claude
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
sprain/sprainocchio#45 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno