Last modified: 2014-05-25 15:13:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66289, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64289 - JavaScript error prevents WikiEditor from showing up
JavaScript error prevents WikiEditor from showing up
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
master
All All
: Highest major with 1 vote (vote)
: MW 1.23 version
Assigned To: Nobody - You can work on this!
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-23 14:53 UTC by Niklas Laxström
Modified: 2014-05-25 15:13 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niklas Laxström 2014-04-23 14:53:58 UTC
When using WikiEditor together with SemanticForms, and editing a which has textareas but no text area for the main content, I get a following JavaScript error:

Uncaught TypeError: Cannot read property 'selectionStart' of undefined jquery.textSelection.js:352
getCaret jquery.textSelection.js:352
fn.getCaretPosition jquery.textSelection.js:359
$.fn.textSelection jquery.textSelection.js:565
$.fn.wikiEditor jquery.wikiEditor.js:491
(anonymous function) ext.wikiEditor.js:6
fire load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140423T14…:974
self.add load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140423T14…:1020
jQuery.fn.jQuery.ready load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20140423T14…:246
(anonymous function) ext.wikiEditor.js:4
Comment 1 Bartosz Dziewoński 2014-04-25 12:41:59 UTC
This error is also showing up on Wikipedias.
Comment 2 Bartosz Dziewoński 2014-04-25 13:02:17 UTC
This happens when something loads the 'ext.wikiEditor' module on a page with no #wpTextbox1. WikiEditor then tries to get the caret position (using the 'jquery.textSelection' module) in a non-existent <textarea> and it blows up.

It's amazing that this has ever worked, but if it did, then it probably should keep working. textSelection probably shouldn't throw errors in this case, as jQuery functions generally handle empty collections just fine.
Comment 3 Bartosz Dziewoński 2014-04-25 13:02:38 UTC
(Caused by https://gerrit.wikimedia.org/r/#/c/124567/)
Comment 4 Gerrit Notification Bot 2014-04-25 13:19:32 UTC
Change 129683 had a related patch set uploaded by Bartosz Dziewoński:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/129683
Comment 5 Gerrit Notification Bot 2014-04-25 18:46:44 UTC
Change 129683 merged by Mwalker:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/129683
Comment 6 Derk-Jan Hartman 2014-04-25 20:04:09 UTC
BTW, anyone got actual examples of such pages ?

It's helpful to be able to take such pages into account with future changes to WikiEditor perhaps.
Comment 7 Gerrit Notification Bot 2014-04-25 20:20:01 UTC
Change 129813 had a related patch set uploaded by Mwalker:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/129813
Comment 8 Matt Walker 2014-04-25 20:34:08 UTC
OK; I've reverted the original patch that caused this issue to surface [1] (because it's Friday and that was safer than deploying this.) The plan is to deploy the fix [2] to this bug on Monday, and then deploy the revert to the revert that I did today on Tuesday once we know this patch doesn't cause issues.

[1] https://gerrit.wikimedia.org/r/#/c/129807/
[2] https://gerrit.wikimedia.org/r/#/c/129813/
Comment 9 Andre Klapper 2014-04-26 18:08:32 UTC
Increasing priority due to comment 1 (comment 0 only mentioned SemanticForms)
Comment 10 Gerrit Notification Bot 2014-04-28 23:30:19 UTC
Change 129813 merged by Mwalker:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/129813
Comment 11 Derk-Jan Hartman 2014-04-29 13:18:37 UTC
Where are we with this ? Do we still need to do the revert of the revert ? 

Does anyone have a good test case that doesn't require a full install of semantic mediawiki ?
Comment 12 Derk-Jan Hartman 2014-04-29 23:26:50 UTC
The patch has now been reapplied in 1.24wmf2
Comment 13 Bartosz Dziewoński 2014-04-30 09:14:54 UTC
Everything should be fixed, then.
Comment 14 Niklas Laxström 2014-05-16 09:57:23 UTC
Requesting backport of Ib97f47ef1d66420682bd429c9c12e66c3392e77d to fix editing with forms in tieteentermipankki.fi
Comment 15 Gerrit Notification Bot 2014-05-17 21:52:16 UTC
Change 133942 had a related patch set uploaded by TheDJ:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/133942
Comment 16 Gerrit Notification Bot 2014-05-18 16:01:12 UTC
Change 133942 merged by jenkins-bot:
jquery.textSelection: Don't throw errors on empty collections

https://gerrit.wikimedia.org/r/133942
Comment 17 Gerrit Notification Bot 2014-05-21 15:28:03 UTC
Change 134616 had a related patch set uploaded by Krinkle:
Sync 1.23 release notes for bug 64289 from REL1_23

https://gerrit.wikimedia.org/r/134616
Comment 18 Gerrit Notification Bot 2014-05-21 15:58:23 UTC
Change 134616 merged by jenkins-bot:
Sync 1.23 release notes for bug 64289 from REL1_23

https://gerrit.wikimedia.org/r/134616
Comment 19 Andre Klapper 2014-05-25 15:13:39 UTC
All patches merged, closing again.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links