Make WordPress Core

Opened 8 years ago

Last modified 7 years ago

#36823 reopened defect (bug)

"TypeError: wp.updates is undefined" when installing a plugin

Reported by: tfrommen's profile tfrommen Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.2
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: javascript Cc:

Description

When I install a new plugin that has a translation pack for my current language (which is not en_US), I get the following error:

TypeError: wp.updates is undefined
if ( wp && wp.updates.decrementCount ) {

Patch will follow soonish.

Attachments (2)

36823.patch (677 bytes) - added by tfrommen 8 years ago.
decrementCount.jpg (174.2 KB) - added by Presskopp 7 years ago.

Download all attachments as: .zip

Change History (17)

@tfrommen
8 years ago

#1 @swissspidy
8 years ago

  • Component changed from Administration to Upgrade/Install
  • Keywords has-patch needs-testing added

#2 @swissspidy
8 years ago

  • Milestone changed from Awaiting Review to 4.6

Just needs someone to reproduce the bug and verify the fix.

#3 @j-falk
8 years ago

@tfrommen I am trying to reproduce the bug and verify the fix, could you give an example of a language and a plugin that gives this issue?

I am trying with with de_DE and Formidable on a trunk WP install but don't see any error in the js console.

#4 @SergeyBiryukov
8 years ago

  • Keywords reporter-feedback added

#5 @swissspidy
8 years ago

It's worth noting that the code in question isn't run anymore for most parts thanks to the merge of Shiny Updates V2. It's only used on update-core.php right now, for example when updating language packs.

#6 @tfrommen
8 years ago

It's worth noting that the code in question isn't run anymore for most parts thanks to the merge of Shiny Updates V2. It's only used on update-core.php right now, for example when updating language packs.

Well, then this might be fixed for 4.6, because on update-core.php, the according script file is enqueued, so wp.updates is defined there.

#7 follow-up: @swissspidy
8 years ago

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

Looks like this is no longer an issue then.

#8 in reply to: ↑ 7 @tfrommen
8 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Replying to swissspidy:

Looks like this is no longer an issue then.

Well, ... updating the (Spanish) core language pack (directly after updating to 4.7.2) got me a similar error, again:

https://i.imgur.com/6kXQcGe.png

#9 @ocean90
8 years ago

  • Milestone set to Awaiting Review

#10 @swissspidy
8 years ago

  • Milestone changed from Awaiting Review to Future Release

36823.patch makes sense, but I can't reproduce this.

#11 follow-up: @jrf
7 years ago

I've just been able to reproduce this bug twice and can confirm that it still exists in WP 4.8.

Steps I took which caused me to encounter the bug:

  1. Go to the /wp-admin/update-core.php page.
  2. The only updates showing were translations, so I click the button to run that update.
  3. It runs a while and downloads a lot of core translations. When the run ends, I see the following js error in the Debug Bar.

https://snag.gy/MBt72J.jpg

  1. Now there are suddenly two plugin updates available.
  2. I run those.
  3. I return to the WordPress Updates Page, there are new translations available again.
  4. I click on the Update translation button and see the plugin translations being pulled in. When the update is finished, I see the same js error but with a different line number:

https://snag.gy/3m1zk4.jpg

So the short of it is, that it seems to only happen when only translations are being updated.

The easiest way to reproduce (other than coming across it in the wild like I did), would probably be to remove a couple of translation files from the languages folder, getting WP to check for new updates from the Update Core page via the "Check again" button and hoping it will pick on the removed files. If it does, you should now have an install with only translation updates available which is the basis needed to reproduce the bug.

Last edited 7 years ago by jrf (previous) (diff)

#12 in reply to: ↑ 11 @tfrommen
7 years ago

  • Keywords reporter-feedback removed

Replying to jrf:

So the short of it is, that it seems to only happen when only translations are being updated.

Yes, this is what I encountered as well so far (see ticket description and comment).

#13 @tfrommen
7 years ago

For what it's worth, I'm unable to reproduce this with WordPress 4.8.1, even though I don't see any changes related to this issue.

#14 @Presskopp
7 years ago

Can't remember what build that was, but 4.9RC, I forgot about the screenshot, but here it is:

Last edited 7 years ago by Presskopp (previous) (diff)

#15 @hardlyneutral
7 years ago

  • Version set to 4.9.2

I just received a report from a user that encountered this issue. I recently internationalized my plugin and it does not have any GlottPress translations. Perhaps that might be part of the issue?

Note: See TracTickets for help on using tickets.