On initial edit, items were sorted by virtue of being pulled from a sorted table, but on preview they were displayed in rough order of use in parsing, which is a bit less legible.
Added Title::compare() static comparator available as a callback for usort(), using it in Linker::formatTemplates().
* (bug 14047) Fix regression in installer which hid DB-specific options.
Also makes SQLite path configurable in the installer.
* (bug 13546) Follow image redirects on image page
+* (bug 12644) Template list on edit page now sorted on preview
=== API changes in 1.13 ===
}
$outText .= '</div><ul>';
+ usort( $templates, array( 'Title', 'compare' ) );
foreach ( $templates as $titleObj ) {
$r = $titleObj->getRestrictions( 'edit' );
if ( in_array( 'sysop', $r ) ) {
&& $this->getDBkey() === $title->getDBkey();
}
+ /**
+ * Callback for usort() to do title sorts by (namespace, title)
+ */
+ static function compare( $a, $b ) {
+ if( $a->getNamespace() == $b->getNamespace() ) {
+ return strcmp( $a->getText(), $b->getText() );
+ } else {
+ return $a->getNamespace() - $b->getNamespace();
+ }
+ }
+
/**
* Return a string representation of this title
*