I'm trying to import some data into a flexinode content type that has some date fields and I can't figure out what the "date" data in the file should look like. If I use these date formats they all get converted wrong:
Spreadsheet Shown in preview of import
Sat, 2005-12-31 09:00 Wed, 1969-12-31 17:00
19990130 Thu, 1970-08-20 01:48
02/30/1999 Wed, 1969-12-31 17:00
03301999 Wed, 1969-12-31 17:00
04-30-1999 Wed, 1969-12-31 17:00
Any ideas what format I should use to map into a date field?
Thanks,
Vicki
Comments
Comment #1
Robrecht Jacques commentedYou need a file like:
Things might get easier when the CVS-HEAD version gets released.
Comment #2
vprugh commentedI think I did bring down the CVS Head version, but when I go to the mapping part, it doesn't show the individual components of the dates, and when I map each one to the field:
flexinode_30day=term_date
flexinode_30month=term_date
flexinode_30year=term_date
It still comes out wrong.
This is the version I'm using:
// $Id: node_import.module,v 1.15 2005/06/20 21:21:31 drumm Exp $
Any thoughts?
Comment #3
Robrecht Jacques commentednode_import.module is being rewritten in CVS. We're still working on a simpler way to import date fields (either in flexinode or event). I hope to have enough time this evening to submit a patch.
In the meantime, if you are using the CVS version (v1.15 for example), you will need to use the "raw data (advanced)" option. So, don't select the content type in the first page from the select dropdown. With the "raw data (advanced)" option you can import any content node, but your fieldnames (=column names) need to be correct (no field matching). So you need a seperate column for flexinode_30day, ..._30month, ..._30year, ..._30hour AND ..._30minute (you will need every column!). And you need a "type" (flexinode-XX), "name" and "ctype_id" (XX) column too.
Hope this helps.
Comment #4
vprugh commentedAwesome!... that did it! Thanks! Is there any way I can assign it to a category which it would have prompted for had I chosen a flexinode type?
Comment #5
Robrecht Jacques commentedNo, not at the moment. This is being worked on.
There is no way to assign "taxonomy terms" (or categories like you call them) when using "raw data (advanced)". And there is no way (currently) to assign a date if you don't use "raw data (advanced)". So it is either "assign a date" or either "assign a category" for the moment.
Things will improve in the following hours -- at least that is the plan for me this evening :-)
Comment #6
vprugh commentedThanks Jacques,
I really appreciate all your help (now AND in tonight ;-) I really like this module. It's SUCH a timesaver! Could I ask you one more thing? If it's something you don't know off the top of your head, don't worry about it. I'm importing some data in the CSV that I'd like to have carriage returns imbedded in (for things like an address), so I've inserted
where I need them. However the default input format is "filtered html" which seems to expect you to type the actual carriage returns in the text area. Is there something I can put in the data that simulates a carriage return in the "filtered html"?
Thanks again for everything!
Vicki
Comment #7
vprugh commentedI found it... I just needed to configure the input format to allow
... sorry for the sidetrack :-)
Comment #8
Robrecht Jacques commentedSome ways I can think of right now:
Paragraphs are seperated by at least one empty line (which seems to be filtered out here, so I've put "(an empty line here)" instead). If you insert a linebreak (like between "foo" and "bar"), you'll get a
<br><br>as an allowed HTML tag to the "filtered HTML". This is done on the "administer (menu) => input formats (menu) => configure (next to "filtered html" radio option) => configure (tab)" and add<br>to the list of "Allowed HTML tags", you can then use<br>where you want a linebreak. You now allow all users to use<br>in their comments etc. This is no real problem;<br>where you want a linebreak. Don't forget to change it back because this is quite insecure if you let anonomous users (or even members) add comments (or other content) because now they will be able to insert ANY HTML in their comments;There are probably other methods too :-)
Comment #9
Robrecht Jacques commentedClosing this support issue:
- original poster was helped and solved her problem.
- the things I promised to do is: http://drupal.org/node/24910 . This has only partly been committed.
Comment #10
ontoligent commentedMore: It looks like the node_import_valid_date function is broken, since it is looking for a number. Here's what I did to fix it temporarily -- if this is valid. someone should make it into a patch.