Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-5518

Problems with Custom Group as tab and ACL permission - Tab not shown

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.9, 3.0, 3.0.1, 3.0.2
    • Fix Version/s: 3.0.3
    • Component/s: None
    • Labels:
      None

      Description

      Problem:

      If you create a custom group that is set to display as a tab and you have permission at drupal level 'access all custom data' in the civicrm module, you see the tab fine.

      If you do not have 'access all custom data' permission but still have permission through ACL to view/edit the custom group, the tab does not appear. Though if you change the custom group to Inline instead of Tab it works fine.

      My requirement is to use 'multiple' records option that requires to use the Tab. So I am stuck. If I give 'access all custom data' permission it exposes other custom groups to users that I don't want.

      Solution: http://forum.civicrm.org/index.php/topic,9219.msg39757.html#msg39757

      In CRM/Core/BAO/CustomGroup.php, function "public static function &getActiveGroups(...)" there is a line:
      $permissionClause = CRM_Core_Permission::customGroupClause( null, null, true );

      The first parameter is null in CRM_Core_Permission::customGroupClause(...).

      In function CRM_Core_Permission::customGroupClause (CRM/Core/Permission.php) if the first parameter '$type' is null it should replace it with CRM_Core_Permission::VIEW default value and that is not happening.

      When I replaced line in CRM/Core/BAO/CustomGroup.php:
      $permissionClause = CRM_Core_Permission::customGroupClause( null, null, true );
      With
      $permissionClause = CRM_Core_Permission::customGroupClause( CRM_Core_Permission::VIEW, null, true );
      it seems to work.

      Not sure if I introduced any other issue with this change.

      Can someone in civicrm development could verify this or suggest a better alternative?

        Attachments

          Activity

            People

            • Assignee:
              sushant Sushant Paste
              Reporter:
              raphy Raphael Vering
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: