title: Older dates for CiviEvent

text:
# Question
Title: Older dates for CiviEvent
We're importing participant data from all our old events. However, I've run into the issue that it only allows me to pick dates back to 1999 when creating the old events. I need to go back as far as 1970. Where do I go to change that setting? I found it for activities and such, but nothing that has affected the listing for events.

# Answer
As you have discovered Jenni, changing any of the start offset and end offset values in the date preferences settings do not reflect participant and event dates.

/civicrm/admin/setting/preferences/date?reset=1

So unfortunately, there is no option to make these amendments via the UI.

However, CiviCRM does allow you to manually input dates/years well before 1999/2009 which are accepted, and the records do get saved without an error –

The same method also works when importing participants.

This is a sample CSV I’ve used which had a registered date of 1966 which imported successfully –
> 4 votes

# Answer
When you are creating an Event, the date picker may only offer dates back a certain way (per the purple rectangle in the screenshot), but you can manually enter the dates in the form specified in your Date Settings at civicrm/admin/setting/date?reset=1, eg mm/dd/yyyy (per the green rectangle in the screenshot)
> 2 votes

# Answer
On an older version you can use the prefs for activityDateTime. The code uses the same setting as for activityDateTime under Administer - Customize Data and Screens - Date Preferences. The line of code that creates the widget looks like this:

`$this->addDateTime('start_date', ts('Start Date'), FALSE, array('formatType' => 'activityDateTime'));`

which tells the form system to use the prefs for activityDateTime.

If you're on a more recent version of CiviCRM the widget has changed and there doesn't seem to be a pref. Temporarily you can edit the file CRM/Event/Form/ManageEvent/EventInfo.php and change the line that says this (around line 177)

`$this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE]);`

to this:

`$this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE, 'yearRange' => '-50:+50']);`

See also https://docs.civicrm.org/dev/en/latest/framework/ui/#date-picker
> 0 votes

---
Tags: civievent
---


# Question
Title: Manually 'Grant' last event places by 'Pending from waitlist' and override 'max participants'
When an event fills as an event organizer you want some flexibility on who you would grant the last places from your waitlist to. For our summercamps we take into account if people already have brothers and sisters in our other camps and if the family also booked in the last years.

This means we would like to manually 'grant' the last places to some of the people on our waitlist. Therefore we change the participant status to 'Pending from waitlist' in order for the registrant to finish the registration.

Unfortunately this cannot proceed, because of the 'maximum participants' setting. I would advocate for a setting to be able to override the max.participant setting when people finish their registration.

I do not know which files would be related to this 'maximum check' and what good ways would be to be able to override it.

# Answer
Currently we use this as a workaround: In CRM/Event/Form/Registration/ParticipantConfirm.php we manually edit the emptyseats to allow the registration to finish.

```
//Allow confirmation even when waitlist is still on
$emptySeats = 99
//$emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);

```

In this way the event is still full and new registrations will be on the waitlist. But the people I manually edited to "pending from Waitlist" can finish their registration.
> 3 votes

# Answer
If you want to do this in an extension it would depend in where the data would be coming in. If you are using CiviCRM to create an event I would use the buildForm hook (details: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/) to set defaults for the field and set it to read only.

If you are using webform-civicrm and the data is coming in with the API (when an event is created from the website) you could use the apiWrappers hook to override the data coming in (details: https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_apiWrappers/). For the latter approach I have developed an extension that might jumpstart you if you play a little with it: https://lab.civicrm.org/extensions/contactspecificapidefaults.
> 3 votes

---
Tags: civievent
---


title: Can't install Shoreditch

text:
# Question
Title: Can't install Shoreditch
I'm on Drupal 7 and Civi 5.9.0. I went and got a copy of the extension straight from GitHub. There is says they recommend using version 5.0+, even though the page on the Civi site says it's compatible with 4.7 only. I uploaded everything, but it's still not available to enable. Is it really only working on 4.7? This is listed as how Spark is setup and we'd like to be able to use that new look for our site as well.

# Answer
And just as I posted that, I found the answer on my own - it is not called Shoreditch in the extension listing. It is called "CiviCRM Bootstrap theme". So I'm keeping the question here and adding the answer for anyone who gets stuck like I did looking for the wrong name.
> 6 votes

---
Tags: shoreditch
---


# Question
Title: Upgrade to 5.9.0 - 'From' address for e-mail confirmations has changed
Following our upgrade to CiviCRM 5.9.0, the 'from' address for event registration confirmations has changed to "7306@civi.acenterprises.org.uk"

It should be ""Ian Foster" " - and this is what still appears in the list of 'From' addresses in CiviCRM settings.

I've looked at contact ID 7306, in case it is a contact ID, and they have no significance in our system.

Baffled! Any thoughts? Thank you.

# Answer
This is now fixed and should be part of next release hopefully. You may wait for next release or apply patch manually from here.
> 2 votes

# Answer
There has been a bug in sending confirmation receipts for renewals of memberships in 5.8.2 and 5.9.0:

Confirmation receipt sent from strange sender address

Apparently, instead of setting the sender name, the table index of the sender name was set instead. It might be the case that the same bug is showing up for event registration confirmations as well.

You mention that 7306 is not the id of "Ian Foster" - but maybe it is some other kind of index value?
> 1 votes

---
Tags: civimail
---


title: CiviCRM 5.9 upgrade

text:
# Question
Title: CiviCRM 5.9 upgrade
I just finished the upgrade, and I'm getting an error list at the top of some panels consisting of a series of identical messages:

Notice: Undefined index: name in CRM\_Core\_SelectValues::quicksearchOptions() (line 1157 of /opt/bitnami/apps/civicrm/htdocs/sites/all/modules/civicrm/CRM/Core/SelectValues.php).

The panels appear to function normally, but it's rather disconcerting. These only seem to appear on the first open of the panel.

I didn't notice any error messages or weirdness doing the upgrade. I did the db upgrade in drush.

Thanks.

# Answer
Looks like one of your customfield extending 'Contact', 'Individual', 'Organization', 'Household' has missing machine name. The best way to check would be to run below sql query to check if there is any result

```
SELECT id, name, label FROM civicrm_custom_field WHERE (name = '' OR name IS NULL)

```

If you found any rows than run below query to update the name with label

```
UPDATE civicrm_custom_field set name = label WHERE (name = '' OR name IS NULL);

```

Cheers

Pradeep
> 6 votes

# Answer
If the concern is that it is 'disconcerting' then for a live site it would be normal to turn Drupal "Errors and Warnings" off via admin/config/development/logging
> 3 votes

---
Tags: upgrade
---


title: Tokens not evaluated in Activities

text:
# Question
Title: Tokens not evaluated in Activities
I have used tokens in a template for sending out as emails and as a mail merge documents. It seemed that while the emails sent and the documents downloaded have their tokens correctly evaluated, the respective activities are not recording the actual documents/email with the tokens evaluated. Is this correct?

Separately i have a CiviRule sent out the emails via the same template and the corresponding email activity recorded do have their tokens correctly evaluated. I thought the correct behaviour should be like this, rather than recording a template within the Activities. So i thought this is an anomaly, but applies to only if you do the sending/printing directly on the record. Is that the right understanding ? Thanks.

Clement

# Answer
I'm not sure I can answer whether it's the 'correct' behavior. But I can verify that when you email or 'print/merge a document' with tokens, the activity detail records the literal tokens, not the generated content. (Just for clarity of anyone reading and not familiar - i.e. it will show the token {contact.addressee} in the details for the activity versus "John Doe".)

For the 'print/merge document' side - if you turn on record generated letter (System Settings \> Misc), the pdf that attaches to the activity will showcase the generated tokens.

My guess is that it's easier to record the tokens rather than the generated content especially when you consider you can store the same activity on multiple contacts i.e. you email a group of 15 people, they all get the same activity stored but it contains multiple 'with' contacts.

Strangely enough, if you send through CiviMail and then view the activity details it does show the generated token. Although this is also probably not the ideal behavior because it shows the evaluated token at the moment you view the activity - not from when it was sent.

