r23869 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23868‎ | r23869 | r23870 >
Date:15:34, 8 July 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Bugfix: main labels for query result now computed correctly
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -435,19 +435,19 @@
436436 case '*': //print statement
437437 $chunk = $this->readChunk('\]\]|\|');
438438 if ($chunk == '|') {
439 - $label = $this->readChunk('\]\]');
440 - if ($label != ']]') {
 439+ $printlabel = $this->readChunk('\]\]');
 440+ if ($printlabel != ']]') {
441441 $chunk = $this->readChunk('\]\]');
442442 } else {
443 - $label = '';
 443+ $printlabel = '';
444444 $chunk = ']]';
445445 }
446446 } else {
447447 global $wgContLang;
448 - $label = $wgContLang->getNSText(NS_CATEGORY);
 448+ $printlabel = $wgContLang->getNSText(NS_CATEGORY);
449449 }
450450 if ($chunk == ']]') {
451 - return new SMWPrintRequest(SMW_PRINT_CATS, $label);
 451+ return new SMWPrintRequest(SMW_PRINT_CATS, $printlabel);
452452 } else {
453453 $this->m_errors[] = 'Misshaped print statement.'; //TODO: internationalise
454454 return NULL;
@@ -490,18 +490,18 @@
491491 case '*': // print statement, abort processing
492492 $chunk = $this->readChunk('\]\]|\|');
493493 if ($chunk == '|') {
494 - $label = $this->readChunk('\]\]');
495 - if ($label != ']]') {
 494+ $printlabel = $this->readChunk('\]\]');
 495+ if ($printlabel != ']]') {
496496 $chunk = $this->readChunk('\]\]');
497497 } else {
498 - $label = '';
 498+ $printlabel = '';
499499 $chunk = ']]';
500500 }
501501 } else {
502 - $label = $rel->getText();
 502+ $printlabel = $rel->getText();
503503 }
504504 if ($chunk == ']]') {
505 - return new SMWPrintRequest(SMW_PRINT_RELS, $label, $rel);
 505+ return new SMWPrintRequest(SMW_PRINT_RELS, $printlabel, $rel);
506506 } else {
507507 $this->m_errors[] = 'Misshaped print statement.'; //TODO: internationalise
508508 return NULL;
@@ -595,18 +595,18 @@
596596 switch ($value) {
597597 case '*': // print statement
598598 if ($chunk == '|') {
599 - $label = $this->readChunk('\]\]');
600 - if ($label != ']]') {
 599+ $printlabel = $this->readChunk('\]\]');
 600+ if ($printlabel != ']]') {
601601 $chunk = $this->readChunk('\]\]');
602602 } else {
603 - $label = '';
 603+ $printlabel = '';
604604 $chunk = ']]';
605605 }
606606 } else {
607 - $label = $att->getText();
 607+ $printlabel = $att->getText();
608608 }
609609 if ($chunk == ']]') {
610 - return new SMWPrintRequest(SMW_PRINT_ATTS, $label, $att, $printmodifier);
 610+ return new SMWPrintRequest(SMW_PRINT_ATTS, $printlabel, $att, $printmodifier);
611611 } else {
612612 $this->m_errors[] = 'Misshaped print statement.'; //TODO: internationalise
613613 return NULL;

Status & tagging log