Hi,
We've noticed another possible bug with the Tagging module. We are using the Tagging module/widget with the Extractor module and tagging_extractor_suggest. We are getting duplicate suggestion buttons for every suggested term. I've verified that there aren't duplicate entries in the actual taxonomy. When you click the button to select one of the terms, it's duplicate stays as an available suggestion, but is not clickable. Since there is no indication which button is the actual term this is causing duplicate terms to actually be created in the taxonomy when the user clicks on the "wrong" term button. For now I've disabled the Extractor and tagging_extractor_suggest module to prevent users from entering duplicate terms into the DB. I've attached a screen shot of what we are seeing on the node edit screen.

We are using Tagging 6.x-2.1 and Extractor 6.x-1.0-alpha3.

Incidentally, using the auto-complete suggest box does NOT list or enter duplicate terms into the taxonomy.

Thanks for the help!

CommentFileSizeAuthor
#1 dup-suggest-tagging.png7.34 KBtimwood

Comments

timwood’s picture

StatusFileSize
new7.34 KB

Weird, the screenshot didn't make it into Drupal.org. I've never had this problem before. Trying to attach again...

EugenMayer’s picture

Hmm could it be that the hook is called twice, could you check this? (dsm)

Thanks for the report!

timwood’s picture

Can you explain how to check if the hook is called twice?
Thanks,
Tim

EugenMayer’s picture

using dsm ( developer module) or echo whatever. Just go into the suggestion submodule and look for the api hook

timwood’s picture

Eugen,
You were right. It looks like nearly the exact same code is being called twice, once in the tagging module and once in the tagging_extractor_suggest module. I guess the code in the tagging module is left-over from before you created the sub-module. Below is the code straight out of each .module files.

tagging/tagging.module

    $terms = extractor_extract($node->body);

    $result = array();
    foreach($terms as $key => $term) {
      $result[] = array('#weight' => (1/$key), '#name' => $term);
    }
    $suggestions = $result;

modules/tagging_extractor_suggest/tagging_extractor_suggest.module

  $terms = extractor_extract($node->body);

  $result = array();
  foreach($terms as $key => $term) {
    $result[] = array('#weight' => (1/$key), '#name' => $term);
  }
  return $result;
}

So, for now, I've disabled the tagging_extractor_suggest module because the code is running twice due to that module being enabled. With the sub-module disabled I get one suggestion for each term as expect.

EugenMayer’s picture

Status: Active » Patch (to be ported)

Ah i see. Your suggestion was completely correct, this is a leftover!

Thanks for the help and effort!

EugenMayer’s picture

Status: Patch (to be ported) » Fixed

will be fixed in 2.2

EugenMayer’s picture

Status: Fixed » Closed (fixed)

released in 2.2

EugenMayer’s picture

released in 2.2