Last modified: 2012-12-13 19:45:32 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 T21185, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19185 - Check for empty section before printing title, else visible in text browsers
Check for empty section before printing title, else visible in text browsers
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.16.x
All All
: Lowest trivial (vote)
: ---
Assigned To: Trevor Parscal
http://abj.jidanni.org/index.php?titl...
: accessibility
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-14 07:36 UTC by Dan Jacobson
Modified: 2012-12-13 19:45 UTC (History)
3 users (show)

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


Attachments

Description Dan Jacobson 2009-06-14 07:36:14 UTC
On read-only wikis (e.g., no accounts except for WikiSysop, who adds
documents for others to read, but not alter, and logs in himself via
the link on Special:SpecialPages) sure, one can eliminate the Login
link altogether from the upper right corner of the (Monobook) screen:

>function JidanniNoLoginLinkOnMainPage(&$personal_urls){unset($personal_urls['login']);return true;}
>$wgHooks['PersonalUrls'][]='JidanniNoLoginLinkOnMainPage';
The problem is in text browsers, one will still see
> Views
>
>   • Page
>   • View source
>   • History
>
> Personal tools
>
> Navigation
>
>   • Main Page
>   • Recent changes
>   • Random page
i.e., an empty "Personal tools".
Looking for a way of eliminating the words "Personal tools" above, one
finds MonoBook.php has checks like
> function languageBox() {
>    if( $this->data['language_urls'] ) {
but unfortunately no check is done for Personal tools, before "sending
out the delivery truck with an empty package. Might as well have
stayed at home."

Anyway, if there were any such check, we could tailor our above hood
to work with it (e.g., do nothing if already logged in, else
unset($personal_urls) altogether.)

I didn't check e.g., "Views" etc. for similar
problems. Each such group on the page needs to check first before
making its <h5> etc.

Nor did I check other skins...
Comment 1 Brion Vibber 2009-06-23 00:54:37 UTC
This is a bug in your PHP extension code. unset() doesn't do what you're trying to do on arrays -- it sets the item value to NULL but leaves the key intact and present.

Use array_splice or array_filter or whathaveyou to produce a new array that contains the elements you want.
Comment 2 Dan Jacobson 2009-06-23 16:20:15 UTC
Excuse me but if you take a closer look at Monobook.php, you will see
that no less than
	<div class="portlet" id="p-personal">
		<h5>Personal tools</h5>
		<div class="pBody">
			<ul lang="en" xml:lang="en">
			</ul>
		</div>
	</div>
will always be emitted, as there are no enclosing if()s or functions
to prevent it, no matter what the user does in hooks.
Same with the "views" <h5>.
At the most he could do something crazy, like set
Mediawiki:Personaltools to "", but at most that would buy him an empty
<h5></h5>.
Comment 3 Dan Jacobson 2009-07-08 12:00:25 UTC
I see the vector skin has the same problem. I'll reset the Component above.

Dear Vector skin maintainer: when fixed please don't close this bug, but
instead change the Component back to "Page rendering" and remove
&useskin=vector from the URL above, unless you fix the other skins too. Thanks.
Comment 4 Trevor Parscal 2009-07-08 19:13:12 UTC
Resolved for Vector in r52937.
Comment 5 Dan Jacobson 2009-07-09 00:24:30 UTC
OK, now could someone apply similar changes to Monobook, etc. Thanks
Comment 6 Jarry1250 2012-12-06 15:31:06 UTC
Right, time to tick this one off methinks: https://gerrit.wikimedia.org/r/#/c/37224/
Comment 7 Jarry1250 2012-12-13 19:45:21 UTC
As Matmarex points out on the Gerrit changeset, there isn't a good way of doing this without breaking user scripts in wikis that want to do that; and moreover, we want to be consistent with our portlets and none of the others are hidden if empty - these days, Vector doesn't suppress an empty p-personal, for example.

Fortunately modern text browsers won't read it out anyway if it's display:none;.

Resolved WONTFIX.

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


Navigation
Links