Last modified: 2013-09-04 11:51:35 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 T31586, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29586 - If you browse subcats, don't show articles
If you browse subcats, don't show articles
Status: NEW
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
1.17.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-25 19:14 UTC by Subfader
Modified: 2013-09-04 11:51 UTC (History)
3 users (show)

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


Attachments

Description Subfader 2011-06-25 19:14:36 UTC
This saves some queries and is more user friendly:

If user navigates via "(previous 200) (next 200)", don't show the other sections. I'm not talking about "from"...

Background: If the user browses through e.g. the list of subcats, he doesn't care much about the images atm. If he wants to see everything again he can click "catgeory" in the upper left.

Example without image gallery section:

public function getHTML() {
		global $wgOut, $wgContLang, $wgRequest;
		wfProfileIn( __METHOD__ );

		$this->clearCategoryState();
		$this->doCategoryQuery();
		$this->finaliseCategoryState();

		$subcatfrom  = $wgRequest->getVal( 'subcatfrom' );
		$subcatuntil = $wgRequest->getVal( 'subcatuntil' );
		$pagefrom    = $wgRequest->getVal( 'pagefrom' );
		$pageuntil   = $wgRequest->getVal( 'pageuntil' );

		$r = '';

		if (!isset($pagefrom) &&!isset($pageuntil))   {
			$r .= $this->getSubcategorySection();
		}

		if (!isset($subcatfrom) && !isset($subcatuntil)) {
			$r .= $this->getPagesSection();
		}
...
Comment 1 Sam Reed (reedy) 2011-06-25 19:17:45 UTC
Can you provide this as a proper patch please?
Comment 2 Subfader 2011-06-25 19:29:28 UTC
Sorry. Never used patches before. Can you recommend a tool for creating them?
Comment 3 Bawolff (Brian Wolff) 2011-06-25 21:46:41 UTC
I personally don't think this is a good idea from a usability prespective.

(In reply to comment #2)
> Sorry. Never used patches before. Can you recommend a tool for creating them?

[[diff]] is the general tool. The easiest way is to do an svn checkout of mediawiki, edit the file, then run svn diff. There's probably fancy gui front ends to all that as well if you prefer those. Also per coding conventions, one shouldn't use isset to check for nulls, but do if ( $f === null ) type checks.
Comment 4 Subfader 2011-06-25 22:36:08 UTC
Thanks for the null hint. 

I do think it's user friendly. 

http://commons.wikimedia.org/wiki/Category:Mountains_of_Tyrol

Click next 200 images. Why scroll below the 200 subcats A-S and below the 2 pages? Why load those again at all when I actually want to see images 201-400?
Comment 5 Bawolff (Brian Wolff) 2011-06-25 23:37:02 UTC
I'm just concerned someone might hit next 200 images, and then want to see subcats, and won't be able to figure out where the other stuff went.

What about making the next 200 link for images link to http://commons.wikimedia.org/w/index.php?title=Category:Mountains_of_Tyrol&filefrom=Kogelsee.JPG#mw-category-media instead so it goes directly to the section (and similar for other sections)?
Comment 6 Subfader 2011-06-25 23:49:16 UTC
The anchor would be a bit more user friendly, sure.

But I'd like to save CPU load wherever I can, esp. for non-cached stuff like category browsing. And seen this way loading all section while obviously browsing one oarticular section seems like a big waste.

Proviously there was only 'from' and 'until'. Now we got those per section. I have hard-coded this already, so I don't care much if MW applies it.
Comment 7 Bawolff (Brian Wolff) 2011-06-26 03:17:58 UTC
I did the target thing in r90815. I'll leave this bug open though in case anyone else has any thoughts on just not showing those sections (since the target thing is not what this bug was about)

>But I'd like to save CPU load wherever I can, esp. for non-cached stuff like
>category browsing. And seen this way loading all section while obviously
>browsing one oarticular section seems like a big waste.

While personally I'd suggest just caching category pages (via squid caching or HTML caching) if your concerned about that - although I guess that doesn't get logged in folks. I'd be surprised if it actually saved enough to be worthwhile to not show those sections just for performance reasons.

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


Navigation
Links