https://bugzilla.wikimedia.org/show_bug.cgi?id=32977

       Web browser: ---
             Bug #: 32977
           Summary: [SRF] When used on images, "array" format fails
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: SemanticResultFormats
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


This will display images instead of silently storing them in an array:

{{#ask: [[Category:Images]] | ? | format=array | name=image array}}

Using #arrayprint from the Arrays extension will then fail:

{{#arrayprint: image array | <br /> | VariableValue | [[VariableValue|180px]]
}}

Using link=none on the #ask query will still non-silently produce a
File:pagename list:

{{#ask: [[Category:Images]] | ? | format=array | name=image array | link=none}}

Once again, using #arrayprint from the Arrays extension will then fail:

{{#arrayprint: image array | <br /> | VariableValue | [[VariableValue|180px]]
}}

Also, #arraymap from Semantic Forms will also fail:

{{#arraymap:{{#arrayprint: image
array}}|,|VariableValue|[[VariableValue|180px]]|\n\n}}

With two different extensions failing to make use of the data that the SMW
"array" format is providing, in two different ways, it appears that the array
format is non-functional when dealing with files and/or images.

The workaround is to use the "list" format, with the "sep=," parameter to
manually construct a data set:

{{#arraydefine: image array
| {{#ask: [[Category:Images]] | ? | format=list | sep=, | link=none}}
}}

The #arrayprint then succeeds:

{{#arrayprint: image array | <br /> | VariableValue | [[VariableValue|180px]]
}}

The #arraymap also succeeds:

{{#arraymap:{{#arrayprint: image
array}}|,|VariableValue|[[VariableValue|180px]]|\n\n}}

I marked this as major instead of critical because although the array feature
of SMW's Semantic Result Formats is non-functional with images (I didn't test
other data types), the problem can be worked around as described. Here's the
relevant documentation. Note that part of it is incomplete, and does not
describe some of the things I did in my examples above:

http://semantic-mediawiki.org/wiki/Help:Array_format
http://www.mediawiki.org/wiki/Extension:Semantic_Result_Formats

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to