Last modified: 2011-07-11 16:54:14 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 T31797, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29797 - With subpages disabled for user pages, I get error: "Tried to load block with invalid type"
With subpages disabled for user pages, I get error: "Tried to load block with...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.20.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-10 01:10 UTC by Robin Pepermans (SPQRobin)
Modified: 2011-07-11 16:54 UTC (History)
1 user (show)

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


Attachments
Working patch (1.17 KB, patch)
2011-07-10 19:40 UTC, Jarry1250
Details

Description Robin Pepermans (SPQRobin) 2011-07-10 01:10:54 UTC
When subpages are disabled for user pages, I get the following error on user subpages:

Tried to load block with invalid type

Backtrace:

#0 C:\wamp\www\mw\includes\Block.php(1010): Block->newLoad('Robin/subpage')
#1 C:\wamp\www\mw\includes\Article.php(646): Block::newFromTarget(NULL, 'Robin/subpage')
#2 C:\wamp\www\mw\includes\Article.php(570): Article->getRobotPolicy('view')
#3 C:\wamp\www\mw\includes\Wiki.php(458): Article->view()
#4 C:\wamp\www\mw\includes\Wiki.php(230): MediaWiki->performAction(Object(Article))
#5 C:\wamp\www\mw\includes\Wiki.php(606): MediaWiki->performRequest()
#6 C:\wamp\www\mw\includes\Wiki.php(517): MediaWiki->main()
#7 C:\wamp\www\mw\index.php(57): MediaWiki->run()
#8 {main}
Comment 1 Jarry1250 2011-07-10 19:40:32 UTC
Created attachment 8767 [details]
Working patch

The callback indicates that MW is running a quick check on the user who "owns" the page to decide if it should be indexed or not by search bots (because the user viewing the page could be a search bot).

Since subpages are now turned off, MW assumes that the user "owning" the page is called "Robin/subpage".

As usernames should never contain a forwards slash, it should be simple enough to check for the presence of a forwards slash, and, if it is found, conclude that the username being passed is in fact not a username at all but an old subpage. The correct username can then be extracted.

This is what the attached patch does.
Comment 2 Robin Pepermans (SPQRobin) 2011-07-11 16:54:14 UTC
Thank you for the patch.

I applied it in r91886.

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


Navigation
Links