r23153 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23152‎ | r23153 | r23154 >
Date:06:50, 21 June 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Minor fixes
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php
@@ -119,10 +119,18 @@
120120 }
121121
122122 public function addPrintRequest(SMWPrintRequest $printrequest) {
123 - return $this->m_printreqs[$printrequest->getHash()] = $printrequest;
 123+ $this->m_printreqs[$printrequest->getHash()] = $printrequest;
124124 }
125 -
 125+
126126 /**
 127+ * Add a new print request, but at the beginning of the list of requests
 128+ * (thus it will be printed first).
 129+ */
 130+ public function prependPrintRequest(SMWPrintRequest $printrequest) {
 131+ $this->m_printreqs = array_merge(array($printrequest->getHash() => $printrequest), $this->m_printreqs);
 132+ }
 133+
 134+ /**
127135 * Return a string expressing this query.
128136 */
129137 abstract public function getQueryString();
@@ -268,11 +276,11 @@
269277 }
270278
271279 public function getQueryString() {
272 - $result = '';
 280+ $result = '<q>';
273281 foreach ($this->m_descriptions as $desc) {
274282 $result .= $desc->getQueryString() . ' ';
275283 }
276 - return $result;
 284+ return $result . '</q>';
277285 }
278286 }
279287
@@ -339,7 +347,7 @@
340348 }
341349
342350 public function getQueryString() {
343 - return '[[' . $this->m_relation->getText() . '::' . $this->m_description->getQueryString() . ']]';
 351+ return '[[' . $this->m_relation->getText() . '::<q>' . $this->m_description->getQueryString() . '<q/>]]';
344352 }
345353 }
346354
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php
@@ -852,12 +852,12 @@
853853 } elseif ($description instanceof SMWNominalDescription) {
854854 if (array_key_exists('PREVREL', $curtables)) {
855855 $where .= $curtables['PREVREL'] . '.object_title=' .
856 - $db->addQuotes($description->getIndividual()->getText()) . ' AND ' .
 856+ $db->addQuotes($description->getIndividual()->getDBKey()) . ' AND ' .
857857 $curtables['PREVREL'] . '.object_namespace=' .
858858 $description->getIndividual()->getNamespace();
859859 } elseif ($this->addInnerJoin('PAGE', $from, $db, $curtables)) {
860860 $where .= $curtables['PAGE'] . '.page_title=' .
861 - $db->addQuotes($description->getIndividual()->getText()) . ' AND ' .
 861+ $db->addQuotes($description->getIndividual()->getDBKey()) . ' AND ' .
862862 $curtables['PAGE'] . '.page_namespace=' .
863863 $description->getIndividual()->getNamespace();
864864 }

Status & tagging log