Opened 3 years ago
Closed 3 years ago
#53898 closed defect (bug) (fixed)
Duplicated 404 templates in the TemplatePanel
Reported by: | Mamaduka | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.8.1 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Editor | Keywords: | has-patch commit fixed-major |
Focuses: | Cc: |
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.
3 years ago
#1
- Keywords has-patch added
3 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.
#11
@
3 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 51595:
#12
@
3 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for backporting to the 5.8 branch.
SergeyBiryukov commented on PR #1561:
3 years ago
#13
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51595.
Changes
array_merge
witharray_replace
. The latter will keep the same numeric keys.Verification example: https://3v4l.org/tlft6
Trac ticket: https://core.trac.wordpress.org/ticket/53898