[wp-trac] [WordPress Trac] #33154: Issues with Editing Comments where the post ID is zero or post is deleted
WordPress Trac
noreply at wordpress.org
Thu Aug 13 00:01:29 UTC 2015
#33154: Issues with Editing Comments where the post ID is zero or post is deleted
-----------------------------+-----------------------------
Reporter: johnnietb | Owner: pento
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.2.5
Component: Role/Capability | Version: 4.2.3
Severity: normal | Resolution:
Keywords: has-patch | Focuses: administration
-----------------------------+-----------------------------
Comment (by dd32):
Replying to [comment:19 dd32]:
> Replying to [comment:16 ocean90]:
> > With [attachment:33154.3.diff] the response column is empty for
existing posts too. `$post = get_post( $comment->comment_post_ID );` in
`WP_Comments_List_Table::single_row()` sets the global `$post` variable so
that `get_post()` in `WP_Comments_List_Table::column_response()` returns
the correct post object.
> >
> > [attachment:33154.4.diff] fixes this issue by using `get_post(
$comment->comment_post_ID )` in
`WP_Comments_List_Table::column_response()`.
>
> Reliance on Globals, Ugh. Good catch, updated patch gets a +1 from me.
I take that back, Reliance on Globals = Ugh. If my change broke core,
imagine what custom columns could be doing :)
I guess we need to slip `$GLOBALS['post'] = get_post( ... )` back in some
form, be it through the original patch here, or through
[attachment:33154.4.diff] with some back-compat added in.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33154#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list