Repository navigation
Privacy: Preserve exporter and page order when grouping personal data - #14619
salvatorecorsi wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
When multiple personal-data exporters contribute to the same group and item,
wp_privacy_process_personal_data_export_page()prepends each later response to the earlier data. This reverses exporter priority and page order. Reused string keys can also cause later name/value records to be discarded.Append each incoming name/value record to the item's existing list. This preserves every record in the order it was exported, including records with numeric, sparse numeric, or reused string keys. Grouping, response handling and metadata cleanup remain in the existing processing flow.
Trac ticket: https://core.trac.wordpress.org/ticket/44151
This follows robobot3000's append proposal in
44151.3.patch. Thanks to allendav for confirming the report and providing a corrected exporter-registration example in the ticket. The historical proposal is being refreshed with regression coverage; this does not claim prior maintainer acceptance.Reproduction and regression coverage
group_idanditem_id._export_data_groupedduringwp_privacy_personal_data_export_file.Four integration cases cover numeric keys, sparse numeric keys, colliding string keys, and empty data. The callbacks are registered in reverse order to verify that filter priorities establish their processing order. Tests invoke those callbacks and the real processing function against a user-request post and its metadata, capturing grouped data at the export-file action. They also check distinct groups and items, callback sequence, unchanged response data and completion flags, the download URL, and removal of temporary metadata. The original exporter hook and the test's action callback are restored after each case.
The test class's existing setup disables archive generation. These new tests do not execute email delivery, archive generation, or the AJAX transport.
Validation
e46ac23b14711601e6cb17aafe63af6673c03591: 4 tests, 52 assertions, 3 expected failures. The empty-data control passed.privacyPHPUnit group: 284 tests, 673 assertions passed.privacy-tools.php: zero errors. PHP syntax andgit diff --checkpassed.npm run buildafter the runtime fix: passed. Built and sourcewp-admin/includes/privacy-tools.phpare byte-identical (SHA-256). Existing Node deprecation and webpack asset-size/performance warnings remain nonfatal.PHPUnit ran through the laboratory's serialized runner against its isolated, disposable MariaDB database. The runner executed these checkout-local commands:
PHPUnit reported the existing deprecated XML configuration schema notice. No new warning suppression was added. The full repository PHPUnit suite, multisite and Docker-based tests were not run.
Use of AI Tools
AI assistance: Yes
Tool(s): OpenAI Codex
Used for: Issue investigation, implementation, regression tests, validation and this PR description. A separate Codex agent reviewed the complete implementation, test diff and validation evidence. No human review by the account owner is claimed; contributor and maintainer review is requested.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.