Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -1518,9 +1518,10 @@ |
1519 | 1519 | $db->insert('smw_ids', array('smw_id' => 0, 'smw_title' => $title, 'smw_namespace' => $namespace, 'smw_iw' => $iw, 'smw_sortkey' => $sortkey), 'SMW::makeSMWPageID'); |
1520 | 1520 | $id = $db->insertId(); |
1521 | 1521 | $this->m_ids["$iw $namespace $title -"] = $id; // fill that cache, even if canonical was given |
1522 | | - if ($canonical) { // this ID is also authorative for the canonical version |
1523 | | - $this->m_ids["$iw $namespace $title C"] = $id; |
1524 | | - } |
| 1522 | + // This ID is also authorative for the canonical version. |
| 1523 | + // This is always the case: if $canonical===false and $id===0, then there is no redi-entry in |
| 1524 | + // smw_ids either, hence the object just did not exist at all. |
| 1525 | + $this->m_ids["$iw $namespace $title C"] = $id; |
1525 | 1526 | } elseif ( ($sortkey != '') && ($sortkey != $oldsort) ) { |
1526 | 1527 | $db =& wfGetDB( DB_MASTER ); |
1527 | 1528 | $db->update('smw_ids', array('smw_sortkey' => $sortkey), array('smw_id' => $id), 'SMW::makeSMWPageID'); |