Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 15 months ago

#61578 closed defect (bug) (fixed)

Issue with search functionality in installed themes section

Reported by: nithi22 Owned by: joedolson
Priority: normal Milestone: 6.6.2
Component: Themes Version: 6.6
Severity: normal Keywords: has-patch has-test-info commit fixed-major dev-reviewed
Cc: Focuses: accessibility, administration

Description

If we navigate to Appearance > Themes and use the search box to check if a theme is already installed, it works as expected as we are entering the search term and don't press the enter key. In this instance, it will display "No themes found. Try a different search." However, if we enter the name of a theme that is not installed and press the enter key, the page will refresh and show the list of installed themes instead of displaying "No themes found. Try a different search.".

Environment

  • WordPress: 6.6-RC2
  • PHP: 8.2.0
  • Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2u PHP/8.2.0 mod_wsgi/3.5 Python/2.7.18 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
  • Database: mysqli (Server: 5.7.39 / Client: mysqlnd 8.2.0)
  • Browser: Firefox 127.0 (macOS)
  • Theme: Twenty Twenty-Four 1.1
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.5

Steps to Reproduce

  1. Navigate to Appearance > Themes.
  2. Enter the name of a theme that is not installed in the search box.
  3. Press the enter key.
  4. Observe that the page refreshes and shows the list of installed themes instead of displaying the "No themes found. Try a different search" message.

Expected Results

  1. When pressing the enter key after entering a search term for a theme that is not installed, it should display "No themes found. Try a different search."

Actual Results

  1. When pressing the enter key after entering a search term for a theme then the page refreshes and shows the list of installed themes instead of the "No themes found. Try a different search" message.

Attachments (6)

AddThemeSearch-6.5.5.gif (1.1 MB ) - added by hellofromTonya 2 years ago.
Add Theme > Search on WP 6.5.5
AddThemeSearch-6.6.1.gif (6.0 MB ) - added by hellofromTonya 2 years ago.
Add Theme > Search on WP 6.6.1
AddThemeSearch-withPR6976.gif (2.6 MB ) - added by hellofromTonya 2 years ago.
Add Theme > Search with PR 6976 applied : Works as expected โœ…
ThemesSearch-6.5.5.gif (1.6 MB ) - added by hellofromTonya 2 years ago.
Appearance > Themes > Search on WP 6.5.5 : shows the behavior before 6.6.0
ThemesSearch-6.6.1.gif (4.2 MB ) - added by hellofromTonya 2 years ago.
Appearance > Themes > Search on WP 6.6.1 : shows the bugs ๐Ÿž
ThemesSearch-withPatch.gif (5.9 MB ) - added by hellofromTonya 2 years ago.
Appearance > Themes > Search on WP trunk with PR 6976 applied : shows bugs are resolved and works as expected โœ…

Change History (35)

#2 @the ank
2 years ago

Hi,

This bug exists in Playground. However, if we download 6.6-RC2 now, it does not show that bug anymore.

Edit- Yes I can see the bug when press Enter.

Last edited 2 years ago by the ank (previous) (diff)

This ticket was mentioned in โ€‹PR #6976 on โ€‹WordPress/wordpress-develop by โ€‹@the ank.


2 years ago
#3

  • Keywords has-patch added

#4 @sabernhardt
2 years ago

  • Milestone Awaiting Review โ†’ 6.6
  • Version โ†’ trunk

This ticket was mentioned in โ€‹Slack in #core-test by monikarao. โ€‹View the logs.


2 years ago

#6 @monikarao
2 years ago

#61601 was marked as a duplicate.

#7 @joedolson
2 years ago

  • Owner set to joedolson
  • Status new โ†’ accepted

#8 @joedolson
2 years ago

  • Milestone 6.6 โ†’ 6.6.1

Wish I'd seen this sooner; it could have made 6.6. At this point, however, I think it'll have to go into 6.6.1.

This ticket was mentioned in โ€‹Slack in #core by hellofromtonya. โ€‹View the logs.


2 years ago

#10 @hellofromTonya
2 years ago

