Last modified: 2011-03-18 18:07:42 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 T28930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26930 - New result format Array and Hash
New result format Array and Hash
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticResultFormats (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Jeroen De Dauw
: need-parsertest, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-25 11:32 UTC by Daniel A. R. Werner
Modified: 2011-03-18 18:07 UTC (History)
3 users (show)

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


Attachments
I realised both of the result formats already. (16.68 KB, patch)
2011-01-25 11:32 UTC, Daniel A. R. Werner
Details
improved version of the first patch. (18.69 KB, patch)
2011-01-31 16:45 UTC, Daniel A. R. Werner
Details

Description Daniel A. R. Werner 2011-01-25 11:32:48 UTC
Created attachment 8029 [details]
I realised both of the result formats already.

New result format similar to the 'list' format but with more options how to list values. It should be possible to define separators between...
1. ...values per page
2. ...properties of a page
3. ...multi value properties.
4. ...record values.
It should be possible to define whether requested properties not defined on a page should create an empty list entry or not. And the format should be working together with Extension:ArrayExtension and Extension:HashTables to create an array or hash directly.
Comment 1 Daniel A. R. Werner 2011-01-31 16:45:22 UTC
Created attachment 8073 [details]
improved version of the first patch.

This one only introduces four config variables which allow to define default separators within the LocalSettings.php
It is possible to define one of the wikis pages as source for a seperator. This is very useful when using templates for consistent array separators within template code.
Comment 2 Jeroen De Dauw 2011-03-18 18:07:42 UTC
I just applied the patch: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/84252

I have not included these 2 formats in the list of default enables ones though, since I have some concerns:

* My IDE complains about the $var::CONST used (it's indicated as a fatal error), but it runs on my server. This makes me think you can only do this with PHP 5.3 (which my server has), and not 5.2 (to which my IDE is configured). Can you confirm it works with 5.2, or rewrite the accessing of these constants?

* They are not documented (as far as I can tell), can you add some basic docs here: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Extension:SemanticResultFormats#Formats ?

Also, it looks like you need ArrayExtension for the array format, and some other one (that I don't know of) for the hash format. This in itself is a reason to not enable the formats by default :)

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


Navigation
Links