Closed (fixed)
Project:
Node import
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2008 at 22:31 UTC
Updated:
14 Jul 2012 at 23:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnalbinHere's the patch I used on a site recently. It makes node_import compatible with Date 5.x-2.x. Unfortunately, the patch breaks compatibility with Date 5.x-1.x, so it needs work.
Comment #2
johnalbinFYI, Karen (the Date module maintainer) says the best approach to check for which version of the Date API is installed over in: #265056: 5.x modules need to support Date 2 API and Date 1 API
Comment #3
jesss commentedSubscribing.
Comment #4
datawench commentedputting here, because it's been set as the "original" of which http://drupal.org/node/256918 is the duplicate.
the patch almost worked for me, but i got the error that said that "date.inc" couldn't be found.
changed line 95 of node_import/supported/cck/content.inc from
to
Comment #5
asb commentedHi,
applying the patch against the current date module (5.x-2.x-dev) from 2008-Jun-21 works fine for me when running it from the "node_import" module's directory:
Importing a small bunch of nodes with one date field (year) and some other CCK fields basically is working, except for the known issues in the node_import moduel (cutting of content after non-ascii characters).
However, all imported nodes contain a strange reference to "nid:14536" that I did not select during the importing steps (e.g. under "options" in "Field options"). So be extra careful before doing mass imports when using node_import!
Thanks for the patch & greetings, -asb
Comment #6
BrianKlinger commentedDid you check your error log, asb? I just looked at the most recent 5.x-2.x-dev date module (2008-Jun-26) and there is no date/date/date.inc. I did a huge node import and have hundreds of errors in my error log pointing to that reference. Everything worked, btw, (thanks to the patch in here), but I wonder what DIDN'T work with that error over and over. I'm going to try changing date.inc to date_token.inc (as suggested by datawench) and hope that's all I need to resolve the issue.
Comment #7
seaneffel commentedSubscribing. I have the same issues here and applying the patch on the Juune 28 dev version also makes import possible - I think that should be reviewed and committed soon. I am still looking at the line 95 errors.
Comment #8
BrianKlinger commentedI changed line 95 as suggested by datawench and haven't seen any line 95 errors since. Not sure if there are other consequences, but I sure haven't noticed any. If there are no other consequences, we should probably get an updated patch that includes that change rolled out. Anyone else?
Comment #9
seaneffel commentedI vote go.
Comment #10
dieter@drupal.org commentedsubscribing
Comment #11
BrianKlinger commentedIf I'm doing this wrong, I'm sorry, someone come along behind and correct my error. I just grabbed version 5.x-1.6 so I could roll a new patch against that latest version available. I then went through and created a patch that includes the original patch in comment #1 and the correction that was written in comment #4. Since the patch I created was against 5.x-1.6, I changed the version number of this post - I hope that was the correct thing to do. Anyway, as I said, this is the latest patch and fixed all problems that I was having. I know nothing about committing patches to CVS and I don't know if anyone is maintaining the node_import module, but hopefully if others find the problem with Date 2 they will be able to at least have this patch to correct it.
As was stated earlier in this thread, I don't really think this patch is the CORRECT way to fix this problem, because this patch will BREAK node import for anyone who uses Date 1, but at least it gives a solution to other Date 2 users.
Comment #12
johnalbinActually, Brian, I think you did pretty good! :-)
Marking this as “patch (code needs work)” since, yes, its not the CORRECT way to fix it.
Comment #13
svelasco commentedHow can I apply the patch?
Comment #14
seaneffel commentedIf you have never done it before, svelasco, the instructions to apply patches in general are here. Sorry for the indirect answer, but other people have answered it better than I already:
http://drupal.org/patch/apply
Comment #15
davidseth commentedJust applied and it works perfect! Thanks.
Comment #16
mvcBased on the advice KarenS gave (#265056: 5.x modules need to support Date 2 API and Date 1 API) I've modified this patch to work with both Date 1 and 2. It worked for me -- as always, if this helps you please mark this issue as 'reviewed and tested by the community'; if not, please mention what went wrong.
Comment #17
asb commentedHi,
applying "date2_import.patch" from July 25, 2008 - 07:03 results on my site in:
Regards, -asb
Comment #18
mvc@asb: If you tell me what version of node import you're using I'll try to look into your problem.
Comment #19
asb commentedHi mvc,
thanks for the offer ;)
Version:
version = "5.x-1.6"
project = "node_import"
datestamp = "1209805811"
Content of content.inc.rej:
Thanks again & greetings, -asb
Comment #20
pclux commentedI have the exact same config and issue applying patch as asb...was there a resolution to that that didn't get posted perhaps?
Comment #21
LinL commentedApplied the patch and all imported OK but all my dates are showing as 1970.
I have date fields with granularity of Year and in my csv file I have put only the year. Like this:
... "John","Smith","1906","1986" ...
I expect I need to put a full date in there, but what would the format be for that?
Comment #22
LinL commentedAs is so often the case, a night's sleep resolves the problem!
I need to put the dates in ISO format and they work fine. So I changed my csv file to:
... "John","Smith","1906-01-01","1986-01-01" ...
and it imports the dates flawlessly into both a Text field and a Select List field.
Thanks for the patch.
But, I also have a field with a "To Date" defined and this is not working correctly. The From part is imported, but not the To.
(D5.10, Date 5.x-2.1, PHP 5.2.4, MySQL 5.0.51a)
Comment #23
caprenter commentedJust to say I used the patch in #11 to fix this issue in drupal 6.4, date 6.x-2.0-rc2, CCK 6.x-2.0-rc7, node import 6.x-1.x-dev, views 6.x-2.0-rc2 (updated on 11th Sept 08)
Thanks very much!
Comment #24
mvc@asb, @pclux: I've just confirmed that my patch in #16 applies cleanly against node_import version 1.6. From looking at your .rej file I believe you applied the patch in #1 or #11 before applying my patch. Please try backing up and removing your node_import directory, downloading a clean copy, and then using my patch.
@LinL: a wide variety of date formats are supported (see strtotime() for details), but as you discovered, the year alone isn't one of them.
Comment #25
DanielJohnston commentedWorks fine in ISO date format for both from and to dates, although it took me a while to realise I had to have my dates in that format first. Subscribing.
Comment #26
Robrecht Jacques commentedFixed. Will be included in next release of node_import (5.x-1.8) released after the weekend.
Comment #27
traviss359 commentedDev version fixed the problem for me, node_import-5.x-1.x-dev.
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.