Download & Extend

Content Taxonomy Autocomplete terms are created twice if role does not have "create" privs for the vocab

Project:Taxonomy Access Control
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Terms are created twice in a Autocomplete field if the Taxonomy Access module is installed.
I am not sure whether this is a Content Taxonomy problem or a Taxonomy Access Control problem.

Comments

#1

Title:D5.5 Terms are created twice if TAC is enabled.» Autocomplete terms are created twice if TAC is enabled

More info:
content_taxonomy_autocomplete_widget is called twice with $op=process form values.
This is probably caused by bug http://drupal.org/node/118645

Furthermore:
content_taxonomy_autocomplete_tags_get_tids does not get the created in term in the first round since TAC has not set it's access control yet and will not include the just created term id as an accessible term for ther current user.

When I change in content_taxonomy_autocomplete_widget()
case 'process form values': to case 'submit':
everything works fine.

Reading the comments in CCK's field.php hook_widget()
* @param $op
* What kind of action is being performed. Possible values:
* - "prepare form values": The editing form will be displayed. The widget
* should perform any conversion necessary from the field's native storage
* format into the storage used for the form. Convention dictates that the
* widget's version of the data should be stored beginning with "default".
* - "form": The node is being edited, and a form should be prepared for
* display to the user.
* - "validate": The user has just finished editing the node and is
* trying to preview or submit it. This hook can be used to check or
* even modify the node. Errors should be set with form_set_error().
* - "process form values": The inverse of the prepare operation. The widget
* should convert the data back to the field's native format.
* - "submit": The user has just finished editing the node and the node has
* passed validation. This hook can be used to modify the node.

As far as I understand the submit should be called anyway.

Please let me know what you think about this!

Cheers, Joep

#2

I have the same issue. Tracking.

#3

same issue, but i have more troubles: if i change radiobutton on
Save options:
Save as tag
Save in cck table
Both
in any way i have 2 terms in my vocab and they are at the highest level of taxomomy

#4

Version:5.x-1.x-dev» 6.x-1.x-dev

Confirming that this is still a problem in 6.x.

#5

Marked #356590: Duplicate Terms as duplicate.

#6

#8

Note that if TAC is enabled and the user tags a node with core taxonomy (without a Content Taxonomy field), it works fine. If TAC is disabled, it also works fine.

#9

Note also that it does not occur when logged in as the administrative user, and only if Save values additionally to the core taxonomy system (into the 'term_node' table) is checked for the field. I'll post some steps to reproduce shortly.

#10

Steps to reproduce:

  1. Install Drupal 6.16.
  2. Install and enable:
    • CCK 6.x-2.6
    • Taxonomy Access Control 6.x-1.2
    • Content Taxonomy 6.x-1.0-rc2 (or current 6.x-1.x-dev), including Content Taxonomy Autocomplete.
  3. Rebuild access control as prompted by TAC.
  4. Create a role and grant that role Create story content permissions.
  5. Create a test user account with that role.
  6. Create a vocabulary with the Tags option checked.
  7. Add a Content Taxonomy Autocomplete field to the Story content type with the Save values additionally to the core taxonomy system (into the 'term_node' table) option checked.
  8. Log in as the test user and create a story. Enter something in the CT Autocomplete field.
  9. Edit the node and click Save without making any changes. The term you entered in step 8 is now saved twice, with different term IDs. Each additional time you edit the node, an additional duplicate will be added.

#11

Project:Content Taxonomy» Taxonomy Access Control
Version:6.x-1.x-dev» 6.x-1.x-dev

If the role is properly granted Create permissions for the vocabulary default after following the steps in #10 above, the term duplication seems to stop. So, I think this is a TAC issue.

#12

Title:Autocomplete terms are created twice if TAC is enabled» Content Taxonomy Autocomplete terms are created twice if TAC is enabled

#13

Title:Content Taxonomy Autocomplete terms are created twice if TAC is enabled» Content Taxonomy Autocomplete terms are created twice if role does not have "create" privs for the vocab

#14

Priority:critical» normal

#15

Still experiencing this issue... any help is greatly appreciated.

#16

#15: This is a known issue. Have you tried adding "create" permissions to the vocabulary default for the role?

#17

Thanks for your reply. I unfortunately posted my issue prematurely, the issue was something unrelated triggered by the rules module. Sorry again, and thanks for the support.

nobody click here