Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialAttributes.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | attribute_title as value, |
48 | 48 | COUNT(*) as count |
49 | 49 | FROM $attributes |
50 | | - GROUP BY attribute_title"; |
| 50 | + GROUP BY attribute_title, value_datatype"; |
51 | 51 | } |
52 | 52 | |
53 | 53 | function sortDescending() { |
— | — | @@ -59,19 +59,12 @@ |
60 | 60 | $attrtitle = Title::makeTitle( SMW_NS_ATTRIBUTE, $result->value ); |
61 | 61 | $attrlink = $skin->makeLinkObj( $attrtitle, $attrtitle->getText() ); |
62 | 62 | // The value_datatype is in title, see getSQL(). |
63 | | - if (strncmp($result->title, $wgExtraNamespaces[SMW_NS_TYPE], count($wgExtraNamespaces[SMW_NS_TYPE])) == 0) { |
64 | | - // The value_datatype is a Type: page name. |
65 | | - $typetitle = Title::newFromText($result->title); |
66 | | - } else { |
67 | | - // The value_datatype is a type ID. |
68 | | - // Get this ID's localized label and turn it into a Type: page. |
69 | | - $typelabel = SMWTypeHandlerFactory::getTypeLabelByID($result->title); |
70 | | - if ($typelabel !== NULL) { |
71 | | - $typetitle = Title::makeTitle( SMW_NS_TYPE, $typelabel); |
72 | | - } else { |
73 | | - $typetitle = NULL; |
74 | | - } |
| 63 | + |
| 64 | + $typelabel = SMWTypeHandlerFactory::getTypeLabelByID($result->title); |
| 65 | + if ( $typelabel === NULL ) { // type unknown, maybe some upgrade problem |
| 66 | + $typelabel = $result->title; |
75 | 67 | } |
| 68 | + $typetitle = Title::makeTitle( SMW_NS_TYPE, $typelabel ); |
76 | 69 | $typelink = $skin->makeLinkObj( $typetitle); |
77 | 70 | // Note: It doesn't seem possible to reuse this infolink object. |
78 | 71 | $searchlink = new SMWInfolink( |