r95575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95574‎ | r95575 | r95576 >
Date:20:55, 26 August 2011
Author:yaron
Status:deferred
Tags:
Comment:
Removed special handling for 'icon' parameter - causes problems when icon is defined by a URL, and seems to no longer be necessary
Modified paths:
  • /trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php
@@ -158,28 +158,11 @@
159159
160160 $query = self::createQuery( $querystring, $params, $context, null, $extraprintouts );
161161 $query_result = smwfGetStore()->getQueryResult( $query );
162 - $display_options = array();
163 -
164 - foreach ( $params as $key => $value ) {
165 - // Special handling for 'icon' field, since it requires conversion of a name to a URL.
166 - if ( $key == 'icon' ) {
167 - $title = Title::newFromText( $value, NS_FILE );
168 -
169 - if ( !is_null( $title ) && $title->getNamespace() == NS_FILE && $title->exists() ) {
170 - $icon_image_page = new ImagePage( $title );
171 - $display_options['icon'] = $icon_image_page->getDisplayedFile()->getURL();
172 - }
173 - } else {
174 - $display_options[$key] = $value;
175 - }
176 -
177 - foreach ( $query_result->getResults() as $wiki_page ) {
178 - $wiki_page->display_options = $display_options;
179 - }
 162+ foreach ( $query_result->getResults() as $wiki_page ) {
 163+ $wiki_page->display_options = $params;
180164 }
181165
182166 wfProfileOut( 'SCQQueryProcessor::getQueryResultFromQueryString' );
183 -
184167 return $query_result;
185168 }
186169