Since multigroup is not yet supported in node import (and only exists in cck's -dev branch), I decided to model my fields ungrouped with an unlimited number of values.

I am trying to import multiple values for a field where some of the values are blank. Is this even possible? Often the values do not even parse.

For example, on a multi-value string field, I am trying to import "||||A" where the divider token is "||" and I want to import ,,"A".

CommentFileSizeAuthor
#3 node_import_586294.patch3.26 KBlegion80

Comments

seehawk’s picture

I'm interested in this as well.

If you import multiple value fields that are part of a multigroup, will the values of each field match up so long as you separate multiple values in a consistent fashion?

In other words, if you have three fields in a multigroup, and the goal is to have values like this:

A B C
1 2 3
X Y Z

if you import the first field as "A||1||X", the second as "B||2||Y" and the third as "C||3||Z", will they align properly after the import?

Zidewinder’s picture

I have been trying to import data into some multigroup fields, and it seems like it all goes fine until the import finishes and I go check the results and see only the first set of values got imported. I'm not sure if this is because it's a multigroup, or if it's a larger issue with importing into multi-value text fields...

legion80’s picture

StatusFileSize
new3.26 KB

I was working on tracing what's going on a few weeks ago, and then got sidetracked.

Basically what's happening is that if you're trying to do a multigroup import, it is possible for each "column" of the group to have a blank value in the middle. The node import code will (twice?) filter out all values that are empty, so that's one big bug.

I think I remember running into the same problem you did; that is, even if every column in every row has been filled out, it still only saves the first one. That's another bug that I haven't yet located. I have successfully imported multi-value fields, so it's not that-- it has something to do with the fact that multiple columns are part of a multi-group, and that you are saving the multi-group.

in node_import.inc, line 605 and 677 you'll find duplicate if statements that filter the $values variable based on empty strings. I first tried to import by commenting those lines out, but it still didn't work. Then I discovered another bug, in supported/cck/content.inc, lines 108 and 114. What's happening is that it is going through the list of data based on an incrementing index, where $i is defined by the length of the array. This is wrong, since what you want to use is the actual key of the array, not the index of the array. This code worked before since it basically assumed that if you were importing multiple values for a column, each element of the array is filled with a non-empty string. Since we can't assume that anymore, this code breaks.

That's as far as I got. The code still won't work. If anyone else can help with the debugging, hopefully what I described here will help.

I've submitted a patch of what I changed.

amclin’s picture

I found this thread while trying to figure out why importing CCK multigroups was only saving the first entry and did a bunch of debugging and reading through the code to figure out how this all works and I think I found a solution.

If the CCK multigroup is set to an unlimited number of repeats, then Node Import only imports the first value from the CSV Content Field list of multiple values (even though all the values exist in the data array).

However, if the CCK multigroup is set to a fixed limit of repeats, then things work properly and multiple entries are created for the multigroup.

This also appears to allow for "empty" entries for values within multigroups!

So it seems to me what needs to be fixed is whatever is affected by the multigroup entry limit flag.

tomgf’s picture

I have exactly this problem and can confirm this: trying to import from a CSV file, the CCK multigroup accepts only the first group ignoring the rest when set to unlimited values. It works fine if there is a fixed limit of values.

bikingbadger’s picture

I've run into this problem and solved it temporarily with the maximum number of entry's.
Problem is my node needs more than the ten set as the maximum.
Is there any way that I can work around it?

mscalone’s picture

subscribe

Anonymous’s picture

subscribe

zeezhao’s picture

subscribe

Anonymous’s picture

There's a patch to reset the maximum of the multigroup, I haven't tried it yet though:

http://drupal.org/node/841914

anj’s picture

Subscribe

vacilando’s picture

I confirm amclin's workaround in #4:

If the CCK multigroup is set to an unlimited number of repeats, then Node Import only imports the first value from the CSV Content Field list of multiple values (even though all the values exist in the data array).

However, if the CCK multigroup is set to a fixed limit of repeats, then things work properly and multiple entries are created for the multigroup.

Anonymous’s picture

Is there any work around if most of my repeats will stay under 10, but I have a few that will be 100+?

Anonymous’s picture

This is really close to a deal breaker for me, I have a whole mess of data. I'll provide a $50 bounty (paypal) for this to work with the multigroup set as unlimited...hope this is okay.

pvanerk’s picture

I use the Feeds module in combination with the feeds tamper module to get this working.
With the Node Import module didn't get this working.

I have written a blog post on the setup of the Feeds, Feeds Tamper and a bit of VBA code.

Anonymous’s picture

Thanks to pvanerk for providing an alternative--of which I am investigating. Am still hoping for this to work out for unlimited multigroups though.

overbythere’s picture

I am still seeing this as an issue. Not specifically for this module, but I am presuming a module conflict as above. Annoyingly our client has already entered 12 items, so I cannot set the limit to 10. Is it possible to set the limit to 15 for example?

Anyone have any idea if this got fixed, or if a fix is available? Using latest Drupal and CCK.

Thanks,

Dan.

JayBroughton’s picture

Issue summary: View changes

Did this get fixed?

Thanks
Jay