Last modified: 2014-08-06 14:57: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 T27816, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25816 - Querying for categories does not work on category pages
Querying for categories does not work on category pages
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-07 07:04 UTC by Patrick
Modified: 2014-08-06 14:57 UTC (History)
4 users (show)

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


Attachments

Description Patrick 2010-11-07 07:04:22 UTC
While a query like

{{#ask: [[{{PAGENAME}}]] | ?Category }}

works flawlessly on a page (and returns the categories a page is in), it returns nothing on category pages (where it should list "parent" categories).
Comment 1 Jan Schoonderbeek 2010-11-07 08:10:16 UTC
I can't directly see if this is a bug or not. Some notes:

First, on page Category:Foo, {{PAGENAME}} returns "Foo". Thus, the query becomes
{{#ask: [[Foo]] | ?Category }}
If there is no page Foo, or it is in no category, then the result is empty.

Second, should you specify
{{#ask: [[Category:Foo]] | ?Category }}
then you're essentially selecting all pages in category Foo, and asking in which categories each page is.

However, I've tested with
{{#ask: [[:Category:Foo]] | ?Category }}
and got no results, where I expected one - so I'll leave it to Markus et al. to check things further.
Comment 2 Patrick 2010-11-07 08:32:55 UTC
Hi Jan, thanks for looking into this.

You're right,
{{#ask: [[{{PAGENAME}}]] | ?Category }}
on a category page would not select "the page I (the query) am on", but instead the pages of that category...

But what I actually meant was your third query - which should definitely return the parent categories as result, imo.
Comment 3 MWJames 2014-08-06 14:57:42 UTC
As of SMW 2.0 doing #ask/#show on a "Category" page results in:

- {{#ask: [[{{FULLPAGENAME}}]] | ?Category }} will return all pages the Category is assigned to

- {{#show: {{FULLPAGENAME}} |?Subcategory of }} will show all parent categories the category is assigned to

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


Navigation
Links