Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#66085 closed defect (bug) (fixed)

Privacy: results row in export/erase tables opens a <th> but closes a </td>

Reported by: hbhalodia Owned by: SergeyBiryukov
Priority: normal Milestone: 7.2
Component: Privacy Version: 4.9.6
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description (last modified by sabernhardt)

While working on the ticket #65994 and resolving PR comment here - ​PR, Found that

appendResultsAfterRow() in src/js/_enqueues/admin/privacy-tools.js builds the results row that appears under a request on the Export and Erase Personal Data screens. The cell opens as a <th> but closes as a </td>, See below snippet:

// src/js/_enqueues/admin/privacy-tools.js:73-79
return '<tr class="' + resultRowClasses + '"><th colspan="5">' +
        '<div class="notice inline notice-alt ' + classes + '" role="alert">' +
        '<p>' + summaryMessage + '</p>' +
        itemList +
        '</div>' +
        '</td>' +
        '</tr>';

The <th> is intentional — [43216] changed the cell from <td colspan="5"> to <th colspan="5"> but did not update the closing tag, which has read </td> ever since.

Impact

No visual defect. Per the HTML parsing spec a </td> end tag with no td in table scope is a parse error and is ignored, so the th is closed by the following </tr> and the element is a th as intended.

The cost is maintenance rather than rendering. The markup is invalid, and it actively misleads: during review of ​PR the mismatched tag led to a suggestion to select the cell with > td, which would have matched nothing.

Steps to reproduce

  1. Go to Tools → Export Personal Data and add a request.
  2. Click "Download personal data" on that row.
  3. Inspect the results row that appears below. The cell is a <th>, despite the source closing it with </td>.

Patch

-                               '</td>' +
+                               '</th>' +

Change History (4)

This ticket was mentioned in ​PR #13470 on ​WordPress/wordpress-develop by ​@hbhalodia.


2 months ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/66085

## Description

  • Fixed the closing tag to be </th> instead of </td>.

## Use of AI Tools

  • Claude Code
  • Opus 5.
  • Used for Ticket creation and identifying the changeset where the issue occured and potential version.

#2 @hbhalodia
2 months ago

Cc: @afercia @joedolson

#3 @sabernhardt
2 months ago

  • Description modified (diff)
  • Focuses coding-standards removed
  • Keywords good-first-issue removed
  • Milestone Awaiting Review → 7.2

#4 @SergeyBiryukov
2 months ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 63581:

Privacy: Correct closing tag in results row on personal data tables.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/13470.

Follow-up to r43216.

Props hbhalodia, dhruvang21, afercia, sabernhardt.
Fixes #66085.

Note: See TracTickets for help on using tickets.