When will a version of node_factory be released for Drupal 6? Or can anybody tell me what to change. I tried node_factory for drupal 6 but it did not work. It seems that the vid is not generated automatically. How can I adapt the code?

CommentFileSizeAuthor
#3 node_factory.info_.txt173 bytesjp.stacey

Comments

clemens.tolboom’s picture

Title: Drupall 6 » Drupal 6

As node_factory is in its infancy for D5 I do not dare to release it for D6.

If you provide a patch I will create a branch for D6 which will probably stay in dev for a long time.

I really want the CCK integration done first in the D5 version.

For a working D6 you need at least at core compatibility to .info

That the vid is not generated is weird afaik because drupal should do that.

Cheers,
Clemens

kyle_mathews’s picture

I need to port this module for a project I'm doing in the next couple of weeks -- has there been any progress towards a Drupal 6 port that I can piggyback on?

jp.stacey’s picture

StatusFileSize
new173 bytes

@scoorch: in node_save() there's logic to (a) detect if there's no nid and set is_new = TRUE (b) detect is_new and run _node_save_revision() with no existing vid. So it should be working. However, the node your code is currently working on doesn't have the new vid attached to it by these functions - you might have to go back to the database with node_load() to get that.

@clemens.tolboom: could you leave the specifics of the CCK integration out of the node factory module, but permit CCK modules to do it for you? E.g. node factory's CCK integration could just search all CCK modules for a hook to import the relevant field. That way each CCK module owner separately can integrate with node factory, if they want to do the work... ;)

@kyle_matthews, @clemens.tolboom: I'd be interested in helping port this to D6, although I don't have a great deal of time free. @clemens.tolboom, what functionality do you think might be affected by the list of upgrade requirements at http://drupal.org/node/114774 ?

Please find attached a possible .info file for a D6 version. @clemens.tolboom, I've commented out a dependency on the node module and also a PHP minimum requirement, so please review and see what you think.

jp.stacey’s picture

I can confirm that, for the simplest of nodes (no CCK fields), node_factory_create_node() and node_factory_save_node() have just worked for me. However, node_factory_save_node() doesn't seem to return anything, and doesn't add an nid to the array passed to it, so it's difficult to obtain the nid for that node. You *could* get the most recently created nid from the database, but that might result in race conditions, especially if you're creating a lot of nodes.

clemens.tolboom’s picture

Assigned: Unassigned » clemens.tolboom

hmmm ... where's my post ?

node_factory_save_node returns a nid. See #214257: retrieving node->nid and #288719: node_factory_save_node returns node

For this issue to be clear please create separate issues for separate problems :p

jp.stacey’s picture

clemens.tolboom: sorry, wires got crossed! (Thanks for adding the nid feature re: those two other issues.)

Could you get a list together of what would get the module out for D6, at least as an alpha, and maybe people can help move towards that? I find node factory very useful for importing from other data sources and am glad to help.

In fact, do we now have enough to create a dev branch, with the .info file, as you mention here? Comment #4 confirms that basic nodefactory functionality works under D6.

clemens.tolboom’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Active » Fixed

There is now a totally untested version available.

I hope someone finds the time or gives me money to do a complete test on especially the CCK interface.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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