Needs review
Project:
Node import
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Apr 2009 at 20:58 UTC
Updated:
25 Jul 2012 at 16:03 UTC
Jump to comment: Most recent file
Comments
Comment #1
GreyHawk commentedNote: same issue when doing product-type imports.
No problems doing catalog vocabulary imports, tho.
Comment #2
giorgio79 commentedThis issue may be related as well
http://drupal.org/node/437834
Comment #3
giorgio79 commentedI tried to investigate this.
I notice that even on preview, the taxonomy free tagging terms and the hierarchical taxonomy is empty.
Here is a part of the output of one
Comment #4
giorgio79 commentedI just tried the sample csv, but that did not work as well for taxonomy...
Any tips are appreciated :)
Comment #5
ludo1960 commentedHow are defining the Taxonomy in your CSV file ? Print one line here
Comment #6
giorgio79 commentedThanks, it is very simple, I have a free tagging, and a hierarchical taxonomy and here they are for example:
TAG_CSV_COLUMN
these,are,my,tags
I am separating them wtih commas, which are offered as the default separators for tags in Node Import. ludo1960 can you tell me if you can import tags and/or terms during importing of nodes?
Comment #7
ludo1960 commentedTry separating your tags with || double pipe like these||are||my||tags let me know how it goes
Comment #8
kilrizzy commentedI am trying to import my catalog terms for products and have had no luck importing. I keep getting the errors:
warning: mb_strlen() expects parameter 1 to be string, array given in /websites/tilegallerypa/html/includes/unicode.inc on line 404.
I have tried a few different methods - "cat1"||"cat2", 1||2, cat1||cat2
Any thoughts?
Comment #9
ludo1960 commentedTry cat1||cat2|| no commas
Comment #10
giorgio79 commentedThanks Ludo, just tried like you say
these||are||my||tags
even with quotes like
"these||are||my||tags"
specifying double pipe || as the separator, but no luck.
Everything else works fine, from title, body to CCK text fields except taxonomy
Regarding kilrizzy's comment, it may be a different issue as I am not getting any error messages. Also I am having these issue via a taxonomy enabled content type import.
Comment #11
kilrizzy commentedStill no luck that way. It seems to be splitting the data though, I get two of the errors for every array entry.
To be clear, cat1 represents the machine readable term name correct?
Comment #12
ludo1960 commentedSorry that didn't work, JFYI I tried with a Vocab "City" and created terms "North" and "South" I was able to import terms into "South" and "North" seperately but not together, I got the same error as you when I tried.
Comment #13
giorgio79 commentedLudo are you referring to an import to ubercart product, or to a content type?
Comment #14
ludo1960 commentedContent type
Comment #15
Robrecht Jacques commentedThere are problems with hierarchical vocabularies. As all vocabularies are hierarchical by default on Drupal 6, this means all.
I'm working on it right now.
Comment #16
ludo1960 commentedGreat!
Comment #17
Robrecht Jacques commentedFixed in CVS. I'll release a -rc5 with this fix later today. Any of the formats above should work btw.
Comment #18
giorgio79 commentedThanks Jacques, I look forward to this.
Please let me know if you need any help.
I was trying looking at the code and understanding it hoping to fix it myself but it is massive :P
Comment #19
Robrecht Jacques commented@giorgio79 : you could test the -dev release of April 22th.
Things to do in the next couple of days (-rc5 ETA is April 25th):
- node reference fixes (working on now)
- date (including date_repeat) fixes
- book fixes
- get_csv fixes
- Fatal error: Only variables can be passed by reference in ...node_import.inc on line 594
- ...
Comment #20
ludo1960 commentedHi Robrecht,
Anything I can do to help?
Thanxs
Comment #21
giorgio79 commentedThanks Jacques, I just tested it but I am still getting empty tags for my free tagging taxonomy import.
I also noticed I cannot set default values for CCK fields, like CCK text field :)
Comment #22
cleanthes commentedJust wanted to say, I have tried the -dev version and Parents are now correctly imported. Thanks! Looking forward to -rc5
Comment #23
giorgio79 commentedcleanthes have you tried importing a flat, free tagging terms that have no parents?
Comment #24
cleanthes commentedGiorgio: No, but if you want to provide me with a test file I'd be happy to try it for you
Comment #25
voidfiles commentedHi,
I have been following this bug, and I wanted to share my problems. I have tried to import vocabulary terms with hierarchy >> and I am reciving errors.
Like this
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') td, term_hierarchy th, term_synonym ts WHERE td.vid = 1 AND th.parent = 10 AND' at line 1 query: SELECT td.tid FROM term_data) td, term_hierarchy th, term_synonym ts WHERE td.vid = 1 AND th.parent = 10 AND td.tid = th.tid AND td.tid = ts.tid AND LOWER(ts.name) = 'jets - american products & pentair' in /home/.furbag/viresh_hwp/ubercart.tastestalkr.com/modules/node_import/supported/taxonomy.inc on line 407.
* Input error: is not allowed for Catalog (not a term or synonym in Catalog).
* Input error: is not allowed for Catalog (not a term or synonym in Catalog).
and this is what I see in the dump
values = Array
(
[created] =>
[node_import_build_mode] => 1
[title] => American Products Luxury Jet Tool
[body] => Tools American Products - Luxury Jet and Diverter Jets
[type] => product
[format] => 2
[cck:field_image_cache:data] => Array
(
)
[cck:field_image_cache:fid] => Array
(
[0] => 2
)
[cck:field_image_cache:list] => Array
(
[0] => 1
)
[model] => AP45271100
[list_price] => 0
[cost] => 4.1600
[sell_price] => 8.3200
[shippable] =>
[weight] => 1
[weight_units] => lb
[length_units] => in
[length] =>
[width] =>
[height] =>
[pkg_qty] =>
[default_qty] => 1
[ordering] => 0
[uid] => 1
[revision] => 0
[log] => Imported with node_import.
[sticky] => 0
[status] => 1
[promote] => 1
[path] =>
[comment] => 2
[field_image_cache] => Array
(
[0] => Array
(
[fid] => 2
[list] => 1
[data] =>
)
)
[name] => admin
[taxonomy] => Array
(
[1] => Array
(
)
)
[op] => Preview
)
I am also attaching the csv I am trying to import
Comment #26
hanjek commentedFor people who import UTF-8 based taxonomy with multiple terms, you need to alter the include->unicode.inc :
Comment #27
giorgio79 commentedComment #28
GreyHawk commentedvoidfiles -- just revisiting this, and saw your message. I know what part of your import problem is: the Category column is incorrect.
For example, for parent "Spa Parts Catalog >> Pumps >> Aqua-Flo", the keyword you want to apply to that line is aqua flo circ pump" -- you need to change the Parent category of "Category_DataPort_Id" to look like this: ">> Aqua-Flo"
You'd have to sort your list so that any terms which are not already in the appropriate vocabulary but are necessary for assigning as parents are uploaded first, I think, to help avoid problems.
So, you'd go from this:
"Category_DataPort_Id", "Customer_Price", "Keywords", "List_Price", "Large_Image", "Long_Description", "Part_Number", ...
"Spa Parts Catalog >> Pumps >> Aqua-Flo","0.8800","aqua flo circ pump","0","","Pipe Plug O-Ring (#011) #9","AF92200120",
To this:
">> Aqua-Flo","0.8800","aqua flo circ pump","0","","Pipe Plug O-Ring (#011) #9","AF92200120", ...
That would put keyword "aqua flo circ pump" as a child underneath parent term "Aqua-Flo" -- assuming I'm reading the data correctly.
Comment #29
giorgio79 commented@hanjek I notice your code requires core modification, which wont go through in Drupal, so we should look for sg we can change in node import.
I tried it anyway but no luck, my tags (several of them separated with a comma) did not import, not even showed on the preview.
Comment #30
fitzed commentedAwesome! hanjek's unicode.inc fix above worked perfectly. I'll simply revert to the original include file after my import is complete.
Thanks!
Comment #31
GreyHawk commented@giorgio79 -- are you using the .dev release? Also, are you importing multiple taxonomies as separate values (i.e., separated by comma) or as multiple values in the same cell (separated by a | or whatever the symbol is)?
I found that the .dev release resolved a lot of issues I was having with taxonomies, particularly hierarchies, but I also had to get an example file that worked so that I could figure out the correct way to format my data.
See the response I gave above for an example of at least how I imported a hierarchy, and perhaps attach a small sample of your data...
Comment #32
giorgio79 commentedHereby I would like to thank all you guys for the kind advice and help.
Finally I had some time to dedicate to getting to the bottom of it.
Basically it turned out that during preview my tags and CCK fields showed as empty and I assumed this is a problem and stopped.
Now I ignored this and went ahead with the import, and tags imported fine! Hurrah! :)
Thanks again,
Cheers,
G
Comment #33
giorgio79 commentedOne more thing I found is that I had to disable active tags for my vocabulary as it prevented tags from importing.
Comment #34
coloryan commentedFor some reason, I need to turn off the hierarchical select module to import taxonomies. No uninstall it completely, just turn off the module.
Comment #36
diego.paroni commentedI confirm #34, if you have installed the module Taxonomy Super Select, you have to disable the Taxonomy Super Select checkboxes in the vocabulary, otherwise the node import generate "warning: Invalid argument supplied for foreach() in ...\modules\taxonomy\taxonomy.module on line 70." and the taxonomy terms are no correct.
Thanx Coloryan!
Comment #38
maaak commentedHi all,
Been trying this for a good few days ;) maybe longer could be weeks
Thankyou to all that have contributed, with the result, i have at last seen a glimmer of product import working !
Got as far as pasting in hanjek 's code for people who import UTF-8 based taxonomy with multiple terms yet i am still getting the catalog error when importing products.
Please look at the sample .csv and advise as to what i am doing incorrectly ............
* Input error: is not allowed for CATALOG (not a term or synonym in CATALOG).
* CATALOG field is required.
.m
Comment #39
maaak commented.....and here is the rejected .csv.................
Comment #40
maaak commentedOops.............
had two versions of uc_powertools loaded !
deleted the offending and Voila ! or as greywolf would say awooooooooooo!
.m
Comment #41
deedeedum commentedhanjek's code change in comment #26 fixed my issue. Thanks a bunch!
Comment #42
fonant commentedhanjek's hack in #26 worked for me too. So it seems that somewhere in nodeimport we are trying to run drupal_strlen() on an array...
Comment #43
benone commentedSo I have last Drupal 6.19 and last dev version of node import and clean vocabulary. I have no terms there.
When I am trying to import nodes with hierarchical terms I get this:
* Input error: is not allowed for Categories (not a term or synonym in Categories).
* Input error: is not allowed for Categories (not a term or synonym in Categories).
* Input error: is not allowed for Categories (not a term or synonym in Categories).
* Input error: is not allowed for Categories (not a term or synonym in Categories).
* Input error: is not allowed for Categories (not a term or synonym in Categories).
Can I create vocabulary like that ? Just importing the nodes with proper hierarchy ?
I am stucked since 3 hours and cant do nothing about that.
What can be wrong ?
Comment #44
benone commentedAlso changed 'hierarchical' to 1 using phpmyadmin and after that I can set the hierarchy string in step 5 of import.
I have ',' for multiple terms and '>' for hierarchy.
What else I can do to import them correctly ?
I use php 5.3.
Comment #45
TheBobbu commentedI've tried all the fixes in the rc4 version of node import to no avail, and now trying the dev version it still doesn't want to import my terms into Catalog as a hierarchy. Help?
I can send folks my CSV file if anyone wants to see if the problem is in there?
Comment #46
stinky commentedSubscribe
Comment #47
kazah commentedI've solved it! The hierarchy in terms.
My own method. (Sorry for my bad English)))
1. First of all go to admin/content/taxonomy/edit/vocabulary and select only tags. Nothing more (because it is very important)
2. Edit your csv => taxonomy must be like this: House,Room (without any spaces or other symbols...only commas)
3. Then start import.
4. Are you happy?=))
After all you can change admin/content/taxonomy/edit/vocabulary and unselect tags for more convinience.
Thank you.
I really love drupal.
Comment #48
polmaresma commented#26 and put hierarchy to 1 on vocabulary table worked for me
Comment #49
kazah commentedYEAh!! =))
Now it really works. Just follow these steps:
1. go to admin/content/taxonomy/edit/vocabulary and unselect all.
2. go to phpmyadmin and in vocabulary table put 1 in hierarchy.
3. while importing your csv in step 5 choose > in hierarchy (and in csv put > for hierarchy)
Works for me.
Thank you very much.
Comment #50
stinky commentedStep five doesn't give me any options! Any thoughts on how I can get options? I have a screen shot here...http://drupal.org/node/993782
Comment #51
delboud commentedIm very lost right now, i seem to had tried everything in this thread
I added the 1 to the hierarchy - didnt work
tried the unicode.inc edit from #26 - didnt work
tried #47 and #49 combinations and still didnt work
how come its working for everyone else??
Im putting my terms in like below
Volvo >> V70 >> Engine
and yes its set for >> for hierarchy
any ideas?
Comment #52
kazah commentedWrite your warning message. What version of node_import do you use?
Comment #53
sittard commentedOn my site hierarchy was set to 0 in the 'vocabulary' table, simply reordering the terms and saving magically solved this issue. A quick look in the database table and I can see that the hierarchy has now been updated to '1'.
Comment #54
doublejosh commentedTurns out it was just Taxonomy Super Select! Turned it off for these vocabs and the import went fine.
BTW: I also killed the hierarchies in the vocab during the import, so it might have been that too :)
Comment #55
matteoraggi commentedI have the same problem als owithout subterms, importing ubercart products, both with 1.1 and .dev version.
Comment #56
cristianff commentedHi,
I have the same problem: the import process works correctly with all the fields, but not detect words that are part of a taxonomy content field... I'm desperate!!! :(
I have a qüestion with #47. When you say 1. First of all go to admin/content/taxonomy/edit/vocabulary and select only tags.
Sorry but i don't understand... What do you mean with only tags?
Regards
Comment #57
doublejosh commentedBelieve they mean to make the vocab into "merely" tags so the module can handle the import.
Then you can change it back to a more specifically controlled taxonomy post import.
Assuming that was the meaning.
Comment #58
psampaz commentedSet hierarchy to 0 before importing free tags. http://drupal.org/node/723336
Comment #59
cristianff commentedI do it (hierarchy = 0), but I have the same 'bad' results.
Comment #60
jasonabc commentedHi guys - I have a two row CSV (for testing) and am getting this error:
Record 2:
Input error: is not allowed for Catalog (not a term or synonym in Catalog).
Input error: is not allowed for Catalog (not a term or synonym in Catalog).
What's odd is Record 1 imports perfectly?! I have tracked it down to the Catalog Taxonomy column in my CSV:
Record 1: Holiday >> Holiday Party Invitations >> Christmas Party Invitations
Record 2: Party Invitations >> Birthday Invitations >> Kids Birthday Party Invitations
Record 1 imports fine and places the product in the Christmas Party Invitations category. Record 2 fails. If I change Record 2 to the values in Record 1, the entire CSV imports fine.
What is wrong with my taxonomy structure in Record 2? Party Invitations >> Birthday Invitations >> Kids Birthday Party Invitations are all valid categories and the hierarchy correct.
Here is the output:
values = Array
(
[created] =>
[node_import_build_mode] => 1
[title] => Monster Truck Wiggler Invitation
[cck:field_best_seller_order:value] =>
[cck:field_product_paper_weight:value] => Array
(
[0] => 100 lb. cardstock
)
[cck:field_product_size:value] => Array
(
[0] => 4 x 9.25
)
[cck:field_product_printing_method:value] => Array
(
[0] => Flat printing
)
[cck:field_cust_pro_time_max:value] => Array
(
[0] => 3
)
[cck:field_processing_time_max:value] => Array
(
[0] => 2
)
[cck:field_cust_pro_time_min:value] => Array
(
[0] => 2
)
[cck:field_product_proof:value] => Array
(
[0] => FREE Proof emailed within 1 business day
)
[cck:field_product_printer_compat:value] => Array
(
[0] => Laser & Ink Jet Compatible
)
[cck:field_preview_tool_image:list] => Array
(
[0] => 1
)
[cck:field_preview_tool_image:data] =>
[cck:field_preview_tool_image:fid] => Array
(
[0] => 9240
)
[cck:field_image_cache:data] => Array
(
)
[cck:field_image_cache:fid] => Array
(
[0] => 9241
)
[cck:field_image_cache:list] => Array
(
[0] => 1
)
[cck:field_processing_time_min:value] => Array
(
[0] => 1
)
[cck:field_product_envelope_color:value] => Array
(
[0] => White
)
[format] => 2
[cck:field_product_new:value] =>
[type] => product
[body] => This adorable invitation features your text printed on a background with monster truck tracks. The truck appears at the top and is attached to a spring so it wiggles when moved.
[model] => PSP-SCW990
[list_price] =>
[cost] =>
[sell_price] =>
[shippable] =>
[weight] =>
[weight_units] => lb
[length_units] => in
[length] =>
[width] =>
[height] =>
[pkg_qty] =>
[default_qty] => 1
[ordering] => 0
[uid] => 1
[revision] => 0
[log] =>
Imported with node_import.
[promote] => 0
[status] => 1
[sticky] => 0
[path] =>
[comment] => 2
[name] => mc_admin
[taxonomy] => Array
(
[1] => Array
(
)
[6] => Array
(
[0] => 374
)
[7] => Array
(
[0] => 347
)
[4] => 68
)
[field_best_seller_order] => Array
(
)
[field_product_paper_weight] => Array
(
[0] => Array
(
[value] => 100 lb. cardstock
)
)
[field_product_size] => Array
(
[0] => Array
(
[value] => 4 x 9.25
)
)
[field_product_printing_method] => Array
(
[0] => Array
(
[value] => Flat printing
)
)
[field_cust_pro_time_max] => Array
(
[0] => Array
(
[value] => 3
)
)
[field_processing_time_max] => Array
(
[0] => Array
(
[value] => 2
)
)
[field_cust_pro_time_min] => Array
(
[0] => Array
(
[value] => 2
)
)
[field_product_proof] => Array
(
[0] => Array
(
[value] => FREE Proof emailed within 1 business day
)
)
[field_product_printer_compat] => Array
(
[0] => Array
(
[value] => Laser & Ink Jet Compatible
)
)
[field_preview_tool_image] => Array
(
[0] => Array
(
[fid] => 9240
[list] => 1
[data] =>
)
)
[field_image_cache] => Array
(
[0] => Array
(
[fid] => 9241
[list] => 1
[data] =>
)
)
[field_processing_time_min] => Array
(
[0] => Array
(
[value] => 1
)
)
[field_product_envelope_color] => Array
(
[0] => Array
(
[value] => White
)
)
[field_product_new] => Array
(
)
[op] => Preview
)
Comment #61
jasonabc commentedUPDATE: not sure how or why this fixed it but I simply removed the first term from both records and now the CSV imports perfectly. So I changed this:
Record 1: Holiday >> Holiday Party Invitations >> Christmas Party Invitations
Record 2: Party Invitations >> Birthday Invitations >> Kids Birthday Party Invitations
to this:
Record 1: Holiday Party Invitations >> Christmas Party Invitations
Record 2: Birthday Invitations >> Kids Birthday Party Invitations
Comment #62
Marko B commentedI hade the same problem when using Hierarchy Select and saving Terms Lineage, when this is removed and multiple select is gone, import started working correctly.
Comment #63
tinflute commentedI'm having this same problem - can't import content taxonomy fields.
Getting these errors on page 7:
Have tried all of the following:
-- applied patch from #26
-- switched field widget types (tries all of them)
-- tried vocabulary.hierarchy at 0 and 1 (it was initially = 0)
-- tried turning on terms checkbox
-- turned off all non-essential modules with 'taxonomy' in the description (did not have hierarchical select on)
My vocabulary is not hierarchical, and there is one term per record, there are no lists of terms.
I'm pasting my devel array below. field_project is the taxonomy field, 'Discovery' is a term in the vocabulary.
Thanks for the great module, and any tips.