Index: trunk/extensions/SemanticMediaWiki/RELEASE-NOTES |
— | — | @@ -10,6 +10,7 @@ |
11 | 11 | |
12 | 12 | * Fixed fatal error occurring for some invalid property definitions (bug 33652). |
13 | 13 | * Fixed error in RSS when using creator or date parameters (bug 33721). |
| 14 | +* Fixed incorrect offset of export formats (bug 33726). |
14 | 15 | |
15 | 16 | == SMW 1.7.0.1 == |
16 | 17 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | } else { |
121 | 121 | $label = wfMsgForContent( 'smw_rss_link' ); |
122 | 122 | } |
123 | | - $link = $res->getQueryLink( $label ); |
| 123 | + $link = $res->getQueryLink( $label, false ); |
124 | 124 | $link->setParameter( 'rss', 'format' ); |
125 | 125 | if ( $this->m_title !== '' ) { |
126 | 126 | $link->setParameter( $this->m_title, 'title' ); |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_JSONlink.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | $label = wfMsgForContent( 'smw_json_link' ); |
131 | 131 | } |
132 | 132 | |
133 | | - $link = $res->getQueryLink( $label ); |
| 133 | + $link = $res->getQueryLink( $label, false ); |
134 | 134 | if ( array_key_exists( 'callback', $this->params ) ) { |
135 | 135 | $link->setParameter( htmlspecialchars( $this->params['callback'] ), 'callback' ); |
136 | 136 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | $label = wfMsgForContent( 'smw_csv_link' ); |
90 | 90 | } |
91 | 91 | |
92 | | - $link = $res->getQueryLink( $label ); |
| 92 | + $link = $res->getQueryLink( $label, false ); |
93 | 93 | $link->setParameter( 'csv', 'format' ); |
94 | 94 | $link->setParameter( $this->m_sep, 'sep' ); |
95 | 95 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RDF.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | $label = wfMsgForContent( 'smw_rdf_link' ); |
98 | 98 | } |
99 | 99 | |
100 | | - $link = $res->getQueryLink( $label ); |
| 100 | + $link = $res->getQueryLink( $label, false ); |
101 | 101 | $link->setParameter( 'rdf', 'format' ); |
102 | 102 | $link->setParameter( $this->syntax, 'syntax' ); |
103 | 103 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | $label = wfMsgForContent( 'smw_dsv_link' ); |
160 | 160 | } |
161 | 161 | |
162 | | - $link = $res->getQueryLink( $label ); |
| 162 | + $link = $res->getQueryLink( $label, false ); |
163 | 163 | $link->setParameter( 'dsv', 'format' ); |
164 | 164 | $link->setParameter( $this->separator, 'separator' ); |
165 | 165 | $link->setParameter( $this->fileName, 'filename' ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -196,11 +196,12 @@ |
197 | 197 | * TODO: have this work for all params without manually overriding and adding everything |
198 | 198 | * (this is possible since the param handling changes in 1.7) |
199 | 199 | * |
200 | | - * @param mixed $caption A caption string or false |
| 200 | + * @param string|false $caption |
| 201 | + * @param boolean $offsetResults Should the results be offsetted by the current limit? |
201 | 202 | * |
202 | 203 | * @return SMWInfolink |
203 | 204 | */ |
204 | | - public function getQueryLink( $caption = false ) { |
| 205 | + public function getQueryLink( $caption = false, $offsetResults = true ) { |
205 | 206 | $params = array( trim( $this->mQuery->getQueryString() ) ); |
206 | 207 | |
207 | 208 | foreach ( $this->mQuery->getExtraPrintouts() as /* SMWPrintRequest */ $printout ) { |
— | — | @@ -217,8 +218,16 @@ |
218 | 219 | $params['mainlabel'] = $this->mQuery->getMainLabel(); |
219 | 220 | } |
220 | 221 | |
221 | | - $params['offset'] = $this->mQuery->getOffset() + $this->mQuery->getLimit(); |
222 | | - |
| 222 | + $params['offset'] = $this->mQuery->getOffset(); |
| 223 | + |
| 224 | + if ( $offsetResults ) { |
| 225 | + $params['offset'] += $this->mQuery->getLimit(); |
| 226 | + } |
| 227 | + |
| 228 | + if ( $params['offset'] === 0 ) { |
| 229 | + unset( $params['offset'] ); |
| 230 | + } |
| 231 | + |
223 | 232 | if ( $this->mQuery->getLimit() > 0 ) { |
224 | 233 | $params['limit'] = $this->mQuery->getLimit(); |
225 | 234 | } |