[wp-trac] [WordPress Trac] #58027: Post Content / Post Featured Image blocks break content if added before the loop (was: Post Featured Image block breaks content if added before the loop)

WordPress Trac noreply at wordpress.org
Thu Mar 30 22:29:24 UTC 2023


#58027: Post Content / Post Featured Image blocks break content if added before the
loop
--------------------------+------------------------------
 Reporter:  edge22        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  5.8
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by flixos90):

 * version:  6.2 => 5.8


Comment:

 @edge22 I can reproduce this issue. I am curious however, how did you ran
 into it? My first hunch would be to consider this an edge-case, since why
 would you use a block intended for FSE / block themes in a classic theme?
 I would like to understand in which legitimate use-case would be affected
 by this bug.

 I also would like to add that this bug is not actually new. While the
 logic was added to the `post-featured-image` block in 6.2, it was directly
 taken over from the same code being in the `post-content` block. If you
 put the same code from your snippet but with the `post-content` block,
 you'll see the same problem occur. While I would love to understand better
 where this realistically is a problem, I certainly agree that that logic
 feels clunky, and I am not sure why it's there.

 The logic (i.e. also the bug) has been in that block since it was
 originally added in WordPress 5.8 (introduced as part of [50929] and
 [51344]). Digging further, it looks like the original logic was introduced
 in https://github.com/WordPress/gutenberg/pull/30405. Acknowledging that
 this was added almost 2 years ago, @aristath @ntsekouras do you have any
 memory on why enforcing a loop was added in that post? Shouldn't we rather
 make sure, outside of that block, that it is used within a loop?

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


More information about the wp-trac mailing list