Jump to content

Topic on Extension talk:VisualEditor/Flow

Is picture search in VE wikicommons only?

25
Summary by Jdforrester (WMF)

No.

Myonlyeye (talkcontribs)

I've installed VisualEditor and Parsoid on my CentOS 6.x-server and everything is up and running quite nicely. When I try to add pictures it seems that the picture search automatic searches wikicommons and not my own uploaded pictures in my local mediawiki installation. And when I add pictures it only reefers to the file name, as it should do with wikicommons - if I where editing on wikipedia.

Can I change this anywhere in the VE beta?


MyOnlyEye

Myonlyeye (talkcontribs)

I found something that worked in:

modules/ve/init/mw/ve.init.mw.Platform.js:              { 'url': '//commons.wikimedia.org/w/api.php' }

I changed the URL to my own wiki (and path to api.php) and then it worked quite well.

I _love_ this editor! Thanx!

Jdforrester (WMF) (talkcontribs)

Sorry, you're right, we need to factor that out of our code - I've created a bug about this. Glad you like it generally!

Stephan Matthiesen (talkcontribs)

Now it doesn't search in commons, but it doesn't find images in the local directory either. Do I have to set anything, besides the usual image upload enable stuff ($wgUploadDirectory, $wgUploadPath)? This is 1.23wmf10.

81.208.38.27 (talkcontribs)

Hi, i try to do the same. i'm in local wiki, i found this line of code in VisualEditor/modules/ve-mw/init/ve.init.mw.Platform.js, but not understand how to modify it to work for me. My local media are in http:localhost/media directory the api for my wiki are in http:localhost/wiki/api.php

this is right? this.mediaSources = [ { 'url': mw.util.wikiScript( 'api' ) }, { 'url': '//localhost/wiki/api.php' } ]; and then what i do?

thank's for help and sorry for my poor english!

Krinkle (talkcontribs)

VisualEditor now no longer hardcodes the reference to Wikimedia Commons. Instead it uses whatever media repositories your wiki server is configured to use.

