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) »
  • ACL: what happens when a group is disabled?
Pages: [1]

Author Topic: ACL: what happens when a group is disabled?  (Read 756 times)

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
ACL: what happens when a group is disabled?
October 07, 2011, 07:33:25 am
When groups are disabled, are they still used in the ACL checks? I have the impression they do.

I was having a performance issue on a site, more specifically in CiviMail, when at the second step civi calculates the number of recipients in the mailing. i.e. the ACL checks do 5 "left joins" on civicrm_group and mine has 160 000 entries in it.

After further inpsection, many of those tables being joined were for disabled groups.

So I tested changing CRM/ACL/BAO/ACL.php, in function whereClause, I added "AND g.is_active = 1" in the code (line 132 in my case, CiviCRM 3.4.5):

Code: [Select]
            if ( ! empty( $ids ) ) {
                $ids = implode( ',', $ids );
                $query = "
SELECT g.*
  FROM civicrm_group g
 WHERE g.id IN ( $ids )
 AND is_active = 1
";

This removed those disabled tables and solved a big part of my problem.

Is this correct? Should I open an issue for this?
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

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: ACL: what happens when a group is disabled?
October 07, 2011, 07:48:38 am

hey bgm:

yes, can you please file an issue and the patch

thanx

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

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: ACL: what happens when a group is disabled?
October 07, 2011, 08:16:09 am
Thanks for the quick feedback. I created the issue : http://issues.civicrm.org/jira/browse/CRM-8999
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • ACL: what happens when a group is disabled?

This forum was archived on 2017-11-26.