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

Open Beginner friendly
#326 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, wordpress
Domain
backend

Research direction

Start with Main::register_row_action_filter_shortcut() and add_to_knowledge_base_row_action(); trace how the post_row_actions and page_row_actions hooks affect other post types. Check enqueue_addons_assets() to understand when the row action script loads. Done when unsupported post types no longer show the action and the Posts and Pages actions still work.

Written by the indexing model from the issue text.

Description

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

Dominant language
PHP
Stars
1
Forks
2
Avg merge
3d 8h
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Codeinwp/hyve-lite

All issues in Codeinwp/hyve-lite

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.