Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#41407 closed defect (bug) (fixed)

Updating a plugin from the Plugin Install Screen throws a JavaScript error

Reported by: imath Owned by: swissspidy
Priority: normal Milestone: 4.9
Component: Upgrade/Install Version: 4.6
Severity: normal Keywords: has-patch shiny-updates
Cc: Focuses: administration

Description

Hi,

/wp-admin/js/updates.js when refreshing the screen to decrement the count needs window._wpUpdatesItemCounts to be set. This is done using wp_localize_script() in the regular plugins list table. But this is not done in the plugin *install* list table.

When going into the Plugin Install screen having a plugin to upgrade we get this :

https://cldup.com/U0tmTYg-Dr.png

If from there i click on the "Update Now" button, i get this result :

https://cldup.com/NWin8FrfHg.png

The plugin is updated, but the screen is not refreshed. Bubbles in the WP Admin Bar and in the menu still show there's one plugin to upgrade.

https://cldup.com/bwTZrH0S9G.png

And there's actually a JavaScript error because window._wpUpdatesItemCounts is undefined.

Using the patch i'm adding to this ticket, it's solving the issue.

Attachments (2)

41407.patch​ (3.5 KB ) - added by imath 9 years ago.
41407.diff​ (3.4 KB ) - added by swissspidy 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @imath
9 years ago

  • Keywords has-patch added

#2 @swissspidy
9 years ago

  • Keywords shiny-updates added
  • Milestone Awaiting Review → 4.9
  • Owner set to swissspidy
  • Status new → reviewing

#3 @swissspidy
9 years ago

  • Version trunk → 4.6

In 41407.diff​ I refreshed the patch to apply cleanly again.

#4 @swissspidy
9 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 41612:

Upgrade/Install: Fix updating plugins on the Add Plugins screen.

Props imath.
Fixes #41407.

Note: See TracTickets for help on using tickets.