6.6.1 RC will likely happen late tomorrow, July 18th (no time is set yet). Discussed this ticket in today's scrub. As the patch isn't ready yet, will move this ticket to 6.6.2 (once that milestone is available in Trac).

#11 @hellofromTonya
2 years ago

  • Milestone 6.6.1 โ†’ 6.6.2

โ€‹@the ank commented on โ€‹PR #6976:


2 years ago
#12

All suggested changes are applied, thank you :)

โ€‹@jeherve commented on โ€‹PR #6976:


2 years ago
#13

This tests well for me on 6.6.1. Thanks for working on a fix!

โ€‹@the ank commented on โ€‹PR #6976:


2 years ago
#14

Awesome, Thank you!

#15 @sabernhardt
2 years ago

#61788 was marked as a duplicate.

#16 follow-up: @josklever
2 years ago

#61788 was closed as duplicate, although it described a different location where the bug appears (wp-admin/theme-install.php). That's for installing new themes. But it's probably the same issue.

I've applied the changes on wp-admin/js/theme.js (it's probably me, because I don't understand the paths in the PR, but I guess that's the one that needs the change), but that doesn't seem to work.

Via Playground I can't test this, because it's not possible to install new theme's so the search doesn't work there.

Can somebody please test the PR by going to Appearance - Themes - Install new theme and do a search there followed by pressing enter?

#17 @hellofromTonya
2 years ago

  • Keywords has-testing-info added

[58405] appears to be the changeset that introduced the bug. Noting here for context and commit follow-up history.

#18 in reply to: ↑ 16 ; follow-up: @hellofromTonya
2 years ago

Replying to josklever:

#61788 was closed as duplicate, although it described a different location where the bug appears (wp-admin/theme-install.php). That's for installing new themes. But it's probably the same issue.

I've applied the changes on wp-admin/js/theme.js (it's probably me, because I don't understand the paths in the PR, but I guess that's the one that needs the change), but that doesn't seem to work.

Via Playground I can't test this, because it's not possible to install new theme's so the search doesn't work there.

Can somebody please test the PR by going to Appearance - Themes - Install new theme and do a search there followed by pressing enter?

Thanks for alerting. I'll reopen that Trac ticket as I just tested it on 6.5 and it doesn't work there either for me. Seems unrelated to the bug introduced in 6.6.

#19 in reply to: ↑ 18 @hellofromTonya
2 years ago

Replying to hellofromTonya:

Replying to josklever:

#61788 was closed as duplicate, although it described a different location where the bug appears (wp-admin/theme-install.php). That's for installing new themes. But it's probably the same issue.

I've applied the changes on wp-admin/js/theme.js (it's probably me, because I don't understand the paths in the PR, but I guess that's the one that needs the change), but that doesn't seem to work.

Via Playground I can't test this, because it's not possible to install new theme's so the search doesn't work there.

Can somebody please test the PR by going to Appearance - Themes - Install new theme and do a search there followed by pressing enter?

Thanks for alerting. I'll reopen that Trac ticket as I just tested it on 6.5 and it doesn't work there either for me. Seems unrelated to the bug introduced in 6.6.

Wait, I was wrong. I now understand. Entering a theme name in the Add Themes > search field should automatically trigger a search. That worked in 6.5.5, but doesn't in 6.6.0.

Applying the patch resolves the issue for me, showing the issue is related to the [58405] change. Thus, #61788 is a duplicate of this ticket but with a different set of testing steps.

I'll add a test report shortly.

@hellofromTonya
2 years ago

Add Theme > Search on WP 6.5.5

@hellofromTonya
2 years ago

Add Theme > Search on WP 6.6.1

@hellofromTonya
2 years ago

Add Theme > Search with PR 6976 applied : Works as expected โœ…

#20 @hellofromTonya
2 years ago

Test Report for Appearance > Themes > Add Themes

Patch tested: โ€‹https://github.com/WordPress/wordpress-develop/pull/6976

