Skip to content

Fix servcheck test filter: display_name column renamed to name - #70

Merged
TheWitness merged 1 commit into
developfrom
fix/servcheck-display-name-column
Sep 29, 2026
Merged

TheWitness merged 1 commit into
developfrom
fix/servcheck-display-name-column

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Problem

Filtering on the Maintenance schedules page (and the per-schedule Servcheck test association tab) throws:

CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 't.display_name' in 'WHERE'
CMDPHP ERROR: A DB Row Failed!, Error: Unknown column 't.display_name' in 'WHERE'
  (maint.php[111]:schedules(), maint.php[1063]:db_fetch_assoc_prepared() ...)

Cause

plugin_servcheck's 0.3 upgrade renamed the test table's display column:

// plugin_servcheck setup.php
db_execute('ALTER TABLE plugin_servcheck_test RENAME COLUMN display_name TO name');

but maint.php still referenced the old display_name column on plugin_servcheck_test, so any filter that hits those queries fails.

Fix

Update the five stale plugin_servcheck_test references from display_name to name:

  • schedules() filter WHERE (the reported crash) — t.display_name → t.name
  • the delete/description lookup — SELECT display_name → SELECT name
  • the Servcheck test association tab filter WHERE — t.display_name → t.name
  • the listing cells — $test['display_name'] → $test['name'] (description cell + checkbox cell)

The plugin_webseer_urls.display_name references (that table still uses display_name) are intentionally left unchanged.

Testing

  • php -l maint.php — no syntax errors.
  • Confirmed against current plugin_servcheck that the canonical column is now name (its only remaining display_name reference is the rename migration itself).

plugin_servcheck's 0.3 upgrade renamed plugin_servcheck_test.display_name to name, but maint.php still referenced t.display_name in the schedules() and servcheck-test filter WHERE clauses (and \['display_name'] in the listing), causing 'Unknown column t.display_name' errors when filtering. Update the five plugin_servcheck_test references to name. The plugin_webseer_urls.display_name references are unaffected and left as-is.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

All Servcheck references were updated consistently while WebSeer references remain correctly unchanged.

Review effort: Balanced
Findings: None

What changed in this PR

Updates Maint’s Servcheck integration for the renamed name column in Servcheck 0.3.

Changes:

  • Fixes schedule and association-tab filtering.
  • Updates description lookup and test-name rendering.
File Description
maint.php Replaces five stale Servcheck display_name references with name.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@TheWitness
TheWitness merged commit 50cab03 into develop Sep 29, 2026
4 checks passed
@TheWitness
TheWitness deleted the fix/servcheck-display-name-column branch October 20, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants