Skip to content

Host MAC tab: show the primary MAC as selected - #2105

Merged
fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/mac-primary-radio-unchecked
Nov 18, 2026
Merged

fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/mac-primary-radio-unchecked

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

Forums 18310: on every host's MAC Addresses tab, no MAC shows as primary. A newly chosen primary also looks lost after the redraw. The database is correct: the poster has 1295 primary MACs, and the grid's JSON returns primary: 1.

Cause

The primary radios shared name="primary". DataTables Responsive measures the grid by inserting a copy of the table into the page. The copied radio is checked and joins the same named group, so the browser unchecks the real radio. Then the copy is removed. Observed on the lab in a browser: the real radio kept its checked attribute, but its checked property was false. A MutationObserver showed the copy (dtr-inline collapsed) added and removed.

Change

  • The primary radio has no name attribute, so a copy cannot uncheck it.
  • onMacsRadioSelect() clears the other primary radios itself, so one stays selected.
  • The POST (updateprimary=1&primary=<id>) and the redraw are unchanged.

Side effect: arrow keys no longer move between these radios. Tab reaches each one.

Tests

  • tests/mac-primary-radio-survives-responsive.test.php pins both parts by source. It fails 2 of 3 on the dev-branch file.
  • In a browser on the lab, with the edited file served over the deployed one: the primary MAC shows checked. Clicking the other MAC moves the selection and sends one POST, updateprimary=1&primary=670. That POST was intercepted, so lab data did not change.
  • Both phpstan passes are clean.

🤖 Generated with Claude Code

The primary radios shared name="primary". DataTables Responsive measures
the grid by inserting a copy of it into the page. The copy's checked radio
joined the same named group and unchecked the real one, then the copy was
removed. Every host's MAC tab showed no primary MAC, and a new choice
looked lost after the redraw (forums 18310). The saved flag was correct.

The radio now has no name, so a copy cannot touch it, and the change
handler clears the other radios itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot enabled auto-merge November 18, 2026 13:13
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 18, 2026
Merged via the queue into dev-branch with commit ffea669 Nov 18, 2026
12 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/mac-primary-radio-unchecked branch November 18, 2026 13:23
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.

1 participant