Last modified: 2014-03-07 00:20:34 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 T64329, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62329 - VisualEditor: Fix "Uncaught Type: Cannot call method 'attr' of undefined"
VisualEditor: Fix "Uncaught Type: Cannot call method 'attr' of undefined"
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
MediaWiki integration (Other open bugs)
unspecified
All All
: Normal major
: VE-deploy-2014-03-06
Assigned To: Krinkle
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-06 17:08 UTC by Krinkle
Modified: 2014-03-07 00:20 UTC (History)
5 users (show)

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


Attachments

Description Krinkle 2014-03-06 17:08:35 UTC
When VisualEditor deactivates itself after Parsoid fails, this exceptions thrown because the property never got set.



  ve.init.mw.ViewPageTarget.prototype.deactivate = function(override) {
    if (..) {
      if (..) {
        this.deactivating = true;
        if (ve.msg('accesskey-save') !== '-' && ve.msg('accesskey-save') !== '') {
          this.elementsThatHadOurAccessKey.attr('accesskey', ..);
                        ^

ve.init.mw.ViewPageTarget.prototype.setupToolbarButtons = function () {
  ..
    if (ve.msg('accesskey-save') !== '-' && ve.msg('accesskey-save') !== '') {
      this.elementsThatHadOurAccessKey = $( .. );


The code in deactivate() shouldn't be repeating conditions like that as they're no longer semantically relevant, and in this case even incorrect. Instead the top one (which usually runs after setupToolbarButtons) should limit its interest to elementsThatHadOurAccessKey itself which we either set to null or to a jQuery object.
Comment 1 Gerrit Notification Bot 2014-03-06 17:12:19 UTC
Change 117224 had a related patch set uploaded by Krinkle:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117224
Comment 2 Gerrit Notification Bot 2014-03-06 17:18:11 UTC
Change 117224 merged by jenkins-bot:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117224
Comment 3 Gerrit Notification Bot 2014-03-06 17:28:05 UTC
Change 117228 had a related patch set uploaded by Alex Monk:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117228
Comment 4 Gerrit Notification Bot 2014-03-06 17:31:16 UTC
Change 117230 had a related patch set uploaded by Jforrester:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117230
Comment 5 Gerrit Notification Bot 2014-03-07 00:01:41 UTC
Change 117230 merged by jenkins-bot:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117230
Comment 6 Gerrit Notification Bot 2014-03-07 00:02:40 UTC
Change 117228 merged by jenkins-bot:
mw.ViewPageTarget: Check elementsThatHadOurAccessKey before accessing

https://gerrit.wikimedia.org/r/117228

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


Navigation
Links