Last modified: 2014-10-29 12:40:56 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 T31280, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29280 - More detailed badtitle errors
More detailed badtitle errors
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
: 72672 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-06 14:18 UTC by Vitaliy Filippov
Modified: 2014-10-29 12:40 UTC (History)
3 users (show)

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


Attachments
Detailed badtitle patch for svn89562 (11.97 KB, patch)
2011-06-06 14:18 UTC, Vitaliy Filippov
Details

Description Vitaliy Filippov 2011-06-06 14:18:31 UTC
Created attachment 8621 [details]
Detailed badtitle patch for svn89562

When passed an invalid page title, MW just tells it's "bad", but doesn't tell WHY exactly it's bad.
I suggest a patch which introduces more error messages for different cases.
Comment 1 Roan Kattouw 2011-06-06 15:48:24 UTC
(In reply to comment #0)
> Created attachment 8621 [details]
> Detailed badtitle patch for svn89562
> 
Haven't looked at this in detail, but I did notice it seems to change Title-constructing functions to return a BadTitle object for bad inputs instead of null. This is probably a bad idea, with checks like <code>if ( !$title )</code> hardcoded all over MediaWiki and its extensions.
Comment 2 Brion Vibber 2011-06-06 18:09:07 UTC
Yeah, that would be ... massively problematic. :)

It might not be unreasonable actually to have *new* functions which either return an error object or throw an exception on invalid input, while the existing Title::newFromText() and friends call those and then pass back a null as their thousands of callers expect.

But if designing a new core object-creation call for one of the most frequent operations, should probably float the idea for feedback on wikitech-l first.
Comment 3 Vitaliy Filippov 2011-06-06 20:02:58 UTC
Yes, I understand it, but it's needed in only one place, so I think it doesn't need to be a new core call, and in the patch, it's returning BadTitle only when second argument is true, and only from newFromURL...
In fact, in our patched 1.16.2, we use static Title member Title::$lastError :-[ it's even more ugly I think :-)
But I don't see the way to return error information from Title creation other than static member or the hack from patch :-)
Comment 4 Sumana Harihareswara 2011-11-25 02:42:02 UTC
Vitaliy, thanks for your patch.  It looks like you've gotten some feedback on the contribution, and maybe you could come into wikitech-l, or into the #mediawiki channel on freenode, to talk about revising your approach (if you have time and interest).  Thanks!
Comment 5 Vitaliy Filippov 2011-11-25 14:38:04 UTC
Maybe just discuss it here? The discussion will be easier to be found here. What would be the correct approach to return an error from title creation? Especially now, when BadTitle class is removed from trunk again?
Comment 6 Sumana Harihareswara 2011-11-25 14:42:35 UTC
Vitaliy, the reason I suggest that you go somewhere else to ask the question is because there are about 5 people paying attention here (you and the 4 cc'd people) and there are dozens more than that who pay attention to the mailing list or IRC channel.  Usually, what we do is: have the discussion in a place where lots of people are available and willing to discuss it, and then summarize that discussion in a comment here in the bug tracker, to combine convenience and archivability/discoverability.  :-)
Comment 7 Vogone 2014-10-29 12:40:56 UTC
*** Bug 72672 has been marked as a duplicate of this bug. ***

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


Navigation
Links