From: Michael Dale Date: Thu, 8 Oct 2009 05:47:18 +0000 (+0000) Subject: * fixed remote search driver js bug in file check X-Git-Tag: 1.31.0-rc.0~39346 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=d53ec596d42d593627f7eab9e65cff73a710a8e7;p=lhc%2Fweb%2Fwiklou.git * fixed remote search driver js bug in file check --- diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 115698d4fb..6e8370f4a1 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -1256,8 +1256,12 @@ remoteSearchDriver.prototype = { //local repo jump directly to check Import Resource callback: cir_callback( rObj ); }else{ - //check if the orginal - _this.checkForFile( + //check if the file is local (can be shared repo) + _this.checkForFile(rObj.target_resource_title, function(imagePage){ + if( imagePage ){ + cir_callback( rObj ); + } + }); //update target_resource_title with resource repository prefix: rObj.target_resource_title = cp.resource_prefix + rObj.target_resource_title; reqObj['titles'] = _this.cFileNS + ':' + rObj.target_resource_title, @@ -1374,8 +1378,8 @@ remoteSearchDriver.prototype = { $j(this).remove(); }); }); - } - ); + } + }); } }, checkForFile:function( fName, callback){