CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_custom_group and ACL system????
Pages: [1]

Author Topic: civicrm_custom_group and ACL system????  (Read 1842 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
civicrm_custom_group and ACL system????
January 02, 2008, 10:00:04 am
I've been debugging a weird problem with an API search under 1.9:  I pass $returnedValues looking like this, but the custom fields do not return:

  $return_properties =
    array('return.contact_id' => 1,
          'return.email' => 1,
          'return.display_name' => 1,
          'return.do_not_email' => 1,
          'return.custom_3' => 1,  //membercountry
          'return.country' => 1,
          'return.custom_4' => 1,  //memberchapter
          );
  $search_params =
    array('contact_id' => $contact_id,
          );
  $search_params = array_merge($search_params, $return_properties);
  require_once 'api/v2/Contact.php';
  $contacts = civicrm_contact_search($search_params);

After many joyful hours in the debugger, I've discovered that the ACL system won't allow me to get returned values out of anything that references civicrm_custom_group -- i.e., I can't get any custom data back.  The problem seems to be around line 230 in CRM/Core/BAO/CustomField.php:

            // also get the permission stuff here
       require_once 'CRM/Core/Permission.php';
            $permissionClause = CRM_Core_Permission::customGroupClause( CRM_Core_Permission::VIEW,
                                                                        "{$cgTable}." );
This returns "(0)"  for the current user, blocking access to any and all custom data.

Lobo checked this in at r8515.  What does this do, really?

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: civicrm_custom_group and ACL system????
January 02, 2008, 10:45:18 am
Commenting out the ACL check in CustomField.php definitely fixed my problem.

Why does civicrm_custom_group have an ACL lock on it?  Is there a setting issue on my side, or am I right that the check doesn't belong there?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_custom_group and ACL system????

This forum was archived on 2017-11-26.