Mantis - Quercus
Viewing Issue Advanced Details
1619 minor always 02-20-07 10:46 02-28-07 10:38
ferg  
nam  
normal  
closed  
fixed  
none    
none 3.1.1  
0001619: mediawiki null object
(rep by Alex Sharaz)

Mediawiki 1.9.2

When you try to perform a search on a media wiki page you get the following error message
 
/usr/web/commswiki/webapps/wiki/includes/SpecialSearch.php:324: Fatal Error: null: 'getText' is an unknown method.
 
From SpecialSearch.php
 
 
  function showHit( $result, $terms ) {
                $fname = 'SpecialSearch::showHit';
                wfProfileIn( $fname );
                global $wgUser, $wgContLang, $wgLang;
 
                $t = $result->getTitle();
                if( is_null( $t ) ) {
                        wfProfileOut( $fname );
                        return "<!-- Broken link in search result -->\n";
                }
                $sk =& $wgUser->getSkin();
 
                $contextlines = $wgUser->getOption( 'contextlines', 5 );
                $contextchars = $wgUser->getOption( 'contextchars', 50 );
 
                $link = $sk->makeKnownLinkObj( $t );
                $revision = Revision::newFromTitle( $t );
<!ŚLine 324 Ó
                $text = $revision->getText();
<!-- Ó
                $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
                        $wgLang->formatNum( strlen( $text ) ) );
 
                $lines = explode( "\n", $text );
 
                $max = intval( $contextchars ) + 1;
                $pat1 = "/(.*)($terms)(.{0,$max})/i";
 
                $lineno = 0;
 
                $extract = '';
                wfProfileIn( "$fname-extract" );
                foreach ( $lines as $line ) {
                        if ( 0 == $contextlines ) {
                                break;
                        }
                        ++$lineno;
                        $m = array();
                        if ( ! preg_match( $pat1, $line, $m ) ) {
                                continue;
                        }
                        --$contextlines;
                        $pre = $wgContLang->truncate( $m[1], -$contextchars, '...' );
 

Notes
(0001766)
nam   
02-28-07 10:37   
php/142t