[wp-trac] [WordPress Trac] #53898: Duplicated 404 templates in the TemplatePanel

WordPress Trac noreply at wordpress.org
Mon Aug 16 18:39:29 UTC 2021

#53898: Duplicated 404 templates in the TemplatePanel
 Reporter:  Mamaduka                      |       Owner:  SergeyBiryukov
     Type:  defect (bug)                  |      Status:  closed
 Priority:  normal                        |   Milestone:  5.8.1
Component:  Editor                        |     Version:  5.8
 Severity:  normal                        |  Resolution:  fixed
 Keywords:  has-patch commit fixed-major  |     Focuses:
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


 In [changeset:"51620" 51620]:
 #!CommitTicketReference repository="" revision="51620"
 Editor: Preserve the original template keys when preparing a list of page

 Previously, the original "404" template key was lost when "Default
 template" is merged into the available templates array, as the
 `array_merge()` function renumbers numeric keys. Later, when we merge
 templates on the client side, this caused duplicate "404" templates to
 appear in the dropdown.

 By replacing the `array_merge()` call with `array_replace()`, we make sure
 to keep the original numeric keys.

 Props Mamaduka, Toro_Unit, youknowriad, SergeyBiryukov.
 Merges [51595] to the 5.8 branch.
 Fixes #53898.

Ticket URL: <https://core.trac.wordpress.org/ticket/53898#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list