It would be really great if we would state how deep into a taxonomy tree it should create queues for

so if I have

Mammals
-four legs
--cat
--dog
-two legs
-human
-monkey

I would only like it to create queues for terms starting at level 1 or level 2 (as an option)

How hard would it be to code this? I think I could do it if you tell me where to start.

Thanks,
Sara

CommentFileSizeAuthor
#3 smartqueuep.txt7.41 KBdrupalnuts

Comments

merlinofchaos’s picture

I think it wouldn't actually be that hard at all.

In smartqueue_taxonomy_nodequeue_subqueues(), when going through the taxonomy on a node, run each $tid thorugh a translation function to get back the top level tid; and then make sure that there are no duplicate tids in case a node has multiple terms with the same top level taxonomy term set. Everything else will be basically untouched, except for adding the option to the UI.

merlinofchaos’s picture

Version: 7.x-2.x-dev » 5.x-2.x-dev
drupalnuts’s picture

Version: 5.x-2.x-dev » 6.x-2.1
Category: feature » bug
StatusFileSize
new7.41 KB

I have tried to do this in the attached module file (not a patch).

It works but only for the first term one tries to add. After that you get a database error in watchdog of

Duplicate entry '0' for key 1 query: INSERT INTO nodequeue_subqueue (qid, reference, title) VALUES (17, '6501', 'Arts') in /home/tmd/public_html/sites/default/modules/nodequeue/nodequeue.module on line 2134.

If anyone can look at it and let me know what mistake I have made it would be appreciated.

I called the module smartqueuep for smartqueue parent, but I do plan to rename it if I release it.

drupalnuts’s picture

Status: Active » Fixed

I took care of this, I should really read my code better before I post.

Status: Fixed » Closed (fixed)

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

billk2’s picture

I've got the same requirement.

I'd really appreciate it if you could post the working version of your smartqueuep.