title: Memory leak in API create Contact

text:
# Question
Title: Memory leak in API create Contact
I am trying to use PHP on the Command Line to import 90,000 contacts to Civi 5.0. It seem like there is a memory like when calling: civicrm\_api3('Contact', 'create', $usrArray);

Does anyone know what code in the api could be causing this?

The looping of the CSV has been written not to use up more memory than the line being read, this has been tested alone with memory\_get\_usage();

Best, Joel

# Answer
We have been running this patch in production for some months to address the memory leak

https://github.com/civicrm/civicrm-core/pull/11615

When we first deployed it we hit a bug on the use of cloning the DAO in export. I removed that place however there is one remaining when exporting related contacts and I closed the PR until I had a chance to address that

```
      $allRelContactArray[$rel][$allRelContactDAO->refContact] = clone($allRelContactDAO);

```

I've now updated for that issue & re-submitted - https://github.com/civicrm/civicrm-core/pull/12276
> 4 votes

---
Tags: api
---


# Question
Title: Deduping between Individuals and Organisations
An issue that's come up while we've been cleaning up our records for GDPR - we have a significant number of records where organisations have been entered as individuals, and vice versa.

This is mostly through user error - for example from records bulk imported as individuals, but also because individuals use an organisation email to sign up or contact us, or we only have an individual contact email for an organisation.

However, there is duplication between these contacts, and testing on CiviCRM I realise that if you create a new individual contact with the email of an existing organisation, 'Check for Matching Contacts' doesn't find the existing organisation. And, of course, the dedupe rules can only be run on either individuals, households or organisations.

Is there any way to set a dedupe rule across all contacts? e.g. a basic check to see if an email is already on the system?

# Answer
You can change a contact's type either by the API or (safer) using the contact-editor extension. Obviously once you fix the types the dedupe rules will work better for you - but I don't know of an easy way to search for dupes across types.
> 4 votes

# Answer
Unfortunately you cannot merge 2 contacts of different type AFAIK. Dedupe rule is set of each contact type. Current code in CiviCRM doesn't allow to merge contact of between Org-Ind.

The only possible way to do is to write an script to find duplicate contacts and do merge.

Quick solution(might work or not): 1. Find Contact and Sort on basis of email. 2. Select and delete the contacts

HTH

Pradeep
> 2 votes

# Answer
Actually you can force a merge just it's not officially supported. You need to hack the merge url to use the internal contact ids (the id that appears at the bottom of the contact summary page where it says "Contact ID").

For example, the number 16 after cid below is the "loser" contact and the number 134 after oid is the "winner" contact. The winner is the one that remains at the end. So just take this url and replace those numbers and of course the domain name.

http://dmaster.demo.civicrm.org/civicrm/contact/merge?reset=1&cid=16&oid=134&action=update&rgid=3&criteria=%7B%7D&limit=
> 1 votes

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


title: events 'missing'

text:
# Question
Title: events 'missing'
someone of our team managing the events in civiCRM yesterday realized that there are events missing from the the 'manage events' page in our wordpress installation (4.7.31)

in researching i found this Events 'missing' after upgrade to 4.7.19 which very much looked like the issue, but the quick fix of updating CRM/Event/BAO/event.php didn't change anything so i just updated to 5.2.0 as i assumed this should fix it.

unfortunately the events in question are still not shown.

Checking contacts who had been participants in one of these events does show the event listed there and i can get a list of all participants - but i can't manage/edit/duplicate such event.

any hints on how to debug/resolve this?

thanks, markus.

# Answer
> 1 votes
if you have access to your DB you could look in civicrm\_event and peruse the data there in case you have some odd values in eg date fields

otherwise try usual of clearing caches, drop templates\_c folder etc etc in case the fix has worked but you just aren't seeing it

---
Tags: wordpress, civievent
---


# Question
Title: Contact Import explode issue with matching contacts
I am getting the following warnings when trying to import contacts:

Warning: explode() expects parameter 2 to be string, array given in //wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser/Contact.php on line 704

Warning: array\_pop() expects parameter 1 to be array, null given in //wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser/Contact.php on line 706

