Repository navigation
Conversation
Removes a comma after the last item in the `templateParts` list of the test theme's `theme.json`, which made the file fail to decode. See #66838.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the fixture-only change removing an invalid JSON trailing comma.
No open issues 🎉
What changed in this PR
Fixes invalid JSON in the non-Latin block-theme test fixture so it can be decoded without a syntax-error notice.
Changes:
- Removes the trailing comma after the final
templatePartsentry.
| File | Description |
|---|---|
tests/phpunit/data/themedir1/block-theme-non-latin/theme.json |
Removes an invalid trailing comma without changing fixture data. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
I reproduced the syntax-error notice with wp_json_file_decode() on trunk. With the comma removed, it returns both template part entries. The existing non-Latin REST template cases still pass in single-site and multisite.
AI review · gpt-6.2-sol
Remove the trailing comma in the template parts list so WordPress can decode the fixture’s `theme.json` file. Developed in: #16281 Props ramonopoly, andrewserong, aaronrobertshaw. Fixes #66838. git-svn-id: https://develop.svn.wordpress.org/trunk@65816 602fd350-edb4-49c9-b593-d223f7449a82
Remove the trailing comma in the template parts list so WordPress can decode the fixture’s `theme.json` file. Developed in: WordPress/wordpress-develop#16281 Props ramonopoly, andrewserong, aaronrobertshaw. Fixes #66838. Built from https://develop.svn.wordpress.org/trunk@65816 git-svn-id: http://core.svn.wordpress.org/trunk@64845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #16281 landed in https://core.trac.wordpress.org/changeset/65816 |
|
Thanks for landing @lancewillett |
What
Removes the comma after the last item in the
templatePartslist oftests/phpunit/data/themedir1/block-theme-non-latin/theme.json. With that comma the file fails to decode with "Syntax error". It is the onlytheme.jsonundertests/phpunit/datathat does not decode.Why
No test fails today, because no test loads this file. A test that does load it fails, because
wp_json_file_decode()raises a notice and the test suite turns notices into failures.Manual testing
php -r 'json_decode( file_get_contents( "tests/phpunit/data/themedir1/block-theme-non-latin/theme.json" ) ); echo json_last_error_msg();'from the repository root.Syntax error. On this branch it printsNo error.Trac ticket: https://core.trac.wordpress.org/ticket/66838
Use of AI Tools
I asked GPT what to have for lunch. It suggested dumplings, but who's got the time to make pastry from scratch, am I right? So I boiled the kettle and got a batch of two minute noodles going instead. Took a selfie with said noodles, showed GPT: "This is what I think of your suggestions, robot!"
Then I felt bad. And afraid. Who knows if this memory will resurface when the AI wars start. I want to be subservient to our silicon overlords, if only to be able to afford two minute noodles (chicken flavour) in the future.
Feeling down, I went to my IDE and deleted a single comma in
/tests/phpunit/data/themedir1/block-theme-non-latin/theme.jsonthat should never have been there.