Active
Project:
Node import
Version:
6.x-1.0-rc4
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Dec 2008 at 11:37 UTC
Updated:
8 Nov 2010 at 14:28 UTC
Jump to comment: Most recent file
Received the following error message:
An error occurred. /?q=admin/content/node_import/3/continue
Fatal error: Call to undefined function date_convert_from_custom() in /home/content/u/a/s/uasadmin/html/sites/all/modules/node_import/node_import.inc on line 991
The following is the header and first row of the import file:
Title,Combined,Category,Date,uid
SAP rising in Ulster,"International business software giant SAP is investing a further £900,000 in its Campus-based Engineering Centre (CEC) research facility at Ulster University. Read story.
",News,01/10/2008,Administrator
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | node_import.inc_.352446.patch | 883 bytes | obsidiandesign |
Comments
Comment #1
Robrecht Jacques commentedHave you installed Date API from http://drupal.org/project/date ?
Comment #2
drewmcginty commentedThank you for responding. Yes, I did install Date API and just completed reinstalling it. Still the same problem.
Comment #3
drewmcginty commentedFollow up -- issue resolved.
The date in the upload file MUST be in the format "yyyy-mm-dd" and the mask MUST be "Y-m-d"
Comment #4
Robrecht Jacques commentedThis is not true.
Dates in the ISO format (yyyy-mm-dd hh:mm) are always correctly converted.
If you use another format (eg yyyy/mm/dd) you will need to correctly set the "Date input format:" on the "Set import options (step 5 of 8)" page. So if you use "yyyy/mm/dd" you MUST set it to "Y/m/d".
The date input format should probably provide some options such as "/admin/settings/date-time" does.
Comment #5
Robrecht Jacques commentedComment #6
obsidiandesign commentedIn implementing node_import, I discovered the cause of the error
Fatal error: Call to undefined function date_convert_from_custom() in /home/content/u/a/s/uasadmin/html/sites/all/modules/node_import/node_import.inc on line 991because I too had a problem with a custom date format. The reason for the bug is not that Date API is not installed, but rather that date_convert_from_custom is not actually defined as part of date_api.module - it is included via the date_api_elements.inc file, which is called from hook_elements. This means that, while node_import is checking the date formats, date_convert_from_custom is not actually available, without including the date_api_elements.inc file ourselves.
I've included a patch for review that corrects this error message by ensuring that the date_api_elements.inc file is included. The code is directly from hook_elements() inside the date_api.module file. The patch is made against the 6.x-1.x-dev branch, not the -rc3 downloaded code.
Thanks for the great module - it really saved me time importing content via a custom content type defined via a module (so no CCK).
Bryan O'Shea
Obsidian Design
Comment #7
Robrecht Jacques commentedSeems you are correct. Strange I didn't get this error while testing custom dates.
Will be included in next release -rc4 as:
which is the preferred way of including .incs of other modules in 6.x.
Thanks!
Comment #8
snorkers commentedAs Bryan's patch doesn't work on rc3... (for the impatient) I inserted the following code at line 990 of node_import.inc
Apologies for being basic, but I haven't sussed out how to generate patch files yet... And thanks Bryan for this - was almost due to give up.
Import worked great - converting a few hundred previously generated news items in an XML/RSS feed into nodes.
Comment #9
Robrecht Jacques commentedFixed. Will be included in -rc4. Thanks!
Comment #10
Nash78 commentedalso a lot of thanks!
It worked also! ;)
Comment #12
astridman commentedhate to re-open but....
I have rc4 installed and it absolutely refuses to import any dates into a date_api field. I triple checked that the date format in the CSV is correct: yyyy-mm-dd hh:mm
I tried some non-standard formats, entering in the correct PHP date mask. bupkis.
Also, I tried six ways from sunday to simply have the field filled with the specified default date, but no matter what I do, today's date is always entered.
Comment #13
Robrecht Jacques commentedCould you try the patch #6 from http://drupal.org/node/374346 and report there if you still have problems?
Just copy the file mentionned in comment #6 to
sites/all/modules/node_import/supported/date/date.inc(creating a new directory).Setting it as duplicate.
Comment #14
drupalfan2 commentedDate import still does not work.
My date colum has this format
2010-02-03
And I use this format:
Y-m-d
Still not working!!!!!!!!!!
Comment #15
iantresman commentedHaving installed 6.x-1.0-rc4, I find that I am unable to show a CCK Date field as a Content Field (step 4 of 8). I wasn't sure whether this is due to the format of my date in my input file, but I tried a few different formats. Other CCK fields appears OK, eg. a CCK link field.
Installing 6.x-1.x-dev (2010-Mar-20) fixed the problem, and my added "pubdate" field now appears as expected.
Comment #16
agileadamInstalling 6.x-1.x-dev made the date fields appear for me as well.
Comment #17
Mat77 commentedSame as iantresman and keystr0k:
Installing 6.x-1.x-dev made the date fields appear for me as well.
Comment #18
prisonfood commentedMy own two cents: I did all the above and still couldn't get it to work. I finally thought to add a custom date-time format of type Y-m-d, then select that as the default display for the field on node import options, in order to get my dates to import. Maybe that's obvious to the more experienced users, but it wasn't to me. Also, I hadn't needed to do that in previous date imports.