r82277 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82276‎ | r82277 | r82278 >
Date:19:09, 16 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Failed attempt to fix bug 27440
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php
@@ -1,28 +1,13 @@
22 <?php
33
44 /**
5 - * File holding the SMWSpecialTypes class for the Special:Types page.
6 - *
7 - * @file SMW_SpecialTypes.php
8 - *
9 - * @ingroup SMWSpecialPage
10 - * @ingroup SpecialPage
11 - *
12 - * @author S Page
13 - * @author Markus Krötzsch
14 - * @author Jeroen De Dauw
15 - */
16 -
17 -if ( !defined( 'MEDIAWIKI' ) ) {
18 - die( 'Not an entry point.' );
19 -}
20 -
21 -/**
225 * This special page for MediaWiki provides information about types. Type information is
236 * stored in the smw_attributes database table, gathered both from the annotations in
247 * articles, and from metadata already some global variables managed by SMWTypeHandlerFactory,
258 * and in Type: Wiki pages. This only reports on the Type: Wiki pages.
269 *
 10+ * @file SMW_SpecialTypes.php
 11+ *
2712 * @ingroup SMWSpecialPage
2813 * @ingroup SpecialPage
2914 *
@@ -75,6 +60,35 @@
7661 return '<p>' . wfMsg( 'smw_types_docu' ) . "</p><br />\n";
7762 }
7863
 64+ /* Failed attempt to fix https://bugzilla.wikimedia.org/show_bug.cgi?id=27440
 65+ function getQueryInfo() {
 66+ $joinConds = array();
 67+
 68+ foreach ( SMWDataValueFactory::getKnownTypeLabels() as $label ) {
 69+ $label = str_replace( ' ', '_', $label ); // DBkey form so that SQL can elminate duplicates
 70+ $joinConds['page'] = array( 'UNION', "(SELECT 'Types' as type, " .
 71+ SMW_NS_TYPE .
 72+ " as namespace, '$label' as title, " .
 73+ "'$label' as value, 1 as count)" );
 74+ }
 75+
 76+ return array(
 77+ 'tables' => array( 'page' ),
 78+ 'fields' => array(
 79+ SMW_NS_TYPE . ' AS namespace',
 80+ 'page_title AS value',
 81+ 'page_title AS title',
 82+ '1 AS count'
 83+ ),
 84+ 'conds' => array(
 85+ 'page_namespace' => SMW_NS_TYPE,
 86+ 'page_is_redirect' => '0'
 87+ ),
 88+ 'join_conds' => $joinConds
 89+ );
 90+ }
 91+ */
 92+
7993 function getSQL() {
8094 global $smwgContLang;
8195 $dbr = wfGetDB( DB_SLAVE );
@@ -102,7 +116,7 @@
103117 }
104118
105119 /**
106 - * Returns the info about a type as HTML
 120+ * Returns the info about a type as HTML.
107121 */
108122 function getTypeInfo( $skin, $titletext ) {
109123 $tv = SMWDataValueFactory::newTypeIDValue( '__typ', $titletext );
@@ -135,5 +149,3 @@
136150 }
137151
138152 }
139 -
140 -
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php
@@ -1,27 +1,13 @@
22 <?php
33
44 /**
5 - * File holding the SMWSpecialProperties class for the Special:Properties page.
6 - *
 5+ * This special page for MediaWiki shows all used properties.
 6+ *
77 * @file SMW_SpecialProperties.php
88 *
99 * @ingroup SMWSpecialPage
1010 * @ingroup SpecialPage
11 - *
12 - * @author Markus Krötzsch
13 - * @author Jeroen De Dauw
14 - */
15 -
16 -if ( !defined( 'MEDIAWIKI' ) ) {
17 - die( 'Not an entry point.' );
18 -}
19 -
20 -/**
21 - * This special page for MediaWiki shows all used properties.
2211 *
23 - * @ingroup SMWSpecialPage
24 - * @ingroup SpecialPage
25 - *
2612 * @author Markus Krötzsch
2713 * @author Jeroen De Dauw
2814 */
@@ -116,4 +102,3 @@
117103 }
118104
119105 }
120 -

Follow-up revisions

RevisionCommit summaryAuthorDate
r82636fix bug 27440jeroendedauw22:30, 22 February 2011

Status & tagging log