Last modified: 2011-03-06 06:24:49 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 T29638, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27638 - Add a link output format to inline queries
Add a link output format to inline queries
Status: RESOLVED DUPLICATE of bug 27885
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-22 18:39 UTC by John Morton
Modified: 2011-03-06 06:24 UTC (History)
1 user (show)

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


Attachments
link format for inline queries (3.51 KB, patch)
2011-02-22 18:39 UTC, John Morton
Details

Description John Morton 2011-02-22 18:39:29 UTC
Created attachment 8195 [details]
link format for inline queries

Hello from earthquake ravaged Christchurch!

This patch adds a new inline query output format to the core which produces a link to the query's equivalent Special:Ask page, much the same as the “further results” link. 

Use cases are to create additional “further results” links that use different output formats (eg calendar or event line for blogs), or to link to a query that shows all pages with a particular property on that property — think delicious/technorati style blog tags.

The code is pretty simple; it just copies paramaters straight into a link object for display, using the linkformat parameter to set the actual format of the linked-to search page.  

The patch was made between 1.5.5.1 and current SVN, but I stripped any irrelevant changes between them, especially in the messages code.

Needs a help page; I'll write one if you want to use the patch.
Comment 1 Markus Krötzsch 2011-02-22 20:10:52 UTC
Hi -- hope you are doing well down there, and that software is the only thing that needs patching in your immediate vicinity!

I wonder how the function you propose is different from running #ask with limit=-1. This should exactly do what you suggest: produce a further result link without even running the query, and passing all parameters on as other further results would do. Note that limit=0 runs the query and displays only if there is some result at all.
Comment 2 John Morton 2011-02-22 20:18:42 UTC
Ah, didn't know about that functionality. I'll test it out.
Comment 3 John Morton 2011-02-27 10:20:45 UTC
Yes, that does pretty much what I want, so maybe this is just a documentation bug after all :-)

Minor difference: the search page will use it's default limit, as you can't supply one if you're setting limit=-1.

I'll look at making some edits to the wiki docs to make it more obvious how to achieve this result. 

Would I be right in assuming that setting searchlabel empty is a good way to suppress the further results link if you don't want one?
Comment 4 Jeroen De Dauw 2011-02-27 10:30:42 UTC
(In reply to comment #3)
> ...
> Would I be right in assuming that setting searchlabel empty is a good way to
> suppress the further results link if you don't want one?

Yes
Comment 5 John Morton 2011-03-05 07:54:40 UTC
On further examination, I have to say it doesn't work. The code path that produces a link in the limit < 0 case doesn't preserve parameters, so you get vanilla broadtable results:

http://semantic-mediawiki.org/wiki/User:Jwm/Minus_One_Limit_Bug

Further more, several result formats in the Semantic Result Formats override the
getResult method to print something even if there are no results, so they never produce a link.

I think the solution to the problem might be to fix getResult to produce the correct link, and have a flag to produce output for the no results, not limit<0 case — but it's starting to look like the limit special case method is harder to maintain than an explicit link result format.
Comment 6 John Morton 2011-03-06 06:24:49 UTC
Fixed by #27885

*** This bug has been marked as a duplicate of bug 27885 ***

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


Navigation
Links