Tech List

[index] [prev] [next] [options] [help]
See the Mailing Lists Page for how to subscribe and unsubscribe.

eprints_tech messages

Please note: this page shows emails that have been sent to the eprints_tech mailing list. Some of these may be spam emails we have failed to filter.

[EP-tech] Re: Google map export error

From: Sam Moffatt <Samuel.Moffatt AT usq.edu.au>
Date: Tue, 30 Jun 2009 09:46:05 +1000


Threading: [EP-tech] Google map export error from lz.fcla AT gmail.com
      • This Message

http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Looking at that location rendered an empty document element - I'm
guessing its failing because the plugin doesn't check that there are
children for the root node or for any other node. 

The code in question I'm guessing is this:
my  AT country = $dom->getElementsByTagName( "countryCode" );
my  AT location = $dom->getElementsByTagName( "name" );
my $countryString = $country[0]->getFirstChild->getNodeValue;
my $locationString = $location[0]->getFirstChild->getNodeValue;	

Perhaps change this to be the following:
my  AT country = $dom->getElementsByTagName( "countryCode" ); 
my  AT location = $dom->getElementsByTagName( "name" );
next unless(EPrints::Utils::is_set($country[0]) && 
EPrints::Utils::is_set($location[0]);
my $countryString = $country[0]->getFirstChild->getNodeValue;
my $locationString = $location[0]->getFirstChild->getNodeValue;	


I certainly haven't tested this but give it a go and see how you
progress. I'm still learning how ePrints works and there is probably a
better way of doing that in Perl as well (perhaps just check that
location/country has values?).

Cheers,

sam


On Sat, 2009-06-20 at 04:52 +1000, Liang Zhong wrote:
> http://ws.geonames.org/findNearbyPlaceName?lat=38.2052&lng=122.572
> [Fri Jun 19 14:44:05 2009] [error] Can't call method 
"getFirstChild"
> on an
> undefined value
> at /var/eprints/perl_lib/EPrints/Plugin/Export/MapPlot.pm
> line 147.\n


This email (including any attached files) is confidential and is for the
intended recipient(s) only.  If you received this email by mistake,
please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily
reflect those of the University of Southern Queensland.  Although all
reasonable precautions were taken to ensure that this email contained no
viruses at the time it was sent we accept no liability for any losses
arising from its receipt.

The University of Southern Queensland is a registered provider of
education with the Australian Government (CRICOS Institution Code No's.
QLD 00244B / NSW 02225M)



[index] [prev] [next] [options] [help]