[Koha-bugs] [Bug 6727] can't import frameworks

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 17 13:38:41 CEST 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6727

--- Comment #10 from Salva Zaragoza Rubio <salva at masmedios.com> 2011-08-17 11:38:41 UTC ---
Created attachment 5044
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=5044
CVS with LF ok

Opening the csv with a text editor this is what I see (only the
marc_tag_structure is affected):

"tagfield","liblibrarian","libopac","repeatable","mandatory","authorised_value","frameworkcode"
"000","LEADER","LEADER","0","1","
","FA"
"020","INTERNATIONAL STANDARD BOOK
NUMBER","INTERNATIONAL STANDARD BOOK
NUMBER","1","0","","FA"
"022","INTERNATIONAL STANDARD SERIAL
NUMBER","INTERNATIONAL STANDARD SERIAL NUMBER","1","0","","FA"
"082","DEWEY DECIMAL CLASSIFICATION NUMBER ","DEWEY
DECIMAL CLASSIFICATION NUMBER ","0","0","","FA"
"090","LOCALLY ASSIGNED LC-TYPE
CALL NUMBER","LOCALLY ASSIGNED LC-TYPE CALL NUMBER","1","0","","FA"
"092","Local Dewey","Local Dewey","0","0","","FA"
"100","MAIN
ENTRY--PERSONAL NAME","MAIN ENTRY--PERSONAL NAME","0","0","","FA"
"245","TITLE
STATEMENT","TITLE STATEMENT","0","1","","FA"
"250","EDITION STATEMENT","EDITION
STATEMENT","0","0","","FA"
"260","PUBLICATION, DISTRIBUTION, ETC.
(IMPRINT)","PUBLICATION, DISTRIBUTION, ETC.
(IMPRINT)","1","0","","FA"
"500","GENERAL NOTE","GENERAL
NOTE","1","0","","FA"
"942","ADDED ENTRY ELEMENTS (KOHA)","ADDED ENTRY ELEMENTS
(KOHA)","0","0","","FA"
"952","LOCATION AND ITEM INFORMATION (KOHA)","LOCATION
AND ITEM INFORMATION (KOHA)","1","0","","FA"
"999","SYSTEM CONTROL NUMBERS
(KOHA)","SYSTEM CONTROL NUMBERS (KOHA)","1","0","","FA"


This is what it should be (deleting the spurious LF):
I attach the file or the textarea will add again LF where it shouldn't.


With this new format I've imported and exported correctly the csv file.

I don't know where those LF characters have come from.
The code from exporting in csv format is (C4::ImportExportFramework, line 319,
only takes data from the database):

$query = 'SELECT * FROM ' . $table . ' WHERE frameworkcode=?';
        $sth = $dbh->prepare($query);
        $sth->execute($frameworkcode);
        my $data;
        while (my $hashRef = $sth->fetchrow_hashref) {
            for (@fields) {
                $$strCSV .= '"' . $hashRef->{$_} . '",';
            }
            chop $$strCSV;
            $$strCSV .= chr(10);
        }
        $$strCSV .= chr(10);

So I thinks they have come from $hashRef->{$_}, the result from the database
query. Look at your marc_tag_structure table from the mysql command and query
the framework to check whether there are LF or not.

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list