Repository navigation
Fix TypeError in schedules() from form_checkbox_cell() integer id - #77
Closed
TheWitness wants to merge 1 commit into
Closed
TheWitness wants to merge 1 commit into
TheWitness wants to merge 1 commit into
Conversation
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 6, 2026 17:57
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted casts consistently resolve the strict-type mismatch without changing behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes PHP 8 TypeError failures caused by passing integer database IDs to form_checkbox_cell() under strict typing.
Changes:
- Casts schedule, host, WebSeer, and Servcheck IDs to strings.
| File | Description |
|---|---|
maint.php |
Ensures all checkbox helper IDs satisfy the required string type. |
💡 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
Member
Author
|
Turned out to be a Cacti develop issue. |
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
Under
declare(strict_types = 1)(already in effect inmaint.php), Cacti core'sform_checkbox_cell(string $title, string $id, ...)requires$idto be a string. The four call sites were passing the integer DBidcolumn directly, which throws a fatalTypeErroron PHP 8:Fix
Cast the integer id to
(string)at all fourform_checkbox_cell()call sites:schedules()(line 1202) —$schedule['id']$host['id']$url['id']$test['id']php -lpasses. No behavioral change beyond the type coercion the function already expects.