[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 22:33:30 UTC 2016
#38700: REST API: Cannot send an empty or no-op comment update
------------------------------------------------+--------------------------
Reporter: jnylen0 | Owner: rmccue
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
Component: REST API | Release
Severity: normal | Version: trunk
Keywords: has-patch has-unit-tests 4.8-early | Resolution:
| Focuses:
------------------------------------------------+--------------------------
Changes (by dd32):
* keywords: has-patch has-unit-tests => has-patch has-unit-tests 4.8-early
Comment:
(re-adding early keyword unless it's moved out of Future Release)
I agree that these error conditions should be fixed, I don't personally
believe that the error conditions need to be disambiguated right-this-
instant though. Error messages are probably the easiest thing to expand
upon in future iterations.
I disagree that discarding the return value is a viable option here, it's
not. At the very minimum those two checks should be performed, and then a
`false === $wp_update_comment_return` should also be added which returns
the current error.
[attachment:38700.wp-error.diff] is the changed needed to
`wp_update_comment()` so you can disambiguate the errors (and also fixes
the incorrect PHPDoc to show how wild the return values are - "0 or 1 on
success, 0.. on failure"), if others feel that it's worth pushing ahead
here and that it's the most important thing to do, this is the route I'd
suggest taking when no compromise is being made. `wp_update_comment()`
really needs a make over.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38700#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list