In summary, what you have described (I can't vouch for CiviRules) is the current 'standard' behavior.
> 1 votes

---
Tags: activities
---


# Question
Title: Portable Directory Path Variables Real-time List
Wordpress: 5.0.3

CiviCRM: Upgraded from 4.7x to 5.9.0

Everything is working, but now I'm getting these status notices about portable path variables. From my status page:

> To maximize portability, consider using a variable in each directory (eg "\[cms.root\]" or "\[civicrm.files\]").

It would be great if a list of existing path variables and what they currently point to were actually made available on the "Directory Paths" and "Resource URLs" admin pages. Anything I can do to reduce possible mistakes makes me less anxious about updating my existing paths to the new preferred method.

Sort of Like this:

> **List of available path variables with their current real-time paths:**
>
> \[cms.root\] --\> /home/myusername/mysite.org/wp-content/plugins/civicrm/
>
> \[civicrm.files\] --\> /home/myusername/mysite.org/wp-content/plugins/civicrm/uploads/files/
>
> \[cms.other.path\] --\> /home/myusername/mysite.org/wp-content/plugins/civicrm/whatever/
>
> Also tips on whether to add a slash when using something like:
>
> *Example temp file location: \[cms.root\]uploads/temp/*

Is this in the works?

Cheers in advance.

# Answer
> 4 votes
If you click the help icon in the help text at the top of the page, it shows you the current values.

# Answer
> 1 votes
Can you make sure in Directories and Resource url settings you are using real-time paths rather hardcoded paths in all text fields on the form. eg \[cms.root\]uploads/temp/ and not using /home/myusername/mysite.org/wp-content/plugins/civicrm/

Some organisation define this settings in civicrm.settings.php if thats the case in yours than you will need to update your civicrm.settings.php file.

> **Note:** After doing the change make sure everything is working fine specially cron job and online signup/registration forms.

HTH

Pradeep

---
Tags: directory, resource-urls
---


title: Exclusive Relationship to organisation

text:
# Question
Title: Exclusive Relationship to organisation
I'm trying to find a best way to setup relationships to the Club that would only "allow" one person to be ex. "Secretary", "Coach" etc. Can this be done via Rules (either CiviRules or Drupal) or database trigger or, hopefully not, a custom module? So basically, when a person gets assign a role, whoever had that role previously has the relationship removed or ended or de-activated.

# Answer
> 1 votes
I can answer for CiviRules: at the moment there is no such combination of condition and action available in CiviRules.

**But** there is no stopping you to develop (or have someone develop) such a combination for you. It does not sound too complicated for someone familiar with CiviRules.

Do you have the ability to develop this yourself? The condition would be 'relationship is of the type(s)' (that one already exists) and the action 'de-activate previous relationship' would have to be developed.

There is documentation on CiviRules here: https://docs.civicrm.org/civirules/en/latest/.

Documentation on how to develop your own action is here: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/

# Answer
> 1 votes
Pretty sure we have done this via (incorporated in an existing) extension. I don't recall what there was by way of an interface, ie if you could specify relationship type X has a max of 1, but relationship type Y has a max of 3 - or if we just hard-coded for that situation.

It may not take much to refine for public consumption or for your specific use case (ie without a UI)

---
Tags: relationships
---


# Question
Title: URL Variables with/w/o slashes Upload Directories vs Resource URLs
Wordpress 5.0.3

CiviCRM 5.9.0

I'm looking at the help pop-ups compared on two pages. (The text in the black box in the two images)

I've got Path Variables on the Upload Directories page:

I've got URL Variables on the Resource URLs Page:

They are supposed to be the same variables: \[cms.root\], \[civicrm.root\] and \[civicrm.files\], yet on the former page, the variables have no slashes. On the latter page, they *do* have slashes. I suspect the one *without* slashes is correct, because the Extensions Directory for both uses \[civicrm.files\]/ext/ and had already been set that way.

Before I make any mistakes, these are the settings I have on Resource URLs *now*:

**CiviCRM Resource URL:** wp-content/plugins/civicrm/civicrm/

**Image Upload URL:** wp-content/plugins/files/civicrm/persist/contribute/

These are what I should probably change them to:

**CiviCRM Resource URL:** \[civicrm.root\]/

**Image Upload URL:** \[civicrm.files\]/persist/contribute/

Please confirm.

Is it possible this a minor bug?

# Answer
> 4 votes
Its not a bug, adding extra '/' won't make any difference. The variables shown Directories and Resource URL forms have same naming conventions however they are rendered in different way for each form.

```
CiviCRM Resource URL: [civicrm.root]/

Image Upload URL: [civicrm.files]/persist/contribute/

```

Your Settings looks fine.

Cheers

Pradeep

---
Tags: wordpress, directory, resource-urls
---


title: Adding CSS to extra tpl file

text:
# Question
Title: Adding CSS to extra tpl file
I've added CSS to a Summary.extra.tpl file to change reports. But the CSS does not apply.

Adding the CSS by itself crashes the report (character encoding issue) so adding the {literal} tag is what I have.

```
{literal}
#s2id_groups {display:none;}
{/literal}

```

I am trying to remove the add contacts to group dropdown.

# Answer
You might be able to do it with css but I might use jquery instead:

```
{literal}
<script type="text/javascript">
CRM.$(function($) {
  $('#s2id_groups').hide();
});
</script>
{/literal}

```

The problem with css might also be that you don't have a `<style type="text/css">` tag around your css?
> 4 votes

# Answer
There are 3 solutions on how to achieve this

1 - Adding Javascript in tpl file as mentioned by Demerit

```
{literal}
<script type="text/javascript">
  CRM.$(function($) {
    $('.crm-report-form-block select[name="groups"]').closest('td').hide();
  });
</script>
{/literal}

```

2 - Adding a code using buildForm hook in an extension

```
function membershipapproval_civicrm_buildForm($formName, &$form) {
  // unset from all reports
  // Change if condition to $formName == 'CRM_Report_Form_Event/Summary'
  // if want to hide on specific event
  if (get_parent_class($form) == 'CRM_Report_Form') {
    $groupsElementIndex = CRM_Utils_Array::value('groups', $form->_elementIndex);
    if ($groupsElementIndex) {
      unset($form->_elements[$groupsElementIndex]);
    }
  }
}

```

3 - Adding CSS in tpl file as

```
{literal}
<style type="text/css">
 #s2id_groups {
  display:none;
 }
</style>
{/literal}

```

HTH

Pradeep
> 4 votes

---
Tags: css, custom-templates
---


# Question
Title: Implementing tokens and tokenValues hooks for Event custom field
I'm trying to implement a hook for inserting Event custom fields into Scheduled reminders; however, I'm not a developer so I'm really not sure what the code needs to look like. The custom field is custom\_115 (Learning Materials link), which I know is the correct field as I located it using the API Explorer. The problem for me has been the hooks; not really understanding the structure. I'm running CiviCRM 5.7.2 on WordPress. I've pasted the following code (which I pieced together from various sources, and partly guessed) into my functions.php file but I know it's wrong and I don't know how to get it to work:

```
<?php
/* CiviCRM token addition for custom_115 */
function civicrm_tokens(&$tokens) {
  $tokens['event'] = array(
    'event.custom_115' => 'Custom 115',
    );
}

/**
* Populates a token named "custom_115" with the value from a custom field
* (id 115) for use in Scheduled Reminders
* Implements hook_civicrm_tokenValues().
*/

function civicrm_tokenValues(&$values, $cids, $job = null, $tokens = array(), $context = null) {
static $events = array();

  if (is_numeric($cids)) {
    // We're being called by CRM/Core/BAO/ActionSchedule.php:465
    // Params are structured differently than they're supposed to be, but we
    // can work with it. See https://civicrm.stackexchange.com/questions/3573/can-tokenvalue-hooks-be-used-in-scheduled-reminder-emails

if ($event_id = CRM_Utils_Array::value('event.event_id', $values)) {
  // We've been passed an event ID

  if (!array_key_exists($event_id, $events)) {
    // We haven't looked up the custom field value yet

    // Fetch the custom field value from the database
    $event = civicrm_api3('Event', 'getsingle', array(
      'sequential' => 1,
      'return' => "custom_115",
      'id' => $event_id,
    ));

  $val = CRM_Utils_Array::value('custom_115', $event);

  // Keep this value in memory to use with the other event participants
  $events[$event_id] = $val;

  } else {
    // We stored the value previously
    $val = $events[$event_id];
  }

  $values['event.custom_115'] = $val;
  }

 }
}
?>

```

I'm assuming that if it is set up properly, I'll be able to locate "Custom\_115" as an option in the Tokens list - is that right? Any help/advice would be appreciated. Thanks

# Answer
The code doesn't go in functions.php, you need to create a little extension. See https://docs.civicrm.org/dev/en/latest/extensions.
> 0 votes

---
Tags: wordpress, civievent, custom-fields, hooks
---


title: Sort report by event role and/or status

text:
# Question
Title: Sort report by event role and/or status
In the sorting tab for event participation reports, I can't sort by role or status. Even those these are built-in fields that it seems obvious people would want sort by, are not in the list of columns- I'm a newbie user, so I suspect it's something easy and I just don't see it??? I'd like the report to be sorted first by status, then by role, but I'd take at least one of two. Please advise, thanks!

# Answer
> 2 votes
The default reporting does not cater for sorting status and role. One way to achieve this is by writing code as Pradeep suggested. Another way is to export the report data to Excel (csv) and do the sorting in Excel.

# Answer
> 1 votes
Existing report in CiviCRM for participant doesn't provide sorting based on participant status and role. Probably best solution would be to add some code to implement hook\_civicrm\_alterReportVar through extension and define sorting fields in $var\['civicrm\_participant\]\['order\_bys'\] when $varType == 'columns'.

Cheers

Pradeep

# Answer
> 1 votes
Similar to Pradeep's answer, yet another option is to clone the report and modify it - see https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report specifically `civix generate:report --copy`

You could then publish your report as a new extension or submit a PR to enhance the core report.

---
Tags: civireport
---


title: Civievent Template

text:
# Question
Title: Civievent Template
I'm working on determining what is causing the following behavior and trying to determine if it's a bug or user error.

I have an event template set up for a recurring monthly event that we host.

I am attempting to set up a new event. During the initial set-up, I select the template that I would like to use for the new event. After setting the event date, etc, I hit the "Continue" button. Upon doing so, instead of creating a new event based on that template, a new template is created. Therefor there is no event created and a duplicate template is created.

I found the same behavior on the WP demo site and the Joomla site was not working in order for me to test it (I am using Joomla).

This behavior did not occur previously but I am not sure which version it started. I am currently using 5.9.0 for Joomla.

# Answer
Taylor,

This is a regression bug and is logged here. I have submitted a fix for it which should get merge this week and will be available in next release. In meantime can you please QA if it fixes the bug by applying patch from here?

Please post your QA results on PR so that it will help to speed up the process in getting the PR merged ASAP.

Thanks

Pradeep
> 2 votes

---
Tags: civievent
---


# Question
Title: Payment Processor. MD5 Hash Removal/Disablement from Authorize.Net
Today Morning I got an Email from the authorize.net regarding MD5 Hash Removal/Disablement. Here what exactly they stated.

```
Authorize.Net is phasing out the MD5 based transHash element in favor
of the SHA-256 based transHashSHA2. The setting in the Merchant
Interface which controls the MD5 Hash option will be removed by the
end of January 2019, and the transHash element will stop returning
values at a later date to be determined.

Merchants utilizing this feature will need to work with their web
developer or solutions provider to verify if they are still utilizing
MD5 based hash and if still needed to move to SHA-256 hash via
Signature Key.

```

Currently I am using CiviCRM 4.7.29 version. Integrated with Drupal 7.

In payment Processors settings. I am using Authorize.Net as Payment Processor Type. And Using MD5 hashing also.

Now my question is. Does the latest version 5.9 supports this feature? Or Please let me know is their any other alternate solution.

# Answer
> 3 votes
Thanks to your question, the immediate issue has been resolved. Issue financial#39 removes MD5 hashing from CiviCRM starting with the March release.

Note that Authorize.Net is removing the ability to ADD MD5 hashing to your account in January - but MD5 hashing won't stop working for several months after that.

---
Tags: payment-processor, authorize.net
---


# Question
Title: Extracting a report/pulling a search result to CSV but setting an exported flag to indicate this
I am looking for a way to mark data as exported in some way.

The scenario is that we are receiving and capturing data for enquirers (people making enquiries) on behalf of a third party.

The 3rd party doesn't have access to the system (and are not allowed to be given log in - apparently this is a 'politics' reason) however need to be given an extract of all the people who have made contact in the last 24 hours.

Ideally I would like to pull a report (automatically generate a CSV file perhaps) but mark the data in some way with an exported flag or date so we can show it has been exported.

Any suggestion as to how I could do this?

(Open to other suggestions such as an export that sets an activity as completed or something too, or something that can be developed by the API)

# Answer
> 3 votes
This Log Export extension "logs to a files within the ConfigandLog directory whenever an export happens, who performed it what columns involved and the relevant entity IDs"

There is a blog about it here

# Answer
> 2 votes
How are you recording the enquiry? As an activity? If so, you could add a custom field "exported" (Yes/No field, default No), then search for exported=no, export, and update exported=yes.

There are various problem scenarios you might want to think about: eg if an export is lost after you generate it (eg email bounces), do you need to be able to reproduce an export? How important is it to make sure you export every enquiry once, and once only? If you need a robust process you could take a look at how Accounting Batches manages exports of contributions.

---
Tags: civireport, export, csv
---


# Question
Title: DB Error: constraint violation on anonymous user contribution/membership registration after 5.8.2 -> 5.9.0 update
I upgraded two Joomla sites from 5.8.x to 5.9 and one of them now gives an error for anonymous contributions or membership registrations:

Error:

```
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452

```

Additional Details:

Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]

```

)

