Page MenuHomePhabricator

MediaViewer fails in Internet Explorer 11 with error about localStorage.getItem being null
Closed, ResolvedPublic

Description

Internet Explorer 11, not logged in:

  1. visit https://www.mediawiki.org/wiki/Help:Multimedia/Media_Viewer/de?uselang=de&debug=true
  2. click on first image on the right
  3. black lightbox comes up but then fails and closes
  4. right side automatic disappearing floating errorbox notifcation with:

Error loading MediaViewer: Die Eigenschaft "getItem" eines undefinierten oder Nullverweises kann nicht abgerufen werden. TypeError: Die Eigenschaft "getItem" eines undefinierten oder Nullverweises kann nicht abgerufen werden. at MetadataPanel (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/ui/mmv.ui.metadataPanel.js:40:3) at init (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.lightboxinterface.js:91:3) at LightboxInterface (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.lightboxinterface.js:35:3) at MultimediaViewer (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.js:112:3) at getViewer (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.bootstrap.js:316:4) at isCSSReady (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.bootstrap.js:106:5) at Anonymous function (https://bits.wikimedia.org/static-1.24wmf2/extensions/MultimediaViewer/resources/mmv/mmv.bootstrap.js:70:4) at fire (https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=true&lang=de&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20140424T184325Z:974:5) at fireWith (https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=true&lang=de&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20140424T184325Z:1084:7) at fire (https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=true&lang=de&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20140424T184325Z:1091:5)

  1. can be repeated by clicking on the thumb again

Expected Behaviour:
*) It loads and works or
*) Isn't loaded at all and old behaviour (if unsupported browser; see bug 63801 for degrade gracefully)


Version: unspecified
Severity: major

Details

Reference
bz64525

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz64525.
bzimport added a subscriber: Unknown Object (MLST).
Se4598 created this task.Apr 28 2014, 6:04 AM

could it be that there only is a "window." before "localStorage.getItem" missing on line 40?

"this.hasAnimatedMetadata = window.localStorage === undefined ||

			localStorage.getItem( 'mmv.hasOpenedMetadata' );"
Tgr added a comment.Apr 28 2014, 6:33 AM

That would be weird. If there is no localStorage variable in the current scope, the JS engine should walk up the scope chain until it reaches the window object. At any rate, opened bug 64527 for handling errors more gracefully.

Tgr added a comment.Apr 28 2014, 7:45 AM

Apparently when localStorage is disabled (about:config dom.storage.enabled in Firefox, don't know about IE), it is null, not undefined, so the test fails:
https://github.com/openstreetmap/iD/issues/591
We should just for truthiness instead.

Tracked as https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/521

Looks similar to gerrit 129245 (for CentralAuth)

Change 130230 had a related patch set uploaded by Gergő Tisza:
Handle window.localStorage === null case correctly

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

Change 130230 merged by jenkins-bot:
Handle window.localStorage === null case correctly.

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

Change 130493 had a related patch set uploaded by Gergő Tisza:
Handle window.localStorage === null case correctly.

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

Change 130494 had a related patch set uploaded by Gergő Tisza:
Handle window.localStorage === null case correctly.

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

Change 130493 merged by jenkins-bot:
Handle window.localStorage === null case correctly.

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

Change 130494 merged by jenkins-bot:
Handle window.localStorage === null case correctly.

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

Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 4 2014, 10:11 AM
Gilles triaged this task as Unbreak Now! priority.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:23 AM