On Thu, Oct 24, 2013 at 10:01 AM, Élie Roux
<elie.roux(a)telecom-bretagne.eu>wrote;wrote:
This title is around 90 Tibetan characters, but each
caracter being 3
bytes, it exceeds the limit for title length of 256 bytes that MediaWiki
has.
So I have two questions:
1. If I change this limit to 1023 in the structure of the database
('page_title' field of the 'page' base), will other things (such as
search
engine) break? Is there a way to change it more cleanly?
2. Could I propose you to make this limit 1023 instead of 255 (or to make
it configurable easily)? This would allow at least 256 characters (even for
asian languages) instead of 256 bytes, which seems more consistant with the
fact that MediaWiki is well internationalized.
As mentioned already in this thread, changing this limit is possible in
theory but ..... not simple to do reliably, as there are a number of
database columns with the same limitation, and the 255-byte limit
assumption is unfortunately scattered throughout a number of places in the
code.
If you only need to *display* longer-form original page titles on the
article, you might consider using the {{DISPLAYTITLE:}} keyword with
$wgRestrictDisplayTitle disabled to allow fairly arbitrary customizations:
https://www.mediawiki.org/wiki/DISPLAYTITLE#Displaytitle
https://www.mediawiki.org/wiki/Manual:$wgRestrictDisplayTitle
If you really want the full-length titles as the low-level page title, you
might try something like this:
Note that as of MySQL 5.0.3, VARCHAR columns are no longer limited to 255
bytes -- they can go up to 65,535 (or the maximum row size defined for the
table). So it should be possible to change the column definitions... but I
have not tested it and make no guarantees!
1) Before configuring MediaWiki, edit maintenance/tables.sql and change
instances of "VARCHAR(255)" to "VARCHAR(1023)".
2) Search around for '255' appearing in .php, .inc, or .js files and change
the checks to 1023.
You might be able to get away with mostly changing just this bit in
includes/Title.php:
# Limit the size of titles to 255 bytes. This is typically the size
of the
# underlying database field. We make an exception for special
pages, which
# don't need to be stored in the database, and may edge over 255
bytes due
# to subpage syntax for long titles, e.g. [[Special:Block/Long
name]]
if (
( $this->mNamespace != NS_SPECIAL && strlen( $dbkey ) > 255 )
|| strlen( $dbkey ) > 512
) {
return false;
}
Update both the 255 and the 512 check with larger numbers (the 512 check is
for Special: pages, since they often take other page titles as parameters).
There's a JavaScript clone of this check in
resources/mediawiki/mediawiki.Title.js, which should probably be updated
likewise.
There are similar checks for other fields such as the edit comment, which
you might also want to make sure get increased, but that looks like the
most important one.
Be sure *not* to change instances of '255' that are actually color
components or other values -- you can't safely do a mass search and replace!
-- brion
Thank you in advance,
--
Elie
______________________________**_________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<https://lists.…