FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16783&edit=1

ID: 16783
Comment by: mschraeder@btsb.com
Reported By: mschraeder at btsb dot com
Summary: Better validation when creating a field
Status: Closed
Type: Feature/Change Request
Package: File_MARC
Operating System: N/A
Package Version: 0.4.2
PHP Version: Irrelevant
Assigned To: dbs
Roadmap Versions:
New Comment:

I just stumbled upon a MARC file with a control field that has this
same problem. Would it be possible to add the same check when making a
Control Field?


Previous Comments:
------------------------------------------------------------------------

[2009-11-13 15:19:04] frozensolid

Confirmed fix.

When File_MARC hits the file with the invalid tag it's carrying on just
fine and otherwise seems to be working.

I must have messed up when I was putting together the test.mrc file so
my apologies for that. It was throwing the error I expected it to, but
I didn't check that the records after that were formatted properly.

------------------------------------------------------------------------

[2009-11-12 22:51:05] dbs

-Status: Feedback
+Status: Closed
-Assigned To:
+Assigned To: dbs
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download
at
http://pear.php.net/get/

Changed the behaviour to catch the exception that was thrown by
MARC_Data_Field and add it as a warning to the MARC_Record object.

Added a new test for the specific case mentioned in the bug report
(invalid tag name). The sample provided by the bug reporter appears to
be a different case entirely and isn't handled by other standard MARC
parsing tools.

Pushing out release 0.4.3 as a result.

------------------------------------------------------------------------

[2009-11-12 22:28:08] dbs

Hmm. Comparing the output of File_MARC 0.4.2 to yaz-marcdump and
pymarc, even though File_MARC throws an exception for the really
egregiously formatted record in question (which seems to be less about
having a '30-' tag than it is about having a horrendously corrupted
leader), it at least continues to soldier on and produces output for the
following record.

In comparison, both pymarc and yaz-marcdump terminate after hitting the
egregious record in question and don't dump the output of the following
record.

So, I don't think File_MARC is doing such a bad job of dealing with
invalid input data. Throwing an exception is probably the right thing to
do.

------------------------------------------------------------------------

[2009-11-12 21:09:18] frozensolid

try http://www.frozen-solid.net/test.mrc

------------------------------------------------------------------------

[2009-11-12 20:53:41] dbs

I can't resolve that address. Can you double-check it, please?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=16783

Search Discussions

  • Denials at Mar 4, 2010 at 4:23 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16783&edit=1

    ID: 16783
    Updated by: denials@gmail.com
    Reported By: mschraeder at btsb dot com
    Summary: Better validation when creating a field
    Status: Closed
    Type: Feature/Change Request
    Package: File_MARC
    Operating System: N/A
    Package Version: 0.4.2
    PHP Version: Irrelevant
    Assigned To: dbs
    Roadmap Versions:
    New Comment:

    Please open a new bug and attach an example bad MARC record, so that I
    can target
    the bug against the correct package version and also have something to
    test against.
    Otherwise, I'm just making stuff up.


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-03-03 22:50:34] frozensolid

    I just stumbled upon a MARC file with a control field that has this
    same problem. Would it be possible to add the same check when making a
    Control Field?

    ------------------------------------------------------------------------

    [2009-11-13 15:19:04] frozensolid

    Confirmed fix.

    When File_MARC hits the file with the invalid tag it's carrying on just
    fine and otherwise seems to be working.

    I must have messed up when I was putting together the test.mrc file so
    my apologies for that. It was throwing the error I expected it to, but
    I didn't check that the records after that were formatted properly.

    ------------------------------------------------------------------------

    [2009-11-12 22:51:05] dbs

    -Status: Feedback
    +Status: Closed
    -Assigned To:
    +Assigned To: dbs
    Thank you for your bug report. This issue has been fixed
    in the latest released version of the package, which you can download
    at
    http://pear.php.net/get/

    Changed the behaviour to catch the exception that was thrown by
    MARC_Data_Field and add it as a warning to the MARC_Record object.

    Added a new test for the specific case mentioned in the bug report
    (invalid tag name). The sample provided by the bug reporter appears to
    be a different case entirely and isn't handled by other standard MARC
    parsing tools.

    Pushing out release 0.4.3 as a result.

    ------------------------------------------------------------------------

    [2009-11-12 22:28:08] dbs

    Hmm. Comparing the output of File_MARC 0.4.2 to yaz-marcdump and
    pymarc, even though File_MARC throws an exception for the really
    egregiously formatted record in question (which seems to be less about
    having a '30-' tag than it is about having a horrendously corrupted
    leader), it at least continues to soldier on and produces output for the
    following record.

    In comparison, both pymarc and yaz-marcdump terminate after hitting the
    egregious record in question and don't dump the output of the following
    record.

    So, I don't think File_MARC is doing such a bad job of dealing with
    invalid input data. Throwing an exception is probably the right thing to
    do.

    ------------------------------------------------------------------------

    [2009-11-12 21:09:18] frozensolid

    try http://www.frozen-solid.net/test.mrc

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=16783

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 3, '10 at 9:54p
activeMar 4, '10 at 4:23a
posts2
users2
websitepear.php.net

2 users in discussion

Denials: 1 post Mschraeder: 1 post

People

Translate

site design / logo © 2022 Grokbase