Skip to content

Commit

Permalink
Merge pull request #9385 from eileenmcnaughton/reg
Browse files Browse the repository at this point in the history
CRM-19646 fix error introduced to ACLs
  • Loading branch information
eileenmcnaughton authored Nov 15, 2016
2 parents a4f320f + 251cca6 commit 88fdc63
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 5 additions & 3 deletions CRM/Contact/BAO/Contact/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static function allow($id, $type = CRM_Core_Permission::VIEW) {
public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force = FALSE) {
// FIXME: maybe find a better way of keeping track of this. @eileen pointed out
// that somebody might flush the cache away from under our feet,
// but the altenative would be a SQL call every time this is called,
// but the alternative would be a SQL call every time this is called,
// and a complete rebuild if the result was an empty set...
static $_processed = array(
CRM_Core_Permission::VIEW => array(),
Expand Down Expand Up @@ -254,7 +254,7 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force
($type == CRM_Core_Permission::VIEW && CRM_Core_Permission::check('view my contact'))) {
if (!CRM_Core_DAO::singleValueQuery("
SELECT count(*) FROM civicrm_acl_contact_cache WHERE user_id = %1 AND contact_id = %1 AND operation = '{$operation}' LIMIT 1", $queryParams)) {
CRM_Core_DAO::executeQuery("INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(%1, %1, '{$operation}')");
CRM_Core_DAO::executeQuery("INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(%1, %1, '{$operation}')", $queryParams);
}
}
$_processed[$type][$userID] = 1;
Expand Down Expand Up @@ -305,7 +305,9 @@ public static function cacheClause($contactAlias = 'contact_a') {
}

/**
* Generate acl subquery that can be placed in the WHERE clause of a query or the ON clause of a JOIN
* Generate acl subquery that can be placed in the WHERE clause of a query or the ON clause of a JOIN.
*
* This is specifically for VIEW operations.
*
* @return string|null
*/
Expand Down
20 changes: 13 additions & 7 deletions CRM/Contact/Form/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
* Class CRM_Contact_Form_Merge.
*/
class CRM_Contact_Form_Merge extends CRM_Core_Form {
// the id of the contact that tere's a duplicate for; this one will
// possibly inherit some of $_oid's properties and remain in the system
// The id of the contact that there's a duplicate for; this one will
// possibly inherit some of $_oid's properties and remain in the system.
var $_cid = NULL;

// the id of the other contact - the duplicate one that will get deleted
// The id of the other contact - the duplicate one that will get deleted.
var $_oid = NULL;

var $_contactType = NULL;
Expand All @@ -51,10 +51,16 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
*/
var $limit;

// FIXME: QuickForm can't create advcheckboxes with value set to 0 or '0' :(
// see HTML_QuickForm_advcheckbox::setValues() - but patching that doesn't
// help, as QF doesn't put the 0-value elements in exportValues() anyway...
// to side-step this, we use the below UUID as a (re)placeholder
/**
* String for quickform bug handling.
*
* FIXME: QuickForm can't create advcheckboxes with value set to 0 or '0' :(
* see HTML_QuickForm_advcheckbox::setValues() - but patching that doesn't
* help, as QF doesn't put the 0-value elements in exportValues() anyway...
* to side-step this, we use the below UUID as a (re)placeholder
*
* @var string
*/
var $_qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9';

public function preProcess() {
Expand Down
2 changes: 0 additions & 2 deletions CRM/Core/Invoke.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/
class CRM_Core_Invoke {

Expand Down

0 comments on commit 88fdc63

Please sign in to comment.