[wp-trac] [WordPress Trac] #35624: Use of get_comment() function shows Notice

WordPress Trac noreply at wordpress.org
Fri Feb 5 23:01:31 UTC 2016


#35624: Use of get_comment() function shows Notice
--------------------------+--------------------
 Reporter:  WisdmLabs     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4.3
Component:  Comments      |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------

Comment (by d4z_c0nf):

 Just to be more accurate:
 @WisdmLabs didn't say that {{{get_comment_author_email_link()}}} prompted
 this ticket to be opened in the first place :)
 He identified {{{get_comment()}}} as culprit (as the ticket title reads),
 and referenced two functions which calls it.
 Infact he didn't say he was using any template tag within the context of a
 comment reply form, he said he used a {{{wp_list_comments()}}} callback,
 which, per se, cannot generate that issue (as it's in the comments loop)
 :D
 He also restricted the issue to a specific case : replying to a comment
 without the js handling.
 So, for my understanding, the issue was/is, in his and my case, only the
 one inside {{{comment_reply_title()}}}.

 Also if he had used one of those template tags within the context of the
 comment form he'd have faced the same issue, not only while replying, but
 just loading the comment form (always when before the comments loop),
 'cause when not replying the global {{{$comment}}} is unset. To avoid that
 he should have conditioned the use of such template tags to the state of
 the the global {{{$comment}}}, and if so he wouldn't have faced the
 'Notice' while replying too.

 For the record, that check will still be needed (when not replying) with
 @boonebgorges patch.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35624#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list