Wow! This module is amazing. This module has performed as described. Well, I have a feature request already for this module … if it can be done.

I already have a hierarchical taxonomy that is category. For example:

Cars
--Domestic
----Chevrolet
----Ford
--Import
----Ferrari
----Honda

So, when I create a story I select the deepest term of my hierarchical taxonomy. Now, I want to use Autotagging to auto-tag the content of the story. However, I want it to compare the auto-generated-terms to the terms in the hierarchical taxonomy I already have created. Then I want the auto-generated-terms that are created in a 2nd taxonomy category called e.g. OpenCalias Tags to link to the existing terms in my hierarchical taxonomy. If they don’t exist, then new terms are created in the OpenCalias Tags category.

I read the description of the FeedAPI Taxonomy Compare module, and that is what I am looking for but just not based on feedapi . I searched for other modules and couldn’t find anything else that was similar.

Any thoughts on this?

Comments

IncrediblyKenzi’s picture

Status: Active » Needs review

Interesting use case!

I just committed some code that adds a new api hook:

hook_autotagging_api_presave(&$node, &$terms);

This should allow you to wire up a module to act on $terms and filter out what you need, reassign terms to other taxonomies, etc. and should satisfy your requirement.

Let me know if you need a hand!

mkinnan’s picture

Thanks for the feedback and getting a jump start on this. I know some basis programming that I have taught myself, but nothing very complex. I can do stuff like get all the menus, pages, tabs, etc setup ... the easy stuff. I looked at the FeedAPI Taxonomy Compare module to get some idea of how it worked. I follow the logic, but don't know if the actual comparing function can be a copy/paste with some minor changes.

Well ... I will go ahead and get started on this tomorrow ... at least the easier stuff.

mkinnan’s picture

I think that this would be a great module to be included as a sub-module with the Auto Tagging module.

IncrediblyKenzi’s picture

Status: Needs review » Closed (works as designed)

While I agree that the feature you suggest is interesting, the purpose of this module is exclusively to handle the retrieval of taxonomy tags from third party services, and to expose an API to facilitate other modules' interaction with the fetched data.

mkinnan’s picture

Well ... I started giving this shot. I created a module called 'attcomp'. I am now trying to test the implementation of the hook function as such

<?php
function attcomp_autotagging_api_presave(&$node, &$terms) {
  drupal_set_message(t('This is a test message.'));
}
?>

However, I am not seeing my test message when I save a node. The autotagging module does it's work, but I don't see my message. This is the method I normally use to make sure a function is being called. Will this not work in this case?

IncrediblyKenzi’s picture

Version: 6.x-1.3-beta3 » 6.x-1.4-beta1
Status: Closed (works as designed) » Needs review

mkinnan: are you using 6.x-1.4-beta1?

mkinnan’s picture

I am using 6.x-1.4-beta1. If I throw in a drupal_set_message for a hook_nodeapi function in my module just because, it works fine. However, I still can't get the hook_autotagging_api_presave to display a drupal_set_message.

IncrediblyKenzi’s picture

Version: 6.x-1.4-beta1 » 6.x-1.4-beta2

I changed the way the hook is invoked (previously it was getting invoked per-sub module, which wasn't ideal.. also converted out to using module_invoke_all.

You'll need to update $node->taxonomy on the passed in node object.

mkinnan’s picture

I don't know what to tell you. I still can't get a drupal_set_message to show or even get any database queries to execute using the api hook function.

IncrediblyKenzi’s picture

I just tested it out using the following code (called it atag_test):

The atag_test.info file:

package = Test
name = ATAG Test hook module
version = 6.x-1.0
description = Test hooks of autotagging module
core = 6.x
dependencies[] = autotagging

The atag_test.module:

<?php

function atag_test_autotagging_api_presave(&$node, &$terms) {
  drupal_set_message("ohai");
}

The result: http://skitch.com/aaronstewart/ba1pe/test-tag.local

Make sure that you have the dependencies[] section in there, otherwise the module might not load in the right order.

mkinnan’s picture

It works now. I tested your module, then mine again, and now both work. I don't have a clue why it didn't work a minute ago. I try to be very conscious of doing hard refreshes, checking setting and module pages, etc. but I guess didn't do something right.

Well, now it's time to see what I can do on getting a module together.

mkinnan’s picture

Thanks for all the work you have done! I appreciate it.

IncrediblyKenzi’s picture

Status: Needs review » Closed (fixed)

Any time!