How difficult would it be, and does anyone else want, to have this module also automatically create a node when a term is created, also?

Use case: http://drupal.org/node/142155

~ ben, Agaric Design Collective

CommentFileSizeAuthor
#5 nat-node-sync.patch4.06 KBjpsalter
#2 tan.patch0 bytesJacobSingh

Comments

Zen’s picture

This is a non-trivial task as one doesn't really know anything about the node form fields etc.

I am however happy to look at patches :)
-K

JacobSingh’s picture

StatusFileSize
new0 bytes

Here's my first pass @ TAN

guardian’s picture

the submitted patch file is empty

jpsalter’s picture

I have a need for this too. Can the empty patch be reloaded? Thanks.

jpsalter’s picture

StatusFileSize
new4.06 KB

I went ahead and built the function for myself. This isn't tested very much. But, it did work for my setup.

jpsalter’s picture

Assigned: Unassigned » jpsalter
Status: Active » Needs review

Sorry, I forgot to set the status to patch.

jpsalter’s picture

Two additional things
--this code works only when you sync (this was the use case I had)
--the patch is against 5.x-2.1 not HEAD

If there is a desire to hook this up to term creation - I'll look into it.

Zen’s picture

Status: Needs review » Needs work

Jason,

Thanks for the patch. Would it be possible to refactor it to make the entire feature optional? Add a checkbox on the sync page and so on. Similarly, as you've stated, hooking this into term creation will also be desirable - again, optionally. IMO, an appropriate warning stating that only the title and body fields of the node will be populated will also be appreciated.

Please also try to stick to the code style as prescribed for core - that will save me some work :)

Thanks!
-K
P.S. Perhaps this could be a way of introducing some pseudo-revision support for terms (create a new revision of the node if the node type by default creates revisions).

jpsalter’s picture

Zen - thanks for the ideas. I'll have time next week to work on it.

jpsalter’s picture

Status: Needs work » Closed (duplicate)

Patch for this posted here: http://drupal.org/node/218005