diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2022-10-26 20:05:12 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2022-10-26 20:11:27 +0200 |
commit | d54b1687773861816d43fd23c0ac6e3080ece89a (patch) | |
tree | 99fbe954ec16f8d788fa201751240c38fc5a5c28 | |
parent | dde9c55fd6d29b982145e6c54181e31b6b4f85b7 (diff) | |
download | mediawikicore-d54b1687773861816d43fd23c0ac6e3080ece89a.tar.gz mediawikicore-d54b1687773861816d43fd23c0ac6e3080ece89a.zip |
specials: RangeChronologicalPager has to use first index column
A array to string conversion is done at the moment and the colum "Array"
is showing up in the sql.
Bug: T321679
Change-Id: Idc87b0e329ee386ebf0c154bbaed23c46c117a44
-rw-r--r-- | includes/pager/RangeChronologicalPager.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/pager/RangeChronologicalPager.php b/includes/pager/RangeChronologicalPager.php index 9c790846b49c..c20e5d695ee6 100644 --- a/includes/pager/RangeChronologicalPager.php +++ b/includes/pager/RangeChronologicalPager.php @@ -47,16 +47,18 @@ abstract class RangeChronologicalPager extends ReverseChronologicalPager { $this->rangeConds = []; try { + // This is a chronological pager, so the first column should be some kind of timestamp + $timestampField = is_array( $this->mIndexField ) ? $this->mIndexField[0] : $this->mIndexField; if ( $startStamp !== '' ) { $startTimestamp = MWTimestamp::getInstance( $startStamp ); $startOffset = $this->mDb->timestamp( $startTimestamp->getTimestamp() ); - $this->rangeConds[] = $this->mIndexField . '>=' . $this->mDb->addQuotes( $startOffset ); + $this->rangeConds[] = $timestampField . '>=' . $this->mDb->addQuotes( $startOffset ); } if ( $endStamp !== '' ) { $endTimestamp = MWTimestamp::getInstance( $endStamp ); $endOffset = $this->mDb->timestamp( $endTimestamp->getTimestamp() ); - $this->rangeConds[] = $this->mIndexField . '<=' . $this->mDb->addQuotes( $endOffset ); + $this->rangeConds[] = $timestampField . '<=' . $this->mDb->addQuotes( $endOffset ); // populate existing variables for compatibility with parent $this->mYear = (int)$endTimestamp->format( 'Y' ); |