I installed taxonomy dhtml and everything worked fine. I have used this in other installations with no problem. Last night I ran into an issue... the taxonomy_dhtml page is not being updated as I add new records... it just stopped updating. The only way I can get it to update the count and show the correct nodes is by running the update.php script.

Any ideas? I am using Drupal 5.1.

Thanks,
Dan

CommentFileSizeAuthor
#6 taxonomy_dhtml_0.patch526 bytesmeba

Comments

meba’s picture

Do you have cache turned on?

huayen’s picture

Same problem, cache is on in 'normal' mode.

meba’s picture

Component: Miscellaneous » Code
Category: support » bug

OK, i can confirm this. I will try to fix it

meba’s picture

This is no doubt a bug. But i am not sure where yet.
TDHTML is using:
cache_set("taxonomy_dhtml:tree_nodes_$type". $vocabulary->vid, "cache", serialize($tree_nodes), CACHE_TEMPORARY);

When you add taxonomy term, cache_clear_all() is called without arguments. This means that the first if() in this function calls cache_clear_all(NULL, 'cache_page'). This basically means that even CACHE_TEMPORARY, this cache is not cleared because it's stored in 'cache' table, not 'cache_page'.
And this means that either:
1) It's a bug in Taxonomy DHTML because my point of view to cache is wrong
2) It's a bug in Drupal's cache mechanism
3) It's a feature and i will have to clear cache manually in some hook

I am investigating this more, the workaround is to manually truncate 'cache' table in your database.

meba’s picture

Title: taxonomy_dhtml page not being updated » cache is not cleared after taxonomy term/vocabulary is added/deleted/edited
meba’s picture

Status: Active » Needs review
StatusFileSize
new526 bytes

Please test the attached patch. Does it solve the problem?

mrubio’s picture

Title: cache is not cleared after taxonomy term/vocabulary is added/deleted/edited » taxonomy_dhtml page not being updated

Hi,
I am experiencing the same issue but without using cache at all (cache disabled). I've updated the module with the patch provided and nothing changes. As danwassink reports, only update.php script gets to update taxonomy_dhtml.

Yours faithfully,
Miguel

meba’s picture

Are you sure you applied the patch correctly? Just try adding this function to the end of taxonomy_dhtml module:

function taxonomy_dhtml_taxonomy($op, $type, $array = NULL) {
   // clear cache after editing taxonomy
   if ($type == 'term') {
     cache_clear_all('taxonomy_dhtml:tree_nodes_', 'cache', TRUE);
   }
}
mrubio’s picture

Yes. And I also run update.php after updating the module (which also updates the taxonomy list), but if I add new records after all that, the taxonomy_dhtml list is not updated with that new records.

This is the final part of the taxonomy_dhtml.module file:

function taxonomy_dhtml_help($section) {
  $output ="";

  switch ($section) {
    case 'admin/modules#description':
      $output = t("A user interface for taxonomy featuring a collapsible list on main page");
      break;
    case 'admin/help#taxonomy_dhtml':
    case 'admin/settings/taxonomy_dhtml':
      $output = "This module provides a DHTML representation of this site's taxonomy. Currently, a ". l("block", "admin/build/block"). " is provided for each vocabulary as well as an ";
      $output .= l("overview", "taxonomy_dhtml");
      $output .= " page showing all vocabularies, terms, and recent nodes within each term. Finally, a box showing taxonomy feeds is outputted on the ". l("syndication page", "syndication"). " if <i>syndication.module</i> is installed.";
      break;
  }

  return $output;
}

/**
  * Implementation of hook_taxonomy()
  */
function taxonomy_dhtml_taxonomy($op, $type, $array = NULL) {
  // clear cache after editing taxonomy
  if ($type == 'term') {
    cache_clear_all('taxonomy_dhtml:tree_nodes_', 'cache', TRUE);
  }
}

?>
mrubio’s picture

Yes. And I also run update.php after updating the module (which also updates the taxonomy list), but if I add new records after all that, the taxonomy_dhtml list is not updated with that new records.

Also remember I am not using cache

This is the final part of the taxonomy_dhtml.module file:

function taxonomy_dhtml_help($section) {
  $output ="";

  switch ($section) {
    case 'admin/modules#description':
      $output = t("A user interface for taxonomy featuring a collapsible list on main page");
      break;
    case 'admin/help#taxonomy_dhtml':
    case 'admin/settings/taxonomy_dhtml':
      $output = "This module provides a DHTML representation of this site's taxonomy. Currently, a ". l("block", "admin/build/block"). " is provided for each vocabulary as well as an ";
      $output .= l("overview", "taxonomy_dhtml");
      $output .= " page showing all vocabularies, terms, and recent nodes within each term. Finally, a box showing taxonomy feeds is outputted on the ". l("syndication page", "syndication"). " if <i>syndication.module</i> is installed.";
      break;
  }

  return $output;
}

/**
  * Implementation of hook_taxonomy()
  */
function taxonomy_dhtml_taxonomy($op, $type, $array = NULL) {
  // clear cache after editing taxonomy
  if ($type == 'term') {
    cache_clear_all('taxonomy_dhtml:tree_nodes_', 'cache', TRUE);
  }
}

?>
mrubio’s picture

I have opened the web page on another computer and it seems to work correctly.

chazz’s picture

Working 50/50...

When i create a node, everything is fine - categories goes into /taxonomy_dhtml. But after i delete node /taxonomy_dhtml didn't update at all. Category and node with deleted links are still there.

But...

When i create new node again, /taxonomy_dhtml is updated.

Anybody can fix it to update immidietly after delete node ?

chazz’s picture

Status: Needs review » Needs work
chazz’s picture

I just deleted previous usused test category from vocab and taxonomy_dhtml site was updated correct, but i add a new node again to the existed category and in block menu everything is ok i saw number (2) but in /taxonomy_dhtml doesn't update at all.

meba’s picture

Status: Needs work » Postponed (maintainer needs more info)

That's because the cache is not cleared after adding node. I think the solution may be hook_nodeapi catching submit of node which has taxonomy. what do you think?

stevefree’s picture

I'm also running into the same issue. I do not get udpates on node deletes or new node creations. The blocks and the syndication pages update without issues however the summary page (taxonomy_dhtml) is not getting updated unless I run the update.php page.

pacesie’s picture

I have the same issue as stevefree.

AQOne’s picture

Same issue here. Tried the patch etc. No luck. Is this still being worked on? I like the module but I need something that works for this.

momper’s picture

subscribing

doc2@drupalfr.org’s picture

A solution for this needs to be commited in the next 5.x release.

sakuragi’s picture

vertion for drupal 6.x ??

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This module is no longer being actively developed as it duplicates functionality that can be obtained through the usage of taxonomy_menu ( http://drupal.org/project/taxonomy_menu ) and dhtml_menu ( http://drupal.org/project/dhtml_menu ).