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 | 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)
Change History (3)
#1
@
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.
Fix for WP.org's glotpress plugin "wporg-js-warnings" - incorrect usage of the
ok
function