r95873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95872‎ | r95873 | r95874 >
Date:15:08, 31 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed DSV format bugs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES
@@ -4,6 +4,7 @@
55 == SMW 1.6.2 ==
66
77 * Use of native MediaWiki sortable tables for the table formats.
 8+* Fixed separator and filename parameters for the DSV format.
89
910 == SMW 1.6.1 ==
1011
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php
@@ -17,6 +17,11 @@
1818 protected $separator = ':';
1919 protected $fileName = 'result.dsv';
2020
 21+ public function __construct( $format, $inline, $useValidator = true ) {
 22+ parent::__construct( $format, $inline );
 23+ $this->useValidator = $useValidator;
 24+ }
 25+
2126 /**
2227 * @see SMWResultPrinter::handleParameters
2328 *
@@ -33,7 +38,7 @@
3439 $this->separator = trim( $params['separator'] );
3540 }
3641
37 - $this->fileName = str_replace( ' ', '_', $params['increase'] );
 42+ $this->fileName = str_replace( ' ', '_', $params['filename'] );
3843 }
3944
4045 public function getMimeType( $res ) {
@@ -162,7 +167,8 @@
163168
164169 $link = $res->getQueryLink( $label );
165170 $link->setParameter( 'dsv', 'format' );
166 - $link->setParameter( $this->separator, 'sep' );
 171+ $link->setParameter( $this->separator, 'separator' );
 172+ $link->setParameter( $this->fileName, 'filename' );
167173
168174 if ( array_key_exists( 'mainlabel', $this->m_params ) && $this->m_params['mainlabel'] !== false ) {
169175 $link->setParameter( $this->m_params['mainlabel'], 'mainlabel' );