Making WordPress.org

Opened 9 years ago

Closed 7 years ago

#1445 closed defect (bug) (fixed)

"Add translation" button should be re-enabled on error when saving

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords: has-patch
Cc:

Description

If there's a network connection error when saving a translation, a red box is displayed saying "Error saving the translation!".

But the "Add translation" button is still disabled, so you can't try again without a page refresh, and you might lose the changes you've just made.

Could not reproduce on a standalone GP install, so apparently it's specific to translate.wordpress.org.

Attachments (1)

wporg-glotpress-fix-button-reenabling.diff (430 bytes) - added by diddledani 9 years ago.
Fix for WP.org's glotpress plugin "wporg-js-warnings" - incorrect usage of the ok function

Download all attachments as: .zip

Change History (3)

@diddledani
9 years ago

Fix for WP.org's glotpress plugin "wporg-js-warnings" - incorrect usage of the ok function

#1 @diddledani
9 years ago

  • Keywords has-patch added

Explanation:

WP.org includes a function that hijacks glotpress' default click handler on the affected button and tries to pass the button as an argument to glotpress' ok javascript function in glotpress/js/editor.js which expects the button to be assigned to this instead of passed as an argument. My fix therefore uses Function.call to redefine the this value in the ok function when executed.

#2 @ocean90
7 years ago

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

Looks like this was fixed by [2949].

Note: See TracTickets for help on using tickets.