Warning: Cannot modify header information - headers already sent by (output started at //wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser/Contact.php:704) in //wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 912

At first I thought there were unseen characters in the csv file but determined it only complains on contacts that already exist. It appears to update the matching contact but does not add the contact to the specified group on import and it creates a strange log in the matching contact's record with references to other contacts in the import!

The comment above this section of code in lines 704-706 refers to "CRM-10433 - might return comma separate list of all dupes". The Jira title of this issue is: import fails when updating on duplicate, adding to group, and multiple duplicates exist (related!?!?)

I am deduping on Name and Email using the Update option although the error also occurs on Fill. I am running 4.7.19 in WP and I upgraded recently from 4.6.20 where the client did not have this problem.

Is this fix from 4.2 no longer compatible with 4.7.x!?!?

# Answer
Per comment above the fix was part of CiviCRM 4.7.23 and hence the solution is to upgrade to the latest version where it is fixed.

( I keep seeing issues bumped, presumably by a bot where it is a long-fixed bug & no longer relevant)
> 1 votes

# Answer
I just discovered this same issue today on WP 4.8.1 CiviCRM 4.7.22. Examining the code at line 704, I made the edit to treat $newContact\['error\_message'\]\['params'\]\[0\] as an array instead of a comma-separated list. I see that is also the proposed fix in CRM-20739 that Karen S references. I was worried that my quick hack might break something else, until I checked in here. Will this be fixed in an upcoming CiviCRM update?
> 0 votes

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


title: Deduping within contact records

text:
# Question
Title: Deduping within contact records
I've noticed that some of our contact records have the same email duplicated (e.g. as 'home' and 'work' or 'main' and 'work' emails). I'm not seeing a simple way to find these records so we can clean them up - is there any way to 'dedupe' or check for this kind of duplication?

(Similarly, we have some records where the address is duplicated. In both cases, I think it's either from merging records or importing contacts with the fields mismatched)

# Answer
2019 UPDATE: A year later, I had to revisit this problem space, and I improved on my old answer; ignore earlier discussion threads on this answer.

When deleting duplicated emails/phone/addresses within a contact, you're inherently losing data. E.g. if a phone number is both "Main" and "Work", and you delete one, you have to choose which location type you're losing.

The following SQL statements handle three strategies I identified:

* Keep the record marked as "primary". Delete the rest.
* Keep the oldest record. Delete the rest.
* Keep the newest record. Delete the rest.

My preferred strategy is to keep the primary, delete the rest. This does NOT catch duplicates where none of the dupes are primary, so I follow that with a "keep the newest record" statement to catch the stragglers.

**Protip:** To see what records will be deleted before deleting, change `DELETE` to `SELECT`.

### Delete duplicate emails, keeping the primary:

```
-- Delete all emails from Civi that are in the "duplicated" subselect but aren't primary.
DELETE e.*
FROM civicrm_email e JOIN (
  -- Select all duplicated emails
  SELECT contact_id, email
  FROM civicrm_email
  GROUP BY contact_id, email
  HAVING COUNT(*) > 1
) AS f ON f.email = e.email
AND f.contact_id = e.contact_id
WHERE is_primary = 0

```

### Delete duplicate emails, keeping the oldest/newest:

Change `MIN` to `MAX` to keep the newest.

```
-- Compare civicrm_email to the outer subselect.  If your email/contact_id matches but you don't have the minimum email ID, delete.
DELETE civicrm_email.*
FROM civicrm_email
LEFT JOIN(
  -- Select the lowest email id for each value in the inner subselect
  SELECT MIN(id) keep_id
  FROM civicrm_email e
  JOIN (
    -- Get a list of unique email/contact_id combos
    SELECT contact_id, email
    FROM civicrm_email
    GROUP BY contact_id, email
  ) AS f ON f.email = e.email
  AND f.contact_id = e.contact_id
  GROUP BY e.email, e.contact_id) ids ON civicrm_email.id = ids.keep_id
  WHERE ids.keep_id IS NULL AND civicrm_email.contact_id IS NOT NULL

```

### Delete duplicate websites, keeping the oldest/newest:

Change `MIN` to `MAX` to keep the newest.

```
-- Compare civicrm_website to the outer subselect.  If your website/contact_id matches but you don't have the minimum website ID, delete.
DELETE civicrm_website.*
FROM civicrm_website
LEFT JOIN(
  -- Select the lowest website id for each value in the inner subselect
  SELECT MIN(id) keep_id
  FROM civicrm_website w
  JOIN (
    -- Get a list of unique website/contact_id combos
    SELECT contact_id, url
    FROM civicrm_website
    GROUP BY contact_id, url
  ) AS f ON f.url = w.url
  AND f.contact_id = w.contact_id
  GROUP BY w.url, w.contact_id) ids ON civicrm_website.id = ids.keep_id
  WHERE ids.keep_id IS NULL AND civicrm_website.contact_id IS NOT NULL

```

### Delete duplicate phones, keeping the primary:

```
-- Delete all numbers from Civi that are in the "duplicated" subselect but aren't primary.
DELETE e.*
FROM civicrm_phone e JOIN (
  -- Select all duplicated phone numbers
  SELECT contact_id, phone
  FROM civicrm_phone
  GROUP BY contact_id, phone
  HAVING COUNT(*) > 1
) AS f ON f.phone = e.phone
AND f.contact_id = e.contact_id
WHERE is_primary = 0

```

### Delete duplicate phones, keeping the oldest:

Change `MIN` to `MAX` to keep the newest.

```
SELECT civicrm_phone.*
FROM civicrm_phone
LEFT JOIN(
  SELECT MIN(id) keep_id
  FROM civicrm_phone e JOIN (
    SELECT contact_id, phone
    FROM civicrm_phone
    GROUP BY contact_id, phone
  ) AS f ON f.phone = e.phone
  AND f.contact_id = e.contact_id
  GROUP BY e.phone, e.contact_id
) ids ON civicrm_phone.id = ids.keep_id
WHERE ids.keep_id IS NULL AND civicrm_phone.contact_id IS NOT NULL

```

### Delete duplicate addresses, keeping the primary:

```
-- Delete all addresses from Civi that are in the "duplicated" subselect but aren't primary.
DELETE e.*
FROM civicrm_address e JOIN (
  -- Select all duplicated addresses
  SELECT contact_id, street_address
  FROM civicrm_address
  GROUP BY contact_id, street_address
  HAVING COUNT(*) > 1
) AS f ON f.street_address = e.street_address
AND f.contact_id = e.contact_id
WHERE is_primary = 0

```

### Delete duplicate addresses, keeping the oldest:

Change `MIN` to `MAX` to keep the newest.

```
DELETE civicrm_address.*
FROM civicrm_address
LEFT JOIN(
  SELECT MIN(id) keep_id
  FROM civicrm_address e
  JOIN (
    SELECT contact_id, street_address
    FROM civicrm_address
    GROUP BY contact_id, street_address
  ) AS f ON f.street_address = e.street_address
  AND f.contact_id = e.contact_id
  GROUP BY e.street_address, e.contact_id
) ids ON civicrm_address.id = ids.keep_id
WHERE ids.keep_id IS NULL
AND civicrm_address.contact_id IS NOT NULL
AND civicrm_address.street_address <> ''

```
> 6 votes

# Answer
I don't know a way within Civi so my suggestion would be:

1. Export your contacts' details to CSV or if happy delving into the database export the contact\_email table to CSV
2. Do some cell match formatting in Excel to highlight those with duplicate emails
3. Edit each highlighted contact.

Same could be done for addresses - it's the contact\_address database table in that case.
> 1 votes

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


# Question
Title: How do I pass custom field values in CiviReport urls?
For example, I have a membership report `/civicrm/report/instance/103` and I want to filter to only show rows where the value of a custom field with id of 65 is 'abc'

# Answer
`http://example.org/civicrm/report/instance/103?reset=1&force=1&custom_65_value=abc` should do it.

Note that you can also pass an operator to define the type of filtering you want to do, In this case, for example, adding `&custom_65_op=has` means that the filter would be 'custom field 65 contains the string 'abc'.

Right clicking on the relevant field in the report and then choosing inspect will open up a window where you can find the appropriate values for different operations.
> 9 votes

---
Tags: civireport
---


title: Contact Summary Hook Implementation

text:
# Question
Title: Contact Summary Hook Implementation
I am trying to add contact created date in contact summary. I am sure that https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_summary/ helps the requirement. But I'm not getting how to implement this hook.Any help please?

# Answer
As already pointed out, the created date is shown on the summary anyway - but since your question is more about using `hook_civicrm_summary()`, here's an simple example to add the date above the existing summary content:

```
function demo_civicrm_summary($contactID, &$content, &$contentPlacement) {
  // Lookup 'created_date' for the specified contact
  $dateCreated = civicrm_api3('Contact', 'getValue', array(
    'id' => $contactID,
    'return' => 'created_date',
  ));

  // Set $content to what we want to display
  // Can add html with classes for formatting ...
  $content = 'Date created: ' . $dateCreated;

  // Set $contentPlacement to specify where our content is displayed.
  // The default if we don't set this is to display below the existing summary
  $contentPlacement = CRM_Utils_Hook::SUMMARY_ABOVE;
}

```
> 5 votes

# Answer
The contact created date does show up on Contact Summary page at the bottom of the summary page

If you want as a field to show in summary section then i feel you can use civicrm\_summary hook but it would to be very difficult to manipulate where to insert a section in $content as it would be pure html. I would use Buildform and/or Page run hook to add field with some JS to place the field in the page/form.

HTH

Pradeep
> 3 votes

---
Tags: contacts, hooks
---


title: cron calling cv but not executing?

text:
# Question
Title: cron calling cv but not executing?
WP4.9.6 / CiviCRM 5.1.2

Having some issues with cron jobs using cv. I have a cron running with cli.php but that requires a password. I'm about to implement 2FA which breaks that approach.

I've got cv installed (well technically my hosting provider installed it for me), and I can call it from ssh, but it doesn't seem to trigger the scheduled jobs (even when I replace admin with a valid WP / CiviCRM superuser account name)?

```
bash-3.2$ cv api job.execute --user=admin --cwd=/var/sites/h/hbb.org.uk/public_html -vvv
[BootTrait] Start
[BootTrait] Attempting to set verbose error reporting
[BootTrait] Call standard cv bootstrap
[Bootstrap] Options: {
  "dynamicSettingsFile": "phar:///var/sites/h/hbb.org.uk/cv.phar/settings_location.php",
  "env": "CIVICRM_SETTINGS",
  "prefetch": true,
  "settingsFile": null,
  "search": true,
  "cmsType": null,
  "httpHost": "",
  "output": {} }

[Bootstrap] Find settings file
[Bootstrap] Load supplemental configuration for "/var/sites/h/hbb.org.uk/public_html/wp-content/uploads/civicrm/civicrm.settings.php"
[Bootstrap] Load settings file "/var/sites/h/hbb.org.uk/public_html/wp-content/uploads/civicrm/civicrm.settings.php"
[Bootstrap] Find CMS root for "/var/sites/h/hbb.org.uk/public_html"
[Bootstrap] Found "wp" in "/var/sites/h/hbb.org.uk/public_html"
[Bootstrap] Simulate web environment in CLI
[Bootstrap] Initialize class loader

[Bootstrap] Call core bootstrap
[Bootstrap] Finished

[BootTrait] Call core bootstrap
[BootTrait] Call CMS bootstrap

```

My site is an upgrade from before 4.6 so my civicrm.settings.php is in ../plugins/civicrm which I've copied to ../uploads/civicrm just in case, but to no effect.

Everything seems to work, but nothing happens?

# Answer
Closing this as I've managed to get wp-cli to work from ssh, just trying to get it to work from cron now....
> 0 votes

---
Tags: cron, cv, wp
---


# Question
Title: Custom Field that is a Foreign key to contact in Custom Group that extends Event is not updated on merge of contacts
I have created a Custom Group for Events. This Group has one custom field Organizor which is a autocomplete with contacts. But on merging the contact the Organizor custom field is not updated accordingly.

# Answer
This is something not handle in CiviCRM at the moment when two contacts are merged. I am not sure if any one has submitted fix for this issue. You can either fix this by adding code to update contact\_id for all contact reference custom field in core or through hook\_civicrm\_merge hook via extension.

HTH

Pradeep
> 3 votes

---
Tags: duplicate-contacts
---


title: How to enable ACH payment option Stripe

text:
# Question
Title: How to enable ACH payment option Stripe
I am using CiviCRM 4.6 with Stripe extension 4.7.3. I am able to do payment by Credit Card, but unable to find option to enable ACH payment.

Has anyone know how to enable ACH payment option in CiviCRM Stripe.

# Answer
I am not sure if CiviCRM Stripe pp extension supports ACH(https://github.com/drastik/com.drastikbydesign.stripe/issues/124). They might have beta version which is not released yet.
> 4 votes

---
Tags: stripe
---


# Question
Title: Event Management - notify participant on receiption of payment or on cancellation
I am setting up an event using CiviEvent.

People can register and have to transfer the event fee.

What do I need to to that people get a one time notification if the payment is received (manual status change to "transfer received") or if their registration is canceled (for example to modify it).

I am aware of the automatic reminders but I did not found how to configure them that the message is sent just at the day of the status change and only at that day.

I am using CiviCRM 5.2.0 on Wordpress 4.9.6.

Thanks,

Andreas

# Answer
> 3 votes
You can do this in one of the two ways

1. When you edit a participant you get an option to send confirmation email. Ticking the checkbox and saving the form will send email to contact.

2. Other option is to send reminder for particular participant status. Navigate to Administer \>\> Communications \>\> Schedule Reminders. On Add reminder form select entity as either Event Name or Event type and then select Event Name/Event Type and then Participant status with other fields.

> Note: Make sure Schedule reminder schedule job is enabled if you sending it via schedule reminder. But i would prefer to use method 1 as it is most convenient and easy.

HTH

Pradeep

---
Tags: civievent
---


title: Cost for Booster Club Auction Event

text:
# Question
Title: Cost for Booster Club Auction Event
I am the chair person of organizing a silent/live auction for our Booster Club. Looking at streamlining processes. Need cost info please.

# Answer
Welcome to StackExchange. There are several similar questions and answers that you might find useful.

Obviously for anyone to provide more specific costs they would need much more information about what you want to do, but auctions are not a core feature of CiviCRM. You could try contacting someone on this list to discuss further: https://civicrm.org/partners-contributors
> 5 votes

---
Tags: wordpress, evaluating-civicrm
---


# Question
Title: Email address is missing on Thank You page where it says "An email confirmation with these payment instructions has been sent to"
Noticed this on a couple of sites - not sure if this is a bug yet. When I tested on dmaster it fills correctly so perhaps this is a bug/regression that has been fixed between 4.7.27 and 4.7.30/31

# Answer
This is a CiviCRM Core bug, reported here: https://lab.civicrm.org/dev/core/issues/173

It applies to pay later contributions when the email address is included in the profile.
> 1 votes

# Answer
I see this too. I believe its only when the pay later is enabled and the donor selects pay later. The email addresss is not shown. A simple hack may be to find the code change it to just "has been sent." until someone with more knowledge than me can fix the problem. I tried it with a 4.6.X version (on Joomla) and the email showed properly. I tried it with a 4.7.X (on Wordpress, I forget which version I was at! 32?) and had the problem. So I upgraded that to 5.0.2 and still have the problem.
> 0 votes

---
Tags: contribution-page
---


# Question
Title: How to use Campaign ID (as a token) in Contribution Invoice/Email Receipt Template
We use Campaign ID (renamed using Word Replacer to "Project ID") to categorize different kinds of contributions. Some come in through online contribution pages, and some are entered manually on CiviCRM after we receive cash or checks. I am customizing the "Contribution Invoice Receipt" system workflow message, and I tried to show the Campaign ID by using:

* {$contribution.campaign\_ID}
* {capture assign=project\_id1}{contribution.campaign\_id}{/capture}{$project\_id1}

None of these pull up the Campaign ID. And how come there are already contribution related fields in place in the template, such as $contribution\_status\_id or $amount? Is there a full list of fields available somewhere?

Once I identify the campaign id, I'm hoping to run something like

```
{if $campaignid==15}
Thanks for donating to Project 15! Bla bla (custom text)
{elseif $campaignid=17}
Thanks for becoming a member! Bla bla! (custom text)
{else}
Thanks for your donation! Bla bal (generic text)
{/if}

```

So after searching further into the StackExchange I found this, which shows you can get the full list by inserting {debug} into the template, then the template outcome will show it as an email Javascript when viewing the source. Here is the cleaned up debug results, which indicates that the token to use may be $formValues.campaign\_id. I then tested it, and turns out that it works on Contributions - Receipt (offline) and online, but not in Print Invoice.

Here is the list of formats that didn't work. (It seemed that on some paratemers CiviCRM was case sensitive)

```
{$contribution.campaign_ID}
{$contribution.campaign_id}
{$contribution.campaign_Id}
{$contribution.project_ID}
{$contribution.project_id}
{$contribution.project_Id}
{$contribution_campaign_id}
{$contribution_campaign_ID}
{$formValues.campaign_id}
{$formvalues.campaign_id}
{$formTpl.campaign_id}
{$campaign_id}
{$contributionProjectId}
{$projectId}
{$ProjectId}
{$contribution_Project_Id}
{$contributionCammpaignId}
{$campaignId}
{$CampaignId}
{$campaignid}
{$contribution_campaign_id}
{capture assign=project_id1}{contribution.campaign_id}{/capture}
{capture assign=project_id2}{contribution.Campaign_Id}{/capture}
{capture assign=project_id3}{contribution.campaign_Id}{/capture}
{capture assign=project_id4}{formvalues.campaign_id}{/capture}
{capture assign=project_id5}{formValues.campaign_id}{/capture}
{$project_id1} {$project_id2}  {$project_id3}{$project_id4}{$project_id5}
{$contributioncampaignID}
{$value.campaign_id}
{$formValues.33}
{formValues.campaign_id}

```

# Answer
First off, I realize I am ***extremely*** late to the party - but I just read this question in the midst of trying to resolve a similar issue where I needed to know what template variables are available to a PDF template.

What I did to find template variables when {debug} isn't working for a direct download etc was:

In /CRM/Core/Smarty.php, Line 192 *temporarily* change

```
$this->security = TRUE;

```

to

```
$this->security = FALSE;

```

Let me emphasize that this is for a **development environment ONLY**. Please please please under no circumstances do this on a production site (you are turning off very important security features, I cannot emphasize that enough).

Now we can call protected functions in our smarty templates to print out all template variables in several ways. I did it this way:

```
<pre>
{php}print_r(CRM_Core_Smarty::get_template_vars());{/php}
</pre>

```

From a quick glance at that, it didn't look to me like campaign information is available to this template already, and it looked like contribution\_id is only available under 'line\_item'... so I would put something like this in the message template (check out /civicrm/api/explorer for more examples):

```
{foreach from=$lineItem item=value key=priceset}
  {crmAPI var='result' entity='Contribution' action='getsingle' sequential=0 return='campaign_id' id=`$value.contribution_id`}
    {foreach from=$result item=youritem}
      {$youritem.campaign_id}
      {$youritem.contribution_campaign_title}
  {/foreach}
{/foreach}

```
> 1 votes

---
Tags: civicontribute, tokens, message-templates, receipts, civicampaign
---


title: Can users edit an event profile?

text:
# Question
Title: Can users edit an event profile?
I am using CiviCRM on Joomla.

I created an event so users can register and sign up for workshops. One our leaders dropped out and many people signed up for her session. I want them to choose another session before the conference so we can make sure we have enough space. I don't see where I can expose the event profile for editing.

Is this possible?

# Answer
> 0 votes
One possibility if you can't do what you are trying, would be to add a custom field to your system, the send out links to a profile containing that field and hence find out the participants' new preferences. It won't change the data you currently have about them.

If you are using Drupal, then you may be able to send people to a webform that would contain the event fields they originally used when registering.

---
Tags: civievent, joomla
---


# Question
Title: Is this a bug in civicrm/case/activity/view breadcrumb?
Disable popups in display preferences.

Find a case eg civicrm/case/search?reset=1.

'Manage' the case to open it.

Click on the activity Subject, goes to eg civicrm/case/activity/view?cid=203&aid=642

The 'Case Activity' breadcrumb links to civicrm/case/activity?reset=1 which gives an error when you try to use it:

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. required params missing.

Can reproduce this on http://dmaster.demo.civicrm.org

# Answer
> 2 votes
That was logged to gitlab & Coleman provided a fix which was merged - I think it missed the 5.3 rc so will be in 5.4

---
Tags: civicase, activity
---


# Question
Title: Problem with sorting civievent_widget custom_filter by startdate DESC and for past dates
I am trying to sort by start\_date descending but it doesn't seem to be working.

What change would I make to the below to get it to work? I am using CiviCRM 4.6

\[civievent\_widget title="Sorted Events" admin\_type="custom" custom\_filter=custom\_filter='{"is\_public": 1, "options": {"sort": "start\_date DESC"}}'\]

Also I am trying to display only past events by date (ideal would be before "today") but this doesn't work either. Do I have a format incorrect or is this not possible to do?

\[civievent\_widget title="Past Events" admin\_type="custom" custom\_filter='{"start\_date": {"\>=": "2018-06-01"}, "is\_public": 1, "options": {"sort": "start\_date ASC"}}'\]

# Answer
> 1 votes
I figured out why the second one wasn't working -- CiviEvent widget only shows UPCOMING events.

I still am not able to figure out why I cannot see the events in DESCENDING order.

---
Tags: civievent
---


# Question
Title: How to update contact email with JavaScript API?
I'm trying to update a contact and, especially, the email address. As far as I can tell using the API explorer, this is the correct JavaScript code for that:

```
            crmApi('Contact', 'create', {
          id: myContact.id,
          first_name: myContact.first_name,
          last_name: myContact.last_name,
          middle_name: myContact.middle_name,
          "api.Email": myContact.email
        })

```

It correctly updates the names, but not the email. Does anyone see what I have wrong?

# Answer
There are many ways you can update email for contact

1. Using Email api with create action

```
CRM.api3('Email', 'create', {"email": "aaa@asas.comsdsd",  "id": 201}).done(function(result) { // do something});

```
2. Using Email api with replace action

> ```
>   CRM.api3('Email', 'replace', {
>       "values": {"0":{"email":"asasa@asas.com","location_typ_id":"Home"}},
>       "contact_id": 203
>     }).done(function(result) {
>       // do something
>     });
>
> ```

3. Using Contact api with Email chain api

> ```
> CRM.api3('Contact', 'create', {
>   "id": 203,
>   "api.Email.replace": {"values":{"0":{"email":"assdfsfdsasa@asas.com","location_typ_id":"Home"}}}
> }).done(function(result) {
>   // do something
> });
>
> ```

HTH

Pradeep
> 4 votes

# Answer
Email addresses are in their own separate entity in the API named "Email". You would update the email address with that using the contact ID to connect the person to the email address.

Example from the API Explorer (from Civi 4.6):

```
CRM.api3('Email', 'create', {
  "contact_id": 1111,
  "email": "example@example.org"
}).done(function(result) {
  // do something
});

```
> 0 votes

---
Tags: contacts, api, javascript
---


title: Configuration for Smart Group Cache

text:
# Question
Title: Configuration for Smart Group Cache
I have a very simple use case for Smart Groups. I have only two small Smart Groups that are both used exclusively for bulk mailings, once or twice per month:

1. All Individual Contacts: approximately 800 contacts
2. All Current Members: approximately 80 contacts

From what I've read, I'm thinking I probably don't need caching. Is it safe to disable the Rebuild Smart Group Cache scheduled job and set the Smart group cache timeout to 0?

# Answer
I would say yes. Although it probably does no real harm to have it on if you are not hammering it
> 1 votes

---
Tags: smartgroups
---


# Question
Title: Separate membership payment on contribution form with donation
When creating a contribution page with a membership, which is not a price set, the option to: "Separate Membership Payment" is shown. This creates a transaction transaction for any donations and memberships on the same sign up form.

A separate membership payment will: "Check this box if you are including both Membership Signup/Renewal AND a Contribution Amount section, AND you want the membership fee to be charged separately from any additional contribution amount."

Unfortunately when using a price set, the donation options do not appear on the forms, and the option to separate payments is removed. It doesn't appear possible to separate a contribution with donations into two separate transactions.

How can I keep using a membership price set, but also enable donations on the same form through separate transactions?

# Answer
> 1 votes
The separate transaction option is not available with price sets - if you want both you should maybe hire a consultant to develop something.

---
Tags: civimember, contributions
---


# Question
Title: Undefined index: maxlength after update to 5.2.0
I am relatively new to CiviCRM. After we updated to 5.2.0 I started getting this message when I enter the Create New Individual screen:

Notice: Undefined index: maxlength in CRM\_Core\_Form-\>addField() (line 1478 of /home/makernexuswiki/www/crm/sites/all/modules/civicrm/CRM/Core/Form.php).

Searching Google and StackExchange I could not find any relevant info.

Did the upgrade fail to add a required index? Is this a big issue? Should I just set the system to ignore Notices?

We are on Drupal 7.5.9

Any help is appreciated. Jim

# Answer
> 4 votes
Jim,

This is a php notice, you can ignore. However this has been fixed in latest version of Civi. To fix this you can either

1. Apply fix from https://github.com/civicrm/civicrm-core/pull/12090 or wait for next release.
2. Turn off php notices by navigating to Configurations \>\> Logging and errors. Set 'Error messages to display' to None.

HTH

Pradeep

---
Tags: upgrade, error
---


# Question
Title: Can't install extensions on CiviCRM 4.6.36 with Drupal 7.59
So I successfully installed CiviCRM and most things are running well but I can't install extensions.

From Gui I get to the "Download and Install button and the installation fails with:

**WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open\_basedir or safe\_mode. Unable to extract the extension. Extension Upgrade Failed Download failed - ZIP file is unavailable or malformed**

Manual I download and expand the zip file in the extensions directory It shows up as a local install When I click the "Install" button:

**the browser shows an address of *(myserver)/drupal/index.php?q=civicrm/admin/extensions And the message is: This page isn’t working (myserver) is currently unable to handle this request. HTTP ERROR 500***

I suspect some sort of PHP error but I don't know what the solution is.

# Answer
The syntax looks fine for me. You will need to check php version you are using. It should be 5.5 or more i believe.
> 3 votes

# Answer
The main issue is already answered here, but check your php version and configuration against the requirements here: https://docs.civicrm.org/sysadmin/en/latest/requirements/#php

(Also, you might also want to check out 'clean-urls' in Drupal - https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls That's not related to the cause of the problem but makes the URL's in your error message nicer)
> 2 votes

---
Tags: drupal, extension, installation
---


title: CiviCRM Reading Contacts name as admin

text:
# Question
Title: CiviCRM Reading Contacts name as admin
I have a WordPress website with large CiviCRM database. For some reason, CiviCRM is reading one of my Administrators as a contact name (not matching his name) and every time I try to delete him and make him a new user, it matches him to another contact (not his). How can I find a fix for this issue?

# Answer
Every WordPress (or other CMS) user gets a CiviCRM contact, even though not every contact corresponds to a user. The only tool CiviCRM has for making these matches is the email address. Once CiviCRM is installed, whenever a new WordPress user is added, CiviCRM will find or create an individual contact with that email address.

If you have a lot of contacts with this person's email address and/or if his contact has a different email address, you may run into issues. You also may have another user already connected to his contact record. Pete's suggestion about the `civicrm_uf_match` table is a good one: that's the table that connects the user to the contact.

Assuming you have a user account that is good and a contact that is good (and an Individual, not a Household or Organization), you can use the API Explorer to fix the problem.

1. Get the IDs of the WordPress user and the CiviCRM contact you want to connect. Also, get the email address that is *on the WordPress user record*.
2. Go to Support \> Developer \> API Explorer
3. For Entity, pick `UFMatch` and for Action, pick `get`.
4. In the Parameter drop-down, pick `CiviCRM Contact ID`, leave the operator as `=`, and in the Value field, enter the Contact ID.
5. Click Chain API Call, and in the line the appears, select `UFMatch` as the Entity and `delete` in the second column, and leave the third column as `{}`.
6. Hit Execute. This will delete any records connecting the good contact to any WordPress user.
7. Now, modify the first parameter and change it to `CMS ID`, leave the `=`, and change the value to the WordPress user ID of the user you want to connect.
8. Hit Execute. This will delete any records connecting the good user to any CiviCRM contact.
9. Now, go to the Action drop-down and select `create`. This should clear out the old parameters and set up three for CMS ID, CMS Unique Identifier, and CiviCRM Contact ID.
10. Fill those values: enter the WordPress user ID as CMS ID, the WordPress user's email address as the CMS Unique Identifier, and enter the CiviCRM contact ID as CiviCRM Contact ID.
11. Hit Execute. This will explicitly connect the WordPress user to the CiviCRM contact. You can verify this by going to the contact record and seeing the user ID there next to the contact ID.
> 4 votes

---
Tags: wordpress
---


# Question
Title: Events -> Find Participants results in Warning: Cannot modify header information - headers already sent
I've running CiviCRM 4.7.31 on Wordpress 4.9.6. When selecting Events -\> Find Participants, I get the following warnings and a blank screen:

> Strict Standards: Static function CRM\_Core\_Task::permissionedTaskTitles() should not be abstract in .../wp-content/plugins/civicrm/civicrm/CRM/Core/Task.php on line 132
>
> Warning: Cannot modify header information - headers already sent by (output started at .../wp-content/plugins/civicrm/civicrm/CRM/Core/Task.php:132) in .../wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 926

Furthermore, when I go into the Events Dashboard, I get the following each time:

> Standards: Static function CRM\_Core\_Task::permissionedTaskTitles() should not be abstract in .../wp-content/plugins/civicrm/civicrm/CRM/Core/Task.php on line 132

Is this a bug or an issue with my setup possibly?

# Answer
This has been recorded and fixed in later version of CiviCRM. You can either apply patch manually to 4.7.31 or upgrade CiviCRM to 5.2.1.

HTH

Pradeep
> 3 votes

---
Tags: civievent
---


title: Sorry but we are not able

text:
# Question
Title: Sorry but we are not able
I have tried to append a new contact Contact saved When I tried to search this is the answer

# Answer
> 2 votes
You have experienced what is called, a CiviCRM fatal error, or as I like to say, yellow banner of death.

Please update your question with Civi version and CMS info too. Then Start here: https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/

Then share whats in the logs.

---
Tags: error, database
---


# Question
Title: Contribution Tab not visible after upgrade to 5.2.1
after upgrading CiviCRM 5.2.1 in contacts I contribution tab disappeared.

And "Contribution" is checked in Display preferences.

I discovered that it depends that when I save `admin/setting/preferences/display` there is not saved the value `7` for CiviContribute in table `civicrm_setting`. I have executed this query update: `UPDATE `civicrm_setting` SET `value` = 's:27:\"123457910111314\";' WHERE `id` = 1`

I do not know what it depends...

I have another strange thing: the field `civicrm_option_value.label` is missing (there are `label_it_IT` and `label_en_US` instead).

I updated CiviCRM from version 4.7.27 and my database has a lot of views. I notice recent CiviCRM database does not have views instead.

What do you suggest me? Thanks

# Answer
> 1 votes
Switch in English language. In "display preferences" you will find the un-flaged contribution field. Flag it and return in Italian language. You will see that it works. I do not know what the reason is, but it works.

"...a buon rendere!" ;)

---
Tags: civicontribute, localisation, contact-view, i18n
---


# Question
Title: Restrict users who sign up for groups from viewing all groups they have been assigned to
Paul Scully

https://buildingoneamerica.org/civicrm/profile/create?gid=75&reset=1

Do you know if there is a way to offer for people to sign up for a group without all the groups they are assigned to (which are many) being visible. The link is above. I do not want them to see all the groups they are in.

I can't seem to figure this out. below is what it looks like when i sign up.

# Answer
If you go to **Contacts menu » Manage Groups**, you should be able to click the **Settings** link next to a group. Set the *Visibility* to **User and User Admin Only** (see screenshot). This should suppress the visibility of the groups on profiles.
> 4 votes

# Answer
When you create a Profile, in Adv Settings, you can specify that anyone who submits the Profile gets joined to Group X. That may or may not be what you are asking. I suspect not.

For sites using Drupal (as appears to be case for yours) you can use webform\_civicrm extension to finesse public facing forms and be much more specific about what the user sees in terms of Groups etc.
> 0 votes

---
Tags: groups
---


# Question
Title: Why can't I see custom profile fields when I edit an event participant record
I'm using civiCRM on Joomla and I need to edit a participant record to change a selection for a custom field. When I edit the record it does not show the custom field selections. Is this possible, if so, How do I view and edit their selections?

Thanks!

# Answer
I figured it out. It was showing but the fields were collapsed.
> 1 votes

---
Tags: civievent, joomla, participants
---


title: Custom Data Responses

text:
# Question
Title: Custom Data Responses
How can I view responses to custom data questions? By looking at Contact summary I can see that new contacts are responding, but when I click on the link, nothing is there.

# Answer
> 1 votes
Each custom field is part of a group, that is itself attached to a "normal" civicrm entity (that can be a contact, an activity, a participant...), so the first thing you need to do is to find to what the custom group is attached.

the second thing it to be sure it's searchable. You can find both of them in the admin custom fields.

once you know where it is and that it's searchable, you can use the advance search, and you will have that field

As a side note: if your question provides a list of groups (all the sections or committees) it's probably going to be easier for you to ignore the custom field and directly show the list of groups

---
Tags: custom-fields
---


# Question
Title: Where is the file civicrm.settings.php in WP?
Wordpress 4.9.6 and CiviCRM
Where is file `civicrm.settings.php`?
It is not in `/wp-content/plugins/civicrm/civicrm`
It is not in `/wp-content/uploads/civicrm`

thanks

# Answer
> 4 votes
For versions installed before 4.7, the civicrm.settings.php file should be in **/wp-content/plugins/civicrm** (***not /wp-content/plugins/civicrm/civicrm***). As Pradeep says, for newer versions installed from 4.7, the file should be found in **/wp-content/uploads/civicrm**. Hope this helps.

# Answer
> 5 votes
That sounds weird. The /wp-content/plugins/civicrm/ path is for CiviCRM versions older than 4.7. For a new install you should find it under /wp-content/uploads/civicrm. I hope you are looking in right directory.

---
Tags: wordpress
---


title: Large CiviCRM Logs

text:
# Question
Title: Large CiviCRM Logs
CiviCRM 4.7.31 (upgrading today) Drupal 7.x

Our log\_civicrm\_group table crashed and needed repair. We had to run the repair twice from the command line for it to actually work. It's about 850MB large now. When we click the "log" tab on some contact records we're seeing some timeouts or some extremely long load times. It should also be noted we're using a MailChimp extension and there is extensive use of groups.

Does anyone have a suggestion for keeping these log tables at sane sizes (archiving?) or optimizing mysql to present them quicker despite their size?

Thank you for any suggestions. We just enabled the feature and didn't think about what to do after collecting a year of logs.

# Answer
> 4 votes
If you don't need the logs, you could delete them.

Which engine are your log tables using? There is a useful article by Eileen about ARCHIVE vs INNODB: https://civicrm.org/blog/eileen/who-did-what-when

---
Tags: logging, db-logging
---


# Question
Title: Webform conditional from Civicrm checksum
I use drupal 7 and latest civicrm.

I direct people to my form using the checksum. I would like to not display email field and GDPR opt in field if they arrive at the form via checksum. If they arrive at the form without checksum I would like email/opt in to be visible.

I know how to use conditionals within the form (eg if email address is present then display field X) but I can’t work out how to do it from the initial check sum - I feel it ought to be possible. Can anyone help?!

Thanks!

# Answer
I think this is possible with the below adjustments on the webform.

* Add a disabled textfield on your webform and set its default value to a token or checksum value from the URL.
* Now, add the condition on this element to hide email when it's value is not blank.

Update after Karing's comment - If you need to hide the field from the webform, maybe use a little css like `display:none` for the same.
> 5 votes

# Answer
You can use hook\_form\_alter and in hook check if URL parameter for checksum is present then you can remove specific webform form elements like this:

$form\['submitted'\]\['element\_form\_key'\]\['#access'\] = FALSE;
> 0 votes

---
Tags: drupal, webform-civicrm, checksum
---


title: CiviCRM Spark trial and pricing?

text:
# Question
Title: CiviCRM Spark trial and pricing?
Am I missing something obvious, or is there nothing in the CiviCRM Spark sign-up process that says what the billing period is? It says 'CiviCRM Spark Hosting - $ 9.50' and that it'll renew automatically, but not how often. Does anyone know? I'm guessing monthly, but would need to know before trying it. Or even better, is there a free trial somewhere that I can't see?

# Answer
It's per month. Thanks for raising this issue, we will clarify the site.

You can also contact us on the CiviCRM chat: https://chat.civicrm.org/civicrm/channels/spark or by email: info@civicrm.org.

As per the T&C, you can also ask for a refund after 30 days, if you were not satisfied with the service.
> 3 votes

# Answer
Looks an interesting service and will suit many and certainly a good way of getting started. I can't see a contact email for the service or a list of the extensions included. I think I've probably already grown beyond this service as I am using a few extensions, but had it been there when I started, it would probably have been quicker that getting it going on another hosting provider.

But to answer you question - it does look to be monthly - see the T&Cs linked from the signup page (direct link https://civicrm.org/spark-terms-and-conditions).
> 4 votes

---
Tags: evaluating-civicrm, civicrm-spark
---


# Question
Title: Email sent via CiviRules removes unsubscribe token from email template
I tested an email template via CiviMail and the unsubscribe link works and the HTML shows it. In the source it comes up as

```
<a href="{action.optOutUrl}" style="text-decoration: none; color:
#fffffe;" target="_blank">Unsubscribe here.</a>

```

But if the same email template is triggered & sent via CiviRules (you can choose the template along with rules and conditions on how to trigger it), the tag shown above gets stripped out leaving just the text "Unsubscribe here" which has no link - just text! So no one can actually unsub.

Does anyone know how to deal with this? Is there a way to just use the link without using the token? I went through the CiviCRM documentation and didn't find what I was looking for :(

I tried the different versions of the tokens related to unsubscribe/opt out but no joy.

Cheers

# Answer
> 1 votes
The problem with the `{action.optOutUrl}` token is that generates a url which is linked to a send mass mailing.

When CiviRules sends an e-mail it is not a mass mailing but an inidvidual one. Send to one specific contact at the time.

I could understand that you want some sort of link to a profile/optout page. One way to do that is probably create a profile page and link to that page from within the e-mail you send from CiviRules.

Did you solve the issue yourself? If so how?

---
Tags: civimail, civirules
---


# Question
Title: Where can I find the Release Schedule for CiviCRM?
I know there are regular releases of new versions, but when are they?

# Answer
> 3 votes
Releases are generally the first Wednesday of each month.

The testing period for the next release starts when the current release is published.

The release dates and testing periods are recorded in gitlab

---
Tags: release
---


title: cron setting in cPanel error

text:
# Question
Title: cron setting in cPanel error
I use wordpress 4.9.6 and civiCRM 5.1.2 for wordpress in my cPanel: string command:

https://mysite/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=username&pass=password=curl '\[string site-key\]'

message mail: You need to send a valid key to execute this file. Why my key it's not valid? I took the key in cvicrm.settings.php Thanks

# Answer
> 3 votes
The cron url seem to be wrong, it should have been

```
https://mysite/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=<username>&pass=<password>&key=<site-key>

```

# Answer
> 0 votes
The administrator manual has a section on how to setup the cron command. https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cron

---
Tags: wordpress, cron
---


# Question
Title: How do I move a contribution from one contact to another?
The site admin accidentally assigned an Event payment to himself - how do I move the contribution to the correct contact? I understand that insofar as it's an event, it's not as simple as changing the contribution contact ID in phpMyAdmin.

I would think this would be a common request - any suggestions? Thanks in advance!

# Answer
This biz.lcdservices.movecontrib extension should do what you need but it has not been through the extension review process - use with caution.

> CiviCRM extension to support moving a contribution from one contact to another. This can be done through the contact's contribution tab or through a Find Contributions search result action.
> 5 votes

# Answer
There are a few ways to correct this:

1. Delete the contribition and event signup and create a new record
2. Indeed change the contact\_id in the database, you have to do this in every table which holds data for this contribution (I dont know which tables you have to check).
3. Use the extension mentioned by Aiden

Nonetheless to say that the safest one is option 1.
> 2 votes

---
Tags: civievent, civicontribute
---


# Question
Title: Gravity Forms integration with CiviCRM - AutoFill contact field
I have CiviCRM and Gravity form both installed on my Wordpress website. I also bought the CiviCRM + Gravity Form plugin that integrate them together. I want to see how will I be able to use CiviCRM database to autofill the contact information after he logs into the website. For example I have a user who wants to fill out this application, and he already has a WP username and password. So when he logs in, I want this form to autofill his contact information (prefix, FirstName, LastName, Email, phone number, and the full address). Obviously, it should be getting this information from his CiviCRM database.

# Answer
If you paid for Gravity Form-CiviCRM integration, I would contact the authors for support.

Meanwhile, most of the community uses Caldera Form with Caldera Form-CiviCRM integration. I know this feature exists with Caldera Form-CiviCRM but haven't used Gravity Form integration.
> 4 votes

# Answer
To add, I had used the Gravity Forms integration quite a bit as of late 2017 and even if you get it to auto-fill, it will not update an existing record in CiviCRM. It's just not nearly as developed as Caldera Forms integration and would consider it stuck in the development phase.

So... you should just make it easy on yourself and use Caldera Forms.
> 3 votes

---
Tags: wordpress, forms, integration
---


# Question
Title: How to display only Time value in User Contact without the Current Date value
I have created a custom field selecting date type,selecting the date format and time.Actually I will need only Time field but the system doesn't alow to create custom field of type date, without selecting a date format and later in webforms I selected Time widget. In webform it is displayed as time field only But after the user submits the webform, In civicrm contact current date is also displayed with the time(screenshot)and How to get only the Time value in civicrm?I need this field for time of birth of the user.  Any help?

# Answer
> 3 votes
Since you are using date field it won't allow you to store only time. One option would be to use custom field of type text to only store time or use date field to store DOB with time.

HTH

Pradeep

# Answer
> 0 votes
You would need to create a custom field (type = textfield) to store only time.

---
Tags: custom-fields, webform-civicrm
---


# Question
Title: How do I process a refund for a credit card payment via iATS?
I have a member who accidentally bought two memberships and there is no clear way to just refund one of the amounts. Seems like a relatively simple task that should be more intuitive.

# Answer
> 6 votes
You will need to initiate refund at iATS gateway and then change the contribution status to refunded in CiviCRM.

HTH

Pradeep

# Answer
> 4 votes
We don’t support automated refunds to iATS Payments via CiviCRM at this point; and in fact we recommend that organizations configure their iATS Payments subaccounts 80, 81, etc such that they don’t have refund capabilities. Imagine a disgruntled employee scenario or a hack where people could select all / refund all;

In addition to security concerns - there usually are processes/approvals involved in refunds as well as business logic: should the membership or event registration be canceled or an already issued tax receipt be revoked, etc.

So best to ask user with 01 access to iATSPayments to process the refund; then record it in CiviCRM; most orgs I work with record it as a separate contribution of a negative amount; you could also try change the status of the original contribution to Refunded - but then double check that everything is working properly re: financial transaction/reports you may or may not use.

# Answer
> -2 votes
@Dylan - Just edit the contribution which you wanted to refund and set the contribution status to Refunded, then update the contribution

Also please make a refund against your Payment processor manually

I guess this helps !!!

---
Tags: contributions, iats
---


# Question
Title: How to find out about changes in the latest Release Candidate?
We would like to help test the monthly CiviCRM Release Candidate (RC) versions to contribute to more reliable releases. I found out the RC are published here along with the stable releases, so e.g. when CiviCRM 5.2.0 is released, it's accompanied by a RC for 5.3.0.

Now, in order to do focused and meaningful testing, we need to find out which changes went into the Release Candidate so we know which functionalities we should scrutinize most. Where can we get that information?

# Answer
This is an excellent question. Before trying to answer, let me note a bit of the context:

* When defining a test plan, several organizational and technical factors can weigh-in (e.g. perhaps certain extensions or use-cases are more important or more within your expertise; perhaps there's a rotation of responsibilities). The question focused on how to examine the change-list -- that's not the only factor, but it is an important one, so we should have a good answer.
* The RC releases and general releases are lined up on rolling monthly cycles. You can get more specifics by reading the schedule of releases. I usually think about the schedule in reverse (from the release date). For example, `v5.3.0` will be released at the start of July. The testing period for the RC (`v5.3.beta1`) is the previous month, June. The development period for `v5.3.alpha1` is the month before that, May.
* CiviCRM development is managed in Git/Github -- this is where changes are submitted and reviewed. Most reports about changes are derived from this data.
* In a typical monthly cycle, there are 80-150 accepted proposals (aka "PR"s or "pull-requests").

There is no one perfect way to list changes during the RC period, but there are a few tools/techniques available.

**Release Notes**: This is a curated document (usually written by Andrew Hunt and Alice Frumin).

**Github PR Queue**: All changes are proposed in Github by filing a "pull request" (PR).

* **Good**:
    + The full list is available when you want it, and it can be loaded in a web-browser.
* **Bad**:
    + The filter options aren't good for your use-case. You need to try a few different filters.
    + You may need to check multiple repos (`civicrm-core` is the main one; but sometimes interesting things happen in `civicrm-packages`, `civicrm-drupal`, `civicrm-wordpress`, `civicrm-backdrop`, `civicrm-joomla`).
* **Examples**:
* **Comments**:
    + We have an open issue to improve the infrastructure so that it's easier to filter Github data based the target version ("Milestone").

**Git**: Every individual change and every PR approval is available in the `git` database.

* **Good**:
    + This is the most accurate and flexible way to filter a change list. It is always up-to-date.
* **Bad**:
    + This requires more technical proficiency -- e.g. understanding `git` and the Unix CLI.
    + The text in git is written by many different developers. The text varies a lot in terms of length/language/quality.

This is more powerful and more technical, so I want to give a longer discussion of examples.

Git allows you to display developer notes over a range of versions. For example, when studying v5.3, you might to view notes after `5.2` and before `5.3`. This range is called `5.2..5.3` -- or, more specifically, `origin/5.2..origin/5.3`.

You can review developer notes for the range:

```
# Get a list of all developer notes.
git log origin/5.2..origin/5.3

```

Additionally, you can filter based on the affected code/subsystem.

```
# Get a list of all developer notes relevant to the table definitions
git log origin/5.2..origin/5.3 -- xml/schema/

# Get a list of all developer notes relevant to the DB upgrade steps
git log origin/5.2..origin/5.3 -- CRM/Upgrade/

# Get a list of all developer notes relevant to the "Financial" subsystem
git log origin/5.2..origin/5.3 -- CRM/Financial templates/CRM/Financial xml/schema/Financial

# Get a list of all developer notes relevant to the APIv3 framework
git log origin/5.2..origin/5.3 api/ CRM/Utils/API/ Civi/API/

```

All those examples use `git log` to show developer notes, but the same filters (by range and by folder) can produce other types of output. Compare:

```
# Get a list of developer notes for a folder (as above)
git log origin/5.2..origin/5.3 -- CRM/Upgrade/

# Get the same list and display it in a GUI tool (on local Linux/OSX workstation)
gitk origin/5.2..origin/5.3 -- CRM/Upgrade/

# Get the same list and display in short, one-line, summary format
git log --oneline origin/5.2..origin/5.3 -- CRM/Upgrade/

# Get the same list and include the relevant code changes
git log -p origin/5.2..origin/5.3 -- CRM/Upgrade/

# Get cumulative diff reflecting all those changes
git diff origin/5.2..origin/5.3 -- CRM/Upgrade/

```

If you're a CLI guru, then you can do further filtering. This is usually easiest with the `--oneline` format.

```
# Get a summary list which identifies the approved pull requests
git log origin/5.2..origin/5.3 --oneline | grep 'Merge pull'

# As above, but only show the PR#
git log origin/5.2..origin/5.3 --oneline | grep 'Merge pull' | awk '{print $5}'

# As above, but show the URL for each PR
git log origin/5.2..origin/5.3 --oneline | grep 'Merge pull' | awk '{print $5}' | sed 's;#;https://github.com/civicrm/civicrm-core/pull/;'

```

Of course, there may be other tools, but that's the one I use on a day-to-day basis to examine change history.

(**Update**) If this kind of reporting is useful on a regular basis, then you might want to put these commands in a `bash` script -- then you can quickly re-run the same report. Here is an example of a custom report.
> 9 votes

---
Tags: issues, testing, release
---


# Question
Title: Downgrade 4.7.29 to the latest LTS 4.6.37 - is it possible?
I've been asked recently *\[thanks to this post-https://civicrm.org/blog/jackrabbithanna/why-civicrm-long-term-support-lts-is-important \]* about switching to the latest LTS, which is 4.6.37, from 4.7.29.

The first (and only) attempt fails right at the *"your database doesn't seem to have civicrm\_settings table"* message.

So, any way to downgrade (or any arguments for not to?). It updates easily to the latest 5.2., but "LTS is LTS". Thanks!

# Answer
> 6 votes
Is it possible? - Probably, with a lot of time and skill.

In most releases, there are changes to the database structure or table content determined by the files under CRM/Upgrade. To revert back to a previous version you could in principle work through all the updates between your current version and the one you want to go back to and reverse each change in your database. So if a table had a column added, you would need to remove it etc. If a column was dropped, you'll have a harder time adding it back as you may not have the right values.

A `git diff` to show the differences in CRM/Upgrade runs to nearly 10,000 lines (depending on what options you use), so you would have a lot to work through!

Upgrading is regarded as a one-way process. If you do have the time and skills to successfully revert, I'd suggest that is more beneficially put to use in fixing any issues you find in the latest release.

# Answer
> 2 votes
If you really - really - want to get to 4.6.x create a new instance and migrate your data from the 4.7.x to the 4.6.x as you would when coming from any other database/CRM;

---
Tags: lts
---


title: Added credit card not showing up

text:
# Question
Title: Added credit card not showing up
I recently discovered that our payment processor does in fact accept a credit cared type that wasn't enabled before. I went to Administer \> CiviContribute \> Accepted Credit Cards and enabled the card (Discover). Then I cleared caches and CiviCRM caches but the credit card button isn't showing up. We are using Authorize.net.

In the screenshot below, you can see that it still only lists Visa, MasterCard, and American Express.

CiviCRM 5.0.0

Update: Strangely, on my test site, it works just fine on 5.1.2 so when I upgrade production tonight, the issue might just go away.

# Answer
Looks like the issue was unrelated to the version of CRM I was running. The payment processor settings also needed to be edited to include Discover, after adding it to the list of accepted credit cards; Administer \> CiviContribute \> Payment Processors. After I cleared everything in the `sites/default/files/civicrm/templates_c` directory, I was able to see the settings to turn it on. Oop!
> 2 votes

---
Tags: civicontribute, drupal, payment
---


title: CRON RUNNING OK?

text:
# Question
Title: CRON RUNNING OK?
*I write for problem "cron not running"*
I use wordpress 4.9.6 and civiCRM 5.1.2 **Perhaps no quotation mark is required:** wget -O -q -t 1 https://my-site/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=my-name&pass=my-pass&key=my-site-key
and above all: civiCRM 5.1.2 requires php 7.0 or higher. Perhaps my hosting service solved the problem by entering PHP version 7.1.16 Screenshot by civi page system status

# Answer
> 0 votes
The requirements for CiviCRM are php 5.5 or greater for version 5.1.2 https://docs.civicrm.org/sysadmin/en/latest/requirements/#php-version

If you hosting company had an older version upgrading to 7.1 would have solved that issue.

---
Tags: cron
---


# Question
Title: Can I export full database and import it in a fresh newer CiviCRM version?
I am experiencing difficulties during CiviCRM upgrade from 4.7.14 to 4.7.31 or 5.1, namely, fields like **contact.birth\_date** get broken. (More: DB Error after upgrading 4.7.x to 5.1 (Drupal))

I have noticed that during CiviCRM version update, there is a process of sequential updates that seem to also include database updates.

I wonder, if it is possible to export full database and re-import it in a newer version fresh CiviCRM installation?

# Answer
> 4 votes
Aivars, If the problem you facing is something related to report then i would suggest to fix the report rather wasting time exporting-importing data/structure from 2 different instances. The problem you facing has nothing to do with db structure. The error in report might be

1. Any installed extension might be conflicting with report code, so you can probably try after disabling/Uninstalling each extension.
2. Try creating new report from template, sometimes the form values stored in db for saved reports might have values that are missing/renamed in newwer version.

If you still willing to give a try for exporting-importing data/structure then here is a way how you can do it. The doc is pretty old so you will to need to manipulate with the version you trying.

HTH

Pradeep

# Answer
> 0 votes
Yes you can export database and after importing in the new installation, just run civicrm upgrade script: `BASE_URL/civicrm/upgrade?reset=1` that will update your database.

---
Tags: import, database, export, upgrade
---


# Question
Title: How to remove CIviCRM from menu for some roles
We have a group of users who have privileged, but very limited, access to functions on our website. Chiefly, they are able to add blogs. That's about it. We do not want them being able to go in and access the CiviCRM. The list of CiviCRM-related privileges are appropriate and everything works beautifully except one piece I am stuck on.

In my current design, the blogger users use the same admin menu, which only shows what they are given permission to see with the exception of a link to the CiviCRM. Since they don't have access to the CiviCRM backend, the link just renders an error. It's a dead link. How can I get it to disappear for this type of user?

I am using a Drupal module called admin\_menu\_toolbar without any customizations, however, the problem persists using the default `toolbar` also.

Drupal 7.59 CiviCRM 5.1.2

# Answer
> 1 votes
I typically take it out of the black toolbar menu (disable it) and then use shortcut-per-role to add a CiviCRM menu option to users with certain roles (i.e. in the grey toolbar).

# Answer
> 1 votes
You can use `hook_menu_alter` and hide/remove main `civicrm` menu item by check logged in user role through $user variable.

Something like this:

```
function hook_menu_alter(){

   global $user;
   if (in_array('ROLE NAME', $user->roles)) {
       //do stuff here
   }
}

```

# Answer
> 0 votes
Did you had a look at the Menu per Role module?

I have no experience with that module but it sounds like the module which could solve your problem.

---
Tags: drupal, menu
---


# Question
Title: "Print selected rows" option missing in Event Participant listing dropdown actions
After a recent upgrade from 4.7.29 to 5.2.1 (Joomla) I am experiencing the following problem:

After doing an Events/Find Participants search and selecting some or all participants, the "Print selected rows" option in no longer appearing in the Actions dropdown.

An Advanced Search when displaying results as Event Participants also is missing this option. The option does appear when results are displayed as Contacts.

I have verified the same behavior on dmaster.demo (running 5.4.alpha1).

# Answer
This is a core bug introduced during refactoring of task action. I have submitted core PR at https://github.com/civicrm/civicrm-core/pull/12310 . Can you please and if possible comment on PR your test results.

Issue logged at https://lab.civicrm.org/dev/core/issues/185

Thanks

Pradeep
> 4 votes

# Answer
Checking on some older systems I have, it was present in 4.7.27 and not in 4.7.31 so it seems to have disappeared somewhere between 4.7.29 and 4.7.31. Please log an issue at https://lab.civicrm.org/dev/core/issues
> 0 votes

---
Tags: civievent, advanced-search
---


# Question
Title: Disable Inline Editing of Fields in Profile Form
I have created a profile where authenticated members can edit some custom fields which are part of a multivalue fieldset that I created. Everything works fine - the links to view, edit and delete all work ok. However, on the profile listings page itself the inline editing feature is not working for dropdown list custom fields, only for text and text area fields. When a user clicks on one of the dropdown fields, it simply dissappears and throws a jQuery error:

```
jquery.crmEditable.js:19 Uncaught TypeError: Cannot read property 'id' of undefined
    at n.fn.init.$.fn.crmEditableEntity (jquery.crmEditable.js:19)
    at HTMLDivElement.getData (jquery.crmEditable.js:204)
    at HTMLDivElement.<anonymous> (jquery.jeditable.min.js:17)
    at HTMLDivElement.dispatch (jquery.min.js?p9n09n:3)
    at HTMLDivElement.r.handle (jquery.min.js?p9n09n:3)

```

Is it possible to disable completely the inline editing for that profile form? Or perhaps for authenticated users? They can still edit the record by clicking on the edit button.

I am using CiviCRM 4.7.28 with Drupal 7.59.

# Answer
It looks like this was a bug in CiviCRM. I have written a fix and submitted a pull-request for review. Your testing and feedback can help expedite the review process to get it accepted into the codebase.

https://github.com/civicrm/civicrm-core/pull/12312
> 2 votes

# Answer
In my opinion, fixing the bug would be better than working around it. Are you able to reproduce the issue on a demo site? If so you could file a bug report and we could look into it.
> 0 votes

---
Tags: profile, jquery
---


# Question
Title: ISSUE upgrading CiviCRM 4.6 to 4.7 (or 5.1) in Wordpress (comes from a Drupal multisite)
we are trying to upgrade a CiviCRM 4.6.15 on Wordpress that comes from a multisite Drupal installation. This on WordPress is on a different server, but with the same DNS and Admin name. It works correctly but...

...if we try to upgrade to CiviCRM 4.7 (or 5.1) the procedure starts but does not go beyond a "dead screen" with a Retry & Skip button that do not work.

We fear that there were problems with exporting the DB from Drupal multisite. Please, where should we look for the error?

Attached the log file: https://pastebin.com/65fnAgMG

Thanks in advance for those who can help us.

> > UPDATE:

1) as our SysAdmin (user3225453) replied, we've tried to follow Jaap's procedure below, but it's not working.

2) However this activity and the next Jaap' comment helped us to read better the LOGs:

the problem (if does not concern "not imported custom fields" as suspected by Jaap) could also be related to "PROFILE" (aka: "UF\_Group", which are also found in the LOG)

Do you have any idea? what about if we delete all profiles from the previous installation and try a new update?

Thx.

# Answer
> 2 votes
we were able to update CiviCRM from ver. 4.6.18 to version 5.2.1! I will tell you below how we solved the problem:

a) we realized that we had 3 extensions (CiviVolunteer + Angular + CiviRules) that we did not use. CiviRules, in particular, needed updates (a Yellow Warning said us that it was necessary to update the DB, but the relative link did not work);

b) then we unistalled all the extensions and canceled the relative permissions in Wordpress Access Controll.

