http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89511

Revision: 89511
Author:   jeroendedauw
Date:     2011-06-05 17:46:32 +0000 (Sun, 05 Jun 2011)
Log Message:
-----------
follow up to r89501

Modified Paths:
--------------
    trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php

Modified: trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php
===================================================================
--- trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php        
2011-06-05 17:46:14 UTC (rev 89510)
+++ trunk/extensions/SemanticResultFormats/BibTeX/SRF_BibTeX.php        
2011-06-05 17:46:32 UTC (rev 89511)
@@ -164,7 +164,11 @@
                        }
                        
                        if ( $var !== false ) {
-                               $var = efSRFGetNextDV( $field 
)->getShortWikiText();
+                               $dataValue = efSRFGetNextDV( $field );
+                               
+                               if ( $dataValue !== false ) {
+                                       $var = $dataValue->getShortWikiText();
+                               }
                        }
                        else {
                                switch ( $label ) {
@@ -177,13 +181,11 @@
                                                $var = 
$GLOBALS['wgLang']->listToText( $wikiTexts );
                                                break;
                                        case 'date':
-                                               $value = efSRFGetNextDV( $field 
);
+                                               $dataValue = efSRFGetNextDV( 
$field );
                                                
-                                               if ( get_class( $value ) == 
'SMWTimeValue' ) {
-                                                       if ( $value !== false ) 
{
-                                                               $year = 
$value->getYear();
-                                                               $month = 
$value->getMonth();
-                                                       }
+                                               if ( $dataValue !== false && 
get_class( $dataValue ) == 'SMWTimeValue' ) {
+                                                       $year = 
$dataValue->getYear();
+                                                       $month = 
$dataValue->getMonth();
                                                }
                                                break;
                                }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to