WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#42346 closed defect (bug) (worksforme)

Theme count is wrong in customizer

Reported by: subrataemfluence Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.2
Component: Customize Keywords: has-patch
Focuses: javascript, administration Cc:

Description

When I go to Appearance > Customize > Change Theme and type in something in the text box, the count above gets updated based on visible items in the list below.

However, this count is coming wrong, i.e. it is showing the previous count. Meaning when I have say 5 items in the list it is showing 7 (which was actually the previous count)

I have uploaded a screen cast in support. Hope this will help to understand the actual issue I have encountered.

https://www.youtube.com/watch?v=JbAXh-I6gBc

Attachments (1)

42346.diff (579 bytes) - added by subrataemfluence 4 years ago.
Proposed patch

Download all attachments as: .zip

Change History (7)

#1 @subrataemfluence
4 years ago

  • Component changed from General to Customize

#2 @subrataemfluence
4 years ago

  • Keywords needs-patch added

Actual code in wp-admin/js/customize-controls.js

renderScreenshots();

// Update theme count.
count = section.container.find( 'li.customize-control:visible' ).length;
section.container.find( '.theme-count' ).text( count );

While a Timeout wrapper with a 300 ms delay fixes the issue. I propose the following:

renderScreenshots();

window.setTimeout(function(){
   // Update theme count.
   count = section.container.find( 'li.customize-control:visible' ).length;
   section.container.find( '.theme-count' ).text( count );
}, 300);

@subrataemfluence
4 years ago

Proposed patch

#3 @subrataemfluence
4 years ago

  • Keywords has-patch added; needs-patch removed

#4 @adamsilverstein
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

@subrataemfluence Thanks for the bug report!

I tried to reproduce this in trunk and it looks like the theme browsing experience in the customizer is a bit refactored and no longer suffers from the bug you noted. Since its such a minor bug, I don't think its worth backporting to older releases.

Here is a screencast of searching themes in the current customizer in trunk (soon to be 4.9):

https://cl.ly/321s2c3a1v1a

I really appreciate your efforts finding these bugs, I notice you are on a roll!

I am guessing you are testing on the last release version (4.8), can I suggest you check out and work from the github develop repository: https://github.com/WordPress/wordpress-develop - check this out and set up wordpress from the src directory - then you can develop your patches against trunk which is far more useful for core patches. (see here for some more details - https://make.wordpress.org/core/handbook/contribute/git/)

Thanks again.

#5 @subrataemfluence
4 years ago

Thank you for your appreciation! I am testing things on 4.8.2.

From now on I will use https://github.com/WordPress/wordpress-develop. Thank you once again for providing me the resource.

One question though. I have seen the screencast and looks like this is already taken care of. WP team is awesome!

#6 @adamsilverstein
4 years ago

One question though. I have seen the screencast and looks like this is already taken care of.

Yes, I closed this one because it is no longer an issue.

Note: See TracTickets for help on using tickets.