r111977 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111976‎ | r111977 | r111978 >
Date:23:12, 20 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed issue with table sort
Modified paths:
  • /trunk/extensions/EducationProgram/includes/EPPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/includes/EPPager.php
@@ -258,7 +258,7 @@
259259 function isFieldSortable( $name ) {
260260 return in_array(
261261 $name,
262 - $this->table->getPrefixedFields( $this->getSortableFields() )
 262+ $this->getSortableFields()
263263 );
264264 }
265265
@@ -503,7 +503,6 @@
504504
505505 # Make table header
506506 foreach ( $fields as $field => $name ) {
507 - $prefixedField = $this->table->getPrefixedField( $field );
508507 $name = $name === '' ? '' : $this->getMsg( 'header-' . $name );
509508
510509 if ( $field === '_select' ) {
@@ -516,10 +515,10 @@
517516 }
518517 elseif ( strval( $name ) == '' ) {
519518 $s .= "<th>&#160;</th>\n";
520 - } elseif ( $this->isFieldSortable( $prefixedField ) ) {
521 - $query = array( 'sort' => $prefixedField, 'limit' => $this->mLimit );
 519+ } elseif ( $this->isFieldSortable( $field ) ) {
 520+ $query = array( 'sort' => $field, 'limit' => $this->mLimit );
522521
523 - if ( $prefixedField == $this->mSort ) {
 522+ if ( $field == $this->mSort ) {
524523 # This is the sorted column
525524 # Prepare a link that goes in the other sort order
526525 if ( $this->mDefaultDirection ) {
@@ -552,6 +551,14 @@
553552 $s .= "</tr></thead><tbody>\n";
554553 return $s;
555554 }
 555+
 556+ /**
 557+ * (non-PHPdoc)
 558+ * @see IndexPager::getIndexField()
 559+ */
 560+ public function getIndexField() {
 561+ return $this->table->getPrefixedField( $this->mSort );
 562+ }
556563
557564 protected $instanceNumber = null;
558565

Follow-up revisions

RevisionCommit summaryAuthorDate
r111980Follow up to r111977;jeroendedauw23:17, 20 February 2012

Status & tagging log