Make sure you have InstantCommons / $wgUseInstantCommons set up in your LocalSettings. You needed this step already (previously VisualEditor would let you search Commons, but it would break while saving if you don't actually have it configured on the server-side in LocalSettings).

Now VisualEditor detects this configuration automatically and searches any and all media repositories you have configured.

Ckoerner (talkcontribs)

User:Krinkle is correct. For clarification you can have $wgUseInstantCommons set to false if you choose not to use Wikimedia Commons in your wiki.

Stephan Matthiesen (talkcontribs)

My problem is that it doesn't search the local media directory. Uploading is enabled; $wgUploadDirectory and $wgUploadPath are set. Do I also have to define the local directory as a media repository somehow?

Ckoerner (talkcontribs)
Stephan Matthiesen (talkcontribs)

Yes, well, as I said, uploading is enabled, the directory writeable etc and I have absolutely no problem uploading files or including them with Wiki markup. The only problem is that the Visual Editor (1.23wmf11) doesn't find them through the media dialogue.

131.116.254.197 (talkcontribs)

I have the exact same problem, it only works with the commons files, and not the local files located in /var/www/mediawiki/images/, doesnt search, unable to add picture (media) to the articles through VisualEditor

MarkJurgens (talkcontribs)

Has this problem been identified as a bug anywhere? Or fixed?

I'd like to try and install it again soon with a 1.23x, but that little bug makes it unusable on us little 3rd party sites.. :(

Ckoerner (talkcontribs)

I'm running 1.23wmf11 and the latest build of VisualEditor. I can confirm that the "Insert Media" dialog in VisualEditor does return local w/images results out-of-the box.

Plectrum20 (talkcontribs)

I am running 1.23wmf14 mediawiki and visual editor and it does kind of search local images, but for some reason doesn't return what expected. For instance, I have an image called "Caisson Platform II.jpeg" and another "Caisson Platform.jpg". If I search for platform, only "Caisson Platform II.jpeg" is returned. If I search for caisson, both are returned! I have no idea why. Could it be something to do with the database indexing the files? I'm not sure if it's related but the special pages "Gallery of new files" and "File List" searches never retrieve anything whatever I put in.

Also, it would be great to show the top 50 images or so by upload date by default. And of course to have uploading integrated in the visual editor.

200.189.118.162 (talkcontribs)

Something to do with file extension, type the exact name including extension "Caisson Platform.jpg", or "Platform.jpg". I think it's a bug.

217.91.231.179 (talkcontribs)

@Plectrum @Alacn

I set up a wiki in our intranet and have the same problem. But the name or file extension has nothing to do with this bug. The reason "platform" works fine in "Caisson Platform II.jpeg" is the space between "platform" and "II.jpeg". The other file has only the space between "Caisson" and "Platform".

The same problem occurred when I added some logos of our customers. Everytime I named the pictures "logo xyz.jpg" I found them by searching for "logo" but not when a searched for "xyz". Vice versa, when I named the file "xyz logo.jpg" I found the file searching for "xyz".

I don't know why this function works correct when you search Commons. With 2 letters you find results with the searched value inside of a word. But for local files this functions don't work.


Is this bug (and method) already known and possibly fixed?

Jdforrester (WMF) (talkcontribs)

Bug 61151 was filed about this, but was a false report based on the search API being un-intuitive. I'm pretty sure it should work out-of-the-box with InstantCommons off, as it does for me.

Stephan Matthiesen (talkcontribs)

More details: The problem occurs on a private wiki. It works fine when $wgGroupPermissions['*']['read'] = true; but when it is set to false then images are not found in the media selector.

My relevant permissions settings are:

$wgGroupPermissions['*']['read'] = false; # works for true
$wgGroupPermissions['*']['edit'] = false;
if ( $_SERVER['REMOTE_ADDR'] == "127.0.0.1") {
   $wgGroupPermissions['*']['read'] = true;
   $wgGroupPermissions['*']['edit'] = true;
}

The if condition allows VE local access (I also tried cookie forwarding with same results). When I set the first line to true, it works. Two questions:

  • Why does the VE image selector not use the permissions for local access from inside the if statement?
  • Is there any setting that gives VE specifically access to the images without opening the whole Wiki?

Thanks

Stephan Matthiesen (talkcontribs)
46.237.215.30 (talkcontribs)

Editor does not always search local images "out of the box", both my installations (local and webserver) have no integration of local search. The webserver one is private, the local one is public, and both VE's have no access.

Even more interesting in this is that the VE on the private wiki can't even see the already linked files, meaning when I edit a page that has a file linked in it, it disappears within the editor. Checking some logs states that the parsoid service produces API Errors, but everythin else works, including creating, deleting and editing articles with the VE. Permission checks on the images-floder have been run, owner is set correctly, parsoid is installed as a service that works nicely and cookies are being forwarded correctly, but still - nothing.

Don't know if this is still the same bug, but it seems to be something very similar.

221.241.135.146 (talkcontribs)

Any updates regarding this topic? I too am having issues getting graphics to show up on a local wiki. Thanks.

Knut Krüger (talkcontribs)

I just realized that the media dialog is only looking for images with more than 4 characters. The user are looking for the images and do not find anyone.

I changed the title in ../iki/extentions/VisualEditor/modules/ve-mw/i18n/??.json - ?? (means your laguage) the visualeditor-dialog-media-title term so that user are aware of typing 4 chars and * to fin the images:

f.e foopicsfisrt.jpg, foopicssecond.jpg foopicthird.jpg

can be found with foof*

It would be fine if the editor could start with * and also accept search with one character without the *

Jdforrester (WMF) (talkcontribs)

The three-characters-or-more config I think is done by the search system you're using, not by VisualEditor itself?

Ehartman2 (talkcontribs)

I believe this issue is due to HOW visual editor is searching for the local images. In my case, while I have all instances of my settings correctly set up - images fail when I load visual editor (and work again when I close visual editor) Java console reports this is due to searching for these images at 127.0.0.1, so something somewhere is telling visual editor to search for local images at the loopback

Reply to "Is picture search in VE wikicommons only?"