#70 closed defect (bug) (fixed)
Titles of make blogs are messed up
| Reported by: | samuelsidler | Owned by: | |
|---|---|---|---|
| Priority: | trivial | Milestone: | |
| Component: | Make (Get Involved) / P2 | Keywords: | has-patch has-unit-tests |
| Cc: |
Description
The titles of all make blogs are duplicated. e.g.:
"Make WordPress CoreMake WordPress Core"
Attachments (1)
Change History (9)
This ticket was mentioned in PR #10930 on WordPress/wordpress-develop by @adamsilverstein.
6 months ago
#5
- Keywords has-unit-tests added
## Summary
Register the _wp_note_reactions comment meta in wp_create_initial_comment_meta(), alongside the existing _wp_note_status meta. This meta stores emoji reaction data for the block editor's collaborative Notes feature.
### Data Model
Each emoji key (e.g., "👍", "❤️") maps to an array of reaction objects:
{
"👍": [
{ "userId": 1, "date": "2025-01-15T10:30:00" },
{ "userId": 2, "date": "2025-01-15T11:00:00" }
],
"❤️": [
{ "userId": 1, "date": "2025-01-15T10:35:00" }
]
}
### REST Schema
- Type:
object - Single:
true - Default:
[](empty array) additionalProperties: Each property is an array of objects with:userId(integer) — The reacting user's IDdate(string|null, date-time format) — When the reaction was added
### Auth
Uses the same edit_comment capability check as _wp_note_status.
## References
- Gutenberg PR: https://github.com/WordPress/gutenberg/pull/75148
- Trac ticket: (to be created)
---
This is a code-review-only PR. The corresponding Trac ticket will be created and linked.
@adamsilverstein commented on PR #10930:
6 months ago
#6
I have updated this backport PR to apply the custom comment type approach for storage used in https://github.com/WordPress/gutenberg/pull/75549 which replaces the meta based approach in https://github.com/WordPress/gutenberg/issues/75144.
@adamsilverstein commented on PR #10930:
3 months ago
#7
Thanks for the review @t-hamano! I've pushed f3b5af251b addressing the feedback:
@sincebumps: Updated all PR-introduced@since 7.0.0to@since 7.1.0(incomment.php,link-template.php, andclass-wp-rest-comments-controller.php).WP_Comment_Query: Updated the existing exclusion block to iterate overwp_get_internal_comment_types()so bothnoteandreactionare excluded by default unless explicitly requested.get_lastcommentmodified(): Added acomment_type NOT IN (…)clause built fromwp_get_internal_comment_types()to all three timezone branches so internal comment types no longer affect the last modified date.- Reaction icon list: Moved
wp_get_note_reaction_emojis()intoWP_REST_Comments_Controller::get_note_reaction_emojis()as aprotected staticmethod, per your suggestion to avoid a public global while the icon-library plans are still being worked out. wp_internal_comment_typesfilter: Removed — agreed it's not needed for an internal helper.wp_list_plucksimplification at line 360: Applied. The'note' === $comment->comment_typecheck inside the loop was redundant since$request['type']is already gated to'note'above andWP_Comment_Queryconstrains the result set, so it's gone too.
Locally, the relevant test suites (Tests_Comment_*, Tests_REST_Comments, Tests_Avatar) all pass: OK (165 tests, 476 assertions).
@adamsilverstein commented on PR #10930:
4 weeks ago
#8
Re-synced this branch with the latest changes on the upstream Gutenberg PR (https://github.com/WordPress/gutenberg/pull/76767), which had accumulated some PHP hardening since the last update here. Two new commits:
REST API: Harden reaction validation and canonicalize stored slugs (dd9b750d51)
- A reaction's parent note must now belong to the post the reaction targets.
- Hex-codepoint slugs are validated against assignable Unicode: values above U+10FFFF or in the UTF-16 surrogate range (U+D800-U+DFFF) are rejected.
- The stored
comment_contentis the validated canonical slug, so markup in the request (e.g.<b>heart</b>) can no longer splitreaction_summarygrouping. - Error codes now match the Gutenberg implementation (
rest_comment_invalid_parent,rest_comment_invalid_reaction,rest_comment_duplicate_reaction), so client-observable behavior won't change when the feature ships in core.
REST API: Converge concurrent duplicate reactions to a single row (417c5bf9c1)
- The pre-insert uniqueness check is not atomic, so concurrent requests could both insert. After insert, the earliest matching row (lowest comment ID) is kept, later duplicates are deleted, and the response repoints to the survivor.
New tests cover the same-post parent check, invalid codepoints (5 cases), canonical slug storage, and the concurrency convergence (simulated via rest_pre_insert_comment injection). Full WP_Test_REST_Comments_Controller suite passes: 223 tests, 1089 assertions.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Otto, can you review this?