This matches a similar issue after 5.9.0 upgrade: DB Error: constraint violation on anonymous user event registration after 5.8.2 -\> 5.9.0 update

I have Mail enabled. The error doesn't occur when logged in so I've matched and then enabled more permissions than the other site which works, but it makes no difference.

# Answer
This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?

If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.

Cheers

Pradeep
> 5 votes

# Answer
This is fixed in 5.9.1 ............
> 0 votes

---
Tags: joomla, error, acl, upgrade
---


title: Multi-records Custom Field

text:
# Question
Title: Multi-records Custom Field
i have a simple Custom Field set that has 2 text field to capture "Year" and "Class". This custom field is set to keep multiple records/values. The idea is to track the person's class information over years.

It seems that I can do a batch update of this custom field through a profile, but instead of updating the existing records, it goes ahead and add new records/value.

Just to confirm that this is the behavior for batch-update of custom field with multiple records, and currently the interface does not allow batch-update of existing values. Thanks.

# Answer
> 3 votes
Updating a contact via profile with multivalue custom field will always create new entry for those custom set. The only way you can update is using the contact edit form.

Cheerz

Pradeep

---
Tags: profile, multi-record
---


# Question
Title: What is 'object_table' and 'object_id' in Acl API?
I am not understanding the meaning of 'object\_role' and 'object\_id' in ACL API. I was trying to manage ACL using CiviCRM API 3.

# Answer
Object table is the type of data the ACL is operating on.

For eg: if you want to create an ACL which grants permission for an event - object table, in this case, will be `civicrm_event`.

Object id is the id of the event to which the permission is applied to. An example of API which uses these two params could be -

```
$result = civicrm_api3('Acl', 'create', [
  'object_table' => "civicrm_event",
  'object_id' => 2, //event id, 0 for all events.
]);

```
> 3 votes

---
Tags: api, acl
---


# Question
Title: Not inserting a ACL Role using ACL Role API
I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.

> Input json

```
     $result = civicrm_api3('AclRole', 'create', [
  'debug' => 1,
  'sequential' => 1,
  'acl_role_id' => 14,
  'entity_table' => "civicrm_group",
  'entity_id' => 54,
  'is_active' => 1,

]);

```

> Output json

```
"values": [
    {
        "id": "14",
        "acl_role_id": "",
        "entity_table": "civicrm_group",
        "entity_id": "54",
        "is_active": "1"
    }
]

```

I already providing a "acl\_role\_id", but in the output json object, it is showing a blank

# Answer
Make sure the value 14 for acl\_role\_id is correct.

ACL role is an option value pair and should to be set as one of the existing value available from `civicrm/admin/options/acl_role?reset=1`.

UPDATE - just tried on my local and looks like a bug to me. Can you raise this as a new ticket at https://lab.civicrm.org/dev/core/issues/new?
> 1 votes

---
Tags: api, acl
---


# Question
Title: Unsupervised De-Dupe Rule failing in 5.9.0
Since upgrading to 5.9.0 (Drupal 7.6), we have noticed that all self-service / online event registrations are creating duplicate contacts - of both the individual end the organization (employer) record.

Having looked at the Unsupervised rule, it should absolutely be triggering - eg there are multiple contacts that have been created where the first name, last name, and email all exactly match an existing contact.

Our individual unsupervised rule is:

Has anyone else seen this behaviour on their installation?

# Answer
> 2 votes
I am not sure if its somehow related to one of the regression for 5.9.0 for Anonymous user ACL permission which is fixed in 5.9.1. Would be worth trying after upgrading CiviCRM to 5.9.1 or applying patch from here!

HTH

Pradeep

---
Tags: contacts, duplicate-contacts
---


# Question
Title: Unsupervised reserved rule for individuals not working
Am running CiviCRM 5.9.0 on WordPress 4.9.9, PHP 7.1.25.

When I use a contribution page for memberships that worked before on another hosting provider and on a previous version of CiviCRM, the unsupervised reserved dedupe rule worked fine. Now, every time someone renews their membership online, I get a duplicate record. Not sure when this broke, when we moved over from our old hosting provider, when I updated CiviCRM, or if there's another reason why it doesn't work. I do know that it definitely worked late last year when we started getting some early renewals for 2019 and the system was on our old provider, running an older version of Civicrm and possibly an older version of PHP.

If I manually run the rule, it brings up the duplicates and I can merge them. The merge screen shows that the email, first name and last name are exactly the same. In fact, if I enter the exact same contact information for all contact fields, it still doesn't dedupe.

There is an error in the error\_log, and not sure if this is the reason: \[14-Jan-2019 14:00:52 America/Toronto\] PHP Warning: A non-numeric value encountered in /home/xxx/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php on line 900. This line is contained in a "// return if this is express mode" section.

If I have to manually dedupe all of our online membership renewals, this will be a real pain, so any hints are greatly appreciated.

# Answer
I am not sure if its somehow related to one of the regression for 5.9.0 for Anonymous user ACL permission which is fixed in 5.9.1. Would be worth trying after upgrading CiviCRM to 5.9.1 or applying patch from here!

HTH

Pradeep
> 2 votes

---
Tags: duplicate-contacts
---


# Question
Title: How to hide civiCRM event sections like event attachment, event committee, Event Contact, Event Filter Informations when they don't have data
Currently, I am using CiviCRM 4.7 version and integrated with Drupal 7.

In the Event registration page sections like Event attachment, event committee, Event Contact showing as default. Please refer to the screenshot.

Question is, Can we hide those sections on the Event registration page for each event. If they don't have any information . if they don't have any information.

Please guide me how to achieve this.

If it is possible in a new version of CiviCRM 5.8, Please guide me how to achieve this.

# Answer
> 2 votes
You can try this css trick

```
div:empty {
   display: none;
}

```

Or you can try using jQuery

```
$('div.section:empty').hide();

```

# Answer
> 0 votes
Are those fields visible on the event information page? If so you could uncheck the `public` setting at the custom field. You could do this by going to Administer --\> Customize Data and Screens --\> Custom Fields and then go to the Custom Fields of the custom group `Attachments` and for each field uncheck the public setting.

# Answer
> 0 votes
As you are using Drupal you 'could' stop using the standard civicrm pages for this and build it out in Views, and then you can set the Fields in the View disply to not show if they are empty

(not saying this is desirable or 'easy' but does not require code, css or jquery, but it does seem like a valid answer)

# Answer
> 0 votes
How about using the ‘Complete Description’ field in the ‘Info and Settings’ section when configuring the event?

Enter all the info you wish to display, including documents using the HTML editor -

And use the email and phone fields in the ‘Event Location’ section to display event contact information –

You then have full control over what to display with no empty values -

---
Tags: civievent
---


# Question
Title: Adding repeating event registration shortcode in wordpress
I added my repeating weekly event registration to my wordpress post using \[civicrm component="event" id="XX" action="info" mode="live"\]. I would like people to register every week for the event. Is there a way to make the post update automatically to the next week's event (as each event has a new event ID) or do I need to update the event ID each week?

