LibreCat / Catmandu-MARC

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

Incorrect MARC tag value type (numeric, not a string) in set_field() #82

Closed CaptSolo closed 6 years ago

CaptSolo commented 7 years ago

When editing a MARC record retrieved via marc_copy incorrect MARC tag value type (numeric, not a string) is set when using set_field() :

Code:

marc_copy(100, tmp)
set_field(tmp.0.tag, "910")
marc_paste(tmp)

The resulting tag value is 910 not "910" :

   "tmp" : [
      {
         "tag" : 910,
         "ind1" : "1",
         "ind2" : " ",
         "subfields" : [
            {
               "a" : "Birzvalka, Irēna,"
            },
            {
               "d" : "1936-"
            }
         ]
      }
   ],

This is not a major problem as marc_paste understands it anyway however that is inconsistent with how imported MARC records are represented.

phochste commented 7 years ago

This is not a Catmandu::MARC issue but a Catmandu issue. I created a new ticket for that.

One can always create a literal string:

string(tmp.0.tag)