Opened 9 years ago
Closed 9 years ago
#34654 closed defect (bug) (fixed)
Global comment object no longer exists on Admin Comments page
Reported by: | StephenCronin | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Comments | Keywords: | |
Focuses: | Cc: |
Description
In testing one of my plugins with 4.4-beta3, I found it broke because the global comment object no longer exists on the Admin Comments page. Presumably this was removed in 4.4?
The plugin filters the comment text using the get_comment_text
filter and uses global $comment;
in the resulting function. However $comment is now null rather than an object.
I can fix my plugin easily enough, as get_comment_text passes the comment object as the second parameter (thanks @dd32!), but there may be other plugins out there doing something similar, so I thought I'd report it so you're aware of this.
More details:
The plugin in question is https://wordpress.org/plugins/show-parent-comment/
The affected code is here: https://plugins.trac.wordpress.org/browser/show-parent-comment/tags/0.2/show-parent-comment.php
The global $comment
in question is on line 41. When $comment is used on line 44, it throws a "Notice: Trying to get property of non-object" message.
Change History (4)
#2
@
9 years ago
- Milestone changed from Awaiting Review to 4.4
- Owner set to wonderboymusic
- Status changed from new to assigned
@wonderboymusic, @rachelbaker, @boonebgorges: This something to worry about?