You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The #reply-title element is not getting the correctly populated in Twenty Nineteen. It is being output as:
<span[text]='commentform_post_2013.replyToName ? "Leave a Reply to " + commentform_post_2013.replyToName + "" : "Leave a Reply"'></span>
Notice the text content of the span is empty, but no value of [text] is empty.
In #development=1 mode, this is generating a warning:
Default value () does not match first result (Leave a Reply) for <SPAN [text]="commentform_post_2013.replyToName ? "Leave a Reply to " + commentform_post_2013.replyToName + "" : "Leave a Reply"">. We recommend writing expressions with matching default values, but this can be safely ignored if intentional.
It also exhibits a strange behavior when adding comment text to the form.
Upon entering text:
Then hit tab to go to the Submit button, and the “Leave a Reply” heading all of a sudden appears:
The problem here is that Twenty Nineteen renders its comment form via twentynineteen_comment_form() which does:
In particular, the title_reply here is supplied as null. This is causing problems in the \AMP_Theme_Support::filter_comment_form_defaults() method which is doing the following:
The problem is that comment_form() applies filters on comment_form_defaults, not on the actual args passed to comment_form(). Therefore, we don't actually know what value for title_reply was passed.
This hasn't been a problem before Twenty Nineteen because themes normally are calling comment_form() without any args at all.
The text was updated successfully, but these errors were encountered:
We're running into a similar issue in Newspack, where we have a simple plugin that lets you change the comment form text, including the "reply" header:
The Newspack theme is also a fork of Twenty Nineteen and does have the duplicate header issue, but I'm working on removing some of that code, since it's not needed. We will still need to pass a unique title to comment_form(), though, which gets changed to "Leave a Reply" when you interact with the form or toggle the search.
For the short term, we can work around both by hiding and replacing that title, but if it's possible to have AMP use the title value passed to comment_form(), that would be awesome!
The
#reply-title
element is not getting the correctly populated in Twenty Nineteen. It is being output as:Notice the text content of the
span
is empty, but no value of[text]
is empty.In
#development=1
mode, this is generating a warning:It also exhibits a strange behavior when adding comment text to the form.
Upon entering text:
Then hit tab to go to the Submit button, and the “Leave a Reply” heading all of a sudden appears:
The problem here is that Twenty Nineteen renders its comment form via
twentynineteen_comment_form()
which does:In particular, the
title_reply
here is supplied asnull
. This is causing problems in the\AMP_Theme_Support::filter_comment_form_defaults()
method which is doing the following:amp-wp/includes/class-amp-theme-support.php
Lines 1162 to 1191 in 3985eae
The problem is that
comment_form()
applies filters oncomment_form_defaults
, not on the actual args passed tocomment_form()
. Therefore, we don't actually know what value fortitle_reply
was passed.This hasn't been a problem before Twenty Nineteen because themes normally are calling
comment_form()
without any args at all.The text was updated successfully, but these errors were encountered: