Jump to content

Topic on VisualEditor/Feedback

Image copy paste broken after 1.32?

13
Summary by 2804:18:5046:F764:267A:9AAE:57C2:BB02

Um

77.86.179.245 (talkcontribs)

Any ideas why VisualEditor throws this exception to Chrome console with 1.33 and later when copy pasting image to editor,

Query.Deferred exception: files.map is not a function TypeError: files.map is not a function
    at OoUiSelectFileWidget.OO.ui.SelectFileWidget.setValue (https://wiki.local/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=09ovhn2:1048:538)
    at mw.ForeignStructuredUpload.BookletLayout.mw.Upload.BookletLayout.setFile (<anonymous>:1050:340)
    at Array.<anonymous> (<anonymous>:713:254)
    at mightThrow (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:48:916)
    at process (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:49:589)
jQuery.Deferred exception: files.map is not a function TypeError: files.map is not a function
    at OoUiSelectFileWidget.OO.ui.SelectFileWidget.setValue (https://wiki.local/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=09ovhn2:1048:538)
    at mw.ForeignStructuredUpload.BookletLayout.mw.Upload.BookletLayout.setFile (<anonymous>:1050:340)
    at Array.<anonymous> (<anonymous>:713:254)
    at mightThrow (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:48:916)
    at process (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:49:589)
jQuery.Deferred exception: files.map is not a function TypeError: files.map is not a function
    at OoUiSelectFileWidget.OO.ui.SelectFileWidget.setValue (https://wiki.local/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Coojs-ui-core%2Coojs-ui-widgets&skin=vector&version=09ovhn2:1048:538)
    at mw.ForeignStructuredUpload.BookletLayout.mw.Upload.BookletLayout.setFile (<anonymous>:1050:340)
    at Array.<anonymous> (<anonymous>:713:254)
    at mightThrow (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:48:916)
    at process (https://wiki.local/load.php?debug=false&lang=en&modules=jquery&skin=vector&version=0w5wrgy:49:589)
Whatamidoing (WMF) (talkcontribs)

What image are you trying to paste? Are you pasting the code for an image that you copied from another wiki page, or an image from another website?

Titoshadow (talkcontribs)

Same behaviour observed in Firefox 72.0.1, after trying to copy an image from a Word document


79.135.56.229 (talkcontribs)

Same problem on Chrome 79.0.3945.117 (64 bit)

79.135.56.229 (talkcontribs)

Same problem on version 1.34

Whatamidoing (WMF) (talkcontribs)

Do you realize that you are supposed to use Special:Upload to put images on your wiki, and not just copy/paste?

170.253.44.150 (talkcontribs)

What os your point? We can achieve the functionality but being less usable is preferred?

Some extensions like ClipUpload actually manages that, we are talking about just one step more, which was working and now does not.

Whatamidoing (WMF) (talkcontribs)

If you are having trouble with Extension:ClipUpload, then you should contact the maintainers of that extension. Extension:VisualEditor has never supported uploading via copy/paste, and supporting copy/paste uploads from the web is actively unwanted by Wikimedia Commons and the Wikipedia communities.

2001:569:FCE0:7900:F485:2E9F:DF7F:1893 (talkcontribs)
Titoshadow (talkcontribs)

Yet here we are, still without a fix after several years.

213.212.36.180 (talkcontribs)

Absolute pathetic that it's still not a built in feature. This is why mediawiki is being phased out for stuff like Confluence.

Rviauiilyo (talkcontribs)

I completely not agree with you.

If something is unwanted, does no seems that it has to be removed from a system.

This feature was working before and now not. Allowing users to do it or to enable it should be a good point.

You say that it was never supported, but it was here and it was a great feature as lots of users like me use wikimedia to store there IT process and then use copy/paste of screenshot.

How could you explain that if it was not supported it was working before and now it throw an error ?

38.146.48.251 (talkcontribs)

using 1.34 - on line 5803 in oojs-ui-widgets.js, in OO.ui.SelectFileWidget.prototype.setValue, i changed the line files = files.slice(0,1) to files = [files.slice(0,1)] and i'm getting the image upload popup (error was calling .map on a single object not an array). Doesn't quite fix the problem for me, but it's progress (no thumbnail on the upload popup and when i hit upload i get a filename error)

Reply to "Image copy paste broken after 1.32?"