# Answer
You may be able to achieve what’s required with the WordPress CiviEvent Widget extension -

https://civicrm.org/extensions/civievent-widget
> 1 votes

---
Tags: wordpress, civievent, repeating-events
---


# Question
Title: Can't create new events from template after upgrade to 5.9
I recently upgraded to CiviCRM 5.9, WordPress 5.0.3 and PHP 7.2. Now when I try to create a new event from a template, after clicking 'continue' the template is cloned and I'm thrown into a template editing page. The new event is never created.

This happens both with pre-existing templates and with a completely new template. It does not happen with new events created without a template.

It is essentially the inverse of this bug that was patched last February \- not sure if this is an unintended side-effect, or if I've set something up weird.

# Answer
> 3 votes
Looks like this is indeed a bug: https://lab.civicrm.org/dev/core/issues/653

# Answer
> 2 votes
This is a regression bug and is logged here. I have submitted a fix for it which should get merge this week and will be available in next release. In meantime can you please QA if it fixes the bug by applying patch from here?

Please post your QA results on PR so that it will help to speed up the process in getting the PR merged ASAP.

Thanks

Pradeep

---
Tags: civievent, templates
---


# Question
Title: Scheduled job execution time is creeping
I have a scheduled job that runs at 10am each day. It just sends a report. I'm noticing over time that the job is executing later and later. Now it is executing at 10.15am. Anyone else noticed this and it there a way of fixing it without having to go back into the scheduled job and reset the time?

# Answer
> 4 votes
This is a problem that's popped up and been squashed a few times - it's a little trickier to fix than it seems.

The current conversation about it is on Gitlab but CRM-17671 provides some historical perspective.

Your best short-term solution is probably Xavier's answer on a very similar question.

---
Tags: scheduled-job
---


# Question
Title: Fetch membership type along with the contact details with civicrm_api
I am trying to create a lists of contact along with the membership type associated with each contact. Below is the code I have:

```
$result = civicrm_api3('Contact', 'get', array(
    'sequential' => 1,
    'return' => "tag,display_name,id,image_URL",
    'contact_type' => "Organization",
    'options' => array('limit' => 300),
  ));

```

I am not sure how to do join api call to both contact and membership, so that I can get all detail in one single api call.

so I am wondering if anyone can help.

So, far I have created another api call to each contact list returned form the above api call, like this:

```
foreach($result['values'] as $member){
    $ufmatch = civicrm_api3('Membership', 'get', array(
      'sequential' => 1,
      'contact_id' => $member['id'],
    ));
    $member['member_type'] = $ufmatch['values'][0]['membership_name'];

    $nodes[] = array(
      'node' => $member,
    );
  }

$members = array(
    'nodes' => $nodes,
  );

  return drupal_json_output($members);

```

But there are hundreds of contact list. So, it takes almost 2-3 mins load all data.

Can anyone please guide me in a right direction. Thanks in advance.

# Answer
> 1 votes
You need to do it the other way around. Membership is the main entity and then you join on Contact. The api explorer can help put it together but you're looking for something like:

```
$result = civicrm_api3('Membership', 'get', [
  'sequential' => 1,
  'return' => ["contact_id.id", "contact_id.display_name", "membership_type_id"],
]);

```

---
Tags: api
---


title: Installer not showing up

text:
# Question
Title: Installer not showing up
I've uploaded the file civicrm-5.8.2-wordpress.zip into the plugins folder and unzipped it. I've activated the plugin. The first time through this process the installer ran to the point of creating the database, but then this error shows up on the CiviCRM dashboard:

"Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Constraint Violation - contact\_id should possibly be marked as mandatory for DashboardContact,create API. If so, please raise a bug report."

I deactivated and uninstalled the plugin, unzipped it again and activated it. Same error. And the Settings menu does not show a CiviCRM Installer.

CiviCRM shows up in the left nav menu of WP, but clicking on it gives the same error above.

Any guidance would be much appreciated!

# Answer
I realize your situation isn't identical the one discussed here but I would try running the upgrade script to see if it resolves your issue.

If not - one important change is to make sure you remove the CiviCRM database tables when reinstalling! If you installed to a separate database from WordPress, that should be easy. If not, and it's not practical to restore from a backup, you can drop all tables with a prefix of CiviCRM.
> 1 votes

---
Tags: installation
---


# Question
Title: Picture selection for CiviEvent name badge - KCFinder not useable
I am trying to configure name badges for CiviEvent events.

When trying to configure the pictures, for upper left/right corner, an unformatted page opens and clicking on links like upload returns an error.

Any hint how to fix this? I checked civicrm.settings.php to ensure that the correct path is used and that the permissions for the upload folder are correct.

Any other way to get the pictures up and placed on the right place?

CiviCRM 5.8.1 Wordpress 5.0.2

Thanks,

# Answer
> 2 votes
The problem was caused by the CiviMobile extension which injected script code before the original page content and before the OnLoad event for loading the JQuery library. After removing this plugin, the upload page comes up properly.

# Answer
> 0 votes
This looks similar to a problem I had a while ago with the picture editing not being available and most of it was down to the default permissions with the WordPress CiviCRM install not being correct. See Adding images in CKEditor. That may be the answer or at least point you in the right direction. I didn't post an answer, but should go back and do that. My solutions were in the comments.

# Answer
> 0 votes
I have the same problem resolved via DB.. I get the table civicrm\_print\_label and I update part of the field "data" "image\_1":"http://www.grag.org/wp-content/plugins/files/civicrm/persist/contribute/images/Logo\_GrAG\_130x130\_v1\_0.jpg" with the new file name

---
Tags: civievent, kcfinder
---


# Question
Title: Forgotten Mattermost password. Not getting reset emails
I recently spring cleaned my lastpass account (a little too thoroughly).

And have lost my mattermost password.

I've tried to request new password but the notifications aren't getting through.

Anyone know who I can contact to get this resolved?

Cheers

Craig

# Answer
I pinged bgm for you so expect it will be resolved shortly
> 3 votes

# Answer
I am having problems registering with you. Chris Burgess suggested that I advise you here. The email has never been sent to me to confirm for "foreclosurepedia".

Thank you!

IN RE: CiviCRM 5.9.1 Cannot Read Database Information
> 0 votes

---
Tags: user-account
---


title: Manual Event Registration problems

text:
# Question
Title: Manual Event Registration problems
I'm trying to manually register a participant for a specific event, but the registration form is showing custom profiles that I've created for completely unrelated events. I'm unable to complete the manual registration until I've made a selection for all these required fields. This particular event does not use the profiles being show or show these profile questions on the public registration page, they only appear in the manual event registration page, below the Registration Confirmation and Receipt section. I don't see any mention of this in the manual (https://docs.civicrm.org/user/en/latest/events/manual-event-registration/), which makes me wonder if it's a bug.

How are these profiles getting here and how can I get rid of them without completely deleting them from my database?

I'm running CiviCRM 5.8.2 on Drupal.

# Answer
just wondering - you are saying Profiles - are you absolutely certain you aren't referring to a 'group of custom fields'. This would make sense if you have added lots of groups of custom fields and set them to apply for 'all' events. they would then show for a back end registration.

If so there are two steps to consider

a/ do not make custom fields 'required' - only set them to required in the profile

b/ set the 'group of custom fields' so they only apply to certain Event Types
> 4 votes

# Answer
Another step to consider: If those two steps don't work for you, you can use the same public-facing event registration form that the public would use. Just make sure you aren't logged in when you do it (otherwise you can overwrite your own CiviCRM info). We've found that sometimes it's just easier to do it this way when you need a specific profile to be available. Otherwise I don't think that the profiles show up when you're using the back-end system, just the custom fields you've specifically made required for events.
> 0 votes

---
Tags: civievent, registration
---


# Question
Title: Civicontribute radiobuttons without "none", where the "Other" contribution field deselects radiobuttons
This is a Theming/UI question for CiviCRM.

I've done some theming to turn the radiobutton's into clickable options.

When I select an amount it updates the 'Regular Amount' field.

However, when I select other amount, the previous option stays selected and they are added together.

What jQuery/js can I use to make the 'Other Amount' field de-select/unset the contribution amount choice?

I've tried code like this but for the life of me I can not get it to deselect anything!

```
$( "#price_78" ).focus(function() {
$('#CIVICRM_QFID_408_2').prop('checked', false);
});

```

Can you help me come up with a viable solution? We do not want to use the 'None' field on the contribution amount. I tried SimpleDonate but it did not work well for our implementation. We want the focus of the 'Other Amount' field to deselect any contribution amount.

# Answer
> 2 votes
This code worked for me:

```
CRM.$(function($) {
  $('input[type=text]', '#priceset').on('keyup', function() {
    if ($(this).val()) {
      $('input[type=radio]:checked', '#priceset').prop('checked', false).each(function() {
        calculateRadioLineItemValue(this);
      });
      calculateText(this);
    }
  });
  $('input[type=radio]', '#priceset').on('change', function() {
    if ($(this).is(':checked')) {
      $('input[type=text]', '#priceset').val('').each(function() {
        calculateText(this);
      });
    }
  });
});

```

# Answer
> 1 votes
I have a contribution form layout similar to Coleman's that shows clickable amounts (pseudo-buttons) instead of visible radio buttons. It also has the "Other Amount" pseudo-button (see below).

In order to get the right behavior, I had to also trigger the `click()` event on the radio button for the "Other Amount". This then correctly updated all the visual styles. The javascript is below.

