"Add to Hyve" row action appears on all non-hierarchical post types (e.g. Otter Form Submissions) but does nothing there

Aperta Adatta ai principianti
#326 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
79/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
backend

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

  1. Enable the post row action in Hyve settings (post_row_addon_enabled).
  2. Submit an Otter form so at least one record exists.
  3. Go to Otter → Form Submissions (/wp-admin/edit.php?post_type=otter_form_record).
  4. Hover over a submission and click Add to Hyve.
image

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 post that gives post_row_actions, which WordPress runs for every non-hierarchical post type.
  • For page that gives page_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

  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 Codeinwp/hyve-lite

Tutte le issue di Codeinwp/hyve-lite

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.