Last modified: 2014-07-29 18:03:16 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 T65989, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63989 - 'Insert Media' in VE fails to search local repo, returns blank.
'Insert Media' in VE fails to search local repo, returns blank.
Status: RESOLVED INVALID
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All Linux
: Unprioritized normal
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-16 05:53 UTC by Patrick King
Modified: 2014-07-29 18:03 UTC (History)
6 users (show)

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


Attachments

Description Patrick King 2014-04-16 05:53:45 UTC
Running an up-to-date VisualEditor extension and parsoid server on mediawiki-1.22.2, when I use 'Insert Media' no matter the search term (exact filenames are no better) nothing is returned.

Checking server logs and debugging client browser data shows that VE only goes as far as a call to the API 'api.php?format=json&action=query&meta=filerepoinfo' which returns:

{
  query: {
    repos: [
      {
        name: "local",
        displayname: null,
        rootUrl: "/images",
        local: true
      }
    ]
  }
}

There are no further queries to the API after this call.

I can add wikiCommons, with "$wgUseInstantCommons = true", which successfully searches the wikiCommons, but has no effect on local media.

I can manually add media with the standard editor and the [[File:image.ext]] syntax, but if I double click a previously attached image in VE all of the fields in the media dialog box are vacant and I can't change any values or even close the dialog.

A query of 'api.php?action=query&list=allimages&format=json' returns a complete set of media as expected.

Further, looking at the API documentation on the server the example listed for filerepoinfo is 'api.php?action=query&meta=filerepoinfo&friprop=apiurl|name|displayname', but it returns in the warnings field: "Unrecognized value for parameter 'friprop': apiurl". Suggesting that perhaps a variable in LocalSettings.php is missing or inaccurate, I've looked over this several times, but don't see any glaring issues.

The server in question is behind an intranet, but I'm happy to answer any questions.

Thanks,
Patrick
Comment 1 James Forrester 2014-04-16 17:46:05 UTC
Do you have your wiki installed in the server's root (i.e. corp.foo.com/index.php?title=Main_Page rather than corp.foo.com/w/index.php?title=Main_Page)?

This appears to be a quite common configuration, but is explicitly advised against in MediaWiki's documentation because it doesn't work very well with MediaWiki's API and is the cause of similar issues to this for a number of people. :-(
Comment 2 Patrick King 2014-04-17 04:45:13 UTC
Yes, I did have it installed on the server's root (with a wiki. subdomain). But I've just tested with the '/w' leading path ($wgScriptPath = "/w") and it's made no difference, no images are showing up even with exact filenames. 

filerepoinfo query returns:
{"query":{"repos":[{"name":"local","displayname":null,"rootUrl":"/w/images","local":true}]}}
Comment 3 Patrick King 2014-04-23 02:03:03 UTC
Upgraded mediawiki to 1.22.5.

Installed parsoid and VisualEditor as new. 

Merged basic LocalSettings.php.

Uploaded a new file.

File and description in Special:ListFiles.

Still no change to this bug, nothing listed, no search results - only call to api is to query filerepoinfo, result as above.
Comment 4 James Forrester 2014-07-29 18:03:16 UTC
(In reply to Patrick King from comment #0)
> Running an up-to-date VisualEditor extension and parsoid server on
> mediawiki-1.22.2, when I use 'Insert Media' no matter the search term (exact
> filenames are no better) nothing is returned.

Sorry, I completely missed the bit of your question asking about MediaWiki 1.22 – for media search to work, VisualEditor requires APIs that were introduced in MediaWiki 1.23. Indeed, the code intentionally asserts that you are running the right version of MediaWiki to avoid these issues.

For comparison, my local repo (running 1.24 alpha) comes out with:

{
    "query": {
        "repos": [
            {
                "name": "local",
                "displayname": "devwiki",
                "rootUrl": "/images",
                "local": true,
                "url": "/images",
                "thumbUrl": "/images/thumb",
                "initialCapital": true,
                "scriptDirUrl": "/w",
                "scriptExtension": ".php",
                "favicon": "http://localhost:8080/favicon.ico"
            }
        ]
    }
}

Some of these extra return parts are required for VisualEditor's media search to work.


(In reply to Patrick King from comment #2)
> Yes, I did have it installed on the server's root (with a wiki. subdomain).

Quite apart from the MediaWiki 1.22 issue, that's bug 62007 (MediaWiki installed on the server's root is an unsupported configuration by its API, apparently).

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


Navigation
Links