Page MenuHomePhabricator

Make SRF support foreign image repos
Closed, DeclinedPublic

Description

Author: leo_wallentin

Description:
The gallery format of Semantic Result Formats (http://semantic-mediawiki.org/wiki/Help:Gallery_format) could be made to support foreign file repos, such as http://www.mediawiki.org/wiki/InstantCommons, where local file pages are probably missing most of the time.

This is currently prevented by line 257 in SRF_Gallery.php:

if ( $imgTitle->exists() ) {

We still need to check that the file exists, of course. Not sure what the best method is. Maybe something like this:

$imgFile = wfFindFile( $imgTitle );
if ( $imgFile && $imgFile->isVisible() ) {

Version: master
Severity: enhancement

Details

Reference
bz43632

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:20 AM
bzimport set Reference to bz43632.
bzimport added a subscriber: Unknown Object (MLST).

leo_wallentin wrote:

Another user just posted a demonstration of the problem here:

http://scratchpad.referata.com/w/index.php?title=Testask

s9gf4ult wrote:

I am the user who posted demonstration above.

You are writing

This is currently prevented by line 257 in SRF_Gallery.php:

if ( $imgTitle->exists() ) {

We still need to check that the file exists, of course. Not sure what the best
method is. Maybe something like this:

$imgFile = wfFindFile( $imgTitle );
if ( $imgFile && $imgFile->isVisible() ) {

This code belongs to function addImageProperties, but using debug printing i have figured out that it does not even called.

So i belive the guilty code is

if ( $this->params['imageproperty'] !== '' && in_array( $this->params['imageproperty'], $printReqLabels ) || $this->params['redirects'] !== '' && in_array( $this->params['redirects'], $printReqLabels ) ) {

at line 148 of SRF_Gallery.php

Actually, I dont even understand what this condition checks. All after the

$this->params['imageproperty'] !== ''

code.

leo_wallentin wrote:

However, if I understood the mailing list conversation correctly, the problem Uimanov Aleksey is experiencing, does not have with this bug (a suggestion to make foreign repos work) to do.

Aklapper subscribed.

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticResultFormats/issues . We are sorry for the inconvenience.