```
CRM.$(function($) {
  // check for "other amount" text input
  var inpTxt = $('input[type=text]', '#priceset');
  if (!inpTxt.length) { return; }
  // find "Other Amount" radio button
  var rbO = $(":radio[value='0']", '#priceset');

  inpTxt.on('keyup', function() {
    if ($(this).val()) {
      $('input[type=radio]:checked', '#priceset').not(rbO).prop('checked', false).each(function() {
        calculateRadioLineItemValue(this);
      });
      // click event is needed to update style for other amounts
      rbO.not(':checked').click();
      calculateText(this);
    }
  });
  $('input[type=radio]', '#priceset').not(rbO).on('change', function() {
    if ($(this).is(':checked')) {
      inpTxt.val('').each(function() {
        calculateText(this);
      });
    }
  });
});

```

---
Tags: civicontribute, javascript, jquery
---


title: How to access the crm files

text:
# Question
Title: How to access the crm files
We would like to change the minor changes in the content page and webform design, dont know how to access the file. How to get the FTP files from my site need to add custom css file. Any help please.

# Answer
I would recomment reading up on how to customize CiviCRM here: https://docs.civicrm.org/dev/en/latest/ and here: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/

That should answer your question and also allow you to do the customizations in a recommended and structured way.

If you would like a more specific answer it will help us all ot help you if you tell us a little more about what you want to change for what reason, what version of CiviCRM you are using and what CMS.
> 3 votes

---
Tags: drupal-views
---


# Question
Title: How do I move registration to another event
I have a member signed up to the wrong event. I can't find a way to switch to the right event through the back end. I see Transfer - but it transfers to another person; not another event. Is it possible?

# Answer
This is not possible via the UI.

There is a table civicrm\_participant\_payment which links the Participant and the Contribution records.

If you have access to that, and know the contribution\_id then you should be able to edit participant\_id
> 7 votes

