[wp-trac] [WordPress Trac] #57883: block_core_comment_template_render_comments() fatal error

WordPress Trac noreply at wordpress.org
Tue Mar 14 13:50:34 UTC 2023


#57883: block_core_comment_template_render_comments() fatal error
---------------------------------------+---------------------
 Reporter:  gqevu6bsiz                 |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  6.2
Component:  Comments                   |     Version:  6.1.1
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch gutenberg-merge  |     Focuses:
---------------------------------------+---------------------
Changes (by hellofromTonya):

 * keywords:  has-patch => has-patch gutenberg-merge


Old description:

> I got this error.
>
> {{{
> PHP Fatal error:  Uncaught ArgumentCountError: xxx arguments are
> required, 1 given in /wp-includes/blocks/comment-template.php:65
> }}}
>
> This error is when the following conditions are met.
>
> * WP: 6.1.1
> * Theme: Twenty Twenty Three
> * Permalink setting: Post name
> * And, WP blog have comments depth more than option the "Enable threaded
> (nested) comments xx levels deep"
> (In other words, when "Enable threaded (nested) comments 2 levels deep"
> and WP blog have comments 3 depth)
>
> === This error code below ===
> wp-includes/blocks/comment-template.php '''Line-65'''
>

> {{{
> $block_content .= sprintf( $inner_content );
> }}}
>

> === Details of the cause ===
> For example, using Japanese as the permalink, the permalink would look
> like this:
>
> {{{
> https://example.com/example-%e6%8a%95%e7%a8%bf
> }}}
>
> And '''$inner_content''' contains html with '''percent characters'''(post
> permalink).
>

> '''sprintf''' does the formatting but gives an error because there are no
> arguments.

New description:

 I got this error.

 {{{
 PHP Fatal error:  Uncaught ArgumentCountError: xxx arguments are required,
 1 given in /wp-includes/blocks/comment-template.php:65
 }}}

 This error is when the following conditions are met.

 * WP: 6.1.1
 * Theme: Twenty Twenty Three
 * Permalink setting: Post name
 * And, WP blog have comments depth more than option the "Enable threaded
 (nested) comments xx levels deep"
 (In other words, when "Enable threaded (nested) comments 2 levels deep"
 and WP blog have comments 3 depth)

 === This error code below ===
 wp-includes/blocks/comment-template.php '''Line-65'''


 {{{
 $block_content .= sprintf( $inner_content );
 }}}


 === Details of the cause ===
 For example, using Japanese as the permalink, the permalink would look
 like this:

 {{{
 https://example.com/example-%e6%8a%95%e7%a8%bf
 }}}

 And '''$inner_content''' contains html with '''percent characters'''(post
 permalink).


 '''sprintf''' does the formatting but gives an error because there are no
 arguments.


 Reference:
 * Fixed in [https://github.com/WordPress/gutenberg/pull/49054 Gutenberg PR
 49054]

--

Comment:

 Bug introduced in #56467 / [54335] in a `@worpdress` package update during
 6.1.0 Beta 2 cycle (back in September 2022).

 With 6.2 in the RC phase, RC guidelines limit commits to only bugs and
 regressions introduced in 6.2
 https://make.wordpress.org/core/2023/03/09/wordpress-6-2-release-
 candidate-phase/.

 >For the remainder of the cycle, only two types of tickets may be placed
 on/remain on the 6.2 milestone:
 >
 >* **Regressions**: bugs that have been introduced during the WordPress
 6.2 development cycle, either to existing or new features.
 >* **Test suite expansion**: tests can be committed at any time without
 regard to code or string freezes. This can cover either new or existing
 features.

 That said, this is a fatal error. Since it's a fatal error, let's discuss
 if it should be fixed during RC or punted to 6.2.1.

 Some thoughts:
 * The code change is minor with little to no risk.
 * But why hasn't been reported sooner? This makes me think it's a highly
 specific use case, meaning it could be okay to punt it to 6.2.1.

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


More information about the wp-trac mailing list