Comments

dstol’s picture

Status: Needs review » Needs work
+++ taxonomy_menu.module	2011-04-06 17:09:03.000000000 +0100
@@ -87,6 +119,49 @@ function taxonomy_menu_form_alter(&$form
+function taxonomy_menu_include_submit($form, &$form_state){
+  variable_set('taxonomy_menu_include_'.$form_state['values']['tid'], $form_state['values']['include_in_menu']);
+  if($form_state['values']['include_in_menu'] == 0 || $form_state['values']['apply_to_children'] == 1 || $form_state['values']['exclude_children'] == 1){
+    $children = taxonomy_get_tree($form_state['values']['vid'], $form_state['values']['tid']);
+    $include = ($form_state['values']['exclude_children'] == 1)? 0 : $form_state['values']['include_in_menu'];
+    if(is_array($children)){
+      foreach($children as $child){
+        variable_set('taxonomy_menu_include_'.$child->tid, $include);
+      }

This is something that's bothered me in general. I hate that taxmenu just throws all of it's configuration into the variables table.

In this situation, there's a huge potential for hundreds of variable_sets and later on hundreds of variable_gets. A real performance sink.

Marking as needs work. I think there's a better solution here. Also, there's a fair amount of coding standards problems in this patch.

Powered by Dreditor.

agileware’s picture

Subscribe. (Note to self: roll a patch for D7)

psycle interactive’s picture

Assigned: psycleDA » psycle interactive
Status: Needs work » Needs review
StatusFileSize
new5.27 KB
new5.22 KB

Have re-created the patch to try and fix the code styling issues and improve the use of variable_get/_set functions. In the patch only 1 variable is used to store the settings for including/excluding a taxonomy term in the menu, meaning that it does not need to do a variable_get/_set for each taxonomy term.
I have created a patch for both the 6.x-2.x branch and the tag 6.x-2.9, because after creating the patch for the 6.x-2.x branch, i got errors when trying to apply it to the 6.x-2.9 tag. due to changes to comment styling between the branch and the tag.

Any feedback is welcome and i will look into a D7 patch when i have some time to do it.

Status: Needs review » Needs work

The last submitted patch, hide_from_menu_6.x-2.x-1123152-3.patch, failed testing.

psycle interactive’s picture

Status: Needs work » Needs review
StatusFileSize
new5.22 KB

Uploading the 6.x-2.9 patch again so that this issue can be closed as resolved. The failed patch was for the 6.x-2.x branch, as explained in the comment.

no_idea_yet’s picture

Michael Zetterberg fd. Lopez’s picture

With the patch in #5 it is not possible to delete terms from a vocabulary.

Attached is a patch that allows delete of taxonomy terms. Apply to 6.x-2.9.

Also attached an interdiff to #5.

johnv’s picture

Component: Code » Sync

I'm not sure this is the right approach.
There are several other issues that deal with 'syncing' the menu item properties with the taxonomy terms.
To mention just one: #1485198: Menu_links properties (parent plid, hidden, weight) not saved after node creation/update/deletion (in _taxonomy_menu_save() )
IMO the right approach would be to support the 'hidden' property of the corresponding menu item, instead of removing the tree.

johnv’s picture

Title: Hide taxonomy term from menu » Hide taxonomy term from menu (D6)
handell’s picture

Issue summary: View changes

delete the specific menu item from the database.
the table is called 'ryd_taxonomy_vocabulary' in your phpMyAdmin
the mysterious menu item you want gone should be in there.
Mine was called 'Taxonomy Terms'

dstol’s picture

Status: Needs review » Closed (outdated)

The Drupal 6 version is no longer supported