# Answer
Alternative to the good suggestion by @petednz - fuzion would be to use the API explorer (see https://docs.civicrm.org/dev/en/latest/)
> 0 votes

---
Tags: civievent, registration, online-registration
---


title: Civivolunteer Opportunities not showing

text:
# Question
Title: Civivolunteer Opportunities not showing
I've seen similar posts but have not found a solution.

I've created an event and have provided volunteer opportunities for that event. When someone goes to the page to volunteer for an event, the volunteer opportunities do not show. At the bottom, it shows:

"No results found. Please try different search criteria."

Now, what is weird when logged in as a Superuser, it works properly. Every other user group does not work and shows the above result. Upon searching, I saw a post regarding permissions: CiviVolunteer - Joomla - permission issue with multiple volunteer opportunities

I've granted permission to the AJAX API but the opportunities still do not appear. Because super user works, it would lead me to believe it is a permissions issue but I cannot locate the proper change. Any suggestions?

Here is what I see: http://blueribbonproject.org/index.php?option=com\_civicrm&task=civicrm/vol/&Itemid=2001#/volunteer/opportunities?project=13&dest=event&hideSearch=always

# Answer
> 0 votes
CiviVolunteer mentions CiviVolunteer: register to volunteer permission. Did you spot that?

# Answer
> 0 votes
Permissions settings done for ACL? (I'm on Joomla so this is how i do it) Administer / Users and Permissions / Access Control / Joomla Access Control Select your user group (in my case "Registered". CiviCRM: access AJAX API - Allowed CiviVolunteer: register to volunteer - Allowed CiviVolunteer: edit own volunteer projects - Allowed CiviVolunteer: edit all volunteer projects - Allowed

---
Tags: civivolunteer
---


# Question
Title: Create buttons on action from ResultTasks
I´m trying create buttons in ResultTasks.tpl for "show on map" and "export". This actions are in dropdown list with select named "task". I first tried duplicate the select, but it worked only last select, the first select redirect only to print page. Is possible to make separate buttons for these actions?

# Answer
By "buttons", I assume you mean the buttons referenced in the screenshot below.

It's not recommended to edit the .tpl files directly - it's hard to maintain, and will be overwritten any time you upgrade. Instead, it's preferable to use an extension with hook\_civicrm\_links, which allows you to inject your own links.

My Fast Action Links extension also provides a framework for adding links; you can either use it directly if it makes sense, or use it as an example of how to inject links to search results.
> 2 votes

---
Tags: contacts, search-results, custom-templates, button
---


title: Progressive Web App (PWA) on Drupal?

text:
# Question
Title: Progressive Web App (PWA) on Drupal?
I would like to get our CiviCRM install running as a "Progressive Web App" (https://developers.google.com/web/progressive-web-apps/).

Has anyone been able to successfully get the following module working with CiviCRM and Drupal?

https://www.drupal.org/project/pwa

What about other approaches to making CiviCRM run as a PWA?

Thanks!

# Answer
The PWA module is designed to work out of the box for very general cases without providing too much customizable functionality. People wanting advanced PWA functionality often have too-specific of requirements to wrap it up all nicely in a module, but many folks just want branding and some pages to work offline. PWA can offer those basics to you.

When you install the PWA module, you should get a Web Manifest and offline caching, provided you specify which URLs you would like cached in the admin settings. The Web Manifest also works with almost no configuration, but if you want custom icons you can implement `hook_pwa_manifest_alter()` (link goes to official example) and specify your own icons.

If you have any specific questions the best way to get support is by filing an issue on drupal.org and labelling it as a support request. I typically respond quickly and try to point you in the right direction even if I can't offer a coding solution.

I would also love to document your experience in terms of how it works with CiviCRM, and if necessary we can offer recommendations on URLs to exclude, assets to cache by default, etc.
> 1 votes

---
Tags: drupal, modules
---


# Question
Title: Offline Contribution receipts does not contain custom fields information
Currently using CiviCRM 5.9.1 and drupal 7.63

Contribution receipts works as expected if the checkbox to send receipt is checked while creating offline contribution. Receipts for offline contributions sent from `Print Contribution Receipts` task does not contain custom fields added for contribution.

**Steps to reproduce issue:**

1. Add custom fields of your choice for Contributions.
2. Create an offline contribution.
3. Go to `Find contribution` and select the contribution and select the option of `Receipts Print or Email` this will send email for the selected contributions.
4. Check the receipt received and see if you get Contribution related custom fields in the email.

Anyone is facing this issue?

# Answer
I don't think the receipt template for off-line contributions includes the tokens/code to pull in the custom fields. You might want to compare your templates for each - https://www.domain.com/civicrm/admin/messageTemplates?reset=1 and select System Workflow Messages - and compare the two. Then you can attempt copying/pasting in code from the online template and test the email that goes out.
> 1 votes

---
Tags: civicontribute, custom-fields
---


# Question
Title: How to fetch perticular column data of table?
Currently I am using API for fetch the data.
I am creating an extension. I want to fetch the particular column's data from the table. How will I get the data?

```
//getting id and name
public static function getName(){
 $data = ($id,$name);
  $result = civicrm_api3('Emp', 'get', [
      'sequential' => 1,
      'return' => ["id", "name"],
  ]);

  foreach ($result['values'] as $value) {
      $data[$id] += $value['id'];
      $data[$name] += $value['name'];

  }
  return $data;
}

```

> Select option using BuildQuickForm

```
$this->add('select',
      'name',         //field type
      'name', //field label
      $this->getName() //list (id, name)
      );

```

# Answer
For every table CiviCRM has api, you can use following method to retrieve data by specifying **return** in api params.

1 - **Get** \- Returns one or more results and with N number of columns

```
$result = civicrm_api3('Contact', 'get', [
  'return' => ["id", "display_name"],
  'contact_sub_type' => "Parent",
]);

```

2 - **GetValue** \- Returns only single result and with single column (make sure to use id in filer or limit =1 else the api will throw error if the api returns more than one results)

```
$result = civicrm_api3('Contact', 'getvalue', [
  'return' => "display_name",
  'id' => 1,
]);

```

3 - **GetSingle** \- Returns only single result and with N number of columns (make sure to use id in filer or limit =1 else the api will throw error if the api returns more than one results)

```
$result = civicrm_api3('Contact', 'getsingle', [
  'return' => ["display_name", "email"],
  'id' => 1,
]);

```

Incase if you want to retrieve from custom table created using extension then you will need to make sure you have

1. New entity defined -
2. DAO for the table
3. api with create, delete and get action

You can use Civix to create new entity which will create above 3 points automatically for you.

Then you can use below snippet to build your select field

```
    $this->add('select',
      'name',         //field type
      ts('Name'), //field label
      CRM_Utils_Array::collect('name', civicrm_api3('Emp', 'get', [
        'return' => ["id", "name"],
      ])['values']) //list (id, name)
    );

```

HTH

Pradeep
> 3 votes

---
Tags: extension
---


# Question
Title: Is there a way to hide certain transactions from general viewing?
In my organization, everyone raises support through Civi's typical donation processing. Because everyone can view all of the records (both contact and transactional), it's easy for people to see how much support someone else has. Is there a way to hide or limit the ability for most employees from seeing the financial information of other employees but yet see their own transactions and transactions associated with our general fund? I could also work with a solution that limits an employee's ability to see the information associated with a different employee. I'm using Civi 5.0.0.

# Answer
> 2 votes
There are a number of ways you could do your latter option.

A/ set up Groups of Contact for each Employee - then add the Contacts who they should see be able to see - then set up CiviCRM ACLs and remove the permission to View All Contacts - then they will only see those in their Group

B/ use the Permissioned Relationships extension and use this to supply the Access Control via civicrm Relationships

# Answer
> 2 votes
I think Pete might be a bit optimistic. Granting permissions to see everything EXCEPT for a few folks is convoluted. In fact, I doubt it's possible to do what you're describing by ACLs except by excluding employees from viewing other employees' contacts at all (not just contributions).

I think you're looking at a custom extension to hide just contributions of fellow employees.

# Answer
> 1 votes
Depending how flexible your requirements are, you could get part way there with Financial Type ACLs. You need to enable them under `Administer > CiviContribute > CiviContribute Component Settings > Enable Access Control by Financial Type`.

Then arrange for these donations to have a financial type of say 'Employee Support' and limit most people's access to not include access to that type. That way, they can continue to see other types of contributions but not these ones.

However, that (I think, but not tested) will also prevent employees from seeing their own support contributions but you might be able to find ways around that with Reports.

---
Tags: contacts, contributions, permissions
---


# Question
Title: Does CiviVolunteer need volunteer sub-contact type?
We have found that it is more cumbersome than it is worth to use a 'volunteer' sub-contact type classification. One reason is profiles assume one contact type and even working with Caldera Forms it over-complicates matters. Simply, 'Volunteer' is not a distinct enough categorization, at least for us to make it a sub-type.

Are there any effects on the project management side of CiviVolunteer where this is not advised?

We would simply change the custom field set to apply to individuals.

# Answer
> 3 votes
I know this is an old question, but it doesn't have an answer.

The "Volunteer" sub-contact type ships with CiviCRM core and is, for the most part, unrelated to CiviVolunteer. The "Volunteer Information" custom field set ships with CiviVolunteer merely as a demonstration of the "slider" functionality. That it is configured as a "Volunteer" rather than an "Individual" field set is arbitrary.

---
Tags: custom-fields, civivolunteer
---


# Question
Title: CiviVolunteer: Find Volunteer Opportunities
would love to be able to enable/disable search options. Currently there is: Between (date ranges), Role, With, Search by Location. Would like to disable "Search by Location" and replace with "Project". Also the ability to change the order.

# Answer
Karen-Ann,

Thanks for your question. StackExchange is not really the best place for feature requests. In case you wish to pursue this further, I have created an issue for you in the GitHub project for CiviVolunteer.

To provide the level of configurability you describe would require a significant investment of developer hours (though some of the fruit hang lower than others). These enhancements are not currently on the roadmap for CiviVolunteer, but you may be able to hire a developer to implement them for you.

If you're really pressed to hide the "Search by Location" field, an easy way to do this is via your site's theme; the following CSS should do the trick:

```
.crm-vol-opp-search .crm-vol-proximity {
  display: none;
}

```

Note that the elements will still be rendered in the HTML, but they will be hidden from view.
> 2 votes

---
Tags: civivolunteer
---


# Question
Title: What are the security considerations before allowing access AJAX API to anonymous users?
We have an autocomplete-select list in one of our profiles that we want to use on a public page. I can see the call is blocked for anonymous users because of permissions on 'access AJAX API'. I'm trying and have failed to find further documentation on any security considerations before allowing allowing access AJAX API to anonymous users. If we enable this are there features in CiviCRM that would prevent an anonymous user from using the AJAX API maliciously?

# Answer
Is the visibility for your field defined in the profile as Expose Publicly and also with the Searchable checkbox checked? You might not have to fiddle with permissions.

Otherwise to directly answer your question, some of the other permissions might still restrict undesired actions, but among other things it gives access to the REST api (via civicrm/ajax/rest), so you'd have to check what your other actions are allowing. For example you could open a developer tools console in the browser and type (this uses civicrm/ajax/rest behind the scenes)

```
CRM.api3('Contact', 'create', {
  "contact_type": "Individual",
  "first_name": "John",
  "last_name": "Smith"
}).done(function(result) {
  console.log(result);
});

```

which would probably fail because you might not have the add contact permission enabled for anonymous, but you might be able to do something like read all the contributions, depending on what else you're allowing for anonymous.

Also the autocomplete might be limited by whatever you restrict it to in the profile, e.g. limit to a group, but you could use the api to locate other contacts and their info.

The bottom line is it depends what your other permissions are also allowing.
> 3 votes

---
Tags: api, security, ajax
---


# Question
Title: How to add new membership if renewed after old membership expired (native CiviCRM / Drupal)
Consider this:

1. Wilma becomes a member on 1 Jan 2016, but does not renew at the end of the year.
2. (so throughout 2017, 2018, Wilma is not a member)
3. Wilma joins again in Jan 2019.

According to the documentation, CiviMember will find the original membership and change the start date to 1 Jan 2019 and the end date to 31 Dec 2019, and set the status to live (or new etc.)

This now looks like Wilma has been a member since 1 Jan 2016, but that's not the case.

**Is there a way to have CiviMember create a new membership and leave old expired ones (i.e. those with "member: No" configured for their membership status) as-was?**

There's a similar question that seems to be focussed on a WordPress/Caldera forms environment, but I'm asking about CiviCRM's native forms, hence the separate question.

# Answer
> 6 votes
I do not believe this is possible as of CiviCRM 5.4 at least.

The logic is coded in `civicrm/CRM/Member/BAO/Membership.php` so the only way to override this is with a core override file, which is a maintenance headache since it will need re-working on ever upgrade.

This patch seems to make it work as I think it should:

```
diff --git a/civicrm/CRM/Member/BAO/Membership.php b/all/modules/civicrm/CRM/Member/BAO/Membership.php
index 18269014..7713ee9e 100644
--- a/civicrm/CRM/Member/BAO/Membership.php
+++ b/civicrm/CRM/Member/BAO/Membership.php
@@ -1860,6 +1860,14 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = membership.contact_id AND
     $currentMembership = CRM_Member_BAO_Membership::getContactMembership($contactID, $membershipTypeID,
       $is_test, $membershipID, TRUE
     );
+
+    // -------Begin patch to create new memberships if last one had expired-------
+    if ($currentMembership && !$currentMembership['is_current_member']) {
+      // Force a new membership.
+      $currentMembership = NULL;
+    }
+    // -------End patch to create new memberships if last one had expired-------
+
     if ($currentMembership) {
       $renewalMode = TRUE;

```

# Answer
> 0 votes
Not a direct answer but you could create a different membership **type** each year and disable the previous year's type. It sounds like you'd want these reported separately in reports anyway?

---
Tags: drupal, civimember
---


title: Access denied for specific role

text:
# Question
Title: Access denied for specific role
IDs that previously were able to use CiviCRM now get 'Access denied - You are not authorized to access this page.'. (i.e. /civicrm/dashboard) These Ids can log in to Drupal. I may have caused this with some Role permission changes. I've fiddled with many of the Role permissions to no avail. We use ACLs to limit access to contact records.

What's the necessary subset of Drupal Role permissions to gain access to CiviCRM?

Drupal 7.61 CiviCRM 5.9.0

# Answer
We had the same issue and same resolution, but agree, it doesn't feel right. I opened an issue in the lab but couldn't find anything else: https://lab.civicrm.org/dev/drupal/issues/45

EDIT: Maintainer/owner "colemanw" replied to the issue:

> Looks like "access CiviCRM" was recently renamed "access CiviCRM backend and API" I assume to enhance clarity but it seems to have caused some confusion. But it's true, you should only allow trusted users to access your CRM.

EDIT2: More info from colemanw:

> Right, "access CiviCRM" or whatever it's called now is the gatekeeper, the minimum permission needed to access any part of CiviCRM. It is required to have that permission before doing anything.

Looks like we had the right idea!
> 8 votes

# Answer
I solved this with trial and error. I had to grant access to :

CiviCRM: access CiviCRM backend and API Master control for access to the main CiviCRM backend and API. Give to trusted roles only.

I'm having trouble believing that this is really a basic setting for access to CiviCRM, since it's flagged as 'trusted roles only'. I'm not clear what's covered by the term 'CiviCRM backend and API'. What function(s) within CiviCRM require this Permission?
> 6 votes

---
Tags: drupal, permissions
---


# Question
Title: Is moving Civi easier than the docs say?
I've moved Civi a few times in the past 2/3 years, following the docs esp. the PhpMyAdmin method. Lately the restore using this method has failed even though I followed the docs - because of foreign key restraints (error 1215) - so I've emptied the target db and done a full backup & restore with no problem. The last move I just made a full backup & restore with no problems - this is at 5.7.3 level. So I guess that improvements have been made & for systems at 5.7 level moving Civi is more straightforward than the docs say. This is good news of course! Perhaps it's just the docs that need updating, but I wonder what other users have found?

# Answer
> 1 votes
The triggers have a DEFINER that needs to exist and have the right permissions so if the db user is different you might run into some problems there. If by "full" you mean you are also restoring the system mysql.user table that might be ok but that might cause other problems with the hosting provider control panel depending how they are set up.

---
Tags: documentation
---


title: Where is the Update billing url?

text:
# Question
Title: Where is the Update billing url?
we are on Civi 5.8 and Wordcpress 5.

A member called and wants to change her credit card information for her recurring membership. I would prefer to send her a link to click so she can change it herself. Does anyone know what the URL is?

Thank you

# Answer
> 1 votes
If they get the email receipts or have the initial email that notifies it is recurring it has the URL.

This is what I see for WP:

https://example.org/?page=CiviCRM&q=civicrm%2Fcontribute%2Fupdatebilling&reset=1&**crid=XX**&**cs=......**

crid is the in the civicrm\_contribution\_recur table

Not sure what CS string is.

---
Tags: wordpress, civimember, recurring-contributions
---


# Question
Title: Custom profile only displaying one result in search
I've been trying to build a profile to customise the columns shown in search results.

I have the profile working, showing the columns I wanted, but for some reason the results page is only displaying one per page. As shown in the screenshot, it should be displaying 50 results per page. And it's not possible to move though the results one at a time, either. the other 49 results from the page are actually missing. The result that's displayed is't the first one that should be on the page, nor the last, it's from somewhere around the middle. Then the same for all subsequent pages.

Performing the same search without the profile, using the default view, everything displays as expected.

Any ideas what's up? Thanks!

# Answer
> 1 votes
It all worked perfectly in civi 5.8.2 prior to the upgrade. It's a bug in 5.9.0, I am experiencing the same thing. If I remove the "Default Contact Search Profile" everything is good. I'm using civi on joomla.

# Answer
> 1 votes
I've come across something similar but it's not using the custom search profile. I've managed to recreate on the sandbox so I've raised an issue: https://lab.civicrm.org/dev/core/issues/679

---
Tags: profile, search, search-results
---


# Question
Title: Admin-generated receipts show server name in email 'from' field
When we process a contribution in the back end and click the 'Send receipt?' button, a receipt is sent to the user from the address of our server (which is not listed in our 'FROM email address' list). For example the confirmation email header that comes through:

From: \<1111@server234.com\>
Date: Jan 21, 2019 4:21 PM
Subject: Contribution Receipt
To: \<1user@email.com\>

This just started happening after I upgraded to CiviCRM 5.9.1 running on Drupal 7.63.

Recreate by going to Contributions/New Contribution and creating a new contribution for a user (could be $0)
Click the 'Send Receipt?' checkbox
Save transaction (send receipt)
and check the 'from address' - it should indicate the servers name rather than the 'FROM' name that was selected.

I noticed someone else reported this in the last 24 hours in the comment by 'The Doctor' under this question: Registration confirmation email uses wrong From email address

# Answer
> 2 votes
This is now fixed and should be part of next release hopefully. You may wait for next release or apply patch manually from here.

---
Tags: civicontribute, email, receipts
---


title: Uninstall mosaico

text:
# Question
Title: Uninstall mosaico
I have tried installing mosaico (after installing shoreditch and flexmailer). However it did't work so after searching stackexchange I thought I would install it from github which seems to be a later version than the one you install fromt he extension installer within civicrm. So I disabled and uninstalled. Version 1.0 still apppears on my extensions list, so I deleted the folder from my added extensions folder, and mosaico 1.0 still appears in my extensions page (with the option to install).

How is this possible?! How do I delete it fully to start again.

I cleared drupal cache and civicrm cache. I'm on CiviCRM 5.9.1 and drupal 7.

Thanks!

Caroline

# Answer
> 1 votes
To fully delete it, you need to remove the files from your extensions folder.

Then try refreshing the extensions list.

If you do want to install a working version of the extension use version 2.0-BETA4

and the latest versions of Shoreditch theme and Flexmailer.

https://civicrm.org/extensions/mosaico-civicrm-integration/version-20-beta4

# Answer
> 1 votes
The version of Mosaico available from the in-app extensions page is still the old one, so as you have found, if you want the latest version you need to install it manually.

For the old version that you can't remove - expand the entry on the Extensions tab and look for the "Local path" info then check that location.

---
Tags: civimail, mosaico
---


# Question
Title: Can you use Mosaico to create message templates
Is this a thing that is possible? In other words to create a template in Mosaico (that is, the Mosaico CiviCRM extension) and to store it for use in User driven message templates such as emails?

# Answer
> 8 votes
You can try the Mosaico Message Template Synchronisation extension.

From the README:

> This extension enables you to use CiviCRM-Mosaico templates with scheduled reminders, personal messages, etc. It does this by automatically copying each template from Mosaico to a CiviCRM "Message Template".
>
> When you install the extension, all existing MosaicoTemplates will be automatically copied to MessageTemplates.
>
> When you create or update a MosaicoTemplate, the corresponding MessageTemplate will be updated.

There's a few gotchas/caveats to look out for - see README on branch issue/6 for fuller explanation about what happens with things like unsusbscribe links which don't apply to a log of message templates.

# Answer
> 5 votes
Under Mailings, you should have an option for "Mosaico Templates" where you would create your message templates, but these templates are currently only available to you for mass email (Mailings \> New Mailing) - they can't be used for things like Schedule Reminders or direct emails to contacts using the Send Email action (to 50 contacts or less) in CiviCRM.

Sorry not to be able to tell you something nicer, Tamar

---
Tags: civimail, mosaico
---


# Question
Title: Webform submission redirect to view it come from
I have a view of player's grading record using custom fields set in civi. It's a table with current grade, previous grade, dates, etc.

I've created a form that allows adding extra rows into that view.

I'm trying to create a redirection URL on the webform that after submission will go back to that view with contact id in it's argument.

Not sure how to do that :-(((

Any help appreciated.

# Answer
> 3 votes
I've got it finally, I should have copied the token from the actual field, which in my case was "submission:values:civicrm\_1\_contact\_1\_fieldset\_fieldset:civicrm\_1\_contact\_1\_contact\_contact\_id:nolabel\]" and not the example from the token's help window. Happy days!

---
Tags: webform-civicrm
---


# Question
Title: {$contribution_aggregate} not outputting in message template
I'm sure I'm missing something basic, but following the various documentation and examples I've seen I can't get {$contribution\_aggregate} to actually output the aggregate contributions for a donor, it just outputs literally that text.

Steps I'm taking:

1. Find contributions, select the ones I want to include in a thank you letter
2. Select "Thank You Letters - print or email"
3. Select Group contributions by contact
4. Separator: Vertical table cell
5. Print and email options: Generate PDFs for printing (just don't want to email until it's correct of course)
6. Document body: to test I'm literally just putting {$contribution\_aggregate} in the body
7. Click "Make Thank-you Letters"

And the resultant PDF literally just has {$contribution\_aggreate} in it.

I'm on CiviCRM 5.9.0 on WordPress 5.0.3.

Thanks for any guidance anyone can provide!

# Answer
> 3 votes
Look in your civicrm.settings.php (in wp-content/uploads/civicrm). There's a line that says:

define( 'CIVICRM\_MAIL\_SMARTY', 0 );

Change it to

define( 'CIVICRM\_MAIL\_SMARTY', 1 );

See https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty

---
Tags: message-templates
---


# Question
Title: I get a WSOD when I use the search function on CiviCRM
CiviCRM was working fine until I downloaded an extension called CiviRules. I looked into the API for field UFMatch, clicked around in there, and pressed execute (got no warning that it was going to change anything in the database, so I just assumed that it was running a test) and it resulted in no errors supposedly.

I also can't delete the extension, it sends me to an HTTP 500 error. Whenever I input a string search, it gives me a drop menu of contacts with matching strings but when I want to get a list of all the contacts in the database, it takes me to the WSOD!

What can I do to try and fix this?

Edit: it looks like any time I search for something (e.g. contributions, events, participants, contacts etc.), it takes me to the WSOD.

Edit 2: I'm using CiviCRM 4.6.37 and Drupal 7.59. And I'm not sure if it was actually CiviRules or clicking something in the API Explorer... I downloaded CiviRules extension first before I played around with API Explorer. My reasoning for poking around API was to see if there was some way to link/unlink user IDs with CiviCRM contacts and reuse a general username/account for changing members. Hopefully that makes sense! :-/

Edit 3: Problem is fixed. IT support at my organization’s end conquered the WSOD. Lesson learned: don’t mess with API if you don’t know what you’re doing. ¯\_(ツ)\_/¯

Thank you all for your responses!

# Answer
> 0 votes
I don't have any experience with CiviRules specifically, but the two things that usually clear up WSOD for me (on WordPress at any rate -- what CMS are you using?) are to clear out wp-content/uploads/civicrm/templates\_c, or you can also try going to Administer -\> System Settings -\> Cleanup Caches and Update Paths, then click the Cleanup Caches button.

Depending on what version of everything you're on there's also the possibility that the CiviRules extension isn't compatible with your version of CiviCRM, although a quick glance at their releases seems to indicate they keep very on top of things.

It'd also be helpful to see the log details about the 500 error if trying the things above doesn't resolve the issue.

Hope that gives you some things to go on.

# Answer
> 0 votes
Are you able to reinstall from backup? I’m wondering if by using the API Explorer you may have accidentally changed things best left unchanged.

---
Tags: error, database, search, php, error-page
---


# Question
Title: Unable to update participants using civicrm api?
Instead of updating the Participant,its creating new participant.I need to change participant status from **registered** to **attended** and vice versa.

```
civicrm_initialize();
  $result = civicrm_api3('Participant', 'create', [
  'id' => $entity_id,
  'contact_id' => $context['civicrm_participant']->contact_id,
  'event_id'   => $context['civicrm_participant']->event_id,
  'status_id' => "Registered",
]);

```

I am executing the above code in the hook\_action\_info() drupal 7 using views bulk operations & custom entity module

```
function custom_changes_action_info() {
  return array(
     'custom_changes_actions_participant_status_attended_action' => array(
         'type' => 'civicrm_participant',
         'label' => t('Change Participant Status to Attended'),
         'configurable' => FALSE,
         'behavior' => array('changes_property'),
         'triggers' => array('any'),
     ),
      'custom_changes_actions_participant_status_registered_action' => array(
         'type' => 'civicrm_participant',
         'label' => t('Change Participant Status to Registered'),
         'configurable' => FALSE,
         'behavior' => array('changes_property'),
         'triggers' => array('any'),
     ),
  );
}

function custom_changes_actions_participant_status_attended_action($entity, $context = array()) {

  $entity_id = $entity->{$info['entity keys']['id']};

  civicrm_initialize();
 $result = civicrm_api3('Participant', 'create', [
  'id' => $entity_id,
  'contact_id' => $context['civicrm_participant']->contact_id,
  'event_id'   => $context['civicrm_participant']->event_id,
  'status_id' => "Attended",
]);
  //drupal_set_message($entity_id. 'entity_id');
 // $base_url = str_replace('_', '-', $context['entity_type']); // civicrm-participant
  //civicrm_entity_drupal_goto($base_url . '/' . $entity_id . '/edit');
}

```

# Answer
Since you are passing $entity\_id to id in participant params without checking it to be not empty. If $entity\_id is empty then new participant will be created else it will be updated. Make sure your id is set before calling to participant api if you want to update the participant

Cheers

Pradeep
> 4 votes

---
Tags: drupal, api, participants
---


title: How to set a id attribute to button?

text:
# Question
Title: How to set a id attribute to button?
I am creating a button using php pear.

> Button (php code)

```
 $this->addButtons(array(
  /**
   * Array for 'next' button
   */
    array(
    'type' => 'next',
    'name' => E::ts('Next'),
    'isDefault' => TRUE,
  ));

```

> Template code

```
<div class="crm-submit-buttons">
 {include file="CRM/common/formButtons.tpl" location="bottom"}
</div>

```

I want to add a id attribute to that

# Answer
I believe you cannot set id to a button using php however you can define your own class for the button and use JS to set the id for that class.

Here is the snippet to add class for button

```
$this->addButtons([[
  'type' => 'next',
  'name' => E::ts('Next'),
  'isDefault' => TRUE,
  'class' => 'custom_class', //adding class for button
));

```

HTH

Pradeep
> 6 votes

---
Tags: extension, php, smarty
---


title: Custom Data ACLs

text:
# Question
Title: Custom Data ACLs
I'm a little confused on how custom data ACLs work - specifically, when I give a role access to edit a set of custom data fields that are associated with a contact, like so:

Does this allow that role to edit the custom data belonging to *any* contact or just *their own* contact?

If it would allow that role to edit custom data belonging to *any* contact, how can I lock it down so they can only edit their own data?

My use case is this: I want users to be able to log into the site, update their own information, and only their their own. Nobody else's. Their information is in a profile and custom fields.

# Answer
> 4 votes
This will allow to view/edit a custom data field set for every contact the user has view/edit permissions.

Despite the option named `Edit` there is currently no difference to `View`, as descibed in the note. Whether you can actually edit it depends on the ability to edit the contact.

There is a CMS-based permission `CiviCRM: edit my contact` to edit your own contact.

---
Tags: acl
---


# Question
Title: Does Authorize.net's MD5 Hash End-of-Life affect CiviCRM?
Regarding: https://support.authorize.net/s/article/MD5-Hash-End-of-Life-Signature-Key-Replacement

> Authorize.Net is phasing out the MD5 based hash use for transaction response verification in favor of the SHA-512 based hash utilizing a Signature Key. The end of life for MD5 Hash will be done in two phases: Phase 1 \- Starting later this month to early February 2019, we will remove ability to configure or update MD5 Hash setting in the Merchant Interface. There are no changes to the existing API response.
>
> Phase 2 - Stop sending the MD5 Hash data element in the API response. This change will require that applications support the SHA-512 hash via signature key. Dates for phase 2 will be announced later but is expected in the next 2-3 months.
>
> When you receive a transaction response from Authorize.Net, it includes the a SHA2 hash element the name and position depend on the API integration method used. The SHA2 has field contains HMAC-SHA512 hash that Authorize.Net generated for the transaction.

Is CiviCRM's Authorize.net implementation affected?

# Answer
> 3 votes
There is a PR from Monish to remove md5 hash support from Authorize.net payment processor in CiviCRM. Its now merged in master branch and should be part of 5.11 release.

Cheers

Pradeep

---
Tags: payment-processor, authorize.net
---


# Question
Title: If a contact is in Trash (because they were merged) but the person with matching details fills in Membership what is a good outcome
Scenario was Contact A had email mydomain.co.nz

Contact A then filled out a Join/Renew (not using checksum) and used mydomain.nz

Result was Contact B was created.

Those contacts were later identified and merged while keeping Contact A with their original .co.nz email. Contact B was hence in Trash with the .nz email.

Contact then again renewed by using the .nz email - and hence the dedupe rules matched with the contact in Trash and added the membership to that record ie Contact B.

Seems like this is a fuzzy area, if a Contact is in Trash, but meets the required 'matching rules' what should happen to eg Contributions and Memberships or any other data.

# Answer
I'd expect the Contact in Trash to be ignored by the dedupe rules, so if the dedupe rules don't match a (non-Trash) contact then a new one would be created.

If you add the Contact B .nz address as an extra email on Contact A then with the right dedupe rule you could avoid repeated new contacts.
> 1 votes

---
Tags: civicontribute, civimember, duplicate-contacts, deleted
---


title: Custom Fields Table

text:
# Question
Title: Custom Fields Table
I am having issues when working with Custom fields, that the CRM gets frozen, and have to restart everything. Today I noticed that the MySQL table log\_civicrm\_custom\_field has nearly 140K rows, while I have less than 400 custom fields only. There are hundreds of duplicated rows for each of the custom field, with the same id repeated but different log\_date and log\_conn\_id. Is it natural to have this many log records, can we disable this logging? Or is there a way to clear some of these rows, so that the CRM works faster.

# Answer
> 3 votes
It might well be natural to have that many log records as they reflect changes that have been made to the fields. So if a field gets a new label or a new option, that would be reflected in the log tables.

You can disable the overall logging (Administer\>System Settings\>Misc) if you do not need it. It is not required to make CiviCRM run.

You can also elect to keep logging switched on but empty the logging tables regularly? You have to do that in the database, there is no user interface to empty the logging tables.

It could well be however that you switch off logging and your problem persists because that is not the root of the problem? I have so far not experienced the size of the logging tables leading to this behaviour, even with millions of records in it.

---
Tags: custom-fields
---


# Question
Title: getting this error: PDOException: SQLSTATE[23000]
After installation I am getting this error:

```
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'civicrm_handler_field_custom_file-class' for key 'PRIMARY': INSERT INTO {registry} (name, type, filename, module, weight) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4);
Array ( [:db_insert_placeholder_0] => civicrm_handler_field_custom_file [:db_insert_placeholder_1] => class [:db_insert_placeholder_2] => sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm_handler_field_custom_file.inc [:db_insert_placeholder_3] => civicrm [:db_insert_placeholder_4] => 0 ) in _registry_parse_file() (line 179 of /xxxx/drupal70/includes/registry.inc).

```

# Answer
> 1 votes
I resolved this by truncating all the caching tables using mysql query. I followed following steps:

```
1. Connect Sql server
2. Truncate the all the cache tables and they are as follows:
truncate cache;
truncate cache_admin_menu;
truncate cache_block;
truncate cache_bootstrap;
truncate cache_field;
truncate cache_filter;
truncate cache_form;
truncate cache_image;
truncate cache_libraries;
truncate cache_media_xml;
truncate cache_menu;
truncate cache_page;
truncate cache_path;
truncate cache_token;
truncate cache_views;
truncate cache_views_data;

```

By doing this above steps I can able to resolve this issue.

# Answer
> 0 votes
The error message seems like you have two duplicate entries for `civicrm_handler_filter_custom_file-class` in registry table.

To fix, try deleting one of them, i.e, in `registry` table of drupal database

* Search for `civicrm_handler_filter_custom_file-class` in `name` column.
* Check if there are two entries found.
* If yes, delete or rename one of them to see if it fixes the issue.

---
Tags: drupal, webform-civicrm, php
---


# Question
Title: CiviCRM Email seems not to use Outbound Email settings
I've saved outbound email settings with:

Using sendmail Path: /usr/sbin/sendmail Arguments: -t -i

When I press "Save and send testing email", I can receive testing email correctly from sendmail.

But When I send email with CiviEmail, both testing and batch sendings, Outbound email settings seems to be ignored.

It had worked correctly CiviCRM 4.6, but suddenly broken after I upgraded CiviCRM to 5.9.1.

I noticed this issue, because I am doing relay\_host settings with sendmail. It worked on 4.6, but after I upgraded, it doesn't.

Any suggestions?

Here is my sendmail setting. It is working, but when I use CiviEmail it seems not to be used.

relayhost = \[domain.for.send\]:25 smtp\_use\_tls = yes smtp\_sasl\_auth\_enable = yes smtp\_sasl\_password\_maps = hash:/etc/postfix/sasl\_passwd smtp\_sasl\_tls\_security\_options = noanonymous smtp\_sasl\_mechanism\_filter = login smtp\_sasl\_type = cyrus smtp\_tls\_security\_level = verify smtp\_tls\_CApath = /etc/pki/tls/certs/ca-bundle.crt smtp\_fallback\_relay = \[localhost\]

# Answer
I solved this issue. This is caused by Civimail script automatically append -f\[Return-Path\] params when it sends any email.

I fixed CiviCRM core code

packages/Mail/mail.php and packages/Mail/sendmail.php

to prevent that.
> 1 votes

---
Tags: civimail
---


title: Error with site JS for Civicrm 5.8.0

text:
# Question
Title: Error with site JS for Civicrm 5.8.0
Hi we suddenly started getting a \</body\>\r\n\</html\>","help\_post":"\r\n\r\n\t error in the event info page and payment contribution page during editing.

not sure why this started happening.

Has this happened to anyone else, seems like a js error as i can see a few reds in the console.

Civicrm 5.8.0 and drupal 7.60

# Answer
This had to do with the Google Tag Manager module for Drupal. Updating to the latest version resolved this issue.
> 1 votes

---
Tags: civievent
---