Last modified: 2011-07-23 21:13:43 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 T24777, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22777 - Separator between list items in queries cannot be changed (patch attached)
Separator between list items in queries cannot be changed (patch attached)
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Markus Krötzsch
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-09 08:39 UTC by Patrick
Modified: 2011-07-23 21:13 UTC (History)
3 users (show)

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


Attachments
Patch (against SMW 1.5.0) that introduces a query parameter "recordsep", which can be set to ";_" or "<br />", etc. (1.68 KB, patch)
2010-03-09 08:39 UTC, Patrick
Details
Patch (against SMW 1.5.3) that introduces a query parameter "itemsep", which can be set to ";_" or "<br />", etc. (1.79 KB, patch)
2010-11-07 07:54 UTC, Patrick
Details

Description Patrick 2010-03-09 08:39:33 UTC
Created attachment 7185 [details]
Patch (against SMW 1.5.0) that introduces a query parameter "recordsep", which can be set to ";_" or "<br />", etc.

It would sometimes be helpful to change the separator between record items, especially when post-processing query results in a template. The default comma is likely to appear in the actually query results as payload, and can thus not be used to determine where one record item ends, and where the next one appears.
Comment 1 Markus Krötzsch 2010-05-27 15:04:06 UTC
I first thought that this request is about Type:Record, but it actually is about multiple items in a list. The name of the parameter should really be changed now that this type is available in SMW. Part of what you suggest has been planned for some time now: ?printouts can now have parameters like "limit" and one could have a parameter "sep" for printouts to define how they separate their items. Unfortunately, this would need to be taken into account individually in all printouts since it is hard to unify the code.

Now for lists, there is a second type of "," separator: the one that is used between the results generated by each printout. Unfortunately, both separators are unified in the current code, but they are logically not the same. I think this latter kind of separator is closer to the parameter you suggest.

I wonder if it is good to have the "( ... )" if a separator is set. Or should the display just be of the form:

<1st column> <your-sep> <2nd column> <your-sep> ... <your-sep> <last-column>

Where the column text is the property name (unless disabled), and the list of values possibly with another custom separator in between. So the default "( ... )" would go away in this case, and the whole format would look more like a table.
Comment 2 Patrick 2010-11-07 07:51:12 UTC
It seems I was confused about "records" and "record elements in a list" - "recordsep" is definitely not a good name for the kind of separator I was talking about. "elementsep" or "itemsep" would probably be better.

I'll attach a patch against current SVN head, where the parameter is renamed to 'itemsep'.

Here is a live example: http://patrick-nagel.net/wiki/Contact_example
Comment 3 Patrick 2010-11-07 07:54:37 UTC
Created attachment 7796 [details]
Patch (against SMW 1.5.3) that introduces a query parameter "itemsep", which can be set to ";_" or "<br />", etc.
Comment 4 Jeroen De Dauw 2011-07-23 21:13:43 UTC
Patch looks ok to me, although it seems some stuff there rally should be arrays that get imploded instead of string concats with if(isFirstItem) stuff.

> Part of what you suggest hascbeen planned for some time now: ?printouts can now have parameters like "limit"cand one could have a parameter "sep" for printouts to define how they separate their items.

Has this actually been implemented? And if so, where are the docs?

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


Navigation
Links