Details
Description
I just spent a couple of days debugging this annoying ACL issue.
I have set-up an ACL role for someone to have access to a specific event but it is not working properly.
I finally figured out that it is because of the LIMIT in the query below. The specific event I am trying to restrict to is not in the top 10 events, thus it does not work anymore.
Problematic Query:
SELECT civicrm_event.id AS id, civicrm_event.title AS event_title, civicrm_event.is_public AS is_public, civicrm_event.max_participants AS max_participants, civicrm_event.start_date AS start_date, civicrm_event.end_date AS end_date, civicrm_event.is_map AS is_map, civicrm_option_value.label AS event_type, civicrm_event.summary AS summary
FROM civicrm_event
LEFT JOIN civicrm_option_value ON ( civicrm_event.event_type_id = civicrm_option_value.value
AND civicrm_option_value.option_group_id =14 )
WHERE civicrm_event.is_active =1
AND (
civicrm_event.is_template IS NULL
OR civicrm_event.is_template =0
)
AND civicrm_event.start_date >= DATE_SUB( NOW( ) , INTERVAL 7
DAY )
GROUP BY civicrm_event.id
ORDER BY civicrm_event.start_date ASC
LIMIT 0 , 10
Backtrace:
/var/www/html/drupal-6.17/sites/all/modules/civicrm/packages/DB/DataObject.php, backtrace, 2345 /var/www/html/drupal-6.17/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1597 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 145 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 867 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Event/BAO/Event.php, executeQuery, 388 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Event/Page/DashBoard.php, getEventSummary, 56 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Event/Page/DashBoard.php, preProcess, 83 /var/www/html/drupal-6.17/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 215 /var/www/html/drupal-6.17/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 349 , civicrm_invoke, /var/www/html/drupal-6.17/includes/menu.inc, call_user_func_array, 348 /var/www/html/drupal-6.17/index.php, menu_execute_active_handler, 18