c) we cleaned up and verified that no traces were left.

The upgrade was successful.

It must be said that we had installed the three extensions for testing purposes, but if they were in production ... :(

# Answer
> 1 votes
Without seeing the log files or the error message. My guess is that has to do with exporting the database and importing it. When you export a database mysql adds 'DEFINER=...' to triggers. That definer is the database user in your old database, when you import the database it all goes fine, till the database trigger gets fired.

To fix this do the following:

1. export the database from your new site
2. If your are on on linux run the following command: `sed -i 's/DEFINER=[^*]*\*/\*/g' mydump.sql` This will remove the definer statements from the dump.
3. Import the database again

For step 2 see https://stackoverflow.com/a/24613430/3733632

# Answer
> 0 votes
It seems the excellent answer from @Jaap\_Jansma will solve the issue with the DB import. The missing field error which occurs is due to a missing field which is part of the multilingual schema.

As the issue is with a missing `frontend_title` it would appear that your CiviCRM instance is running in "multilingual" mode. Can you run the following command to rebuild the multilingual schema (replacing "en\_US","fr\_CA" with the values for the enabled languages on your CiviCRM instance. *Pick the right command for the CMS you are using.*

# Drupal 7

**Requires DruSH**

`drush php-eval 'civicrm_initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'`

# Drupal 8

**Requires DruSH**

`drush php-eval '\Drupal::service('civicrm')->initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'`

# WordPress

**Requires WP-CLI**

`wp eval 'civicrm_initialize(); CRM_Core_I18n_Schema::rebuildMultilingualSchema(["en_US","fr_CA"], NULL);'`

*Source/Discussion/More Info:* https://gist.github.com/mlutfy/647e6325a09079e4f08f273af64900d9

---
Tags: upgrade, 4.7, 4.6
---


# Question
Title: How to automatically remove a contact from specific group, if end date is added to specific relationship
If end date is added to relationship,the contact should be automatically removed from the specific group. How this can be accomplished?Any suggestions?

# Answer
> 3 votes
You can use civicrm "Smart Group" option for that purpose. Like this:

Go to Contact Advanced search, set the relationship type you want as a filter and other filters if you want, like contact type, etc.

After search is complete, select the `All X records` radio option in "Select Records" field. Then you in `Actions` dropdown menu `Create Smart Group`. Smartgroup automatically updates its contacts list based on the criteria you had set.

Hope this helps.

# Answer
> 2 votes
If smart groups don't do what you need then you could also remove them from a static group with CiviRules

---
Tags: groups, relationships, hooks
---


title: Parse error just appeared

text:
# Question
Title: Parse error just appeared
Our volunteer group uses Civicrm. It runs under Drupal. We host with ..(cough cough) Godaddy. Recently their Cpanel automatically switched us from PHP 5.4 to 7 and our Civicrm 4.7.7 crashed with errors.

To cut a long story short after their techs told us it was a malicious attack, and we went into melt down changing passwords etc, we find it was simply the PHP version change.

So back on topic, we had our Civi working fine under 5.4php and after the crash we went back from PHP 7 to 5.4. Now just one of our reports throws an error:

**Parse error: syntax error, unexpected 'class' (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or '{' or '$' in at line 304**

Here is the code around line 304

), 'civicrm\_membership' =\> array( 'dao' =\> CRM\_Member\_DAO\_Membership::class, 'fields' =\> array( 'membership\_status' =\> array( 'title' =\> ts('Membership Status'), 'name' =\> 'status\_id', 'default' =\> TRUE,

This is line 304 specifically: **'dao' =\> CRM\_Member\_DAO\_Membership::class,**

After doing some reading i found a statement that the use of the word class in php is a reserved word and shouldn't be used. Not really sure what that means. However Our report that was working no longer works.

Am i missing maybe a duplicate here or is it something more than i can handle?

Cheers and Gday from Australia

# Answer
> 3 votes
You are using quite older version of CiviCRM, I would recommend you to upgrade CiviCRM to 4.7.31 or 5.2.1 rather fixing core code to handle php7. The newer version does support php7. And also since 4.7.7 there has been many security releases(since you had malicious attack) and includes many fixes.

HTH

Pradeep

---
Tags: civireport
---


# Question
Title: Create an activity when a specific profile is submitted?
I'm sending out a profile to contacts with a checksum - they are not logged in when they submit it. Can i create an activity for that contact when the profile form is submitted? So far i've run into permissions problems - i'm probably not using the API correctly.

# Answer
> 3 votes
Yes, you can CiviRules extension to create activity when a profile is submitted. Or you can write a extension to use post hook for 'Profile' Object and then use Activity create api to create Activity(Note: you might need to pass check\_permission to FALSE in api params to bypass permission)

HTH

Pradeep

# Answer
> 1 votes
Drupal sites could do this via webform\_civicrm. The module works with links using checksums.

---
Tags: api, profile, activities
---


title: PHP Fatal Error on Custom Report

text:
# Question
Title: PHP Fatal Error on Custom Report
**Background** We have had Civicrm running for two years. last week a malicious attack occurred. We had to implement a back up copy taken of our crm on 12th June 2018. All is working except for a custom report called Residential Communities Report.

**Issue** When clicking on Membership Reports then clicking on Residential Communities Report it throws to a HTTP 500 Error. When looking at the error log it shows the following:

\[17-Jun-2018 08:51:09 Australia/Sydney\] PHP Fatal error: require\_once(): Failed opening required 'CRM/Report/Form/Contact/Residential.php' (include\_path='/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/uk.co.vedaconsulting.membershipchurnchart-master/:/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/uk.co.vedaconsulting.outlookapi-master/:/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/uk.org.futurefirst.networks.civipoints-1.0/uk.org.futurefirst.networks.civipoints-1.0/:/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/org.civicrm.module.cividiscount/:/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/eu.tttp.civisualize/:/home/gazzafm/public\_html/crm/sites/default/files/civicrm/ext/nz.co.fuzion.extendedreport/:.:/home/gazzafm/public\_html/crm/sites/all/modules/civicrm:/home/gazzafm/public\_html/crm/sites/all/modules/civicrm/packages:.:/home/gazzafm/public\_html/crm/sites/all/modules/civicrm:/home/gazzafm/public\_html/crm/sites/all/modules/civicrm/packages:/home/gazzafm/public\_html/crm/sites/all/modules/c in /home/gazzafm/public\_html/crm/sites/all/modules/civicrm/CRM/Core/Controller.php on line 451

A lot of the error seems to also include extensions. We have checked those extensions and they are all working. Not sure why they are included in the error log.

Im including Line 451 from the Controller.php for reference here:

require\_once str\_replace('\_', DIRECTORY\_SEPARATOR, $className) . '.php';

Im not certain why this one report is causing an error. We have checked the paths and the report is registered.

Any ideas would help. I have also included the code around the line 451 if that also helps:

```
  $ext = CRM_Extension_System::singleton()->getMapper();
  if ($ext->isExtensionClass($className)) {
    require_once $ext->classToPath($className);
  }
  else {
    require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
  }
  $$stateName = new $className($stateMachine->find($className), $action, 'post', $formName);
  if ($title) {
    $$stateName->setTitle($title);
  }
  if ($options) {
    $$stateName->setOptions($options);
  }
  if (property_exists($$stateName, 'urlPath') && isset($_GET[CRM_Core_Config::singleton()->userFrameworkURLVar])) {
    $$stateName->urlPath = explode('/', $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar]);
  }
  $this->addPage($$stateName);
  $this->addAction($stateName, new HTML_QuickForm_Action_Direct());

  //CRM-6342 -we need kill the reference here,
  //as we have deprecated reference object creation.
  unset($$stateName);

```

# Answer
> 1 votes
You state that the *Residential Communities Report* is a custom report. And, indeed, I cannot find it in the list with standard reports. Custom reports can be installed in two ways.

* In an extension. You could check if all your extensions are restored and enabled.
* It is put in the *Custom PHP directory*, that can be configured using `civicrm/admin/setting/path` . Check this value. Maybe you restored on another file location and this value is incorrect.

---
Tags: php, custom-reports
---


# Question
Title: What is the cause of Error: Call to undefined function civicrmVersion() in sparkpost_civicrm_check()
Drupal 7.59 Civi 5.1.2 PHP 7 MariaDB 10.1 Debian 9

If our users access "example.com/civicrm" without first logging into Drupal, they receive a generic white page with the message "Error The website encountered an unexpected error. Please try again later.", but also with a green drupal message saying "Log in successful for ...."

Upon refreshing the page, users can then access Civi normally.

Just one php error in the recent log messages:-

> Error: Call to undefined function civicrmVersion() in sparkpost\_civicrm\_check() (line 145 of /var/www/sites/default/files/civicrm/extensions/com.cividesk.email.sparkpost/sparkpost.php).

Could anyone advise the fix for this? Thanks!

# Answer
> 3 votes
I found this on the github issue list: https://github.com/cividesk/com.cividesk.email.sparkpost/pull/58/commits/69a0bdb17bb520334da7f472a2d7670b44da8071

Applied the commit and it has resolved the problem.

---
Tags: sparkpost, 5.1.0
---


# Question
Title: Can I create a Smart Group programatically?
I'm setting up our system to match up contacts with the geographical regions covered by our different chapters. I've gotten to the point of using the built in geocoding, along with polygon coordinates stored in a custom field for each chapter, to be able to create a relationship showing a contact "in the territory of" a chapter. I'll use hooks to create or remove the relationship if a contact address or chapter region changes.

I envisioned having multiple smart groups for each chapter - contacts who are "in the territory of" and members, or volunteers, or on the national mailing list, etc.

Is there a way to create smart groups via the API or DAO calls? It'd be ideal to create desired smart groups via a hook if a new chapter is added, rather than having to manually search on the desired parameters and create each group.

If not, maybe I'll create static groups from hooks, then have a cron job that syncs contacts to those groups. Basically implementing my own smart groups. Thoughts?

# Answer
> 7 votes
There's an example of creating a smart-group in v4.6's CRM\_Contact\_Form\_Task::createHiddenGroup() which calls CRM\_Contact\_BAO\_Group::createHiddenSmartGroup(). It should show the relevant fields/data-structures. There are a few details which would need to be adapted if used in another context:

* In `CRM_Contact_Form_Task::createHiddenGroup()`, it just passes through some existing `formValues`. This data-structure is a big array defining the search parameters. You can inspect example records in `civicrm_saved_search` to see what this looks like. I believe this corresponds to advanced-search/`CRM_Contact_BAO_Query`, but you'd need to investigate.
* In `CRM_Contact_BAO_Group::createHiddenSmartGroup()`, the title is hard-coded.
* In `CRM_Contact_BAO_Group::createHiddenSmartGroup()`, the `is_hidden` field defaults to `1`.

# Answer
> 2 votes
This can be done via the API.

Think of smart groups as a `Group` with an associated `SavedSearch`.

Step 1: Create a Saved Search by defining the fields `select_tables`, `where_tables`, and `where_clause`.

Step 2: Create a group and associate the SavedSearch you created above with the group using the `saved_search_id` field.

---
Tags: smartgroups
---


# Question
Title: Are extensions that work with CiviCRM 4.7 also compatible with 5.x?
Most of my extensions are marked as compatible with 4.7 but do not explicitly say they will work with 5.0, 5.1, etc. Can I safely upgrade CiviCRM and continue to use the extensions?

# Answer
Because 5.0 does not include breaking changes, it is considered equally compatible with 4.7 extensions. There is always minor risk of breakage when upgrading software, but 4.7 to 5.0 is not considered a major upgrade.

From https://lab.civicrm.org/dev/release/issues/1#note\_2843

> * In the 4.x series, tags mean the same as today. (Exact-match to version. An extension declaring 4.6 is not displayed for download on 4.7.)
> * In the 5.x series, tags imply forward compatibility. (An extension declaring 5.2 is displayed on 5.2, 5.3, etc. But not on 5.0.)
> * To bridge them, 4.7 is forward compatible with 5.0. (An extension declaring 4.7 is displayed on 4.7, 5.0, 5.1, etc.)
> * As today, a consumer sees the newest extensions that are compatible with their version.
> 5 votes

# Answer
It is difficult to answer your question without detailed knowledge of your system and the extensions that you have installed.

The best way to find out if there are any issues is to take a copy of your site and upgrade this in a test environment. I would recommend that you do this in any case before applying any updates to your system.
> 2 votes

---
Tags: extension, upgrade
---


# Question
Title: Event Fees not loading when registering in back-end
Recently upgraded a site to 5.2.1 in WordPress 4.9.6. When the user tries to register a event participant in the back-end the fee selections price set does not load after the event is selected. All works fine on front end pages and if you edit an existing registration you are able to change the fee selections.

Checked another site with the same setup and the results are the same.

The results are the same if you try from the contact record either using the register button or the submit CC payment with registration button.

Do not see anything in the CiviCRM logs.

Not sure where to look next. Any thoughts would be appreciated.

Thanks

# Answer
This is a core bug, I have created issue for this bug at https://lab.civicrm.org/dev/core/issues/189

I have submitted a fix for this at https://github.com/civicrm/civicrm-core/pull/12333 . Can you please QA by applying the patch manually to your instance?

Please comment your QA result on PR so that it will helpful to get merge quickly.

Thanks

Pradeep
> 4 votes

---
Tags: civievent, issues
---


# Question
Title: Does Contact Editor Extension work with Version 5.2.1?
I just upgraded to version 5.2.1 from 4.7.27. I tried using the contact editor extension to change a contact type but I get a "Page Not Found" error. As part of the upgrade, I switched to PHP version 7.1. I use CiviCRM with WordPress.

Does the Contact Editor extension work with 5.2.1?

# Answer
> 3 votes
I just identified the issue & fixed it & tagged another release of Contact Editor

# Answer
> 2 votes
Yes contact editor works on 5.2.1 - I don't think 7.1 is an issue. My guess is the issue is caching. Sometimes immediately post-upgrade there is a caching issue. You can use the api (e.g drush cvapi System.flush) or there is a place in the UI - not sure if they flush exactly the same things - or hit the url civicrm/menu/rebuild on your site

---
Tags: extension
---


# Question
Title: How do I sort the bookkeeping report by date?
How do I sort the bookkeeping report by date (descending)?

I have sorted by contribution ID but this isn't exactly by date and when you are looking for a transaction it is easy to assume that it hasn't been made when scanning by date, especially if it is on the next page.

Can export and sort the exported data, but this makes people think the report is not working.

It is #20 on the civicrm demo site dmaster.demo.civicrm.org/civicrm/report/instance/20

# Answer
> 1 votes
It may be worth trying Fuzion's Extended Report extension which offers other reports eg "Bookkeeping with extra fields "

---
Tags: reports
---


# Question
Title: Is there an easy way to have the summary fields for deductible contributions be based on calendar year?
I went to generate letters to our contributors telling them how much they donated in 2015 that was deductible for their taxes. I discovered that total deductible contributions for last year is based upon our FY which is Jul - Jun.

Clearly, that number is worthless to most individuals since most people base their taxes on calendar year.

So is there an easy way to get it to be based upon CY?

As I write this and think about it, I guess the best answer would be to include another summary field for just that or maybe for this year, last year and year before. Most of year we really don't care about contributions by CY, just for the tax reporting thing.

There are, of course, a couple of other ways, tokens for example, to get the number. The nice thing about the summary fields is the ability to use them in searches so we can say only get the people who donated more than a certain amount and to only get people who made tax deductible donations. (Too bad the search form doesn't have a deductible checkbox. One has to wade through all their financial types and pick the ones that are.)

# Answer
Pretty sure this is now available either in Summary Fields itself or via https://civicrm.org/extensions/joinerys-more-summary-fields
> 1 votes

# Answer
Check out our CDN TaxReceipts Extension - https://civicrm.org/extensions/cdn-tax-receipts

It has been written in conjunction with a Canadian BDO Tax Partner but the extension is used is other countries as well - some of its features include:

* single, aggregate and annual Tax Receipt/letter
* bulk receipting
* email, print and data issuing methods
* email tracked openings feature (know if your donors opened their PDF Tax Receipt/letter)
* handles is-deductible (at Financial type level)
* handles lineItems (some may be is-deductible; some may not)
* handles non-deductible amount field
* has hooks for developers such as: calculate additional non-deductible $ amount (for example to handle event expenses per ticket purchased)
* has a PDF template feature (used FPDI - print a stack of Tax receipts/letters your own template)
* has solid reports for audit - tracks re-receipting (issuing duplicates)
* and more!
> 0 votes

---
Tags: contributions, summaryfields
---


# Question
Title: Can't submit credit card payment after update to 5.2.1/5.2.2 (Joomla)
I upgraded to CiviCRM 5.2.1 (on Joomla 3.8.8) and can now no longer add credit card purchases for our customers. I used to be able to log in the Joomla admin, search for the user in CiviCRM, and add an event registration to fill out the details and credit card info. But now the credit card info section is not appearing.

Upon investigating the help docs, I see there should be a "Submit Credit Card Event Registration" button there, which isn't (and I don't recall there ever being one). Searching through SE, I found an old post from a few years ago that the Payment Processor might be the issue so I created a dummy one, made it active and now that button appears. But it only works for the dummy processor and not the one we've been using for a few years now (PayPal) and it also doesn't show the credit card section. All of this works fine on the frontend of the website. We just can't register customers for them on the backend because the credit card processing section of the page is now gone.

First I go to the contact's event tab.

Then I add a new event registration and get this:

There's obviously a big open space there where the credit card block is missing. On the first screenshot you can see what it looks like when I just register a participant to an event without payment (the first row where Fee Level and Amount are empty). The second row show a previous purchase that worked fine. If I try to view/edit registrations that were successful before the update, the credit card info is there:

This shows this was working correctly until recently. So how can I get this feature back?

I should add that in 5.2.2 it seems I can get a step further, but I can't edit the full credit card number, only the last 4 digits.

Why wouldn't I be able to add the full credit card number, expiration date, etc.?

# Answer
As per my knowledge CiviCRM for version \>= 4.6 never allowed to do offline credit card payment either for event registration or membership purchase or record of contribution for Paypal Standard payment processor or any other processor that is Website based gateway i.e payment information like credit or debit card not collected from CiviCRM forms. It does allow for payment processor like Paypal Express or Pro. Even i believe for Paypal standard CiviCRM doesn't show credit card section on online form. Adding paypal pro payment processor might be helpful.

Thanks

Pradeep
> 0 votes

# Answer
I thought I would see how far i could get with dmaster test site. I added a new Payment Processor using PayPal - Website Payments Standard and a fake email.

I went to a contact, tried "Submit Credit Card Event Registration" and saw the credit card fields which suggests this is working with the latest code.

If that suggests tings are working fine, then have you tried just opening the payment processor settings and resaving?
> 0 votes

# Answer
Pradeep has submitted a fix and 5.2.2 will be released shortly
> 0 votes

---
Tags: civievent, joomla, payment-processor
---


# Question
Title: Event -> Find Participants displays event id, not event name in event name field
Selecting Events -\> Find Participants under CiviCRM 5.1.2, Joomla 3.8.8, PHP 7.2.5 under IIS displays the event ID and not event name in the Event Name field. This is a bug introduced after 4.7.31. It may be relevant, but the CiviCRM menu drop downs also disappear.

4.7.31:

5.1.2:

I've tried looking at what has changed, but the obvious files aren't showing any such changes.

# Answer
This is related to a general issue with updating CiviCRM under Joomla in a non-US environment, where the views are not updating correctly. The error was only flagged up when I tried to create an event. This pointed me to the log file that then showed what the issue was.

I solved the issue by adding the following lines to the definition of, in our case, the view civicrm\_uf\_group\_en\_GB:

```
   `civicrm_uf_group`.`frontend_title_en_GB` AS `frontend_title`,
    `civicrm_uf_group`.`cancel_button_text_en_GB` AS `cancel_button_text`,
    `civicrm_uf_group`.`submit_button_text_en_GB` AS `submit_button_text`

```

It seems that the update process isn't applying that change. My knowledge of the update process isn't sufficient to work out how to do it automatically.
> 1 votes

---
Tags: civievent
---