Needs work
Project:
Node import
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2008 at 19:22 UTC
Updated:
16 Apr 2008 at 00:18 UTC
It would be great if node import supported the "drigg" module ( http://drupal.org/project/drigg ). The title and description fields are already present on import but no URL field :(
Drigg admin offered their help http://drupal.org/node/228213
Comments
Comment #1
mercmobily commentedHi,
I am the maintainer of Drigg.
I have never used Node_import. However, it would be great if this issue could be resolved... Is there anything I can do to help?
Bye,
Merc.
Comment #2
Robrecht Jacques commentedThe thing I need to know is:
- what fields do drigg nodes have (eg the title, the body (which is probably description), ...) ?
- how are those fields stored in the $node object ?
If it is just an extra URL field (next to title and body/description), then I only need to know where in the $node object (not in a table) this is saved.
edit: This assumed that you are using hook_nodeapi() or hook_save() to save that extra data. If you do this with some hook_form_alter(), I'd need to know how you store it in your database tables.
Comment #3
Robrecht Jacques commentedMaybe some code (untested):
Or something like that.
Comment #4
mercmobily commentedHi,
Thank you for your answer!
The module does use hook_save :-D
Now... is it just a matter of testing the code you place up there?
ALSO, it's absolutely crucial that we also do:
drigg_url_exists()
If drigg_url_exists() returns true, then the import should puke for *that* particular record (is that how it works?)
I have no way to test the code above. However, I will just commit it, and get my users to test it!
Please let me know :-D
Merc.
Comment #5
Robrecht Jacques commentedI'd prefer it being added to node_import itself (which means adding a drigg.inc file in modules/node_import/supported) because this way I can keep better track of what features node_import currently supports. No other module currently implements the hook_node_import_* hooks inside their own code right now, they all have the code in this supported directory.
The code above is not completely correct, it was intended as just a quick start for you. But if there is nothing more then the URL and you don't do fancy non hook_save() stuff, then it will be pretty easy to do it myself.
This drigg_url_exists() : does this mean that only one URL is allowed site-wide? In hook_node_import_prepare() this would then indeed be tested for that particular record.
I'll look into it later this week and add the feature to node_import.
Comment #6
Robrecht Jacques commentedComment #7
mercmobily commentedHi,
No worries about adding it as drigg.inc to your module!
The extra fields are:
* promoted_on int(11) (it's a timestamp)
* killed (just a 1/0 flag)
* url char(255) (the one to be checked, ONE site-wide)
* title_url (just a string)
* safe_section char(128) (again, just a string)
* content_type char(32) (just a string)
* trackback_ping_url (just a string)
trackback_ping_successful (one or 0)
The module saves everything through node_save(). So, it should just be a matter of mapping these fields "straight".
Is it still OK for you to add them?
Thanks a million!
Merc,