r97736 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97735‎ | r97736 | r97737 >
Date:14:35, 21 September 2011
Author:jeroendedauw
Status:resolved (Comments)
Tags:
Comment:
inceremnting to 1.6.3 alpha; small fixes
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -37,6 +37,13 @@
3838 * @return array
3939 */
4040 public static function getProcessedParams( array $params, array $printRequests = null, $unknownInvalid = true ) {
 41+// $mainlabel = array_key_exists( 'mainlabel', $params ) ? $params['mainlabel'] : '';
 42+// if ( ( $querymode == SMWQuery::MODE_NONE ) ||
 43+// ( ( !$desc->isSingleton() || ( count( $desc->getPrintRequests() ) + count( $extraprintouts ) == 0 ) )
 44+// && ( trim( $mainlabel ) != '-' ) ) ) {
 45+// $desc->prependPrintRequest( new SMWPrintRequest( SMWPrintRequest::PRINT_THIS, $mainlabel ) );
 46+// }
 47+
4148 $paramDefinitions = self::getParameters();
4249
4350 $formatManipulation = new SMWParamFormat();
@@ -95,17 +102,10 @@
96103 $querymode = $printer->getQueryMode( $context );
97104 }
98105
99 - $mainlabel = array_key_exists( 'mainlabel', $params ) ? $params['mainlabel'] : '';
100 - if ( ( $querymode == SMWQuery::MODE_NONE ) ||
101 - ( ( !$desc->isSingleton() || ( count( $desc->getPrintRequests() ) + count( $extraprintouts ) == 0 ) )
102 - && ( trim( $mainlabel ) != '-' ) ) ) {
103 - $desc->prependPrintRequest( new SMWPrintRequest( SMWPrintRequest::PRINT_THIS, $mainlabel ) );
104 - }
105 -
106106 $query = new SMWQuery( $desc, ( $context != self::SPECIAL_PAGE ), ( $context == self::CONCEPT_DESC ) );
107107 $query->setQueryString( $querystring );
108108 $query->setExtraPrintouts( $extraprintouts );
109 - $query->setMainLabel( $mainlabel );
 109+ $query->setMainLabel( $params['mainlabel'] );
110110 $query->addErrors( $qp->getErrors() ); // keep parsing errors for later output
111111
112112 // set mode, limit, and offset:
Index: trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php
@@ -126,7 +126,7 @@
127127
128128 // If no default was set by an extension, use a table or list, depending on the column count.
129129 if ( $format === false ) {
130 - $format = count( $this->printRequests ) == 0 ? 'list' : 'table';
 130+ $format = count( $this->printRequests ) == 1 ? 'list' : 'table';
131131 }
132132
133133 return $format;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php
@@ -14,7 +14,7 @@
1515 * @ingroup SMW
1616 */
1717
18 -define( 'SMW_VERSION', '1.6.2 light' );
 18+define( 'SMW_VERSION', '1.6.2.1 alpha light' );
1919
2020 require_once( 'SMW_GlobalFunctions.php' );
2121
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -8,7 +8,7 @@
99 */
1010
1111 // The SMW version number.
12 -define( 'SMW_VERSION', '1.6.2' );
 12+define( 'SMW_VERSION', '1.6.2.1 alpha' );
1313
1414 // A flag used to indicate SMW defines a semantic extension type for extension crdits.
1515 define( 'SEMANTIC_EXTENSION_TYPE', true );

Comments

#Comment by Nikerabbit (talk | contribs)   19:45, 1 October 2011

[01-Oct-2011 19:41:46] PHP Notice: Undefined index: mainlabel in /www/w/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php on line 101

#Comment by Nikerabbit (talk | contribs)   06:32, 19 October 2011

You removed the fixme, but gave no indication where or how it was solved.

#Comment by Jeroen De Dauw (talk | contribs)   13:00, 19 October 2011

I think I can do more productive things with my time then go find the rev just to post it here. It has been fixed in one of the last 3000 revs :)

#Comment by Nikerabbit (talk | contribs)   14:10, 19 October 2011

Fine. I don't review it then.

#Comment by 😂 (talk | contribs)   14:13, 19 October 2011

If you're removing the fixme, please tell how/when it was fixed so someone other than you can actually confirm it was fixed. It really doesn't take more than 5 minutes to use svn blame, does it?

#Comment by Jeroen De Dauw (talk | contribs)   15:41, 19 October 2011

I don't remember even in which file the fix was made. It'd take me more then 5 minutes. I'd be extremely surprised if the issue was still there (I fixed a number of things such as this over the last month or so). Since there are no directions on how to reproduce the warning here, it's sort of hard to verify though.

Status & tagging log