Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 7 years ago

#39189 closed defect (bug) (fixed)

Translation Update after 4.7 update gives Javascript Error

Reported by: garrett-eclipse Owned by: swissspidy
Priority: normal Milestone: 5.1
Component: Upgrade/Install Version: 4.7
Severity: trivial Keywords: has-patch commit
Cc: Focuses: javascript

Description

I just updated to WordPress 4.7, which then enabled the update translations button, so did so and it updated the translation no problem;

Update Translations
Updating translations for WordPress (en_CA)…
Translation updated successfully.
Return to WordPress Updates page
But my Debug Bar flagged a JS issue, inspecting the full error is;

update-core.php?action=do-translation-upgrade:428 Uncaught TypeError: Cannot read property 'decrementCount' of undefined

at https://bearmountain.ca/wp-admin/update-core.php?action=do-translation-upgrade:428:28
at https://bearmountain.ca/wp-admin/update-core.php?action=do-translation-upgrade:431:8

It goes away as soon as you go to another page, but wanted to flag the minor bug.

Original Support Ticket - https://wordpress.org/support/topic/translation-update-after-4-7-update-gives-javascript-error/

Attachments (2)

decrementCount.jpg (174.2 KB ) - added by Presskopp 9 years ago.
fresh 4.9RC3 installation, first run updating translations
39189.diff (559 bytes ) - added by Presskopp 9 years ago.

Download all attachments as: .zip

Change History (16)

#1 @swissspidy
10 years ago

Hi,

Thanks for opening the ticket! This might be caused by a recent improvement to the update counter, see #13071. However, I wasn't able to reproduce this when updating translations on my local install.

Have you already tried clearing your browser's cache and disabling all plugins?

#2 @garrett-eclipse
10 years ago

  • Keywords close added
  • Resolutionworksforme
  • Severity normaltrivial
  • Status newclosed

Hi @swissspidy

As I didn't want to roll back the live site I tried to install clean 4.6.1 set to en_CA. And the upgrade to 4.7 seemed to automatically do the translation so that wasn't available after the 4.7 upgrade as it was with my other install.

SO I'm going to guess it was a cache or plugin/theme conflict and close this.

Thanks

#3 @swissspidy
10 years ago

  • Milestone Awaiting Review

Alright, I'll keep an eye on it nonetheless.

#4 @ocean90
10 years ago

This could be caused by a race condition when the update of a translation was faster than loading the page and update.js which is now loaded in the footer.

#5 @garrett-eclipse
10 years ago

Thanks Guys, do you feel I should reopen this for further investigation? Cheers

@Presskopp
9 years ago

fresh 4.9RC3 installation, first run updating translations

#6 @Presskopp
9 years ago

  • Resolution worksforme
  • Status closedreopened

Still coming in Version 5.0-alpha-42389:

update-core.php?action=do-translation-upgrade:379 Uncaught TypeError: Cannot read property 'decrementCount' of undefined
    at update-core.php?action=do-translation-upgrade:379
    at update-core.php?action=do-translation-upgrade:382

#7 @swissspidy
9 years ago

  • Keywords needs-patch added; close removed
  • Milestone5.0

We should be able to fix this race condition by using wp && wp.updates && wp.updates.decrementCount there.

@Presskopp
9 years ago

#8 @Presskopp
9 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

@swissspidy Can you please take a look at the patch approach (following your argumentation, no own powers here)

#9 @swissspidy
9 years ago

  • Owner set to swissspidy
  • Status reopenedreviewing

#10 @johnbillion
8 years ago

  • Milestone 5.05.0.1

#11 @pento
8 years ago

  • Milestone 5.0.15.0.2

#12 @swissspidy
8 years ago

  • Keywords commit added; needs-testing removed
  • Milestone 5.0.25.1

#13 @swissspidy
8 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 44513:

Upgrade/Install: Prevent possible JavaScript error when updating translations.

Props Presskopp.
Fixes #39189.

Note: See TracTickets for help on using tickets.