Fix #17869 - Removing the stale table header cell. - #20335
Conversation
|
Thanks for the PR, it looks good. |
|
I will look into why the tests are failing and resolve the conflicts Yes, I used Claude Code Opus to help. I will be updating the PR body soon. I think the scope of the changes is pretty tight as can be. |
This comment was marked as resolved.
This comment was marked as resolved.
|
@williamdes I have addressed the suggested changes and implemented them. What do you think? |
|
The |
Thanks for the quick turnaround — the new commit resolves the R1 concern cleanly. Confirming the logic across all layouts:
The new Two non-blockers:
LGTM from my side once CI is green. |
getColumnAtRightSide() added a stray right-side cell to the results header whenever $cfg['RowActionLinks'] was 'left' (the default): the branch guard relied on operator precedence (A || B && C) and keyed off POSITION_LEFT, so the cell was emitted even though left-positioned row actions leave no matching cell in the body rows. It was also emitted as a <td> inside <thead>. Mirror the sibling getFieldVisibilityParams() by gating both branches on a $rightOrBoth check, so the right-side header cell is only produced for the 'right'/'both' layouts (matching the body), and emit it as <th>. Signed-off-by: Matthew Wyatt <mwyatt2023@fau.edu>
The empty placeholder for the left action column was emitted as a <td> inside <thead> -- the only header cell not using <th>. The column headers, the action-button branch and POSITION_NONE branch in the same method, getRepeatingHeaders(), the now-fixed right-side placeholder, and every other table template all use <th>. It has been a <td> since the initial revision (2001) and was carried through later refactors uncorrected. makegrid.js reads header cells via 'thead th', so a <td> first cell is skipped; switching to <th> aligns the markup with the JS and with valid <thead> semantics. Related to phpmyadmin#17869. Signed-off-by: Matthew Wyatt <mwyatt2023@fau.edu>
getColumnAtRightSide emits the toggle for right/both when text_btn=1 even without edit/delete links (review follow-up to phpmyadmin#17869). To keep the header from becoming wider than the body for keyless/SHOW/JOIN results, getTableBody emits a matching empty cell under that toggle so the columns stay aligned. Also adds testGetColumnAtRightSideShowsTextButtonWithoutEditDeleteLinks (all four RowActionLinks positions) and makes the test closures Psalm- and PHPStan-clean. Signed-off-by: Matthew Wyatt <mwyatt2023@fau.edu>
8512d05 to
cf5711a
Compare
|
@williamdes I rebased this branch onto the latest |
|
@williamdes All checks have passed! Is this ready to be merged? |
|
@williamdes Just want to notify you again since a week has passed. Is everything good to go? |
Description
In Browse mode, the results
<thead>gained one extra cell on the right thatthe body rows lacked.
getColumnAtRightSide()emitted a right-side header cellwhenever
RowActionLinkswasleft(the default), due to an operator-precedencebug (
A || (B && …)) and the wrong position constant in the branch guard.Fix: mirror the correct sibling
getFieldVisibilityParams()by gating bothbranches on a
$rightOrBothcheck, so the right-side cell is only produced forright/bothlayouts — matching the body. The placeholder is also emitted as<th>(valid<thead>markup). Updated the staleResultsTestexpectation andadded a regression test across all four
RowActionLinksvalues.The second commit switches the left-side empty placeholder from
<td>to<th>for the same validity reason (the lone
<td>left in the header); happy to dropit if you'd prefer to keep this strictly scoped.
Fixes #17869
Before submitting pull request, please review the following checklist:
Signed-off-byline as described in our DCO. This ensures that the work you're submitting is your own creation.