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

Abierto Apto para principiantes
#326 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
79/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php, wordpress
Área
backend

Línea de trabajo

Empieza con Main::register_row_action_filter_shortcut() y add_to_knowledge_base_row_action(); sigue cómo los hooks post_row_actions y page_row_actions afectan a otros tipos de contenido. Comprueba enqueue_addons_assets() para entender cuándo se carga el script de la acción de fila. Se considera terminado cuando los tipos de contenido no compatibles ya no muestran la acción y las acciones de Entradas y Páginas siguen funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
PHP
Estrellas
1
Forks
2
Merge medio
3 d 8 h
PR fusionados (30 d)
12

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Codeinwp/hyve-lite

Todos los issues de Codeinwp/hyve-lite

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.