Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -116,15 +116,16 @@ |
117 | 117 | wfProfileIn("SMWSQLStore2::getSemanticData (SMW)"); |
118 | 118 | SMWSQLStore2::$in_getSemanticData++; |
119 | 119 | |
120 | | - if ( $subject instanceof Title ) { |
| 120 | + if ( $subject instanceof Title ) { ///TODO: can this still occur? |
121 | 121 | $sid = $this->getSMWPageID($subject->getDBkey(),$subject->getNamespace(),$subject->getInterwiki()); |
122 | 122 | $svalue = SMWWikiPageValue::makePageFromTitle($subject); |
123 | 123 | } elseif ($subject instanceof SMWWikiPageValue) { |
124 | | - $sid = $this->getSMWPageID($subject->getDBkey(),$subject->getNamespace(),$subject->getInterwiki()); |
| 124 | + $sid = $subject->isValid()? |
| 125 | + $this->getSMWPageID($subject->getDBkey(),$subject->getNamespace(),$subject->getInterwiki()): |
| 126 | + 0; |
125 | 127 | $svalue = $subject; |
126 | 128 | } else { |
127 | 129 | $sid = 0; |
128 | | - $result = NULL; |
129 | 130 | } |
130 | 131 | if ($sid == 0) { // no data, safe our time |
131 | 132 | /// NOTE: we consider redirects for getting $sid, so $sid == 0 also means "no redirects" |