Repository navigation
fix: load Thold's relocated function library and guard the intropage poller - #409
Merged
Merged
Conversation
Thold moved thold_functions.php to includes/functions.php. intropage's panellib/thold.php still include_once()'d the old plugins/thold/thold_functions.php path and thold_collect() then called get_allowed_thresholds() unguarded, fataling the intropage poller (and the cacti integration CI) with an undefined function. Add intropage_load_thold_functions() (new path preferred, legacy fallback), repoint all four include sites to it, and skip thold_collect() when the threshold API is unavailable.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused compatibility fix correctly handles both library locations and safely avoids the reported undefined-function failure.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Intropage’s Thold integration after its function library relocation.
Changes:
- Adds current and legacy Thold library path resolution.
- Prevents poller failures when the threshold API is unavailable.
- Documents the compatibility fix.
| File | Description |
|---|---|
panellib/thold.php |
Adds compatible library loading and poller guard. |
CHANGELOG.md |
Records the Thold integration fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xmacan
approved these changes
Oct 1, 2026
xmacan
previously approved these changes
Oct 1, 2026
Adds patch-coverage for the new Thold loader helper (new path, legacy fallback, and absent branches) and the four panellib/thold.php call sites by invoking the panel renderers with Thold not installed.
The suite already loads includes/functions.php, so rely on the real get_user_list()/save_panel_result() (require functions.php here too for load-order safety) instead of colliding stubs, set \['is_web']=false so get_user_list() takes its non-web branch without a notice, and assert on the recorded db calls.
cigamit
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Cacti integration CI (
syntax.yml"Check All Pages Using Recursive wget") clones the live default branches of the plugins and runs the poller. It currently fatals inintropage:Root cause
plugin_tholdrelocated its function library from the plugin rootthold_functions.phpintoincludes/functions.php.panellib/thold.phpstill didinclude_once($config['base_path'] . '/plugins/thold/thold_functions.php')at four sites, andthold_collect()(run frompoller_intropage.php) then calledget_allowed_thresholds()without a guard — so the missing include left the function undefined and the poller fataled.Fix
intropage_load_thold_functions(), which loads Thold's library from the newincludes/functions.php, falling back to the legacythold_functions.phpfor older Thold installs.include_oncesites to the helper.thold_collect()to return early when Thold's threshold API isn't available (function_exists('get_allowed_thresholds')), so a relocated/missing/incompatible Thold degrades gracefully instead of fataling the poller.Validation
php -l panellib/thold.phpclean.--- develop ---.This unblocks the Cacti core integration CI (e.g. Cacti/cacti#8126), which was red solely due to this plugin drift.