Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -2000,7 +2000,11 @@ |
2001 | 2001 | wfProfileIn( 'SMWSQLStore2::makeSMWPageID (SMW)' ); |
2002 | 2002 | |
2003 | 2003 | $oldsort = ''; |
2004 | | - $id = $this->getSMWPageIDandSort( $title, $namespace, $iw, $subobjectName, $oldsort, $canonical ); |
| 2004 | + if ( $sortkey != '' ) { // get the old sortkey (requires DB access): |
| 2005 | + $id = $this->getSMWPageIDandSort( $title, $namespace, $iw, $subobjectName, $oldsort, $canonical ); |
| 2006 | + } else { // only get the id, can use caches: |
| 2007 | + $id = $this->getSMWPageID( $title, $namespace, $iw, $subobjectName, $canonical ); |
| 2008 | + } |
2005 | 2009 | |
2006 | 2010 | if ( $id == 0 ) { |
2007 | 2011 | $db = wfGetDB( DB_MASTER ); |
— | — | @@ -2035,7 +2039,7 @@ |
2036 | 2040 | * Properties have a mechanisms for being predefined (i.e. in PHP instead |
2037 | 2041 | * of in wiki). Special "interwiki" prefixes separate the ids of such |
2038 | 2042 | * predefined properties from the ids for the current pages (which may, |
2039 | | - * e.g. be moved, while the predefined object is not movable). |
| 2043 | + * e.g., be moved, while the predefined object is not movable). |
2040 | 2044 | */ |
2041 | 2045 | protected function getPropertyInterwiki( SMWDIProperty $property ) { |
2042 | 2046 | if ( $property->isUserDefined() ) { |
— | — | @@ -2065,7 +2069,8 @@ |
2066 | 2070 | if ( ( !$property->isUserDefined() ) && ( array_key_exists( $property->getKey(), self::$special_ids ) ) ) { |
2067 | 2071 | return self::$special_ids[$property->getKey()]; // very important property with fixed id |
2068 | 2072 | } else { |
2069 | | - return $this->makeSMWPageID( $property->getKey(), SMW_NS_PROPERTY, $this->getPropertyInterwiki( $property ), '', true ); |
| 2073 | + return $this->makeSMWPageID( $property->getKey(), SMW_NS_PROPERTY, |
| 2074 | + $this->getPropertyInterwiki( $property ), '', true ); |
2070 | 2075 | } |
2071 | 2076 | } |
2072 | 2077 | |