[wp-trac] [WordPress Trac] #57630: Site Editor: Template part customization is not saved for certain child themes

WordPress Trac noreply at wordpress.org
Wed Mar 8 19:31:55 UTC 2023


#57630: Site Editor: Template part customization is not saved for certain child
themes
--------------------------+---------------------
 Reporter:  mreishus      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.2
Component:  Themes        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------
Changes (by hellofromTonya):

 * milestone:  Awaiting Review => 6.2


Comment:

 Env:

 * Child theme: Twenty Twenty-Two (Red) - WordPress.com
 * Parent theme: Twenty Twenty-Two - WordPress.com
 * Plugins: none
 * WordPress: `trunk`
 * OS: macOS
 * Browser: Firefox

 In a brief investigation, found the following:

 * `get_stylesheet()` returns the child theme, thus `$theme` has the child
 theme's stylesheet name.
 This is expected ✅

 * The theme in the `$template_file` array is pointing to the parent theme.
 This is not expected ❌ It should be pointing to the child theme and its
 template part.

 Why is the parent theme info `$template_file` being passed into the
 function?

 My current thinking:
 * the problem is happening before this function is called, i.e. where the
 child vs. parent decision making happens for which template part to pass
 to the function.
 * [54860] is not the root cause, but rather before that changeset, it was
 hiding this mismatch problem.

 This issue will need a backtrace to following the decision making before
 `_build_block_template_result_from_file()` is invoked.

 == Regression or Bug?

 On the surface this looks like a regression. Underneath, the bug was
 hidden but then revealed by [54860].

 I'm pulling this into 6.2 for visibility. In the current state, child
 theme template parts like this example are broken.

 Need to make some decisions. Some options might be:
 * Revert [54860] for now until the root cause is found.
 * Deep dive to figure out where the root cause is and fix it. But this
 will likely trigger another Beta and may not happen for RC1 which is
 tomorrow.

 Pinging @audrasjb @SergeyBiryukov @costdev

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


More information about the wp-trac mailing list