Steps to Reproduce or Test

  1. Navigate to Appearance > Themes > Add Theme.
  2. In the search box, enter a valid theme's name or part of a name, e.g. "News".
    • Expected: Page should refresh with a list of themes with "News" in their name.
  3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • Expected: Nothing should happen.
  4. In the search box, enter an invalid theme name, e.g. "sometheme".
    • Expected: Page should refresh with no themes listed and a "No themes found. Try a different search." message in the search results.
  5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • Expected: Nothing should happen.

Expected Results

When testing if the patch resolves the issue:

  • Step 2. In the search box, enter a valid theme's name or part of a name, e.g. "News".
    • โœ… Expected: Page should refresh with a list of themes with "News" in their name.
  • Step 3. In the search box, press return or enter key.
    • โœ… Expected: Nothing should happen.
  • Step 4: In the search box, enter an invalid theme name, e.g. "sometheme".
    • โœ… Expected: Page should refresh with no themes listed and a "No themes found. Try a different search." message in the search results.
  • Step 5. In the search box, press return or enter key.
    • โœ… Expected: Nothing should happen.

When reproducing a bug:

  • Step 3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/theme-install.php?browse=popular, search box is cleared, and a list of the popular themes is shown in the search results.
  • Step 5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/theme-install.php?browse=popular, search box is cleared, and a list of the popular themes is shown in the search results.

Environment

  • OS: macOS
  • Web Server: Nginx (using Local for 6.5.5 and 6.6.1 testing) and Docker (for trunk with patch testing)
  • PHP: 8.3.8
  • WordPress: 6.5.5, 6.6.1, and trunk
  • Browser: Firefox 129.0.1
  • Theme: Twenty Twenty-Four
  • Active Plugins: None

Actual Results

When reproducing a bug/defect:

Can reproduce the issues of pressing enter/return key as shown in AddThemeSearch-6.6.1.gifโ€‹:

  • Step 3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/theme-install.php?browse=popular, search box is cleared, and a list of the popular themes is shown in the search results.
  • Step 5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/theme-install.php?browse=popular, search box is cleared, and a list of the popular themes is shown in the search results.
When testing the bugfix patch:

AddThemeSearch-withPR6976.gifโ€‹ shows the results of Steps 4 and 5.

  • Step 2. In the search box, enter a valid theme's name or part of a name, e.g. "News".
    • โœ… Page refreshes and displays a list of themes with "News" in their name.
  • Step 3. In the search box, press return or enter key.
    • โœ… Nothing happens.
  • Step 4: In the search box, enter an invalid theme name, e.g. "sometheme".
    • โœ… Page refreshes with no themes listed and a "No themes found. Try a different search." message in the search results.
  • Step 5. In the search box, press return or enter key.
    • โœ… Nothing happens.

Summary

I can reproduce the issues and with the patch, the issues are resolved.

Last edited 2 years ago by hellofromTonya (previous) (diff)

@hellofromTonya
2 years ago

Appearance > Themes > Search on WP 6.5.5 : shows the behavior before 6.6.0

@hellofromTonya
2 years ago

Appearance > Themes > Search on WP 6.6.1 : shows the bugs ๐Ÿž

@hellofromTonya
2 years ago

Appearance > Themes > Search on WP trunk with PR 6976 applied : shows bugs are resolved and works as expected โœ…

#21 @hellofromTonya
2 years ago

Test Report for Appearance > Themes

Patch tested: โ€‹https://github.com/WordPress/wordpress-develop/pull/6976

Steps to Reproduce or Test

  1. Navigate to Appearance > Themes.
  2. In the search box, enter a valid theme's name or part of a name, e.g. "Three".
    • Expected: Page should refresh with a list of themes with "Three" in their name.
  3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • Expected: Nothing should happen.
  4. In the search box, enter an invalid theme name, e.g. "sometheme".
    • Expected: Page should refresh with no themes listed and a "No themes found. Try a different search." message in the search results.
  5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • Expected: Nothing should happen.

Expected Results

ThemesSearch-6.5.5.gifโ€‹ shows what used to happen before 6.6.0.

