CRM-7787 Allow for same term in different tagsets

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 3.3.5, 3.4.4, 4.0.4
    • Fix Version/s: 4.4.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Currently it is impossible to add a tag with a duplicate term in the name across different tagsets. Example:

      Tagset:
      Political Interests
      With Terms:
      Education
      Youth
      Human Rights

      Tagset:
      Works in
      With Terms:
      K-12
      Education <--- THIS IS NOT POSSIBLE - because the term 'Education' is already used in previous Tagset

      Tagsets should have unique terms within each tagset, but should not be impacted by other tagsets, so we should be able to have the term 'Education' in both tagsets.

      Some considerations:

      Terms outside of tagsets - should be unique, and we need to make sure that we are still checking that after making changes.

      Currently there is a uniqueness constraint in the DB for tag names - this will need to be addressed, and we'll need to coordinate to get the upgrade script to make adjustments..

        Attachments

        1. civicrm_tag.name.not.unique.sql
          0.1 kB
          Mike Chelen
        2. civicrm_tag.UI_name_parent_id.sql
          0.1 kB
          Joe Murray
        3. tag.allow.duplicate.patch
          0.3 kB
          Mike Chelen
        4. tag.unique.tagset.2.patch
          2 kB
          Mike Chelen
        5. tag.unique.tagset.patch
          2 kB
          Mike Chelen

          Activity

          [CRM-7787] Allow for same term in different tagsets
          Mike Chelen added a comment -

          civicrm_tag.name.not.unique.sql
          Changes the name field in the civicrm_tag table to have an index that is not unique.
          Modify with CiviCRM database name, then run.

          tag.allow.duplicate.patch
          Suppresses check for duplicate when creating tags.
          Apply patch to civicrm/CRM/Admin/Form/Tag.php

          Joe Murray added a comment -

          The index should be changed to Unique on parent_id, name, rather than changing from unique on name to just index.

          Mike Chelen added a comment -

          Thanks Joe, civicrm_tag.UI_name_parent_id.sql looks good!

          As discussed in IRC, now trying to add a formRule() to civicrm/CRM/Admin/Form/Tag.php using civicrm/CRM/Admin/Form/PaymentProcessor.php line 192 as an example.

          Mike Chelen added a comment -

          Patch for civicrm/CRM/Admin/Form/Tag.php

          Checks new tag for uniqueness only within its tagset.

          Replaces tag.allow.duplicate.patch

          Mike Chelen added a comment -
          • include all used_for types
          • display tag name in error message
          Coleman Watts added a comment -

          This is going to affect tag API, currently it returns a unique ID based on tag name. What's the expected behavior now?

          David Greenberg added a comment -

          Checked with Lobo and he said we should fix this going forward (eliminates customizations for NYSS and also is useful for others).

          Donald A. Lobo added a comment -


          Closing issues in batch on 4/16/13 since these issues have not been worked on in a long long time

            People

            • Assignee:
              Kurund Jalmi
              Reporter:
              kyle jaster

              Dates

              • Created:
                Updated:
                Resolved: