mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 09:48:05 +02:00
Support permissions ... but then disable them ... hmmm.
This commit is contained in:
parent
daae65a5d3
commit
d8a87d03d3
3 changed files with 8 additions and 3 deletions
|
@ -32,7 +32,10 @@ class Sync extends \Civi\Api4\Generic\AbstractAction {
|
|||
|
||||
public function _run(Result $result) {
|
||||
ini_set('memory_limit', '256M');
|
||||
Civi::log()->debug('Begin', ['=start' => 'ContactCatSync', '=timed' => 1]);
|
||||
Civi::log()->debug(
|
||||
'Begin sync for ' . ($this->contact_id ? "contact $this->contact_id" : "all contacts"),
|
||||
['=start' => 'ContactCatSync', '=timed' => 1]
|
||||
);
|
||||
|
||||
if (!$this->force && !$this->contact_id) {
|
||||
$nextRun = Civi::settings()->get('contactcats_next_run') ?? 0;
|
||||
|
|
|
@ -36,8 +36,9 @@ class ContactCategory extends Generic\DAOEntity {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public static function sync(): Sync {
|
||||
return new Sync('ContactCategory', 'sync');
|
||||
public static function sync($checkPermissions = TRUE): Sync {
|
||||
return (new Sync('ContactCategory', 'sync'))
|
||||
->setCheckPermissions($checkPermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -286,6 +286,7 @@ class Processor {
|
|||
}
|
||||
// We don't need them ordered.
|
||||
unset($apiParams['orderBy']);
|
||||
$apiParams['checkPermissions'] = FALSE;
|
||||
|
||||
$contactIDs = civicrm_api4($search['api_entity'], 'get', $apiParams)->column($contactIdKey);
|
||||
// Unsure if this batching is needed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue