Active
Project:
MARC
Version:
6.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2010 at 12:25 UTC
Updated:
21 Oct 2010 at 17:07 UTC
Jump to comment: Most recent file
I need to import data from a MARC 21 file into the CCK fields. I use module MARC 6.x-2.0-beta3. I choose MARC file and necessary CCK fields in module settings. But after import the fields are empty.
For example, there is a line in marcbib.module.
$bib->loc_code = marc_clean_field(marc_value($marc, '852|a'));
As I understand, value "852|a" is a line number in MARC file, from which module gets data to import into CCK field. This line is empty in my file. I changed the value 852|a on the right line number, but it did not give results. Is this correct idea? Where is mistake? What should I do?
Thank you
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Files.zip | 7.22 KB | Jolly.Wimp |
Comments
Comment #1
aaustin commentedDid you go to admin/build/marc and "map" MARC fields to your CCK fields?
Sorry for the delay in responding.
Comment #2
Jolly.Wimp commentedYes, I did. I tried, but it didn't help.
Comment #3
benjamin.pauley commentedOne thing I missed the first time I tried to import:
On the Import tab, under "Options," make sure the radio button beside the content type that you want to create is highlighted, and (for good measure) click the box beside "Process Records Immediately."
Apologies if you did that already--as I say, it was something I missed the first time, which led to a failed import. (Granted, that was with MARC8 records...)
Comment #4
Jolly.Wimp commentedI've done all as you say, but without any result.
I think, that problem is in another MARC format. Module does not work correctly with MARC 21, but I don't know what I should do to fix this.
Comment #5
aaustin commentedCan you attach a small file of your records and I will test them on my site.
Comment #6
Jolly.Wimp commentedFor example, you can test these files. Probably, there are some problems with encodings. If you can find a solution, could you write general instructions of solving this problem, if possible? This is a test file format, and perhaps it will be changed.
Thank you for help
Comment #7
aaustin commentedYou are right, it does appear to be an issue with encodings. If I change my marc table to be latin1_general_ci encoded, the records will import - but with all ?'s for the non-latin characters.
I am afraid I need to do some research on php, mysql and encoding issues.
Comment #8
aaustin commentedI think I have it figured out. Apparently Drupal supports unicode by default so it seemed to just be an issue with the php file_get_contents() function.
So if you are not having any problems with unicode elsewhere on your site, try this:
Grab a copy of the marc.import.inc file from the cvs repository and replace your existing file.
http://drupalcode.org/viewvc/drupal/contributions/modules/marc/
Now try uploading the files. It worked for me but I am curious if it works for everyone.
I have a couple of more bugs to address, then I will put out another release of the module.
- And thanks for the files, they were extremely helpful.