[wp-trac] [WordPress Trac] #55437: Bugfix: Display correct theme in site editor

WordPress Trac noreply at wordpress.org
Wed Mar 8 22:16:28 UTC 2023


#55437: Bugfix: Display correct theme in site editor
-------------------------------------------------+-------------------------
 Reporter:  ptahdunbar                           |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.2
Component:  Themes                               |     Version:  5.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:  ui,
  tests dev-feedback                             |  administration
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-testing has-unit-tests => has-patch needs-
     testing has-unit-tests dev-feedback
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Reopening as [54860] broke saving changes in a parent's template part that
 is not in the active child theme's template parts. See #57630.

 Why?

 @azaozz and I think (and are assuming) `$template_file` (which is
 populated in `_get_block_templates_files()` is the actual filesystem
 location of each template part. So the `'theme'` element is which theme
 has this template part.

 In `_build_block_template_result_from_file()`, the later code using
 `$template->theme` expects it to be the active theme, not the theme where
 the template part lives.

 What we don't understand is: How is `$template->theme` used? It seems
 there's a mismatch somewhere between how the Site Editor saves changes
 (#57630) and how the UI lists them (this ticket).

 As the changeset has broken saving parent template parts, this changeset
 needs to be reverted for 6.2. And then a deeper review can occur in 6.3 to
 understand where the root cause(s) is(are). It is possible there is an
 underlying issue that is affecting both of these tickets.

 I'm preparing the revert now.

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


More information about the wp-trac mailing list