Index: trunk/extensions/Wikidata/OmegaWiki/Wikidata.php |
— | — | @@ -399,7 +399,7 @@ |
400 | 400 | function fetchName() { |
401 | 401 | global $wgLang, $wdTermDBDataSet; |
402 | 402 | if ( $wdTermDBDataSet ) { |
403 | | - $userLanguageId = $wgLang->getCode() ; |
| 403 | + $userLanguage = $wgLang->getCode() ; |
404 | 404 | $spelling = getSpellingForLanguage( $this->dmId, $userLanguage, 'en', $wdTermDBDataSet ); |
405 | 405 | if ( $spelling ) return $spelling; |
406 | 406 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | require_once( "WikiDataBootstrappedMeanings.php" ); |
7 | 7 | require_once( "ContextFetcher.php" ); |
8 | 8 | require_once( "WikiDataGlobals.php" ); |
9 | | -require_once( "GotoSourceTemplate.php" ); |
| 9 | +// require_once( "GotoSourceTemplate.php" ); // not used, disabled |
10 | 10 | require_once( "ViewInformation.php" ); |
11 | 11 | |
12 | 12 | class DummyViewer extends Viewer { |
— | — | @@ -607,8 +607,7 @@ |
608 | 608 | } |
609 | 609 | |
610 | 610 | function getDefinedMeaningCollectionMembershipEditor( ViewInformation $viewInformation ) { |
611 | | - global |
612 | | - $wgGotoSourceTemplates; |
| 611 | + global $wgGotoSourceTemplates; |
613 | 612 | |
614 | 613 | $o = OmegaWikiAttributes::getInstance(); |
615 | 614 | |
— | — | @@ -616,7 +615,7 @@ |
617 | 616 | $editor->addEditor( new CollectionReferenceEditor( $o->collectionMeaning, new SimplePermissionController( false ), true ) ); |
618 | 617 | $editor->addEditor( new ShortTextEditor( $o->sourceIdentifier, new SimplePermissionController( false ), true ) ); |
619 | 618 | |
620 | | - if ( count( $wgGotoSourceTemplates ) > 0 ) |
| 619 | + if ( count( $wgGotoSourceTemplates ) > 1 ) |
621 | 620 | $editor->addEditor( new GotoSourceEditor( $o->gotoSource, new SimplePermissionController( true ), true ) ); |
622 | 621 | |
623 | 622 | addTableMetadataEditors( $editor, $viewInformation ); |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php |
— | — | @@ -272,34 +272,30 @@ |
273 | 273 | if ( count( $expressionIds ) > 0 ) { |
274 | 274 | $dbr = wfGetDB( DB_SLAVE ); |
275 | 275 | |
276 | | - # Query building |
| 276 | + # Query building |
277 | 277 | $frontQuery = "SELECT expression_id, language_id, spelling" . |
278 | | - " FROM {$dc}_expression" . |
279 | | - " WHERE expression_id = "; |
280 | | - $queueQuery = " AND " . getLatestTransactionRestriction( "{$dc}_expression" ); |
| 278 | + " FROM {$dc}_expression" . |
| 279 | + " WHERE expression_id = "; |
281 | 280 | |
282 | | - # Build atomic queries |
283 | | - foreach ( $expressionIds as &$value ) { $value = $frontQuery . $value . $queueQuery; } |
284 | | - unset( $value ); |
| 281 | + # Build atomic queries |
| 282 | + foreach ( $expressionIds as &$value ) { $value = $frontQuery . $value ; } |
| 283 | + unset( $value ); |
285 | 284 | # Union of the atoms |
286 | | - $finalQuery = implode( ' UNION ', $expressionIds ); |
287 | | - |
| 285 | + $finalQuery = implode( ' UNION ', $expressionIds ); |
| 286 | + |
288 | 287 | $queryResult = $dbr->query( $finalQuery ); |
289 | | - |
| 288 | + |
290 | 289 | $result = array(); |
291 | 290 | |
292 | 291 | while ( $row = $dbr->fetchObject( $queryResult ) ) { |
293 | 292 | $record = new ArrayRecord( $o->expressionStructure ); |
294 | 293 | $record->language = $row->language_id; |
295 | 294 | $record->spelling = $row->spelling; |
296 | | - |
297 | 295 | $result[$row->expression_id] = $record; |
298 | 296 | } |
299 | | - |
300 | 297 | return $result; |
301 | 298 | } |
302 | | - else |
303 | | - return array(); |
| 299 | + else return array(); |
304 | 300 | } |
305 | 301 | |
306 | 302 | function expandExpressionReferencesInRecordSet( RecordSet $recordSet, array $expressionAttributes ) { |
Index: trunk/extensions/Wikidata/OmegaWiki/Record.php |
— | — | @@ -110,6 +110,11 @@ |
111 | 111 | } |
112 | 112 | |
113 | 113 | public function tostring_indent( $depth = 0, $key = "" ) { |
| 114 | + // FIXME why is this called when viewing a WikiData page? |
| 115 | + // anyway, throws a Warning: get_class() expects parameter 1 to be object, string given |
| 116 | + // does it work still? In doubt: disabled! |
| 117 | + return ""; |
| 118 | +/* |
114 | 119 | $rv = "\n" . str_pad( "", $depth * 8 ); |
115 | 120 | $str = $this->getStructure(); |
116 | 121 | $type = $str->getStructureType(); |
— | — | @@ -133,6 +138,7 @@ |
134 | 139 | } |
135 | 140 | $rv .= "}"; |
136 | 141 | return $rv; |
| 142 | +*/ |
137 | 143 | } |
138 | 144 | |
139 | 145 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/Transaction.php |
— | — | @@ -292,6 +292,7 @@ |
293 | 293 | |
294 | 294 | if ( $transaction = $dbr->fetchObject( $queryResult ) ) { |
295 | 295 | $result->user = getUserLabel( $transaction->user_id, $transaction->user_ip ); |
| 296 | + if ( $result->user == null ) $result->user = "userId " . $transaction->user_id . " not found" ; |
296 | 297 | $result->timestamp = $transaction->timestamp; |
297 | 298 | $result->summary = $transaction->comment; |
298 | 299 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php |
— | — | @@ -1,12 +1,12 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +require_once( "WikiDataGlobals.php" ); |
4 | 5 | require_once( "HTMLtable.php" ); |
5 | 6 | require_once( "Controller.php" ); |
6 | 7 | require_once( "type.php" ); |
7 | 8 | require_once( "GotoSourceTemplate.php" ); |
8 | 9 | require_once( "Wikidata.php" ); |
9 | 10 | require_once( "ContextFetcher.php" ); |
10 | | -require_once( "WikiDataGlobals.php" ); |
11 | 11 | |
12 | 12 | function addCollapsablePrefixToClass( $class ) { |
13 | 13 | return "collapsable-$class"; |
— | — | @@ -2447,11 +2447,15 @@ |
2448 | 2448 | } |
2449 | 2449 | } |
2450 | 2450 | |
| 2451 | +/* |
| 2452 | +Don't know what it is, but obviously only used for SwissProt |
| 2453 | +cf. GoToSourceTemplate.php |
| 2454 | +*/ |
2451 | 2455 | class GotoSourceEditor extends Viewer { |
2452 | 2456 | public function view( IdStack $idPath, $value ) { |
2453 | | - global |
2454 | | - $wgGotoSourceTemplates; |
2455 | | - |
| 2457 | + global $wgGotoSourceTemplates; |
| 2458 | + if ( count( $wgGotoSourceTemplates ) <= 1 ) return "" ; |
| 2459 | + |
2456 | 2460 | $collectionId = $value->collectionId; |
2457 | 2461 | $sourceIdentifier = $value->sourceIdentifier; |
2458 | 2462 | |
— | — | @@ -2471,6 +2475,7 @@ |
2472 | 2476 | } |
2473 | 2477 | } |
2474 | 2478 | |
| 2479 | + |
2475 | 2480 | class DefinedMeaningContextEditor extends WrappingEditor { |
2476 | 2481 | public function view( IdStack $idPath, $value ) { |
2477 | 2482 | $definedMeaningId = (int) $value->definedMeaningId; |