Repository navigation
Fix html_nav_bar() TypeError on the maintenance list pages - #76
Merged
Merged
Conversation
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 6, 2026 17:19
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted casts comprehensively address all affected call sites and typed arguments.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes strict-type failures when rendering maintenance pagination.
Changes:
- Casts all pagination arguments to integers at four list-page call sites.
- Documents the fix in the changelog.
| File | Description |
|---|---|
maint.php |
Adds required integer casts for pagination. |
CHANGELOG.md |
Records the resolved TypeError. |
💡 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 6, 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.
Problem
Opening the Maintenance Schedules list (and the Devices/WebSeer/Servcheck association tabs) fatals:
maint.phpdeclaresstrict_types = 1. The core signature is:The
$current_page,$rows_per_pageand$total_rowsarguments were passed straight fromget_request_var('page'),$rows(read_config_option()/get_request_var('rows')) and$total_rows(db_fetch_cell_prepared()) — all strings. PHP reports only the first failure (#3), but#4/#5are strings too, so casting onlypagewould just surface the next error.Fix
Cast all three paging arguments to
intat each of the fourhtml_nav_bar()call sites (schedules, hosts, webseer, servcheck), matching the(int) grv('page')pattern used throughout Cacti core.Testing
php -l maint.phppasses.