[wp-trac] [WordPress Trac] #60928: 500 Error on Posts with empty image

WordPress Trac noreply at wordpress.org
Thu Apr 4 19:13:48 UTC 2024


#60928: 500 Error on Posts with empty image
-----------------------------+-----------------------------
 Reporter:  donohoe          |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  6.5
 Severity:  major            |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 My team was investigating a 500 internal server error. We are not clear on
 if this bug relates to specific issue (as it affected the homepage, and
 this relates to a Post) but it surfaced other problems.

 We have a published post from 2023 and one more from 2022.

 When accessing the published URL there was an issue rendering the page as
 soon as it got to the core content of the story. See screenshot.

 Example from log files:

 {{{
 PHP Fatal error: Uncaught TypeError: {closure}():
 Argument #1 ($content) must be of type string, null given,
 called in /wordpress/core/6.5/wp-includes/class-wp-hook.php on line 326
 and defined in /wordpress/core/6.5/wp-includes/interactivity-api
 /interactivity-api.php:46

 Stack trace:
 #0 /wordpress/core/6.5/wp-includes/class-wp-hook.php(326): {closure}(NULL,
 Array)
 #1 /wordpress/core/6.5/wp-includes/plugin.php(205):
 WP_Hook->apply_filters(NULL, Array)
 #2 /wordpress/core/6.5/wp-includes/class-wp-block.php(525):
 apply_filters('render_block_co...', NULL, Array, Object(WP_Block))
 #3 /wordpress/core/6.5/wp-includes/blocks.php(1705): WP_Block->render()
 #4 /wordpress/core/6.5/wp-includes/blocks.php(1743): render_block(Array)
 #5 /wordpress/core/6.5/wp-includes/class-wp-hook.php(324): do_blocks('<!--
 wp:paragra...')
 #6 /wordpress/core/6.5/wp-includes/plugin.php(205):
 WP_Hook->apply_filters('<!-- wp:paragra...', Array)
 #7 /wordpress/core/6.5/wp-includes/post-template.php(256):
 apply_filters('the_content', '<!-- wp:paragra...')
 #8 /srv/htdocs/wp-content/themes/orbis/template/content.php(169):
 the_content('Continue readin...')
 #9 /wordpress/core/6.5/wp-includes/template.php(812):
 require('/srv/htdocs/wp-...')
 #10 /wordpress/core/6.5/wp-includes/template.php(745):
 load_template('/srv/htdocs/wp-...', false, Array)
 #11 /wordpress/core/6.5/wp-includes/general-template.php(206):
 locate_template(Array, true, false, Array)
 #12 /srv/htdocs/wp-content/themes/orbis/single-post.php(20):
 get_template_part('template/conten...', 'post')
 #13 /wordpress/core/6.5/wp-includes/template-loader.php(106):
 include('/srv/htdocs/wp-...')
 #14 /wordpress/core/6.5/wp-blog-header.php(19):
 require_once('/wordpress/core...')
 #15 /wordpress/core/6.5/index.php(17): require('/wordpress/core...')
 #16 {main} thrown in /wordpress/core/6.5/wp-includes/interactivity-api
 /interactivity-api.php on line 46
 }}}

 We were also unable to open the Post in the WP Admin. Error screen with
 text:

 {{{There has been a critical error on this website. Please check your site
 admin email inbox for instructions.}}}

 We exported the Post using the Export tool to review the contents. The
 only anomaly was this empty image markup:

 {{{
 <!-- wp:image -->
 <figure class="wp-block-image"><img alt=""/></figure>
 <!-- /wp:image -->
 }}}

 When we used this in the Code Editor on a local environment running
 earlier version of WordPress (perhaps 6.2?) and it worked fine. We
 upgraded it to 6.5 and were seeing the same problems.

 We searched the exported XML for this and found one other Post with this
 same markup. In testing the Post web page it also had the same problem.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60928>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list