Last modified: 2014-08-14 20:03:20 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 T69749, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67749 - VisualEditor: [Regression wmf13] TypeError: Cannot read property 'context' of undefined appears when you try to insert another image that appears on the same index as the previous search, right after you inserted one
VisualEditor: [Regression wmf13] TypeError: Cannot read property 'context' of...
Status: VERIFIED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Normal normal
: VE-deploy-2014-07-31
Assigned To: Moriel Schottlender
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-09 19:52 UTC by Rummana Yasmeen
Modified: 2014-08-14 20:03 UTC (History)
5 users (show)

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


Attachments

Description Rummana Yasmeen 2014-07-09 19:52:15 UTC
Steps to reproduce:

1.Open a page with VE
2.Go to Insert>Media
3.Enter a search term
4.Select the first image that appears on the search result
4.Click on Change image immediately
5.Enter a different search term
6.Now try to select the first image on of the new search results 


Observed Result:
It throws an error:Uncaught TypeError: Cannot read property 'context' of undefined 

and cannot select that image
Comment 1 Moriel Schottlender 2014-07-09 22:34:09 UTC
This seems to be the same jQuery/API issue we've had with calling the mw API consecutively. When the API is queried more than once the callback function goes haywire.

In debug mode when clicking the 'change image' (#4 in the above reproduce list), the console error is

"Uncaught TypeError: undefined is not a function" 
api.php?callback=jQuery111109575085956603289_1404944903047&format=json&uselang=en&action=query&gene…:1
Comment 2 Gerrit Notification Bot 2014-07-29 23:55:38 UTC
Change 150054 had a related patch set uploaded by Mooeypoo:
MWMediaSearchWidget: Use json/jsonp for local/foreign api respectively

https://gerrit.wikimedia.org/r/150054
Comment 3 Gerrit Notification Bot 2014-07-30 17:13:48 UTC
Change 150054 merged by jenkins-bot:
MWMediaSearchWidget: Use json/jsonp for local/foreign api respectively

https://gerrit.wikimedia.org/r/150054
Comment 4 Krinkle 2014-07-30 17:17:40 UTC
(In reply to Moriel Schottlender from comment #1)
> This seems to be the same jQuery/API issue we've had with calling the mw API
> consecutively. When the API is queried more than once the callback function
> goes haywire.
> 
> In debug mode when clicking the 'change image' (#4 in the above reproduce
> list), the console error is
> 
> "Uncaught TypeError: undefined is not a function" 
> api.
> php?callback=jQuery111109575085956603289_1404944903047&format=json&uselang=en
> &action=query&gene…:1

That undefined function error is not related in any way, that's bug 59604.
Comment 5 Moriel Schottlender 2014-07-30 21:00:30 UTC
When I tried to reproduce this bug (before the merge of the above fix), I kept getting this error in chrome:

Uncaught TypeError: undefined is not a function commons.wikimedia.org/w/api.php?callback=jQuery1111024360889615491033_14067…set=0&prop=imageinfo&iiprop=dimensions%7Curl%7Cmediatype&iiurlheight=150:1

And this in in firefox

TypeError: jQuery111109862733512069084_1406742881657 is not a function
	
/**/jQuery111109862733512069084_1406742881657({"warnings":{"main":{"*":"Unrecogn...

And only after that I get an 'uncaught type error' that seems to be related to missing details in the image (like the caption document). It only happens right after the first API bug. I wasn't able to reproduce it after the 150054 fix was introduced. 

The API response just before the bug appears seems to suggest that the information from the API is maybe mismatch to the loaded image, which is why I thought it was related. 

The bug doesn't happen with this fix anymore (I can't reproduce it in master or in beta labs now that it's merged)
Comment 6 James Forrester 2014-07-30 22:02:20 UTC
Yeah, deeming this FIXED.
Comment 7 Rummana Yasmeen 2014-08-04 23:49:30 UTC
Verified the fix in test2
Comment 8 Rummana Yasmeen 2014-08-14 20:03:20 UTC
Verified the fix in production

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


Navigation
Links