"Add to Hyve" row action appears on all non-hierarchical post types (e.g. Otter Form Submissions) but does nothing there
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 79/100
Direzione di ricerca
Inizia con Main::register_row_action_filter_shortcut() e add_to_knowledge_base_row_action(); segui come gli hook post_row_actions e page_row_actions influiscono sugli altri tipi di contenuto. Controlla enqueue_addons_assets() per capire quando viene caricato lo script dell’azione di riga. Il lavoro è completato quando i tipi di contenuto non supportati non mostrano più l’azione e le azioni per Articoli e Pagine continuano a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
With the "Add to Hyve" post row action enabled, the link shows up on list screens it doesn't support, such as Otter's Form Submissions (edit.php?post_type=otter_form_record). Clicking it does nothing: no request is sent and no error is shown.
Environment
- Hyve Lite 2.0.5, Hyve Pro 2.0.4
- Otter Blocks / Otter Pro 3.2.14
Steps to reproduce
- Enable the post row action in Hyve settings (
post_row_addon_enabled). - Submit an Otter form so at least one record exists.
- Go to Otter → Form Submissions (
/wp-admin/edit.php?post_type=otter_form_record). - Hover over a submission and click Add to Hyve.
Expected: The link isn't shown on unsupported post types (or, if those types are meant to be supported, it works).
Actual: The link is shown and does nothing. build/addons/index.js and hyveAddons aren't loaded on this screen, so no handler is attached to .hyve-row-action-btn. On Posts (edit.php) the script loads and the action works.
Root cause
Main::register_row_action_filter_shortcut() builds the hook name as $post_type . '_row_actions':
- For
postthat givespost_row_actions, which WordPress runs for every non-hierarchical post type. - For
pagethat givespage_row_actions, which runs for every hierarchical post type.
But enqueue_addons_assets() only loads the script when hyve_register_row_action_for_{$screen->post_type} is true, and that's only set for post and page. The button ends up on every list table, but the JS only loads for two of them.
Suggested fix
In add_to_knowledge_base_row_action(), return $actions unchanged unless apply_filters( 'hyve_register_row_action_for_' . $post->post_type, false ) is true. That keeps the button and the script loader in sync. It also stops third-party post types like form submissions or orders from being offered for the Knowledge Base, which probably shouldn't happen without an opt-in anyway.
Generated by Claude Code
- Lingua principale
- PHP
- Stelle
- 1
- Fork
- 2
- Merge medio
- 3g 8h
- PR unite (30g)
- 12
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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/hyve-lite
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Codeinwp/hyve-lite
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Adyen/adyen-magento2#3453 ·
I maintainer di solito rispondono entro 8 giorni
-
component/media domain/discovery
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug docker
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
magicsunday/webtrees-statistics#664 ·
I maintainer di solito rispondono entro 1 giorno