LibreCat / Catmandu-MARC

Catmandu modules for working with MARC data
https://metacpan.org/release/Catmandu-MARC
Other
8 stars 10 forks source link

marc_map("008/33", ...) returns no value (if the value at pos#33 is "0") #80

Closed CaptSolo closed 6 years ago

CaptSolo commented 6 years ago

Problem: marc_map("008/33", ...) does not return a value if the character at this position is "0".

Data:

      [
         "008",
         " ",
         " ",
         "_",
         "931004s1993^^^^lv^a^^^^^^^^^^001^0^lav^d"
      ],

Fixes tried:

marc_map("008/33", "lit_form")
marc_map("008/32", "another_008_position")

Result: no value in "lit_form" (but the value from another position - 32 - is read OK):

   "another_008_position" : "^"

If the character @ pos 33 is changed to another value (e.g. "f") the value is read OK:

   "lit_form" : "f",
   "another_008_position" : "^"
CaptSolo commented 6 years ago

I found a workaround that worked in the Catmandu::MARC version supplied with the latest Docker image - to use marc_spec() instead of marc_map().

Unfortunately this does not work with more recent Catmandu::MARC versions (1.161, 1.17).

phochste commented 6 years ago

This should be solved for marc_map in 1.17

   marc_map(008/33,z)   #  z => 0

@cKlee Can you take a look at this for marc_spec case?

CaptSolo commented 6 years ago

@phochste : just re-checked this issue in 1.17:

cKlee commented 6 years ago

See https://github.com/LibreCat/Catmandu-MARC/pull/81

phochste commented 6 years ago

Version: 1.171 on its way to CPAN