When testing if the patch resolves the issue:

  • Step 2. In the search box, enter a valid theme's name or part of a name, e.g. "Three".
    • โœ… Expected: Page should refresh with a list of installed themes with "Three" in their name.
  • Step 3. In the search box, press return or enter key.
    • โœ… Expected: Nothing should happen.
  • Step 4: In the search box, enter an invalid theme name, e.g. "sometheme".
    • โœ… Expected: Page should refresh with no themes listed and a "No themes found. Try a different search." message in the search results.
  • Step 5. In the search box, press return or enter key.
    • โœ… Expected: Nothing should happen.

When reproducing a bug:

  • Step 3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/themes.php, search box is cleared, and a list of installed themes is shown.
  • Step 5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshes to /wp-admin/themes.php, search box is cleared, and a list of installed themes is shown.

Environment

  • OS: macOS
  • Web Server: Nginx (using Local for 6.5.5 and 6.6.1 testing) and Docker (for trunk with patch testing)
  • PHP: 8.3.8
  • WordPress: 6.5.5, 6.6.1, and trunk
  • Browser: Firefox 129.0.1
  • Theme: Twenty Twenty-Four
  • Active Plugins: None

Actual Results

When reproducing a bug/defect:

Can reproduce the issues of pressing enter/return key as shown in ThemesSearch-6.6.1.gifโ€‹:

  • Step 3. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshed to /wp-admin/themes.php, search box cleared, and the installed themes are shown.
  • Step 5. In the search box, press return or enter key. ๐Ÿž Bug occurs.
    • โŒ page refreshed to /wp-admin/themes.php, search box cleared, and the installed themes are shown.
When testing the bugfix patch:

ThemesSearch-withPatch.gifโ€‹ shows the results of Steps 4 and 5.

  • Step 2. Entered "Twenty" into the search box.
    • โœ… Page refreshed to /wp-admin/themes.php?search=Twenty and all themes with "Twenty" in their name were shown.
  • Step 3. Clicked the search box field. Pressed return/enter key.
    • โœ… Nothing happened.
  • Step 4: Entered "SomeTheme" into the search box.
    • โœ… Page refreshed to /wp-admin/themes.php?search=SomeTheme, no themes were listed, and a "No themes found. Try a different search." message was shown.
  • Step 5. Clicked the search box field. Pressed return/enter key.
    • โœ… Nothing happened.

Summary

I can reproduce the issues and with the patch, the issues are resolved.

Last edited 2 years ago by hellofromTonya (previous) (diff)

#22 @hellofromTonya
2 years ago

  • Keywords commit added

Patch: โ€‹https://github.com/WordPress/wordpress-develop/pull/6976

With multiple test reports confirming the patch resolves the issue and PR approval, marking the patch for commit.

@joedolson do you have any concerns with patch?

#23 @joedolson
2 years ago

No, the patch looks good to me. No concerns. LGTM.

#24 @joedolson
2 years ago

  • Resolution โ†’ fixed
  • Status accepted โ†’ closed

In 58914:

Themes: Fix themes search event not firing on enter.

Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.

Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromtonya.
Fixes #61578.

#25 @joedolson
2 years ago

  • Keywords dev-feedback added
  • Resolution fixed
  • Status closed โ†’ reopened

Re-opening and marking dev-feedback for backport to 6.6.2.

#27 @hellofromTonya
2 years ago

  • Keywords fixed-major dev-reviewed added; dev-feedback removed

Tested [58914] on 6.6 branch for both Appearance > Themes > Add Themes and comment:21 Appearance > Themes]. Results are same as both test reports โœ…, i.e. resolving the issues.

LGTM. I'll backport it the 6.6 branch.

#28 @hellofromTonya
2 years ago

  • Resolution โ†’ fixed
  • Status reopened โ†’ closed

In 58916:

Themes: Fix themes search event not firing on enter.

Attach the submit event to the parent search form in the installed and add new theme screen. Following [58405], the submit event was no longer attached to an object that was able to handle form submissions.

Reviewed by hellofromTonya.
Merges [58914] to the 6.6 branch.

Follow-up to [58405].

Props nithi22, nithins53, josklever, the-ank, debarghyabanerjee, sabernhardt, jeherve, hellofromTonya.
Fixes #61578.

#29 @wordpressdotorg
15 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.