Page MenuHomePhabricator

Empty captions in MediaWiki:Sidebar result in PHP errors
Closed, ResolvedPublic

Description

Author: praveen

Description:
includes\skin.php

In a fresh installation of 1.11.0, after I edit "* navigation" on MediaWiki:Sidebar, the website stopped working and it started to show:

PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643
PHP Notice: Undefined variable: heading in E:\Domains\ninethsense.best4service.net\wwwroot\includes\Skin.php on line 1643

After adding a line $heading = ""; at 1612 on includes\Skin.php, site working fine.

This issue is a blocker since the website stops working.


Version: 1.11.x
Severity: blocker
URL: http://ninethsense.best4service.net/

Attached:

bug1.JPG (98×607 px, 12 KB)

Details

Reference
bz12753

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:02 PM
bzimport set Reference to bz12753.
bzimport added a subscriber: Unknown Object (MLST).

The format of MediaWiki:Sidebar is as follows:

  • Caption
    • Item
    • Item
    • Item

If you remove the first line (* Caption), wiki software will be unable to find a caption to show above the navigation box. I think it is the user who should avoid this. The caption is mandatory, because one can have more than one such sidebar box like this:

  • Caption1
    • Item
    • Item
  • Caption2
    • Item
    • Item

and MediaWikis needs the captions to store the items in different arrays and show them on differnt boxes, correctly.

If you want to have a sidebar which doesn't have a caption use " " for its caption (without quotes).

As this not a bug of MediaWiki but a result of incorrect use of the Wiki software, I'm suggesting it to be closed as INVALID.

praveen wrote:

Hi Huji,

"..As this not a bug of MediaWiki but a result of incorrect use of the Wiki
software, I'm suggesting it to be closed as INVALID...."

A perfect software must show userfriendly error message when such situation occur. As you know not all users (content managers) of mediawiki are techies. Atleast we can prevent the website to load without blocking.

All up to you. I just comments :)

Best Regards

PraVeeN
blog.ninethsense.com/

With r30115 MediaWiki will use a blank caption when it finds no caption.

With r30125, even if the whole caption line is missing, the wiki will still survive!

praveen wrote:

"even if the whole caption line is missing, the wiki will still survive!"

If you need I can demonstrate this issue on my website. It is easily reproducible. It blocks the the loading of website after showing error :

PHP Notice: Undefined variable: heading in E:\Domains\digitalmanic.com\wwwroot\includes\Skin.php on line 1643

Praveen,

With the above patches I fixed the bug you reported here. However, if you want "your" wiki to be fixed too, you will have to update your wiki to the latest version. The bug I mentioned here is "not" fixed in 1.11; it is fixed in 1.12-svn. If you have questions about updating, you can contact me directly, rather than posting here.

Regards,

Huji