Skip to content

Commit e513faa

Browse files
thomas-topway-itJeroenDeDauw
authored andcommitted
fix sorting with $wgCachePages
1 parent a6f24f0 commit e513faa

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

formats/datatables/DataTables.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ protected function getResultText( QueryResult $res, $outputmode ) {
8080
$id = $resourceFormatter->session();
8181

8282
$context = \RequestContext::getMain();
83-
84-
// $parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
85-
$context->getOutput()->addJsConfigVars( [
86-
'wgCategoryCollation' => $GLOBALS['wgCategoryCollation'],
87-
'smwgEntityCollation' => $GLOBALS['smwgEntityCollation'],
88-
]);
83+
84+
// the following unfortunately does not work with $wgCachePages
85+
// so we append it in the html elements' attribute below
86+
// $context->getOutput()->addJsConfigVars( [
87+
// 'wgCategoryCollation' => $GLOBALS['wgCategoryCollation'],
88+
// 'smwgEntityCollation' => $GLOBALS['smwgEntityCollation'],
89+
// ]);
8990

9091
// Add options
9192
$data['version'] = '0.2.5';
@@ -106,6 +107,7 @@ protected function getResultText( QueryResult $res, $outputmode ) {
106107
'class' => 'srf-datatables' . ( $this->params['class'] ? ' ' . $this->params['class'] : '' ),
107108
'data-theme' => $this->params['theme'],
108109
'data-columnstype' => ( !empty( $this->params['columnstype'] ) ? $this->params['columnstype'] : null ),
110+
'data-collation' => !empty( $GLOBALS['smwgEntityCollation'] ) ? $GLOBALS['smwgEntityCollation'] : $GLOBALS['wgCategoryCollation']
109111
],
110112
Html::element(
111113
'div',

0 commit comments

Comments
 (0)