$this->mInterlangs[$key] = $title;
}
+ foreach ( $this->mCategories as $cat => &$sortkey ) {
+ # If the sortkey is longer then 255 bytes,
+ # it truncated by DB, and then doesn't get
+ # matched when comparing existing vs current
+ # categories, causing bug 25254.
+ $sortkey = substr( $sortkey, 0, 255 );
+ }
+
$this->mRecursive = $recursive;
wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
* @private
*/
function getExistingCategories() {
- $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey' ),
+ $res = $this->mDb->select( 'categorylinks', array( 'cl_to', 'cl_sortkey_prefix' ),
array( 'cl_from' => $this->mId ), __METHOD__, $this->mOptions );
$arr = array();
foreach ( $res as $row ) {
- $arr[$row->cl_to] = $row->cl_sortkey;
+ if ( $row->cl_sortkey_prefix !== '' ) {
+ $arr[$row->cl_to] = $row->cl_sortkey_prefix;
+ } else {
+ $arr[$row->cl_to] = $this->mTitle->getCategorySortkey();
+ }
}
return $arr;
}
-- Bugs 164, 1211, 23682. This is the second version of this patch; the
-- changes are also incorporated into patch-categorylinks-better-collation2.sql,
-- for the benefit of trunk users who applied the original.
+--
+-- Due to bug 25254, the length limit of 255 bytes for cl_sortkey_prefix
+-- is also enforced in php. If you change the length of that field, make
+-- sure to also change the check in LinksUpdate.php.
ALTER TABLE /*$wgDBprefix*/categorylinks
CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '',
ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '',