Hello,
i have about 500 nodes I want to import into drupal. Normally there are 5 pictures assigned to a node. I do import the image_field as followed:
/firmen/dpm1_1_md.jpg||/firmen/dpm1_2_md.jpg||/firmen/dpm1_3_md.jpg||/firmen/dpm1_4_md.jpg||/firmen/dpm1_5_md.jpg
This works fine, but unforetenatly not every node has 5 pictures, so the script does only import 200 nodes, because in 300 nodes some pictures are missing.
Is there any possibility to just skip a picture if it is not existent?
Thanks alot,
greetings,
bastian
Comments
Comment #1
Robrecht Jacques commentedDo you mean that the input "a||b||c||d||e" is wrong because eg "a" and "c" are not copied to the right location for some rows? So node_import detects the error and bails out?
Do you suggest that I add a "import a row if there are errors any way"? (not possible with current design because of form validation)
Do you suggest that I add a "ignore files that are not present"? (could be possible)
Would it not be easier to make sure your input file is correct?
Comment #2
spamwelle commentedit would be option c)
If the picture is not on the ftp, try the next one and just save the pictures which are present.
The old software just took the user-id (like dpm100) and checked within an array if the pictures exist on the server - after that it put out all the existing pictures for this user. no nice coding.
So option c would be great.
Comment #3
spamwelle commentedIt would be very great if you could find a solution. I would definitly make a donation via paypal :-)
Comment #4
cjdavis commentedThis is almost easy. Simply comment out the call to node_import_input_error() in function node_import_check_filepath, located in node_import.inc around line 1240. I also added a message during preview so I can see what is and is not skipped. So the entire function becomes:
Comment #5
spamwelle commentedthanks. worked perfect.