Closed (fixed)
Project:
Taxonomy Node
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2008 at 20:56 UTC
Updated:
17 Jun 2009 at 02:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
Flying Drupalist commentedOh god yes please!
Comment #2
hanoiiMy own developments are still very strong in D5, until I feed ready to move to D6 (probably close) I don't think I will be porting this module. However, as I did with other contributed modules of my own, if I receive a port to D6 I will definitely be tempted to review it, test it and release a D6 version of if.
Comment #3
Flying Drupalist commentedThank you for the update, I dont' have the skills to port this but will be eagerly waiting for you.
Comment #4
mandclu commentedsubscribing, I'd really, really like to use this on a D6 site.
Comment #5
grah commentedsubscribing.
Comment #6
pkej commentedI thought I saw, and used, a similar module for version 6, but an hour of searching has not returned it so:
subscribe!
Comment #7
pkej commentedI ran your module through "deadwood". It doesn't work at all, right now, but the Deadwood includes a list of "TODO" items at the top of the module file.
The form stuff actually works under "Edit Vocabulary", so it just seems the schema is all that is needed at the moment.
Comment #8
pkej commentedI did a few changes, the schema doesn't get installed, I created the table manually. (I suggest updating the schema to use tid,vid,nid as unique, you don't want two nodes associated with one term, or vice versa).
However, if I create a term using the taxonomy add term interface, a new node is created magically! However, if I use the interface, it doesn't work. If I use tags for the taxonomy, then it creates the nodes when I add the tags!
I hope hanoii will review the patch and fix the install bug, and make an uninstall function :)
Bug reports for other modules which doesn't work well with taxonomy_node at the moment:
http://drupal.org/project/active_tags #349904: Doesn't call the correct hook?.
http://drupal.org/project/hierarchical_select creates the node, but #349916: Ajax times out on node form when used with taxonomy_node module.
Best regards,
Paul
Comment #9
pkej commentedIt seems that the 6.x taxonomy_node creates two terms every time it is called, when using a simple autocomplete tagging vocabulary. Using the vocabulary term add page creates only one term. Fortunately it only creates one node per two terms created ;)
Comment #10
pkej commentedFixed the install and uninstall, added a unique index to tid,nid (I belive all tids are unique across all vocabularies, right?). The version number in the .info file hasn't been changed, but it works very well on 6.x.
Now the only thing remaining is the fact it creates two terms when using autocomplete tagging
Comment #11
grah commentedThanks for your work on this Paul,
using #10 i get "Fatal error: Call to undefined function content_types() in /.../taxonomynode.module on line 277".
Looks like taxonomy node is calling a CCK function (we should list CCK as a dependency or find an alternative).
Install/uninstall works fine and I can't reproduce the duplicate terms bug - tagging autocomplete vocab on node create/edit. This is on a fresh 6.x with deadwood, coder, cck + taxonomynode.
Besides from the cck dependency, this is working fine :)
I'll see if I can find any issues with it in a few hours, as I'll need this functionality on a (large) 6.x production site for Wednesday.
- grah
Comment #12
pkej commentedprobably need to add an if clause around that then. I never run a site without cck so I wouldn't notice. if(module_exists("content")) {
// offending code
}
I think the above or similar should work for the encountered problem. iirc of course
Edit: btw check http://api.drupal.org for the offending call, it might need just an include_once statement, because content types can be created in core without cck, right?
Comment #13
pkej commentedI'll have to test on a pristine drupal and add any checks needed. I'll install coder and coder tough love to see if there are things that needs changing. I think I'll remove all the todos deadwood created, they show up regardless of their relevancy to the converted code.
Comment #14
pkej commentedI fixed the problem. Now it works without CCK installed.
I changed the content_types and the following lines to
I can confirm that there are no duplicate nodes created on a pristine Drupal 6 install. I will gradually install a few other taxonomy related modules I've been using, and see where it gets me.
The includes zip file has a correct version string, I have removed unneccessary comments produced by deadwood.
Comment #15
pkej commentedThere is one problem, if you go to /admin/content/taxonomy you will see that the "type" column for your vocabulary has a strange artifact. I'm not sure how to work around that at the moment. I have to try to understand the original foreach code and see what it actually does.
Comment #16
pkej commentedOk, I made it work more like it should, except that now the content type you select for creation is also selected as a conent type to apply the taxonomy for. I'm not quite sure why that is, it must be saved to the same variable as the content types for the vocabulary.
I changed all the variable names in the form and the set_var/get_var calls from content_type to taxonomy_content_type, on the hunch that the names might have something to do with the problem, but that didn't change the behaviour.
This ONLY happened after I changed the line 227 (now without the comments it is 198) and the following foreach.
Obviously there is some subtelty which is lost on me in that loop.
Comment #17
pkej commentedTo anyone trying this out, I recommend using the download in #10, and also use CCK, to avoid the problems in the later versions.
Comment #18
pkej commentedgrah, anyone, can you confirm that if you use #10 you get the same behaviour as I describe in #16? Is this the same behaviour as in Drupal 5?
From what I can see here it seems that
Produces exactly the same $options array as:
but the latter doesn't need CCK to be installed.
However, both seems to display the same bug, if you have a pristine Drupal install, and do the following:
1. Create a new vocabulary (/admin/content/taxonomy/add/vocabulary)
2. Select "Page" from the drop down under "Content type:"
3. Give the vocabulary a name ("Tags")
4. Under "Content types" select "Story"
5. Under "Settings" select "Tags"
6. Save
7. You are now returned to /admin/content/taxonomy
8. Notice that "types" column includes "story, page"
9. Edit the vocabulary again /admin/content/taxonomy/edit/vocabulary/1
10. Scroll down to "Content types"
11. Notice how both Page and Story are selected.
Something is rotten in the Kingdom of Denmark.
EDIT: I downloaded #10 (yeah, I should use patches and version control) and reinstalled my drupal, and it seems that #10 have the same behaviour as #17.
I tried to not apply the vocabulary to any content type, and have it create content of the type "Page" when new terms are created. Then it automatically says that the vocabulary applies to the content type "Page", where I definitly don't want it.
Comment #19
grah commentedI'm confirming that I experience the same behavior for #10.
I haven't used the 5.x of this module, so it could be an artifact from that branch? // edit: that seems to be the case.
Comment #20
hanoiiHi pkej,
Thanks for the time and enthusiasm you are putting into this port. I will review in due course and try to release a D6 version. Although, if at all possible, try to modify only the logic or changes needed rather than variable names and things like that unless really necessary.
A quick comment to #16, it's not a bug, it's a feature and I am doing that specifically.
The vocabulary is automatically assigned to the content type it is mapped through the taxonomy_node module because I wanted to keep a simple hierarchy between nodes as the hierarchy between terms. There's a bit of explanation of this in #335496: Compare to Node Auto Term and Node Hierarchy.
Basically, if you have the following traxonomy tree.
OS (Vocabulary)
|- LInux
| |- Debian
| \- Redhat
\- WIndows
The created node for the taxonomy Debian will have the taxonomy term Linux as a term for the OS vocabulary (all of this automatically assigned). Doing this, you can easily create a list of nodes having the LInux term that would list the nodes of Debian and Redhat (speaking of nodes, not taxonomy) which is an useful feature. This happens automatically so the assignment of the associated content type as a content type of the vocabulary you are associating should not bother at all.
If you have no hierarchy, although the Vocabulary will be there it won't have any assignment. The vocabulary is even disabled in the node edit form (at least in 5.x).
Hope this helps, and thanks,
a.=
Comment #21
pkej commentedI have to read what you wrote a few times more to try to understand what you meant ;)
Attached to this reply is a version where I have applied the fix for removing the dependency on CCK. No variable names have been changed. I even left in the deadwood comments.
It seems this module should have a settings menu, but that one needs to be added. Check the TODOs left by Deadwood for the relevant places.
Best regards,
Paul
Comment #22
pkej commentedI checked what you said, and it works as described, and the vocabulary is missing from the node edit form.
Unfortunately, I can not edit the created nodes. On top of the page there is a message:
And the title of the node is indeed disabled.
When I try to add someting to the cck fields in the node, and the body of the node, I get the following message:
and nothing is changed.
I would like to have the node tagged with itself, in order for http://drupal.org/project/relevant_content to get the right items for the room. Here is a description of what I am doing:
1. I have a big compount of buildings
2. They all have heating, electricity, telephone, fire safety and water dragged into them.
3. They have lots of rooms.
Now, I have modelled, something like this:
Location - /building/floor/room
Fusebox
Fuse
Fire interconnect
Fire loop
Fire bell
Fire detector
Telephonebox
Telephoneline
Water distribution
Water line
Boiler room
Heating line
Log item
The Location type is the one which is created for the Location taxonomy. I use hierarchical select.
The types Log item, Fire bell, Fire detector, Telephonebox, Telephoneline, Water distribution, Water line, Boiler room, Heating line, Fusebox, Fuse, Fire interconnect all can be tagged with the Location taxonomy.
When I create a Fire detector I select the building, then the floor and finally the room in which it resides, the same for all other assets in use.
Thus for me, I would prefer the Location nodes to be tagged with only the tag they represent, thus I can use http://drupal.org/project/relevant_content to show all the assets tagged with the same tags.
Of course, I can do all this with nodereferrer, nodereference, viewreference and views, but it would be faster to work with, and easier to understand, for the user.
As you can see it is a fairly complex system, I will add renters, and resource conflict into the mix to create a front end for the leasers/users of the compound as well.
It could be simplified and there could be added info to say which type of asset a thing is, and thus remove the need for all the specifics.
Comment #23
Flying Drupalist commentedpkej, thanks! Is this module ready for testing?
Comment #24
pkej commentedWell, it seems to work as advertised, so just try testing it out. The admin interface isn't working, but you can just apply the node type to be created in the taxonomy you wish; that part of the gui is working, and the nodes are created.
Comment #25
Flying Drupalist commentedThank you pkej, it works! :D
But it should also be automatically put in the term from which it is created, not just the parent.
Comment #26
pkej commentedmiraploy read #20 and #22 to see the reason why it doesn't and why I agree w/you. it needs an admin interface to select insertion methods, only current terms, current terms and ancestors or ancestors only. I haven't done any programming of admin forms and menus so it won't happen soon.
Comment #27
Flying Drupalist commentedThanks for the explaining, I'll be awaiting then.
Comment #28
pkej commentedOTOH, it would probably not be hard to find the piece of code doing that, and code it to use the current term, and just hard code it into a patch.
But, I have given up using this module, it isn't needed for what I was going to do, I've decided to do it differently using node reference fields.
Comment #29
pkej commentedDeleted this comment, due to stupidness on my part.
Comment #30
thompson commentedsubscribe. this module creates for all taxonomy terms one node ? really ? i think this is was i searched for over an half year.
Comment #31
ccshannon commentedAwesome. I'd like to test it out. Is #10 the stable one or should I try #21? Thanks.
-C
Comment #32
pkej commentedYou all just test it, I have kind of abandoned this since I worked around the need for this module. Anyone with coding experience should feel free to pick it up from where it is. The version I posted last worked for me without any problems, except from what I noted about a missing admin ui.
Comment #33
Jean-Philippe Fleury commentedsubscribe
Comment #34
xjmTracking.
Comment #35
xjmI get the same error as in #22, "Title field is required" when I try to update a term node.
Comment #36
koala098 commentedsubscribe
Comment #37
damienmckennaCould someone please commit the code from comment 21 so we can start providing patches against it? Thanks :)
Comment #38
hanoiiI will be likely porting the module and looking through these patches soon. I'll post on this issue when enough work has been made.
Thanks.
Comment #39
damienmckennahanoii: not to put any pressure on you, but I was intending using it as a key module for a new site, do you have any idea when you might begin work on it? I have myself and two other developers ready & willing to contribute :)
Comment #40
yhager commentedsubscribing
Comment #41
hanoiiAn apparently working version of this module for Drupal 6 has been committed. I haven't used any of the uploads here, sorry for that and thanks for working on this. I'd rather went through the process of upgrading it myself using deadwood at first and then fixing a few bugs I found.
There should be a -dev version soon available for download, and you can also use CVS if needed.
Comment #42
hanoiiTest of this version are welcome. Please submit bug reports and, if possible, patches, on separate new issues.
Thanks,.
a.=
Comment #43
niklp commentedSubscribing (and testing soon)
Comment #44
damienmckennaThanks for the beta release, am going to give it a spin.