Repository navigation
fix(a11y): label filter controls and clear the page-file SonarCloud findings - #928
Merged
Merged
Conversation
patch-coverage.php matched a Clover path to the first changed file whose name it ended with, so a change to the top-level notify_queue.php was measured against the coverage of includes/notify_queue.php. Match each Clover path to the longest tracked PHP file it ends with instead. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Tie each filter caption to its control with <label for> on the Thresholds, Threshold Status, Threshold Templates, Notification Lists and Notification Queue pages, and on the graph selector of the threshold editor. Mark the filter tables as layout tables (role=presentation) so screen readers do not announce them as data tables without headers. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The Add Threshold Template rows that setup.php adds to the device and device template edit pages wrap a caption and a dropdown in a table. Mark those tables as layout tables (role=presentation) so screen readers do not announce them as data tables without headers. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The empty-list row on the Thresholds page used the <center> element, which HTML5 dropped. Use the theme's center class on the cell instead. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The unit bootstrap stubbed get_daysfromtime() with one parameter while the core function takes five and notify_queue.php passes four. Declare the core parameter list on the stub. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…ntrol The lists() filter row was marked as layout but its Search and Lists controls had no label. The markup test only looked for one label per id in a file, so a repeated id hid the gap; it now counts them. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…h matching The label check never matched text inputs because a word boundary cannot follow a closing quote, so the search labels were untested. Also pin the centred empty-list cell and exercise tests/bin/patch-coverage.php against a throw-away repository with same-named top-level and nested files. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…ates from a file The recorded forms are compared byte for byte, not served, so they now use a .golden extension; as .html they were analysed as web pages and counted as duplicated code. The cut templates run from a temporary file instead of eval. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
TheWitness
approved these changes
Dec 4, 2026
TheWitness
left a comment
Member
There was a problem hiding this comment.
Reviewed. No element ids or request variable names changed, so applyFilter()/clearFilter() still work. Every new label points to an id in its own form, and the shared helpers print the same ids, with each page's escaping kept. The get_daysfromtime stub now matches core 1.2.32, and the patch-coverage change only makes path matching stricter. The suite passes merged with current develop (796 tests).
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
SonarCloud reports unlabeled filter controls, layout tables read as data tables, a deprecated
<center>element and a core stub with the wrong signature. Details in the linked issue.Fix
<label for>; the filter and template-add tables are markedrole='presentation'.<center>.get_daysfromtimetest stub takes the same parameters as core.tests/bin/patch-coverage.phpmaps a coverage entry to the longest matching tracked file, sonotify_queue.phpis no longer counted asincludes/notify_queue.php.No behaviour change: markup attributes and test code only.
Duplicated filter rows
SonarCloud counted the new
<label>lines as duplicated new code, because they sit inside filter rows that were already copied acrossthold.php,thold_graph.php,notify_lists.phpandnotify_queue.php. The repeated cells (Search, Rows, Refresh, Site, Status) are now printed by five small helpers inincludes/display.php. Ids, names, classes, option order, selected state, msgids and escaping are unchanged:tests/Unit/FilterFormGoldenTest.phprecords each list page's filter form in three request states (30 cases) from the code before the change and requires byte-identical output after it. The fixtures use a.goldenextension so they are compared as text, not analysed as web pages.locales/po/cacti.potchanges only in source locations and entry order; no msgid or msgstr changes.Verification
FilterFormMarkupTest(every filter control has a label, layout tables are marked) andCoreStubSignatureTest.Out of scope
The
$$afindings inincludes/notify_queue.php(notification step of #906) and four false positives listed in the issue.Fixes #927