https://www.mediawiki.org/wiki/Special:Code/MediaWiki/101911

Revision: 101911
Author:   ning
Date:     2011-11-03 23:09:03 +0000 (Thu, 03 Nov 2011)
Log Message:
-----------
bug fixing

Modified Paths:
--------------
    trunk/extensions/WikiObjectModel/includes/WOM_Processor.php

Modified: trunk/extensions/WikiObjectModel/includes/WOM_Processor.php
===================================================================
--- trunk/extensions/WikiObjectModel/includes/WOM_Processor.php 2011-11-03 
23:06:33 UTC (rev 101910)
+++ trunk/extensions/WikiObjectModel/includes/WOM_Processor.php 2011-11-03 
23:09:03 UTC (rev 101911)
@@ -406,7 +406,7 @@
                wfProfileOut( $fname );
                return $xObj;
        }
-       public static function getObjIdByXPath2( WOMPageModel $wom_obj, $xpath 
) {
+       public static function getObjIdByXPath2( WOMPageModel $wom_obj, $xpath, 
$extra_msg = '' ) {
                $fname = 'WikiObjectModel::getObjIdByXPath2 (WOM)';
                wfProfileIn( $fname );
 
@@ -424,7 +424,7 @@
                                $ret[] = strval( $o['id'] );
                        }
                } else {
-                       throw new MWException( __METHOD__ . ": XML element not 
found in {$title} ({$rid}), xpath: {$xpath}" );
+                       throw new MWException( __METHOD__ . ": XML element not 
found{$extra_msg}, xpath: {$xpath}" );
                }
                wfProfileOut( $fname );
                return $ret;
@@ -433,7 +433,7 @@
                $fname = 'WikiObjectModel::getObjIdByXPath (WOM)';
                wfProfileIn( $fname );
 
-               $ret = self::getObjIdByXPath2( self::getPageObject( $title, 
$rid ), $xpath );
+               $ret = self::getObjIdByXPath2( self::getPageObject( $title, 
$rid ), $xpath, " in {$title} ({$rid})" );
 
                wfProfileOut( $fname );
                return $ret;


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

Reply via email to