https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12747
--- Comment #53 from M. Tompsett <[email protected]> --- Comment on attachment 66587 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66587 Bug 12747 - Add extra column in Z3950 search result Review of attachment 66587: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12747&attachment=66587) ----------------------------------------------------------------- ::: C4/Breeding.pm @@ +362,4 @@ > my @addnumberfields; > foreach (@addnumber_array) { > my $length = length($_); > my $adTag = substr($_, 0, 3); If the field is: 100$a 245$a 700$a Then why aren't you: my @fields_to_add = split / /, $pref_addnumber; And inside the the loop: foreach my $field (@fields_to_add) { my ($tag,$subtags) = split |\$|, $field; You are making an assumption that the user won't type something bad like 20$a instead of 020$a. Notice my use of $subtags, because that would be the 'abc' or whatever was set. my @subtags = split //,$subtags; # I believe this splits each character out. foreach my $subtag (@subtags) { substr() calculations are just messy and slow. @@ +385,5 @@ > + my $subfields_text = $field->as_string(); > + push(@addnumberfields, $_); > + $row->{$_} = $subfields_text; > + } > + } And then all this logic could be optimized. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
