[wp-trac] [WordPress Trac] #38700: REST API: Cannot send an empty or no-op comment update
WordPress Trac
noreply at wordpress.org
Tue Nov 8 05:32:38 UTC 2016
#38700: REST API: Cannot send an empty or no-op comment update
--------------------------------------+------------------------------
Reporter: jnylen0 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------------
Comment (by jnylen0):
The following scenario seems fairly plausible to me:
- A client submits a comment edit with some transformation needed (an
invalid entity; a disallowed HTML tag). HTTP 200
- The client accidentally submits the same request again (the user clicked
save twice in a row). The content in the database is different from what
was submitted, and we pass off to `wp_update_comment`, which "fails" but
not really. HTTP 500 this time.
The real problem is the inconsistent return values of `wp_update_comment`,
so we should address the issue right there at the source. Maybe to avoid
`did_action` or flag-setting hacks, we should add a filter that allows us
to change the "real" error return value from `0` to `false`, then remove
it when we get done?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38700#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list