https://bugzilla.wikimedia.org/show_bug.cgi?id=45265

--- Comment #7 from Krinkle <[email protected]> ---
I agree those variables are a mess.

But one doesn't have to concerned about which variables contain what type of
value and whether they are db or text versions.

And adding another one certainly doesn't make that easier (sure they are both
called "Title", but if that was simple enough, this wouldn't have been a bug,
you said so yourself).

The methods of mw.Title are pretty usable (e.g. mw.Title#toText aka
#getPrefixedText for the non-underscore version, mw.Title#getPrefixedDb for the
db version). We use the same system server-side with matching method names, and
for the same reason: Those individual variables would've been a mess to deal
with on the server-side.

Construct an mw.Title once with whatever input (doesn't matter which title/page
variable, it'll take it - though if you use wgTitle, be sure to pass the
namespace as well).

Then simply use it's methods to get the desired value (full name, just title,
just namespace, in either text or db format)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to