Last modified: 2014-09-28 20:11:06 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 T39214, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37214 - The "...further results" link causes the duplication of the first column on Special:Ask (1.9 alpha)
The "...further results" link causes the duplication of the first column on S...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://semantic-mediawiki.org/wiki/Sp...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-30 09:35 UTC by icarnevale
Modified: 2014-09-28 20:11 UTC (History)
4 users (show)

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


Attachments

Description icarnevale 2012-05-30 09:35:04 UTC
If you define an ask on a page, and the results are paged, the link "...further results ...", which refers to the page Special:Ask passing the query as a parameter causes the duplication of the first column of the ask results table.
Ask generated in the column indicated in "mainlabel" is also added to the list of columns to display, and this causes duplication of the same.
My solution was to exclude the column if it's defined in the parameter "mainlabel".

includes/SMW_Infolink.php:

before line 

$titletext = $this->mTarget . '/' . SMWInfolink::encodeParameters( $this->mParams );

i added

  if(isset($this->mParams['mainlabel'])){
    foreach($this->mParams as $k => $v){
      if($v==='?='.$this->mParams['mainlabel'].'#')
        unset($this->mParams[$k]);
    }
  }
Comment 1 Jeroen De Dauw 2012-05-30 09:51:46 UTC
What version of SMW are you using? I think this has been fixed already. Definitely works fine for me.
Comment 2 icarnevale 2012-05-30 10:02:20 UTC
I'm using Semantic MediaWiki 1.7.1
Comment 3 [[kgh]] 2012-06-24 21:01:41 UTC
I can confirm this behaviour for SMW 1.8alpha (f98e778). When was this fixed?
Comment 4 [[kgh]] 2012-09-05 21:59:23 UTC
Basically a "?=title#" is added to the printout statement
Comment 5 [[kgh]] 2012-10-29 16:33:04 UTC
This problem is still there. A fix would be cool since this duplication consumes space one might not have on screen. For convenience I added a link to the problem.
Comment 6 Markus Krötzsch 2012-11-22 09:52:30 UTC
Is this problem still there? I was no able to reproduce this on semantic-mediawiki.org (running SMW 1.8 RC1).
Comment 7 [[kgh]] 2012-11-22 11:24:54 UTC
Yes, just click on the link provided at the URL field of this bug. The same actually applies to the export formats, too. There it is not as problematic since one may just delete the duplicated column.
Comment 8 [[kgh]] 2012-11-22 11:27:32 UTC
Oops, the query seems to have saved the superfluous syntax. Hmm, indeed it seems to be ok right now. I will run a test today and report back.
Comment 9 Markus Krötzsch 2012-11-23 06:50:41 UTC
Yes, the link stored in this bug report is just the link for a query with additional main printout. The link as such should continue to work as before, showing two main printouts (there are queries for which this is the correct link). But the link should no longer be produced for queries without an additional main printout.
Comment 10 [[kgh]] 2012-11-23 21:16:10 UTC
Oh dear! It took me a while to understand. One of these days :( Hmm...

Having an additional second main printout when you set "mainlabel=name of mainlabel" was not the case prior to SMW 1.7+

What wonders me: How do you set a label for the first main printout, since the first main printout is empty by default? Not being able to set a label for the main printout would be a regression and indeed a bug as far as I am concerned. I believe that setting "mainlabel=name of mainlabel" should not result into a second main printout.
Comment 11 Markus Krötzsch 2012-11-30 11:43:05 UTC
(In reply to comment #10)
...
> 
> What wonders me: How do you set a label for the first main printout, since the
> first main printout is empty by default? Not being able to set a label for the
> main printout would be a regression and indeed a bug as far as I am concerned.
> I believe that setting "mainlabel=name of mainlabel" should not result into a
> second main printout.

Setting mainlabel to a value does not result in a second main printout, at least not in my tests. You can set it to any value and it will merely change the label of the first column. If you want to main printout to vanish, you can set it to "-".

If you want to have a second main printout, you can get this with the printout parameter "|?" which can be assigned a label using "=" like any other printout. You can have as many main printouts as you like (and in any position among the other printouts).

Feel free to close this bug report if everything works fine for you now as well. Otherwise, it would be helpful to have a concrete query that causes a problem for you. In my tests, all queries work as expected.
Comment 12 [[kgh]] 2013-05-23 17:28:08 UTC
Sorry it took me a while:(

I am not sure about this new behaviour. Now you have to force a second main column and suppress the first main column to avoid the column duplication on Special:Ask. Is this really the intended behaviour?

This gives you two main result columns on "Special:Ask":

{{#ask:[[Category:Website]] [[Has property count::+]]
|?Has farm=Farm
|?Has property count=Property values
|?Has used property count=Used properties
|?Has property page count=Declared properties
|mainlabel=Wiki name
|format=table
|link=all
|sort=Has property count
|order=descending
|headers=show
|limit=100
|searchlabel=… more semantic wikis
|class=sortable wikitable smwtable
}}

Now you have to do this to avoid the two main result columns:

{{#ask:[[Category:Website]] [[Has property count::+]]
|?=Wiki name
|?Has farm=Farm
|?Has property count=Property values
|?Has used property count=Used properties
|?Has property page count=Declared properties
|mainlabel=-
|format=table
|link=all
|sort=Has property count
|order=descending
|headers=show
|limit=100
|searchlabel=… more semantic wikis
|class=sortable wikitable smwtable
}}

One may try out the old revision [1] which shows the main result column duplication.

[1] http://wikiapiary.com/w/index.php?title=Semantic_statistics&diff=187773&oldid=187677

Another way out is to use result format "template" but this is a bit overdoing things.
Comment 13 Martin Braun 2013-10-29 00:07:43 UTC
It seems to be a bug in creating the "further results" link from the inline query to the Special:Ask page when reaching the limit and having defined a mainlabel. This link erroneously contains the first search parameter as additional printout.

This problem can be reproduced and can be seen here:
http://sandbox.semantic-mediawiki.org/wiki/InlineQueryLinkBug

(The Sandbox uses SMW 1.8 alpha, it also occurs in my SMW 1.8.0.5.)
Comment 14 Martin Braun 2013-10-29 01:11:28 UTC
Correction: This link erroneously contains the result page as
additional printout.
Comment 15 [[kgh]] 2014-09-28 20:02:57 UTC
This is similar to bug 33475.
Comment 16 [[kgh]] 2014-09-28 20:11:06 UTC
Now known as issue 541 on GitHub.

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/541

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


Navigation
Links