Opened 5 years ago
Closed 5 years ago
#53898 closed defect (bug) (fixed)
Duplicated 404 templates in the TemplatePanel
| Reported by: | Mamaduka | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.8.1 |
| Component: | Editor | Version: | 5.8 |
| Severity: | normal | Keywords: | has-patch commit fixed-major |
| Cc: | Focuses: |
Description
The issue was initially reported on Github - https://github.com/WordPress/gutenberg/issues/33929.
The original "404" template key is lost when we merge "Default template" into the available templates array. The array_merge will re-index/re-number keys with numbering values.
Later, when we merge templates on the client-side, this causes duplicated "404" templates in the dropdown.
Attachments (1)
Change History (15)
This ticket was mentioned in PR #1561 on WordPress/wordpress-develop by Mamaduka.
5 years ago
#1
- Keywords has-patch added
5 years ago
#8
Thanks for the review, @youknowriad.
I think I need to swap argument positions so the "Default template" is always the first item in the array.
I will push this change in few minutes.
#12
@
5 years ago
- Keywords fixed-major added
- Resolution fixed
- Status closed → reopened
Reopening for backporting to the 5.8 branch.
SergeyBiryukov commented on PR #1561:
5 years ago
#13
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51595.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Changes
array_mergewitharray_replace. The latter will keep the same numeric keys.Verification example: https://3v4l.org/tlft6
Trac ticket: https://core.trac.wordpress.org/ticket/53898