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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Custom Search doesn't call aclWhereClause hook
Pages: [1]

Author Topic: Custom Search doesn't call aclWhereClause hook  (Read 1017 times)

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Custom Search doesn't call aclWhereClause hook
February 29, 2012, 11:30:31 am
I've created a custom search, but unlike the built-in search, the aclWhereClause hook is not called. I've included by backtrace from the successful call of the aclWhereClause from a built-in search.

Code: [Select]
/persistent/html/sites/all/modules/custom_hook/custom_hook.module, backtrace, 36
/persistent/html/sites/all/modules/civicrm/CRM/Utils/Hook.php, custom_hook_civicrm_aclWhereClause, 121
/persistent/html/sites/all/modules/civicrm/CRM/Utils/Hook/Drupal.php, runHooks, 60
/persistent/html/sites/all/modules/civicrm/CRM/Utils/Hook.php, invoke, 268
/persistent/html/sites/all/modules/civicrm/CRM/ACL/BAO/ACL.php, aclWhereClause, 792
/persistent/html/sites/all/modules/civicrm/CRM/ACL/API.php, whereClause, 130
/persistent/html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php, whereClause, 3606
/persistent/html/sites/all/modules/civicrm/CRM/Contact/Selector.php, searchQuery, 470
/persistent/html/sites/all/modules/civicrm/CRM/Core/Selector/Controller.php, getTotalCount, 238
/persistent/html/sites/all/modules/civicrm/CRM/Contact/Form/Search.php, __construct, 853
/persistent/html/sites/all/modules/civicrm/CRM/Contact/Form/Search/Basic.php, postProcess, 235
/persistent/html/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 254
/persistent/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Refresh.php, mainProcess, 79
/persistent/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/persistent/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/persistent/html/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 284
/persistent/html/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 227
/persistent/html/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 454
, civicrm_invoke,
/persistent/html/includes/menu.inc, call_user_func_array, 517
/persistent/html/index.php, menu_execute_active_handler, 21

In the case of a custom search, I know I reach:
Code: [Select]
/persistent/html/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 254
but I don't know where postProcess goes from there, as there is no postProcess function in any of the custom search examples.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Search doesn't call aclWhereClause hook
March 01, 2012, 12:02:26 am

to link with the acl hook, we need to know what tables are involved in the ACL sql query and their aliases etc. this is not exposed by the protocol

i suspect each custom search would need to modify the from / where clause to incorporate either built in acls or acl hooks

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Custom Search doesn't call aclWhereClause hook
March 01, 2012, 05:57:08 am
Does that mean duplicating the ACL rules inside of the custom search?

bjtlogue

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.1.5
  • CMS version: drupal
  • MySQL version: 5.5.22-0ubuntu1
  • PHP version: 5.3.10-1ubuntu3.1
Re: Custom Search doesn't call aclWhereClause hook
October 01, 2012, 07:24:07 am
Just trying to understand and repeating last question......

Does that mean duplicating the ACL rules inside of the custom search?

I have an aclWhereClause working but not in custom search...it permissions clubs to access subset of contacts.

I also viewed a post re: custom searches not respecting ACLs in one custom search shipped with 4.1.........but does work with others.




Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Search doesn't call aclWhereClause hook
October 01, 2012, 09:10:59 am

No it does not mean that. It basically means integrating with the from / where clause generated by the ACL permissioning code

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Custom Search doesn't call aclWhereClause hook

This forum was archived on 2017-11-26.