Opened 8 days ago
Last modified 8 days ago
#43556 new defect (bug)
Ensure only sidebar sections are considered when comparing against registered sidebars in Customizer
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.1 |
| Component: | Customize | Keywords: | has-patch |
| Focuses: | javascript | Cc: |
Description
In the Customizer's widgets panel, commonly sections for each registered sidebar are added. However, it is possible to also register regular sections to it, for example it may be useful to add one general settings section related to more general sidebar behavior.
For the most part this works seamlessly, there is just one detail I noticed. Commonly a notice will show in the Customizer if there is at least one registered sidebar that cannot be displayed for the currently previewed page. However this check counts all sections in the panel and compares them to the number of registered sidebars, where it should actually only count the sections that are actually intended to represent sidebars.
In my personal example, I added one additional section of type default, and there was one section of type sidebar which could not be displayed for the currently previewed page. However, since my default section was active, the count matched the registered sidebar count again, causing the notice to falsely not display.
43556.diff ensures that only sections of the type sidebar are counted, to fix this bug.