Page MenuHomePhabricator

VisualEditor: Add media does not search local repo when MW is in root
Closed, InvalidPublic

Description

Author: robert.labrie

Description:
Intention:
Add media with visual editor

Steps to Reproduce:
LocalSettings.php and wiresharks are attached. The MW search does work. I can do a partial name search for an image in the File namespace and it works. The gallery in mediawiki does not.

Actual Results:
No images

Expected Results:
Images

Reproducible: Always


Version: unspecified
Severity: major

Details

Reference
bz62007

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:01 AM
bzimport set Reference to bz62007.

robert.labrie wrote:

visual editor pcap

This shows the whole experience from clicking edit to clicking add media. You can see the call to API.php where it asks for repos, it gets nothing back.

Attached:

robert.labrie wrote:

search pcap

This is just proving that the search does work. Something is broken in the way VisualEditor calls the API, or in the results the API returns.

Attached:

robert.labrie wrote:

My local settings file

Attached:

Is this related to the issue we found (fixed?) in MediaWiki core recently about certain configurations of document root and the file search API?

robert.labrie wrote:

Hi James,

I'm not sure. What I do know is that VE never sends a search to the API. It does a filerepoinfo and that's the end of it. Whatever I type in the searchbox, nothing gets sent to the API.

If you give me a sample querystring I'll change the srsearch param to match something that should be found and test it.

Moriel – was this what gerrit 112491 fixed?

(In reply to James Forrester from comment #6)

Moriel – was this what Gerrit change #112491 fixed?

That change fixed another related bug, but apparently there are other remaining issues after that fix that I'm trying to understand.

I think it has to do with the fact the wiki is installed in the root directory. The media search seems to skip looking for files in the local repository.

If you access the MediaWiki core api.php entry point directly in your browser, what do you get back?

It should look like this: https://www.mediawiki.org/w/api.php

If it doesn't then there is nothing VisualEditor can do as it means your server is not configured correctly to expose MediaWiki's entry points (perhaps you only whitelisted index.php?).

This likely means other features are broken as well (the autocompleting of page names in the search box, the "Watch this page" button etc.).

Serving the MediaWiki application directory from your document root is highly discouraged. If you don't like exposing a /wiki/ path in URLs you can keep the application in /w/ but let Apache rewrite your urls from /Page_name to /w/index.php. That way you have both nice urls in the root, but still keep your application's internal files tucked away safely in /w. See https://www.mediawiki.org/wiki/Manual:Short_URL and related pages.

This appears to be a core MW issue with unsupported hosting paths. Closing as INVALID.