[wp-trac] [WordPress Trac] #55000: 5.9 kills gutenberg blocks

WordPress Trac noreply at wordpress.org
Sun Jan 30 22:42:43 UTC 2022


#55000: 5.9 kills gutenberg blocks
--------------------------+------------------------------
 Reporter:  stevesand     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by glendaviesnz):

 Thanks for reporting this @stevesand.

 A migration was added to the Cover block code to automatically migrate the
 old block structure to the new structure in order to maintain the
 background dim setting, so not sure why that did not work in your
 situation.

 I took the following block structure from a pre 5.9 site:


 {{{
 <!-- wp:cover {"url":"http://localhost:8889/wp-
 content/uploads/2022/01/tree1.jpeg","id":75, "dimRatio":40} -->
 <div class="wp-block-cover has-background-dim-40 has-background-dim">
         <img class="wp-block-cover__image-background wp-image-75" alt=""
 src="http://localhost:8889/wp-content/uploads/2022/01/tree1.jpeg" data-
 object-fit="cover"/>
         <div class="wp-block-cover__inner-container">
                 <!-- wp:paragraph {"align":"center","placeholder":"Write
 title…","fontSize":"large"} -->
                 <p class="has-text-align-center has-large-font-size">
                         Guten Berg!
                 </p>
                 <!-- /wp:paragraph -->
         </div>
 </div>
 <!-- /wp:cover -->

 }}}

 and when pasted into a 5.9 site it converted it to the following
 structure:


 {{{
 <!-- wp:cover {"url":"http://localhost:8889/wp-
 content/uploads/2022/01/tree1.jpeg","id":75,"dimRatio":40} -->
 <div class="wp-block-cover"><span aria-hidden="true" class="has-
 background-dim-40 wp-block-cover__gradient-background has-background-
 dim"></span><img class="wp-block-cover__image-background wp-image-75"
 alt="" src="http://localhost:8889/wp-content/uploads/2022/01/tree1.jpeg"
 data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!--
 wp:paragraph {"align":"center","placeholder":"Write
 title…","fontSize":"large"} -->
 <p class="has-text-align-center has-large-font-size">
                         Guten Berg!
                 </p>
 <!-- /wp:paragraph --></div></div>
 <!-- /wp:cover -->
 }}}


 and the opacity displayed as expected in the editor and the frontend.

 Do you have still have access to the block markup from one of your cover
 blocks prior to the 5.9 upgrade (the block markup as above can be accessed
 in the editor by clicking on the menu at the top left and selecting 'Code
 Editor')? There may be something different about the block structure in
 your case that hasn't been accounted for in the migrations.

 Also, if you are able to provide details of which theme the site is using
 that may also help to track down the cause of the issue.

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


More information about the wp-trac mailing list