Hi, I am curious to know how this module is going to import data using the cron.
I am trying to import a few nodes, (around 10). But the import task does not seem to be running with the cron.
I looked at the code and it seems you do not implement hook_cron() in your code. Is the code running OK with other people?
It is possible I have set it up incorrectly, but all seems OK, apart from the lack of importing!!
Thanks
Al

Comments

dealancer’s picture

Hi Al,

There was a bug. I have fixed it. Problem was in that I forgot to modify an offset.

Hook_cron don't needed there, case hook_node_import_task($op) is used with $op equal to pause. It is called when node_import finishes to import task, that happens while cron is run.
I have remade code a little to be more clear and added come comments.
Soon new release will be available, please use it.

P.S.
Lupus78 and I are working on new version of module that will include following features:
+ cron behavior (import appended data or import data from beginning of a file)
+ option to delete old nodes
+ copying files from imports directory to files directory

dealancer’s picture

Status: Active » Fixed

Forgot to mark as fixed :)

Alun’s picture

Title: Data not importing? no hook_node()? » Data not importing? no hook_cron()?

Ok, thanks. I changed the title to represent my problem, as it was incorrect, but yes I'll give it a go now you have fixed it. I assume I can download the fix in the release?
Import data from the beginning of the file would be great - my plan is to upload a new file every day containing about 10 nodes, and have the import task run overnight, so the next day I will completely overwrite the file. I assume this is possible with importing from the beginning of the file?
Thanks
Al

dealancer’s picture

Hi Al,

To implement fix you just need to download new release of the module and replace old files with new ones.
To be sure that everything is ok you can also run /update.php script as root.

Now you should append data to the file.
What about new features you need, it will be available soon. We are currently working on it.
I will make new release and let you know.

Regards,
Vadim

thaiboxer’s picture

Version: 6.x-1.0 » 6.x-1.2
Priority: Normal » Minor
Status: Fixed » Needs work

just started looking at this on my test site so its not critical at all, but is a feature i desire.

getting this error.

user warning: Unknown column 'offset' in 'field list' query: UPDATE node_import_tasks SET offset = 2208 WHERE taskid = 7 in /public_html/drup69/sites/all/modules/ni_cron/ni_cron.module on line 42.

i am using the 6.x-1.x-dev version of node import btw.

drupal 6.15

Alun’s picture

thai, you should change the fieldname in the code to file_offset I think.. the fieldname was changed between -rc4 and 6.x-1.x-dev

dealancer’s picture

Status: Needs work » Fixed

I think this bug is fixed in 1.3 release Please check.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.