correctly upgrade repeatable field value to array
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 6 Nov 2007 20:06:07 +0000 (20:06 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 6 Nov 2007 20:06:07 +0000 (20:06 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@24 49f9634a-d7ec-0310-8e6b-ec35c6cc8804

Fast.pm

diff --git a/Fast.pm b/Fast.pm
index aa510ba..ace03b3 100644 (file)
--- a/Fast.pm
+++ b/Fast.pm
@@ -336,7 +336,7 @@ sub to_hash {
 
                                        # repeatable subfiled -- convert it to array
                                        if ($val->{$f}) {
-                                               if ( $sf_usage->{$f} == 2 ) {
+                                               if ( ref($val->{$f}) ne 'ARRAY' ) {
                                                        $val->{$f} = [ $val->{$f}, $val ];
                                                } else {
                                                        push @{$val->{$f}}, $val;