Hello, i have installed MediaWiki 1.19 and extension geo

http://www.mediawiki.org/wiki/Extension:Gis

When i insert tag <geo> in the page i receive strange string like this

UNIQ708544003b87c1ef-geo-00000000-QINU

I have also found description of this bug here

http://www.mediawiki.org/wiki/QINU_fix

but i can not fix it myself.
The fact is that

 $wgHooks['ParserFirstCallInit'][] = 'wfGeoSetHook';
 ...........
 function wfGeoSetHook( $parser ) {
        $parser->setHook( 'geo', 'parseGeo' );
        return true;
 }

does processed every time query received, but

 /**
  *  Called whenever a <geo> needs to be parsed
  *
  *  Return markup, but also a pointer to Map sources
  */
 function parseGeo ( $text, $params, &$parser ) {
        global $wgUser;

        $geo = new GeoParam( $text );

        if (($e = $geo->get_error()) != "") {
 .........

does not processed at all.

Another entry point is

 $wgHooks['ArticleSaveComplete'][] = 'articleSaveGeo';
 ........
 /**
 *  Hook function called every time a page is saved
 *  Use the ArticleSaveComplete instead of ArticleSave since the ID is
 *  not available upon ArticleSave for new articles
 */
 function articleSaveGeo ( $article, $user, $text )
 {
        $id = $article->getID();

        $g = new GisDatabase();

        $g->delete_position( $id );

        $tag = 'geo';
        $gis_content = array();
 // !JF1
        $parser = new Parser();
        $text = $parser->extractTagsAndParams( array( $tag ), $text, 
$gis_content );
        foreach( $gis_content as $marker => $tagresult ) {
                $tagname = $tagresult[0];
                $content = $tagresult[1];
                $params = $tagresult[2];
                $full = $tagresult[3];

                if ( $tagname != 'geo' ) {
                        continue;
                }

                $p = new GeoParam( $content );
                $attr = $p->get_attr();

                $g->add_position( $id,
                                   $p->latdeg_min, $p->londeg_min,
                                   $p->latdeg_max, $p->londeg_max,
                                   $attr['globe'],
                                   $attr['type'], $attr['arg:type'] );
        }
        return true;
 }

I suspect that i must do something with this function, but dont know what.

So i do not know where and how to find the cause of this behaviour.
Thanks.

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

Reply via email to