EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #10444


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] bug or feature: zero valued float export couldn't be re-imported


CAUTION: This e-mail originated outside the University of Southampton.

Hi folks,

an EP3 xml export of value 0 for a float field results in <OurFloat></OurFloat>, e.g. for 3.4.7.

A reimport of
<?xml version="1.0" encoding="utf-8"?>
<eprints xmlns="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Feprints.org%2Fep2%2Fdata%2F2.0&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C5a627a3d15b2444119a808df4ca989e1%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C639313963471652321%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=HYqE0pfANVp9QYEpzoYFpTnYca5u%2FKTCWCzdN7K4Rr8%3D&reserved=0";>
  <eprint>
    <eprintid>506</eprintid>
    <eprint_status>archive</eprint_status>
    <userid>1</userid>
    <type>article</type>
    <metadata_visibility>show</metadata_visibility>
    <temperature>
      <Tmin></Tmin>
      <Tmax>50</Tmax>
    </temperature>
  </eprint>
</eprints>

by ~/Eprints/bin/import repoID eprint XML --update --enable-import-fields --force /tmp/506
fails with
Argument "" isn't numeric in numeric gt (>) at /usr/share/eprints/bin/../perl_lib/EPrints/MetaField/Int.pm line 243.
DBD::mysql::st execute failed: Incorrect double value: '' for column `repoID`.`eprint`.`temperature_Tmin` at row 1 at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 1196.
UPDATE `eprint` SET `temperature_Tmin`=?, `lastmod_year`=?, `lastmod_month`=?, `lastmod_day`=?, `lastmod_hour`=?, `lastmod_minute`=?, `lastmod_second`=? WHERE `eprintid`='506': 1366 at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 1086.
        EPrints::Database::update(EPrints::Database::mysql=HASH(0x5578327711c0), EPrints::DataSet=HASH(0x55783272a930), HASH(0x5578369c4130), HASH(0x5578367620b0)) called at /usr/share/eprints/bin/../perl_lib/EPrints/DataObj.pm line 1043
        EPrints::DataObj::commit(EPrints::DataObj::EPrint=HASH(0x5578368273c0), 0) called at /usr/share/eprints/bin/../perl_lib/EPrints/DataObj/EPrint.pm line 1113
        EPrints::DataObj::EPrint::commit(EPrints::DataObj::EPrint=HASH(0x5578368273c0)) called at /home/eprints/Eprints/bin/import line 346
        main::__ANON__(HASH(0x557836785298), "dataset", EPrints::DataSet=HASH(0x55783272a930)) called at /usr/share/eprints/bin/../perl_lib/EPrints/CLIProcessor.pm line 129
        EPrints::CLIProcessor::epdata_to_dataobj(EPrints::CLIProcessor=HASH(0x5578369f43c8), HASH(0x557836785298), "dataset", EPrints::DataSet=HASH(0x55783272a930)) called at /usr/share/eprints/bin/../perl_lib/EPrints/Plugin/Import.pm line 310
        EPrints::Plugin::Import::epdata_to_dataobj(EPrints::Plugin::Import::XML=HASH(0x557836a00690), HASH(0x557836785298)) called at /usr/share/eprints/bin/../perl_lib/EPrints/Plugin/Import/DefaultXML.pm line 225
        EPrints::Plugin::Import::DefaultXML::Handler::end_element(EPrints::Plugin::Import::DefaultXML::Handler=HASH(0x55783021cfe0), HASH(0x55783675cc80)) called at /usr/share/eprints/bin/../perl_lib/XML/SAX/Base.pm line 2201
        XML::SAX::Base::__ANON__(HASH(0x55783675cc80)) called at /usr/share/eprints/bin/../perl_lib/XML/SAX/Base.pm line 2176
        XML::SAX::Base::end_element(XML::LibXML::SAX=HASH(0x5578369cf700), HASH(0x55783675cc80)) called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML.pm line 883
        eval {...} called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML.pm line 883
        eval {...} called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML.pm line 883
        XML::LibXML::parse_fh(XML::LibXML=HASH(0x557836769120), GLOB(0x557836a048c8)) called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML/SAX.pm line 104
        eval {...} called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML/SAX.pm line 103
        XML::LibXML::SAX::_parse(XML::LibXML::SAX=HASH(0x5578369cf700)) called at /usr/local/lib/x86_64-linux-gnu/perl/5.40.1/XML/LibXML/SAX.pm line 60
        XML::LibXML::SAX::_parse_bytestream(XML::LibXML::SAX=HASH(0x5578369cf700), GLOB(0x557836a048c8)) called at /usr/share/eprints/bin/../perl_lib/XML/SAX/Base.pm line 2607
        XML::SAX::Base::parse(XML::LibXML::SAX=HASH(0x5578369cf700), HASH(0x557836826f40)) called at /usr/share/eprints/bin/../perl_lib/XML/SAX/Base.pm line 2631
        XML::SAX::Base::parse_file(XML::LibXML::SAX=HASH(0x5578369cf700), GLOB(0x557836a048c8)) called at /usr/share/eprints/bin/../perl_lib/EPrints/XML/LibXML.pm line 155
        EPrints::XML::event_parse(GLOB(0x557836a048c8), EPrints::Plugin::Import::DefaultXML::Handler=HASH(0x55783021cfe0)) called at /usr/share/eprints/bin/../perl_lib/EPrints/Plugin/Import/DefaultXML.pm line 81
        eval {...} called at /usr/share/eprints/bin/../perl_lib/EPrints/Plugin/Import/DefaultXML.pm line 81
        EPrints::Plugin::Import::DefaultXML::input_fh(EPrints::Plugin::Import::XML=HASH(0x557836a00690), "fh", GLOB(0x557836a048c8), "user", undef, "dataset", EPrints::DataSet=HASH(0x55783272a930), "filename", ...) called at /usr/share/eprints/bin/../perl_lib/EPrints/Plugin/Import.pm line 258
        EPrints::Plugin::Import::input_file(EPrints::Plugin::Import::XML=HASH(0x557836a00690), "dataset", EPrints::DataSet=HASH(0x55783272a930), "filename", "/tmp/506", "user", undef, "actions", ...) called at /home/eprints/Eprints/bin/import line 413
        eval {...} called at /home/eprints/Eprints/bin/import line 413

Use of uninitialized value $db_error in concatenation (.) or string at /usr/share/eprints/bin/../perl_lib/EPrints/DataObj.pm line 1049.
Error committing eprint.506:
Number of records imported: 1

Unfortunately the final message is wrong :(

Up to now we recreate the original value <OurFloat>0</OurFloat> for a successful import ... but is this really intended?

Thanks in advance for any comment
Thomas
Thomas