Make WordPress Core

Opened 17 months ago

Closed 14 months ago

Last modified 14 months ago

#57183 closed defect (bug) (fixed)

After deleting updateable themes, the incorrect update count is displayed.

Reported by: nazmulhasan103's profile nazmulhasan103 Owned by: audrasjb's profile audrasjb
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch has-testing-info has-screenshots commit
Focuses: javascript, administration Cc:

Description

Even though I deleted an updateable theme since it didn't immediately update the decremented total, everything is OK after refreshing the page.

  1. When an updateable theme is deleted: https://prnt.sc/3ugZBS9cRboF
  2. After refreshing the page: https://prnt.sc/tcvo1x6qBwno

Change History (23)

This ticket was mentioned in PR #3669 on WordPress/wordpress-develop by themeaazz.


17 months ago
#1

  • Keywords has-patch added

#2 @riccardodicurti
17 months ago

Hi @nazmulhasan103,
how about moving your if before:

wp.a11y.speak( _x( 'Deleted!', 'theme' ) );

I was looking at the code again, do you decrease the number of updates even if you delete a theme that doesn't need to be updated? I'm wrong?

If you look a little above you can take a hint from here:

// Remove theme from update count.
if ( -1 !== _.indexOf( themes.upgrade, response.slug ) ) {
   themes.upgrade = _.without( themes.upgrade, response.slug );
   wp.updates.decrementCount( 'theme' );
}
Last edited 17 months ago by riccardodicurti (previous) (diff)

#3 @sabernhardt
17 months ago

#52306 was marked as a duplicate.

#4 @sabernhardt
17 months ago

  • Component changed from Administration to Upgrade/Install
  • Keywords needs-testing added
  • Type changed from feature request to defect (bug)
  • Version 6.1.1 deleted

@Hinjiriyo shared steps to reproduce the bug (or to test a patch) in #52306.

How to reproduce the bug:

  1. The Update icon in the admin bar shows a number of available updates. There is at least one inactive, outdated theme (e.g. a theme for which an upgrade is available, and it is not the active theme).
  2. Go to "Appearance" > "Themes" and delete that theme.
  3. Since there is one outdated item less, you would expect a number reduced by 1 at the Update icon. But the number remains unchanged.

I'll add Step 4: Check the number next to "Themes" in the admin side menu to verify that it also is reduced by one.

Last edited 17 months ago by sabernhardt (previous) (diff)

This ticket was mentioned in PR #3671 on WordPress/wordpress-develop by @riccardodicurti.


17 months ago
#5

After deleting updatable themes, the incorrect update count is displayed.

Trac ticket: https://core.trac.wordpress.org/ticket/57183

This ticket was mentioned in Slack in #core-test by ironprogrammer. View the logs.


17 months ago

#7 @ironprogrammer
17 months ago

  • Keywords has-testing-info has-screenshots added

Welcome to Trac, and thank you for this report, @nazmulhasan103!

To move this forward, it would be great to have an issue reproduction report, followed by a patch test report.

#8 @costdev
17 months ago

Reproduction Report

This report validates that the issue can be reproduced.

Environment

  • Server: Apache (Linux)
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 107.0.0.0
  • OS: Windows 10
  • Theme: Twenty Twenty-Two
  • Plugins: None activated

Actual Results

  • ✅ Error condition occurs (reproduced).

#9 follow-up: @costdev
17 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/3669

Environment

  • Server: Apache (Linux)
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 107.0.0.0
  • OS: Windows 10
  • Theme: Twenty Twenty-Two
  • Plugins: None activated

Actual Results

  • ✅ Issue resolved with patch.

#10 @costdev
17 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/3671

Environment

  • Server: Apache (Linux)
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 107.0.0.0
  • OS: Windows 10
  • Theme: Twenty Twenty-Two
  • Plugins: None activated

Actual Results

  • ✅ Issue resolved with patch.

#11 @costdev
17 months ago

  • Milestone changed from Awaiting Review to 6.2

Both patches resolve the issue.

Milestoning for 6.2 so that both PRs can be reviewed to determine the desired one to move forward with.

#12 in reply to: ↑ 9 @nazmulhasan103
17 months ago

Thank's @costdev

This ticket was mentioned in Slack in #core-upgrade-install by afragen. View the logs.


17 months ago

This ticket was mentioned in Slack in #core-upgrade-install by costdev. View the logs.


16 months ago

#15 @robinwpdeveloper
15 months ago

First of all https://github.com/WordPress/wordpress-develop/pull/3669 looks better to me as it contains proper spacing, semi colon, doc block etc.
And passed all checks.

I will submit test report soon here.
https://github.com/WordPress/wordpress-develop/pull/3669

Version 0, edited 15 months ago by robinwpdeveloper (next)

#16 @robinwpdeveloper
15 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/3669.diff

Environment

  • OS: macOS 11.2.3
  • Web Server: Nginx
  • PHP: 7.4.30
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome 109.0.5414.119
  • Theme: Twenty Twenty-One
  • Active Plugins:
    • No plugins activated

Actual Results

  • ✅ Issue resolved with patch.

Additional Notes

  • Successfully reproduced the issue
  • Applied patch fix the count of the top icon as well as left sidebar icon

Supplemental Artifacts

Before: https://d.pr/i/zr7V5T

After: https://d.pr/i/BNb1Z8

#17 @rahmantasnia
15 months ago

Test Report

This report validates that the indicated patch addresses the issue.

Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/3669.diff

Environment

  • OS: macOS 13.1
  • Web Server: Nginx
  • PHP: 7.4.33
  • WordPress: 6.2-alpha-54642-src
  • Browser: Chrome
  • Theme: Twenty Twenty-Three
  • Active Plugins:
    • No plugins activated

Actual Results

  • ✅ Issue resolved with patch.

When 2 themes were downgraded, this issue appeared: https://prnt.sc/w75T1ENIpJlE
After the patch was applied, the issue was resolved: https://prnt.sc/Mmky91kdSsCK

This ticket was mentioned in Slack in #core by costdev. View the logs.


14 months ago

#19 @costdev
14 months ago

  • Keywords needs-testing removed

#20 @costdev
14 months ago

  • Keywords commit added

This ticket was reviewed during the recent bug scrub. Adding for commit consideration.

Additional props: @hellofromTonya

#21 @audrasjb
14 months ago

  • Owner set to audrasjb
  • Status changed from new to accepted

Self assigning for commit consideration.

#22 @audrasjb
14 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55359:

Upgrade/Install: Update available theme updates count when a theme si deleted.

This changeset fixes an issue where the available theme updates count was not updated after a theme is deleted.

Props nazmulhasan103, riccardodicurti, sabernhardt, ironprogrammer, costdev, robinwpdeveloper, rahmantasnia.
Fixes #57183.

Note: See TracTickets for help on using tickets.