# Question
Title: DB Error: no such field after attempt to upgrade from 4.7.14 to 4.7.19
I'm administrating an not-often-maintained site and seeing that 4.7.14 is reaching end-of-life, i attempted to upgrade it to 5.9.1 (a brainless reckless move).

The upgrade went as usual but stopped progressing at "\[info\] Running task: Begin Upgrade to 4.7.19" for many minutes. I refreshed to main CiviCRM page and it throws "DB Error: no such field"

A look at the logs show that the error existed before the attempted upgrade.

```
    Jan 26 14:56:11  [info] $Fatal Error Details = Array
    (
        [callback] => Array
            (
                [0] => CRM_Core_Error
                [1] => exceptionHandler
            )

        [code] => -19
        [message] => DB Error: no such field
        [mode] => 16
        [debug_info] => SELECT a.id as `id`, a.is_active as `is_active`, a.group_type as `group_type`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.help_pre as `help_pre`, a.help_post as `help_post`, a.limit_listings_group_id as `limit_listings_group_id`, a.post_URL as `post_URL`, a.add_to_group_id as `add_to_group_id`, a.add_captcha as `add_captcha`, a.is_map as `is_map`, a.is_edit_link as `is_edit_link`, a.is_uf_link as `is_uf_link`, a.is_update_dupe as `is_update_dupe`, a.cancel_URL as `cancel_URL`, a.is_cms_user as `is_cms_user`, a.notify as `notify`, a.is_reserved as `is_reserved`, a.name as `name`, a.created_id as `created_id`, a.created_date as `created_date`, a.is_proximity_search as `is_proximity_search`, a.cancel_button_text as `cancel_button_text`, a.submit_button_text as `submit_button_text`, a.add_cancel_button as `add_cancel_button`
    FROM civicrm_uf_group a
    WHERE (a.name IN ("new_individual", "new_organization", "new_household")) AND (a.is_active = "1")
    LIMIT 25
    OFFSET 0
     [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']
        [type] => DB_Error
        [user_info] => SELECT a.id as `id`, a.is_active as `is_active`, a.group_type as `group_type`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.help_pre as `help_pre`, a.help_post as `help_post`, a.limit_listings_group_id as `limit_listings_group_id`, a.post_URL as `post_URL`, a.add_to_group_id as `add_to_group_id`, a.add_captcha as `add_captcha`, a.is_map as `is_map`, a.is_edit_link as `is_edit_link`, a.is_uf_link as `is_uf_link`, a.is_update_dupe as `is_update_dupe`, a.cancel_URL as `cancel_URL`, a.is_cms_user as `is_cms_user`, a.notify as `notify`, a.is_reserved as `is_reserved`, a.name as `name`, a.created_id as `created_id`, a.created_date as `created_date`, a.is_proximity_search as `is_proximity_search`, a.cancel_button_text as `cancel_button_text`, a.submit_button_text as `submit_button_text`, a.add_cancel_button as `add_cancel_button`
    FROM civicrm_uf_group a
    WHERE (a.name IN ("new_individual", "new_organization", "new_household")) AND (a.is_active = "1")
    LIMIT 25
    OFFSET 0
     [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']
        [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT a.id as `id`, a.is_active as `is_active`, a.group_type as `group_type`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.help_pre as `help_pre`, a.help_post as `help_post`, a.limit_listings_group_id as `limit_listings_group_id`, a.post_URL as `post_URL`, a.add_to_group_id as `add_to_group_id`, a.add_captcha as `add_captcha`, a.is_map as `is_map`, a.is_edit_link as `is_edit_link`, a.is_uf_link as `is_uf_link`, a.is_update_dupe as `is_update_dupe`, a.cancel_URL as `cancel_URL`, a.is_cms_user as `is_cms_user`, a.notify as `notify`, a.is_reserved as `is_reserved`, a.name as `name`, a.created_id as `created_id`, a.created_date as `created_date`, a.is_proximity_search as `is_proximity_search`, a.cancel_button_text as `cancel_button_text`, a.submit_button_text as `submit_button_text`, a.add_cancel_button as `add_cancel_button`
    FROM civicrm_uf_group a
    WHERE (a.name IN ("new_individual", "new_organization", "new_household")) AND (a.is_active = "1")
    LIMIT 25
    OFFSET 0
     [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']"]
    )

```

Followed by site specific logs, and my attempt to upgrade.

```
    Jan 26 14:56:14  [info] Running task: Cleanup old files
    Jan 26 14:56:16  [info] Running task: Begin Upgrade to 4.7.15
    //upgrades text in between.
    Jan 26 14:56:59  [info] Running task: Finish Upgrade DB to 4.7.18
    Jan 26 14:57:01  [info] Running task: Begin Upgrade to 4.7.19

    Jan 26 14:57:04  [info] $Fatal Error Details = Array
    (
        [callback] => Array
            (
                [0] => CRM_Core_Error
                [1] => handle
            )

        [code] => -19
        [message] => DB Error: no such field
        [mode] => 16
        [debug_info] => SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.name as civicrm_custom_field_name, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group.is_public as civicrm_custom_group_is_public
    FROM     civicrm_custom_group
    LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

    WHERE civicrm_custom_group.is_active = 1
      AND civicrm_custom_field.is_active = 1
      AND civicrm_custom_group.extends IN ('Individual', 'Contact')
    AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )
    ORDER BY civicrm_custom_group.weight,
             civicrm_custom_group.title,
             civicrm_custom_field.weight,
             civicrm_custom_field.label
     [nativecode=1054 ** Unknown column 'civicrm_custom_group.is_public' in 'field list']
        [type] => DB_Error
        [user_info] => SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.name as civicrm_custom_field_name, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group.is_public as civicrm_custom_group_is_public
    FROM     civicrm_custom_group
    LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

    WHERE civicrm_custom_group.is_active = 1
      AND civicrm_custom_field.is_active = 1
      AND civicrm_custom_group.extends IN ('Individual', 'Contact')
    AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )
    ORDER BY civicrm_custom_group.weight,
             civicrm_custom_group.title,
             civicrm_custom_field.weight,
             civicrm_custom_field.label
     [nativecode=1054 ** Unknown column 'civicrm_custom_group.is_public' in 'field list']
        [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.name as civicrm_custom_field_name, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple, civicrm_custom_group.is_public as civicrm_custom_group_is_public
    FROM     civicrm_custom_group
    LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

    WHERE civicrm_custom_group.is_active = 1
      AND civicrm_custom_field.is_active = 1
      AND civicrm_custom_group.extends IN ('Individual', 'Contact')
    AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )
    ORDER BY civicrm_custom_group.weight,
             civicrm_custom_group.title,
             civicrm_custom_field.weight,
             civicrm_custom_field.label
     [nativecode=1054 ** Unknown column 'civicrm_custom_group.is_public' in 'field list']"]
    )

```

civicrm\_uf\_group.frontend\_title exists in table and is all 'NULL' civicrm\_custom\_group.is\_public exists in table and is all '1' No triggers in both tables. Logging is disabled.

I will appreciate any help and suggestions on next steps to take. For example, how do i downgrade back to 4.7.14?

# Answer
Going on @Demerit 's lead, I found out that I had separated CiviCRM DB from Wordpress DB a while ago, but the current civicrm.settings.php does not point to the CiviCRM DB. Could be due to my negligence during one of the previous upgrades. Data is back on the plugin, I just need to figure out how to upgrade safely now. - DB is marked 5.3.1 for some reasons. I'll figure that out later.
> 2 votes

# Answer
I think you should try upgrading CiviCRM to 4.7.30 first and then to 5.9.1. The missing fields were added in 4.7.31 and there might be some updates to profile in 4.7.19 upgrade that is causing problem during upgrade.
> 1 votes

---
Tags: upgrade, error, 4.7.14
---


# Question
Title: CiviEvent: prevent registered users from changing their data
I'm running a CivicCRM installation od Drupal 7. I'm launching our first Event page with online registration - everything seems clear, except one thing: I'd like to prevent registered users from changing their data in the registration form. The form profile consists of Name, Surname and e-mail from Individual/Contact type, so registered users have these fields 'connected' with their crm record. Any change goes straight to the database and I'd like only anonymous users to edit these fields. Can it be done just by configuration (ACLs maybe?) or does it require a custom plugin?

# Answer
Take a look at the No Overwrite extension which prevents name changes on event registration forms.
> 4 votes

---
Tags: civievent, profile, forms
---


title: Invalid document file format - error

text:
# Question
Title: Invalid document file format - error
I can no longer upload docx or odt files to use as templates. Not sure when it happened but I'm running 5.6.0. I had uploaded files previously and even when downloading that same file and trying to upload again I get the error. Is it possibly a directory permissions issue? Confused... Not sure where to. Turning on debugging give no additional information. Thanks.

Attached is a screen shot of when I try to save and the

and a Link to the bare .docx (stripped tokens)

message template

# Answer
> 1 votes
Thank you for adding the screenshot - it makes the issue much clearer. I actually haven't used this feature before and it seems to be undocumented :( That said, I was able to use it successfully on my local install.

While this might be a bug you're seeing, I looked at the code and am suspecting a MIME misconfiguration in the website software settings. To help track down which it is, I recommend editing the file at `<civiroot>/CRM/Admin/Form/MessageTemplates.php`.

Find this line: `$errors['file_id'] = ts('Invalid document file format');`

Replace it with: `$errors['file_id'] = 'MIME type: ' . $files['file_id']['type'];`

The acceptable values are:

* docx: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
* odt: `application/vnd.oasis.opendocument.text`

If you're getting a different value, hopefully it will provide a helpful clue as to the problem. If not, please edit the question again to show the error you're getting.

# Answer
> 1 votes
Based on your comment on my other answer, the issue is that your web browser is setting the MIME type incorrectly to `application/octet-stream`, which basically means "unknown file type". While detailed answers exist on how browsers determine MIME type, the short answer is to see if you can isolate the problem to a particular operating system, browser, etc.

As a fallback, you can simply delete the line I suggested you modify in my other answer - it's very likely this will cause things to start working. However, this isn't a great long-term answer, if for no other reason than you'll need to apply the fix every time you upgrade.

---
Tags: templates
---


# Question
Title: Contact membership ID based on a pattern
Newbie question. I'm looking for a way to add a custom field to each contact that will be a unique membership ID but based on a pattern, eg. 2019-### etc. I'm using Civi with Drupal 7

# Answer
> 1 votes
I also used ContactID to hold membership ID for the same reason that a unique value is allocated by CiviCRM. There doesn't seem to me any standard way to have an autoincrement field in CiviCRM without doing some coding. You also have to think whether the membership ID should be in the membership record rather than the contact record, though because I had some historical data, I decided against this. To get the historical data in I created records for all the membership numbers up to the last one previously used, but tagged all that hadn't been used so that I could delete them all later. I think imported all these records and they were automatically allocated the matching contact id (fortunately I didn't have a membership 1 which was already allocated to the admin account. I then deleted the contacts for the numbers that hadn't been previously used. New contacts were autoincremented from the last one I had used. You might be able to do a trick to get your numbers starting 2019 etc, but that would mean creating a hell of a lot of records and then deleting them, so not sure its a sensible option, but you could try (maybe with just a 19 prefix, so you would be OK for the next 80 years).

I don't think that CiviRules has anything built in that will create an autoincrement field. Indeed I can't see something available off the shelf to set a custom field. I think you would need to write some code.

# Answer
> 1 votes
One way i could think of is to create a custom field on contacts, and use hook\_civicrm\_post hook using following conditions:

* $op = create
* $objectName = contact

You will get contact Id in $objectId variable, then you can use CiviCRM API to update custom field value based on whatever pattern+contactID you desire.

Thanks

# Answer
> 0 votes
I would check out the CiviCRM docs to create a custom field: https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/

We used the Contact ID for our membership ID's because they are automatically a unique ID. For something like 2019-### you would probably have to manual enter each or write something to do that. You could maybe use CiviRules to help.

---
Tags: civimember
---


# Question
Title: KC Finder - Uploading/browsing the images not working in CiviCRM 5.9.1
I am using CiviCRM 5.9.1 and Drupal 7.6

I am creating a new event. adding the image to it by using CKEditor. when I tried to browse images/ upload the image. The error is coming. Please refer to the screenshot for the error.

I followed the previous question regarding this KCFinder. I applied the available patch that is for civi 4.6. That one also didn't work.

I checked file permission and drupal uploading file permission. It is fine.

Please give suggestion how to solve this issue.

# Answer
It looks like you have two `civicrm.settings.php` files - or at least that `CIVICRM_DSN` is already defined. If you remove the extra `civicrm.settings.php` this problem should resolve itself.
> 0 votes

---
Tags: civievent, drupal, images, kcfinder, upload
---


# Question
Title: How do I suppress the "are you sure you want to leave this page" popup from contribution page
Where could I suppress the "are you sure you want to leave this page" popup when leaving a contribution page (e.g. donation) without actually proceeding with the contribution. I realize it may be there to prevent leaving the page accidentally mid-way through filling out the form but I actually think it's more annoying than helpful in the fraction of accidental cases. Also, I have a Facebook login on the page, which, when utilized, forces the page to reload and thus invokes the 'leave this page' popup. This is confusing to the user who wouldn't know they need to hit the "leave this page" button in order to get logged in (not to mention they'll actually stay on the page, hence the confusion).

This is on Joomla (3.4.4 w/ CiviCRM 4.6.9)

I'm assuming there's an `onbeforeunload` function - one appears in /administrator/components/com\_civicrm/civicrm/js/Common.js

The warning appears even when the user has not made any entries on the form. Shouldn't the warning only pop up when they do?

Thank you for any pointers.

# Answer
This happens when the built-in profile for user registration ("Name and Address" is the out-of-the-box title) is used on the contribution page. Swap it for another profile, and the pop-up does not appear. Replicated this on the Joomla CiviCRM demo site.
> 1 votes

# Answer
CiviCRM uses jQuery to watch form inputs and give a warning only if there are unsaved changes. You'll find the code for it in Common.js. When I try out a sample contribution page on the demo server it looks to be working correctly; if I open a contribution page, enter nothing and close the tab, I get no warning. But if I enter an amount and then try to leave it pops up the onbeforeunload message.

If you're up for it, debugging the `CRM.utils.initialValueChanged` function to find out *why* civi thinks the form has been changed when it hasn't would be helpful feedback for us improving the software.

Or you could just add a little javascript to your FB login button. If the existing markup looks like `<button type="submit">` then you could add to it so it looks like `<button type="submit" onclick="window.onbeforeunload = null;">`

But seriously, the debugging feedback would be helpful.
> 3 votes

# Answer
In case it's of use to others: I wanted to make the recurring donation checkbox ("I want to contribute this amount every month") true (checked) by default on a particular donation form. I used the following custom javascript to do it.

After setting the value to "checked" in javascript, the `.data('crm-initial-value', true)` code was necessary to prevent CiviCRM from complaining about unsaved changes when navigating to a different page.

```
<script>
CRM.$(function($) {
// make recurring contribution checkbox true by default
var r = $('#is_recur');
if (!r.length) { return; }
r.attr('checked', 'checked');
r.prop('defaultChecked', true);
r.prop('checked', true);
// necessary to tell Civi the default value has changed
r.data('crm-initial-value', true);
</script>

```
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Webform-CiviCRM recurring contributions Error?
When submitting a recurring contribution on a Webform, If I select recurring for 12 months (for example), Instead of the total amount being charged and scheduled for every month. The form divides my total amount by 12 and charges 1/12 of the amount every month. Then in Civi it records the total amount as 1/12 of the total amount but the non-deductible amount remains the actual total amount. See screenshot

# Answer
> 1 votes
Ad 1) installments: that’s not an error - that’s a feature! It allows you to extend the concept of recurring contributions to eg paying for an Event in installments (day care centre fees eg - $4000 -\> paid in 10 installments - monthly - $400/mo recurring contribution.

Ad 2) non\_deductible amount - I remember fixing that - will have to check if that bug has resurfaced.

PS - If you’re looking for a classic start recurring series -\> open-ended you can set installments = 0 (as per CiviCRM convention) - then the amount shown will be transacted monthly as is.

# Answer
> 0 votes
If you are looking a simple Radio Button option "Recurring Yes/No"

Here are the steps to do that *but you will loose the ability to auto-terminate the recurring contribution after X months*.

1. In the webform field for the Civi Installment, in Edit\>Properties a. add a 1 to the Key b. remove the Default 1
2. Create a new webform field that is Radio select
3. In the new field Key, paste the original Key (without the added 1 from the civi Installment field that you just edited).
4. In Options, just have Yes & No and below that you check "Customize Keys" Set Yes = 0 No = 1
5. Test leaving the original Civi Installment blank
6. If you have a successful recurring donation created, then delete the original Civi Installment field from your form.

---
Tags: webform-civicrm
---


# Question
Title: How to create a custom filter in CiviCRM manage event page?
How can I add a custom field (stored as a field in Drupal db) under Manage
Events page ,which will be displayed as dropdown.
Event Status with values **Pending** or **Approved**.

How can I alter the filters added as seen in the image?

# Answer
> 3 votes
I would create replica of Manage event using Drupal views with same columns and filters as of Manage event screen.

If you still want to use the same screen then use pageRun hook to manipulate results by generating query and creating results and assigning to template

```
$page->assign('rows', $manageEvent);

```

Cheers

Pradeep

# Answer
> 2 votes
Use buildform hook provided by civi in order to add a custom input field on the form. Use this field as a filter eg Event Status.

From the value that is posted from this form(`$_POST['event_status']`) - filter the result as mentioned by Pradeep using pageRun hook

---
Tags: civievent, drupal
---


title: Not adding longitude or latitude

text:
# Question
Title: Not adding longitude or latitude
Pulling my hair out a little! I'm trying to set up the mapping feature on CiviCRM. I've got a google API for the geocoding, I've enabled longitude/latitude/parsing in the localisation section, and I've got the geocoding scheduled task set to: geocode=1, and I've executed the task. I'm not getting any longitudes or latitudes in any of my contacts (it works if I add them manually). What am I missing? And does it matter all our contacts are based in the UK?

Cheers.

# Answer
> 5 votes
I worked it out! Many of my contacts weren't given a country (must have been forgotten in a profile). I checked what the difference was between the handful that were working and the lots which weren't and spotted the missing country - as soon asI updated the contacts that were missing a country it started finding the longitude and latitude. Thanks for the help!

# Answer
> 1 votes
Google needs a credit card on file I believe even if you don't exceed the monthly credit amount.

---
Tags: geocoding
---


# Question
Title: DB Error on contribution form unless signed in
On one of our contribution forms for users to sign up and pay for a membership, we are getting a DB Error. Here is a screenshot of the contribution form so you can see where they are urged to create an account.

Here is the error log message, where `test@example.com` is my test user, who submitted a transaction and created an account on the form. I used a fresh email address, just replaced it here:

```
[info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  209115 , 'test@example.com' ,  140637 )  [nativecode=1062 ** Duplicate entry 'test@example.com-1' for key 'UI_uf_name_domain_id']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  209115 , 'test@example.com' ,  140637 )  [nativecode=1062 ** Duplicate entry 'test@example.com-1' for key 'UI_uf_name_domain_id']
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  209115 , 'test@example.com' ,  140637 )  [nativecode=1062 ** Duplicate entry 'test@example.com-1' for key 'UI_uf_name_domain_id']"]
)

```

The transaction came into the CRM as Pending (Incomplete Transaction). I also processed a test donation, a contribution form that doesn't require the user to create an account, and I did not get an error, however, the transaction still came in as Pending (Incomplete Transaction).

I have recently upgraded to CiviCRM 5.9.0 and Drupal 7.63.

# Answer
From the error it looks like drupal username "test@example.com" already exists, when contribution form is submitted, it is trying to add a new drupal user and civicrm contact which is failing because of a duplicate.
> 0 votes

---
Tags: drupal, civicontribute
---


title: How do you use Apple Pay with CiviCRM?

text:
# Question
Title: How do you use Apple Pay with CiviCRM?
I've seen Apple Pay on CiviCRM contribution pages before, but I don't know how to go about setting it up. Does anyone know how it's done?

# Answer
You can use the stripe payment processor extension to handle stripe.

https://civicrm.org/extensions/stripe-payment-processor

But it only supports credit cards right now. The maintainer is hoping to upgrade it to Stripe v3 which should support Apple Pay and lots of other wallets as well.
> 2 votes

---
Tags: civicontribute, payment-processor
---


title: Unable to delete contacts permanently

text:
# Question
Title: Unable to delete contacts permanently
I have an org that has split into two. They already were working with two payment processors -\> we're all sorted out - contacts and contributions have been migrated over into the spin-off CiviCRM database.

What we can't do is permanently delete the Contacts that have been moved into the spin-off CiviCRM database, because "This contact(s) can not be permanently deleted because the contact record is linked to one or more live financial transactions. Deleting this contact would result in the loss of financial data".

And that's ok with us as we've got all that into their spin-off CiviCRM database now. In fact right now we have double the monies. Is there any way around this - via the GUI?

# Answer
> 6 votes
You can turn off this check by setting hidden setting `'allowPermDeleteFinancial'` to TRUE either in civicrm.settings.php or using api explorer

```
global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['allowPermDeleteFinancial'] = TRUE;

```

or

HTH

Pradeep

# Answer
> 1 votes
I think you need to delete the contributions associated with the contacts that you want to delete before you delete the contacts. If you have also copied those across to the spin-off site then that would also make sense.

---
Tags: contacts
---


# Question
Title: Custom report: how can I add a filter for a dbAlias field?
In a custom report -\> I've created a field

```
 'civicrm_contribution' => array(
    'dao' => 'CRM_Contribute_DAO_Contribution',
    'fields' => array(

```

...

```
         'amounts_ytd' => array(
           'title' => ts('Amount - YTD 2018'),
           'required' => TRUE,
           'dbAlias' => "SUM(CASE WHEN year(contribution_civireport.receive_date)=2018 THEN contribution_civireport.total_amount ELSE 0 END)",
         ),

```

This works nicely - it produces the correct total in the amounts\_ytd column.

How would I go about filtering on this amount - to e.g. find all contacts who have amounts\_ytd \> $100?

Under:

```
    'filters' => array(

```

What does this need to look like?

```
  'amounts_ytd' =>
     array('title' => ts('Aggregate amounts_ytd'),
       'operatorType' => CRM_Report_Form::OP_FLOAT,
       'type' => CRM_Utils_Type::T_FLOAT,
       '??'
     ),

```

# Answer
> 2 votes
Jake sent me this - posting it here for save keeping!

```
 'total_amount_sum' =>
    array('title' => ts('Aggregate Contribution Amount'),
      'type' => CRM_Report_Form::OP_INT,
      'dbAlias' => 'civicrm_contribution_amounts_ytd',
      'having' => TRUE,
    ),

```

# Answer
> 1 votes
I think you should use having clause rather where clause i.e skip the field in whereclause() and have it filter in having clause.

`SUM(CASE WHEN year(contribution_civireport.receive_date)=2018 THEN contribution_civireport.total_amount ELSE 0 END) > 0`

Other option would be to create a temporary table to insert the all the data grouping by sum and contact and then using the temporary table to retrieve the final result with where clause good eg will be Activity Detail report or Contribution Detail report.

HTH

Pradeep

---
Tags: civireport
---


# Question
Title: CiviEvents Confirmation email not being sent
Using CiviCRM 5.7.2, using Drupal 7.61.

We use CiviEvents and have registrations turned on and confirmation emails enabled. Over the last month a few users have reported not receiving confirmation emails and I was able to replicate this myself today.

Essentially, the user fills in their details and then get a 500 error and no confirmation screen or confirmation email. However their registration pulls through on the back-end (I can see they registered for the event on their user on CiviCRM and I see them as a registrant on CiviEvent). But even though this is pulling through, it's not triggering the confirmation email to be sent to the registrant.

It looks like this happens at random - has happened to about 4% of our recent registrants in the last month. It causes a lot of frustration on their end and a poor user experience so would love to work out why it happens and if there's anything I can do to fix this.

Let me know if you need any more information or if this isn't clear.

Cheers,

EDIT: It just happened again. User gets redirected to \[DOMAIN\].com/civicrm/event/register. This happens after the "Confirm your registration details" screen.

EDIT 2: These are the two errors I see in Drupal's Error Log

```
Warning: Unknown: Cannot call session save handler in a recursive manner in main() (line of ).

```

and

```
Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: /opt/alt/php71/var/lib/php/session) in main() (line of ).

```

I have no idea what this means, can anyone assist?

# Answer
> 1 votes
Went into php.ini and replaced the session.save\_path parameter from

```
/opt/alt/php71/var/lib/php/session

```

to

```
/path/to/your/homedir/tmp

```

And it looks like that's done the trick!

---
Tags: civievent, email, confirmation
---


title: Help adding an Action in CiviRules

text:
# Question
Title: Help adding an Action in CiviRules
I trying to add an Action in CiviRules. I am trying to follow the API add instructions.

Here is what I did 1. Copied the file org.civicoop.civirules/CRM/CivirulesActions/Activity/UpdateStatus.php (this looked like an easy edit to do what I wanted--update a field) and created a new file in org.civicoop.civirules/CRM/CivirulesActions/Contributions/UpdateInstallments.php

2. I edited the copied file (edits in bold)

\` * @license http://www.gnu.org/licenses/agpl-3.0.html \*/

**class CRM\_CivirulesActions\_Contribution\_UpdateInstallments** extends CRM\_CivirulesActions\_Generic\_Api {

/\** * Method to get the api entity to process in this CiviRule action * * @access protected * @abstract \*/ protected function getApiEntity() { return '**Contribution**'; }\`

But it does not show up in the Rules option list. I tried a cache clear. What am I doing wrong?

# Answer
There is documentation on how to add your own action here: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/.

I would recommend reading the documentation, it will give you a better understanding of what is required. And then copy and adapt as much as you like :-)

If you do not see it in the list of actions it is because you have copied the class, but not added a record to the civirule\_action table (from what you describe).
> 1 votes

---
Tags: civirules
---


title: Memberships in multiple currencies?

text:
# Question
Title: Memberships in multiple currencies?
I am working for an international NGO with memberships. They want to be able to sell memberships in USD, EUR and GBP. The contribution forms will deal with this for donations, etc. The contributions form will also switch the membership currency to the one give in the Amounts page, but the value is the value given in the Membership type. Logical enough, but the membership type seems to be tied only to the default currency. Is there a way to define a membership prices set or even a separate membership in another currency?

Keith

# Answer
There are many ways you can do this

1. Create contribution page and price set for each currency. Provide a list of contribution page to user and based on currency they can use the contribution page
2. Create contribution page and price set for each currency. Add currency field on each contribution page using buildform hook and on selection of currency load the respective contribution page.
3. Create a price set with radio field and have all the currency as options with same membership type. Using buildform or buildAmount hook change the amount or field label to include currency(not necessary if can add it price field option label). On submit of 1st page set currency in postProcess hook in $form so that right currency is set to send it to payment processor.

HTH

Pradeep
> 3 votes

---
Tags: civimember, currency
---


# Question
Title: Civi 5.9 not serving extension javascript in WP 5
TLDR EDIT: Civi getURL generated `<site>/civicrm/<resourcepath>?r=<key>` doesn't serve `<site>/<resourcepath>` Should the file be coming from civi with a key or not go through civi?

I have a fairly new LAMP machine with CiviCRM 5.9.1 installed in Wordpress 5.0.3 with the plugin installer. I am getting a 404 when a contribution page is trying to pull in civicrm\_stripe.js for the stripe payment processor.

I can load the file at `<site>/wp-content/uploads/civicrm/ext/com.drastikbydesign.stripe/js/civicrm_stripe.js` (where I probably should get a 404) but get a 404 on `<site>/civicrm/wp-content/uploads/civicrm/ext/com.drastikbydesign.stripe/js/civicrm_stripe.js?r=<key>`

Is there any way to see why the resource isn't being served?

# Answer
> 1 votes
Welcome to SE! Check your Extension Resource URL at `Administer > System Settings > Resource URL's`

A typical WP install would show the Extension Resource URL as `[civicrm.files]/ext` where `[civicrm.files]` is `https://example.org/wp-content/uploads/civicrm`

# Answer
> 2 votes
WordPress/CiviCRM can have trouble resolving tokens like `[civicrm.files]` if you have a symlink in your path.

If you're having resource URL issues, I recommend replacing the tokens with absolute paths (with no symlinks) in **Administer » System Settings » Directories** as well as checking **Administer » System Settings » Resource URLs** as Aidan suggests. It sounds like your `CIVICRM_UF_BASEURL` is set correctly in `civicrm.settings.php` but it never hurts to check.

A permanent solution for this is underway: See https://lab.civicrm.org/dev/core/issues/1497.

---
Tags: wordpress, extension, core
---


# Question
Title: VBO (Views Bulk Operations) - Bulk Operations field not showing in field list
Trying to use VBO in a view of CiviCRM contributions, but when I try to add the Bulk Operations field, it is not listed in the pop-up field list so can't be added.

The rest of the view works (ie can access contribution data), and VBO works if the view is based on eg Users.

What else is needed?

(Drupal 7)

# Answer
> 2 votes
1. Using VBO with CiviCRM views requires the CiviCRM Entity module, so make sure that is enabled.
2. CiviCRM Entity does not expose all CiviCRM entities as Drupal entities by default. Go to `admin/structure/civicrm-entity/settings` to enable the right entities - in this case, Contributions

(Thanks to @jackrabbithanna on chat: https://chat.civicrm.org/civicrm/pl/85qwezc5d3fo3jr4hxgafoyn4r)

---
Tags: drupal-views, civicrm-entity
---


# Question
Title: Error You do not have sufficient permission to transfer/cancel this participant
If "Allow self-service cancellation or transfer" is enabled on an event, there is a link to the event self-service page contained in the registration confirmation email. When a user clicks on this link, they receive the following message on our site:

"Error You do not have sufficient permission to transfer/cancel this participant."

My questions: Is there a permission which allows anonymous users following the link to self-service the registration? Or is this functionality only available to logged-in users?

# Answer
> 2 votes
Jason, Welcome to stackexchange. Sorry for the problem you facing. There is no specific permission required to cancel your registration and neither the user should be logged in. However the url should have correct parameter i.e contact checksum. eg

```
http://www.domain.org/civicrm/event/selfsvcupdate?reset=1&pid=53&cs=7f51ab615c6bdcb785d1947e122b1c14_1548964126_inf

```

If the cs is invalid then you will get above error. So please check if the url is correct and hopefully not encoded.

HTH

Pradeep

---
Tags: civievent, registration
---


# Question
Title: Add Email Follow Up to Meeting Completion
When completing a Meeting Activity, at the bottom where you can Schedule Follow-up, would it be possible to add Email to the "Schedule Follow-Up Activity". Thanks.

# Answer
Emails aren't usually editable so they might not make good scheduled activities. Two alternatives:

1. Use the scheduled reminders feature (https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/) to remind somebody to send the email at the future time, or to actually send the email, depending on what you want.
2. Add a new activity type called something like "send an email", and schedule that as the followup instead, just as a visual note.
> 1 votes

---
Tags: activity
---


# Question
Title: SMTP errors with "Thank You Letters - print or email" -- does this use CiviMail settings?
I'm on CiviCRM 5.9 on WordPress. We just did our first batch of year-end contribution summary letters, and ran into an issue when choosing the "Send emails where possible. Generate printable PDFs for contacts who cannot receive email" option. We have a total of about 550 letters/emails to send.

We're using G Suite as the SMTP server, and in looking at the logs, it looks like Google started rejecting the emails after about 100 or so had been sent. The resultant PDF of letters wound up with about 450 pages, including many contacts who do have email addresses (and therefore should have been sent an email).

Since this is my first time doing this and we don't send out any other bulk emails, I took at look at the CiviMail settings and they're all set to the defaults (0 across the board), which is I assume what caused the issue. But I wasn't sure if the specific "Thank You Letters" function actually used those settings or not.

For reference here's the error message in the logs:

`Jan 31 15:29:08 [info] Ignoring exception thrown by nullHandler: 10004, Failed to set sender: EMAIL_ADDRESS_HERE [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 421, response: 4.7.0 Try again later, closing connection. (MAIL) z7sm8172274pga.6 - gsmtp)]`

I verified the settings are correct, and I can send test emails from the settings page fine, but my guess is I triggered a block on the Google side, so I wanted to make sure that if I update the settings and try again that those actually apply to this particular task.

As for the actual settings for Google, I came across these: Questions About Mailer Settings - Suggested G Suite settings?

Are those good settings? Anyone else using G Suite as SMTP have any other advice on settings, particularly as relates to sending out Thank You letters?

Thanks!

# Answer
I think that this is probably a limitation in G Suite. I have certainly not been able to send more than about 100 messages at a time using the G Suite SMTP relay. I think the section on sending limits is relevant https://support.google.com/a/answer/2956491?hl=en
> 3 votes

---
Tags: civimail, g-suite
---


# Question
Title: How to add a radio button with the help of buildQuickForm()
Showing data in the form of radio buttons.

> Data

```
$data[$count++] = array(dao->id,dao->names);

```

Above code return an array of id and names which is retrieved from database.
I want to put this data as radio button. How to do that using buildQuickForm();

# Answer
> 3 votes
Its pretty simple to add it as a group of radio button, adding below snippet on how you can add (not tested)

```
    $choice = [];
    forach ($data as $id => $value) {
      $choice[$value[0]] = $form->createElement('radio', NULL, '', $value[1], $value[0]);
    }
    $form->addGroup($choice, 'element_name_of_radio_button', ts('label of radio button'));

```

HTH

Pradeep

---
Tags: extension, forms
---


# Question
Title: How to alter Event Dropdown values from Register Participant or New Event Registration Page?
On Register Particpant Page, I see list of all Events under Event dropdown
As per the requirement, I am using Recurring Entity to have repeat
events,so I need to hide repeat events and display only parent events
How can we alter the results in the Event dropdown

The Event dropdown has this form structure (from hook\_buildForm) When I add a condition and try to print variables inside it on New Participant Registration it does not show up.(probably since its entering )

```
 $apiRequest['entity'] == 'event'

/**
 * Implements hook_civicrm_apiWrappers
 */
function custom_changes_civicrm_apiWrappers(&$wrappers, $apiRequest) {

  if ($apiRequest['entity'] == 'event' ) {
    print_r('<pre>');
    print_r($apiRequest);
    print_r($wrappers);
    die('ed');
 }
}

```

On adding the code answered below

```
if ('CRM_Event_Form_Participant' == $formName) {
    $elementIndex = $form->_elementIndex['event_id'];
    $element = & $form->_elements[$elementIndex];
    $dataApiParams = json_decode($element->_attributes['data-api-params'], TRUE);
    $dataApiParams['params'] = ['parent_event_id' => ['IS NULL' => 1]];
    $element->_attributes['data-api-params'] = json_encode($dataApiParams);   }

```

I get an error (when I comment I don't get the error).

> Error: Call to undefined method stdClass::getName() in HTML\_QuickForm-\>accept() (line 1686 of csites\all\modules\civicrm\packages\HTML\QuickForm.php).

To fix that I actually went to QuickForm.php and added an if condition as seen below

```
if(method_exists($element,'getName')

```

Is that a correct method and if not , how can I debug that further based on the error log.

```
 function accept(&$renderer)
    {
        $renderer->startForm($this);
        foreach (array_keys($this->_elements) as $key) {
            $element =& $this->_elements[$key];
            if (method_exists($element,'getName')){
            $elementName = $element->getName();
            $required    = ($this->isElementRequired($elementName) && !$element->isFrozen());
            $error       = $this->getElementError($elementName);
            $element->accept($renderer, $required, $error);
            }
        }
        $renderer->finishForm($this);
    } // end func accept

```

# Answer
The event field on participant form uses event api to retrieve events. You can easily alter the list by implementing hook\_civicrm\_apiWrappers hook by adding additional parameter to exclude recurring event in $params of api probably `'parent_event_id' => ['IS NULL' => 1]`.

Or using buildform hook try adding parent\_event\_id condition in data-api-params of the field(element).

```
if ('CRM_Event_Form_Participant' == $formName) {
    $elementIndex = CRM_Utils_Array::value('event_id', $form->_elementIndex);
    if (empty($elementIndex)) {
      return;
    }
    $element = & $form->_elements[$elementIndex];
    $dataApiParams = json_decode($element->_attributes['data-api-params'], TRUE);
    $dataApiParams['params'] = ['parent_event_id' => ['IS NULL' => 1]];
    $element->_attributes['data-api-params'] = json_encode($dataApiParams);
  }

```

Cheers

Pradeep
> 3 votes

---
Tags: civievent
---


# Question
Title: What's the correct webhook for Stripe 5.2 extension?
I can't find any documentation for the latest Stripe 5.2 extension and I've setup the webhook as 'https://www.example.com/civicrm/payment/ipn/1' - I have setup Stripe as the only payment processor hence the '1' at the end. Is this correct? Using Civi 5.7.3 and Drupl 7.61

# Answer
Yes, The new webhook url should be https://www.example.com/civicrm/payment/ipn/1 where 1 is the payment processor ID.

Cheers

Pradeep
> 5 votes

---
Tags: drupal, stripe
---


# Question
Title: What is the most reliable method for merging records with memberships?
I've noticed recently on one site that I look after that a small number of records appear to have 'lost' their membership record. The site in question has organisational memberships and individuals have membership by dint pf their relationship. What I've seen is that while the individuals involved continue to show their membership, the related org record is showing no membership record. Invariably there is an org record in the trash which has the membership record associated with it. So I've got a little digging to do to understand why the org record with the membership is getting deleted, while a duplicate with no membership remains.

Odd behaviour with merging records may be part of the issue: if I recover the deleted record I then have two 'duplicate' records, one with a membership and one without. If I merge the record with the membership into the other one, and ensure that the checkbox is ticked to move the memberships, I end up with a single record with no membership. If I flip the two records and then merge, I end up with one record with a membership, which is what I want. Why, when I have explicitly ticked to move the membership record, is it not getting moved? This strikes me as highly dangerous behaviour - at the very least I would expect to see a large red alert to warn me that I was about to delete a record with a membership record that isn't being transferred to the merge result. Unless it's a bug?

I note that there is also an additional checkbox when merging, to "add a new membership". Do I need to check this as well in order for the membership to be moved, even though I'm not adding a new membership but moving an existing one?

# Answer
I looked into the code and seems like you need to enable the `add new` checkbox to move the membership to the newer contact.

`Add New` stands for adding a new membership on the main contact from the duplicate contact.

**Case when `add new` is not needed**:

This is not needed when both the contacts have a membership of same type and they need to be merged between the two contacts. For eg.

* Contact A has a membership of type 1 with start date = 1/1/2018.
* Contact B has a membership of type 1 with start date = 2/2/2018.

Now, when contact A is merged to contact B, the merge membership is done and all the field values of A membership is copied on to B. Here, no new membership need to be created. Hence, `add new` should not be checked.

But, in your case, as the membership on the main contact is not present and need to be "added" from the duplicate contact - we need to select the `add new` checkbox on the merge screen.

Agree it should be documented as I don't see it anywhere on docs.civi.
> 3 votes

# Answer
We have also experienced this bug, which appears to be longstanding.

The behaviour described is opposite of what happens when merging by checking the box "Move related..." contributions, activities, groups, etc. so it would be very confusing for users for this to be the case. I believe it is a bug, not expected behaviour. **The end result is losing memberships (into the trash), which is a big deal for membership based orgs. We have already had a few members pay for new memberships when it turns out they were already members.**

It is also not consistent with how the "add new" button works in other cases. I think the logical understanding of "add new" in this context is that it would add a second membership if each contact already had one membership. Also note that the red / green / yellow colour coding of merge conflicts shows memberships as yellow in this case, when if there was a conflict and a membership was going to be sent to the trash, it should definitely appear red.

I've reproduced this on demo. Steps are: 1) Create two contacts, the second one with a membership. 2) Merge the two contacts with the default options (Move related... memberships selected)

Expected result: One contact with a membership, a contact with no membership in the trash. Result: One contact with no membership, a contact with a membership in the trash.

Note that this only happens if the duplicate contact has the membership (as there is no membership to move if the original contact, the contact that is being merged into, has the membership).
> 2 votes

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


title: Finding ongoing Recurring Contributions

text:
# Question
Title: Finding ongoing Recurring Contributions
I am trying to find contacts who have live recurring contributions, and by that, I mean recurring contributions that will continue to give, not single contributions that were given as part or a recurring contributions series, and also not recurring contributions series that were cancelled in the past. (I find the terminology here confusing.)

How can I search for all contacts with live recurring contributions that have not been cancelled?

If it's in the docs, I'm sorry, please point out where! Thank you.

Version CiviCRM 4.6.38 (upgrading very soon!)

# Answer
> 4 votes
There is a Recurring contributions report and summary report which allows you do filters and also some related fields. You can find them under Contribution reports section(/civicrm/report/template/list?reset=1&compid=2).

Also there is an extension called 'RECURRING CONTRIBUTION SEARCH' that allows you to search recurring contribution.

Cheers

Pradeep

# Answer
> 0 votes
I don't think there is any per-contact flag maintained in Civi to indicate if someone is a recurring contributor. Therefore, the best you can do is search for contacts who have recently made a recurring contribution. e.g.

* Search | Advanced Search
* Display Settings For Results
    + Display results as: Contacts
* Contributions
    + Contribution is Recurring? Yes
    + Date received: Last 60 days including today

---
Tags: civicontribute
---


# Question
Title: Error adding new new contact: getaddr info?
Suddenly I started getting error when trying to save any new contact using web version of CiviCRM 4.5.3. Persisted for several days now, across 3 different browsers. Looks like this, any advice?:

# Answer
> 1 votes
This says that PHP is trying to connect to an external server and failing. Generally, that would suggest that the DNS settings of the server are no longer correct.

Since you're experiencing this problem on save, the lookup is probably that of geocoding. I would try to disable your geocoding provider to see if it solves the immediate issue. However, the long-term solution is to figure out whether a particular service is gone, your server can't find it, etc.

---
Tags: contacts, webform-civicrm
---


# Question
Title: Why is "Billing" location type marked "reserved"?
What I was trying to do was disable the Billing location type, but I see in the database it's marked is\_reserved=1, so it won't let you do it through the UI. But on a fresh install it's not even the default location type, so why is it marked reserved?

I was able to set is\_reserved=0 in the database and then disable it, but wondering if this is going to break anything.

Thanks

# Answer
> 2 votes
I think billing location type is used incase of Online membership purchase or registering a event or making donation inshort on forms where payment processor is involved(Billing block). Disabling this might cause issue/problem during submit of such form.

Cheers

Pradeep

---
Tags: configuration, location-type
---


# Question
Title: WordPress installation with MySql connection problem
I've been trying to install the lastest version, 5.9.1, on a new WordPress 5.0.3 site. Requirement checks all passed but when I clicked "Check Requirements and Install CiviCRM" button I got this error:

```
Cannot open mysql://username:password@localhost:3306/database_name?new_link=true: DB Error: connect failed

```

Server is using PHP 7.0.27.

Can anyone point me to the right path?

Thanks so much!

# Answer
First, thank you, Demerit, for helping me. I found a patch for the fatal error and it went away. However, the installation error remained.

At the end, turns out this error was due to MySQL password containing special characters. Once the password was changed, I was able to install without any errors. Hope this helps someone else.
> 1 votes

# Answer
It looks like you're using the "mysql" database connector which was removed in php 7.0. Try "mysqli" instead.
> 0 votes

---
Tags: wordpress, mysql
---


title: Change of custom field type to bigint

text:
# Question
Title: Change of custom field type to bigint
I have a custom group where one of its custom fields is of type varchar(64). This field is storing huge numbers only (something that I did not know during development) so I want to convert it into a int type, a bigint type due to the really lengthy numbers it's storing My question is the following: Assuming that the length is the same in all stored entries (around 2,5 million entries, 12 or 16 digit length), can I convert it into another type simply by ALTER TABLE or I need to inform Civi that this is an int/bigint field? Lastly, since I haven't seen the use of Bigint, is it safe to assume that it won't cause havoc in Civi's functionality if I do so?

Thanks!

# Answer
You have all the control of your custom table but always it is not advised to change custom field type in the database

Better way of doing this would be

In DB - Create a temp table of the same and move all the records to the temp table first

In the front end - delete the column with varchar and create a new one with int with the same name

In DB - move all the value from temp table to the custom field

I guess this helps !!!
> 1 votes

# Answer
I have similiar, though not exact, situation... my issue is VarChar field type with field values;

Field\_name=estimated\_household\_income\_56 Field\_type=varchar(60)

As result of "varchar" field type, the field values do not enable "correct" indexing or "range" searching. In fact, the Ascending Index of potential values results as follows;

$1,000,000 $1,000,001 $100,000 $150,000 $200,000 $25,000 $250,000 $50,000 $500,000 $75,000

(these field values were already modified by me, '$0 to $24,999' SET to '$25,000' - using SQL UPDATE/SET/WHERE regime)

I know this will be cleaned up by changing to INT field type. IS it as simple as simply changing field type? OR, should I first, execute SQL commands to modify field values ELIMINATING the '$' and ',' from the field values, then change to INT.

My gut says get rid of the '$' and ',', but hoping this is a single click operation. Of course, did an SQL export of the table as backup.
> 0 votes

---
Tags: custom-fields, mysql
---


title: civiMail doesn't work

text:
# Question
Title: civiMail doesn't work
I'm getting this error message trying to send a bulk mail from civimail:

Finished execution of Send Scheduled Mailings with result: Failure, Error message: API permission check failed for Group/get call; insufficient permission: require access CiviCRM

Who is is that needs permission? The logged in drupal user? Civicrm contact? SMTP user? Someone else?

The mail accounts from which the mail is sent ask for a username and password. Same question, what sort of user is needed here?

Thanks,

Jack Donohue

# Answer
> 3 votes
Its the CMS user that you have used to set CiviCRM cron needs some administrator permission to process your Schedule jobs. Please check the cron user role and assign necessary permission.

Cheers

Pradeep

---
Tags: civimail
---


title: GDPR and Comunication Preferences

text:
# Question
Title: GDPR and Comunication Preferences
GDPR module has the functionality to send an email to the contact in order to get the Comunication Preferences. But in my case, I have made a paper document filled and signed by the contact with his comunication preferences. How I could modify the comunication preferences in Civicrm as administrator?

In the Comunication Preferences I don't see any way to update the GDPR status comunication preferences

# Answer
Communication preferences are stored against contact. You either update each contact by using the communication preferences section on edit or view screen. Or do a bulk update on N contacts using profile.

Cheerz

Pradeep
> 3 votes

# Answer
You could make a table of the data in a spreadsheet and use the Import Wizard to update the preferences.
> 3 votes

---
Tags: wordpress
---


# Question
Title: What are the minimum permissions for Cron User?
In the interest of creating minimal permission sets for automated users, what are these for the cron user? If the cron is being run via drush, what are the minimum Civi permissions it can get away with? If a scheduled job requires permissions to execute (e.g., contact create) does the automated user need these too?

\[This may seem like a pointless question: if there's a Cron User, and its credentials just live on the host machine, why would this be necessary? If they have the host machine, they have the host machine, right? Well, usernames can be guessed, passwords can be cracked over time, and best practice is best practice.\]

# Answer
> 1 votes
Check out this answer.

Safe to run cron jobs using wget and user with full admin rights?

Essentially just give the permissions necessary to run the cron jobs. If no event crons - don't give event permissions.

---
Tags: security, gdpr
---


title: Change email address

text:
# Question
Title: Change email address
We are transitioning from an older version (4.1.5) of CiviCRM to a newer version (5.8.2), and the email address is old (2 staff people previous to me) - how do I update it?

# Answer
> 3 votes
It is possible they mean the info in the Organisation Address and Contact Info settings (Under Administration \> Communication Settings)

or the CiviMail "From Email Address" (under Administration \> CiviMail)

---
Tags: upgrade
---


# Question
Title: CiviCRM 5.9.1 on Joomla 3.9.2 Problems with the language
I've made civicrm (5.9.1) in a Joomla 3.9.2 installation. Only the English language is available, I find nowhere as I can change the language in German. Do you have a tip for me? Greetings Michael

# Answer
> 3 votes
Michael, Welcome to Stackexchange. The language will be available if you have downloaded and place l10n folder in civicrm.

To configure CiviCRM to use an existing translation:

1. Download the translations distribution - civicrm--l10n.tar.gz - from the CiviCRM Sourceforge downloads site. This tarball contains all files for the latest available translations.
2. Uncompress the tarball and you will see a directory called civicrm, containing two subdirectories called l10n and sql. The l10n directory contains a set of sub-directories named using their locale codes. (Example: the Canadian French translation files will located in /civicrm/l10n/fr\_CA)
3. Copy this l10n directory, together with all its subdirectories into your CiviCRM codebase root directory. (note if creating the l10n folder manually it should be ell-ten-n, not capital-I-ten-n)

For Joomla this would be `site_root/administrator/components/com_civicrm/civicrm`. So if you wanted the en\_GB language it would look like this

```
site_root/administrator/components/com_civicrm/civicrm/l10n/en_GB/

```

For Drupal this would be `site_root/modules/civicrm`. So if you wanted the en\_GB language it would look like this `site_root/modules/civicrm/l10n/en_GB/`

4. Login to CiviCRM (as a user with "administer CiviCRM permissions").
5. Go to Administer » Localization » Languages, Currency, Location
6. You should now be able to see and select all the localization options in the Default Language and drop-down menu. If you don't, and instead can just see the default 'English (United States)' option, check the preceding steps as the drop-down options are set by the directories under your l10n directory. Also be sure to confirm that the l10n directory is correctly named as l10n (that is: el-ten-en and not eye-ten-en).

Cheers

Pradeep

---
Tags: language
---


# Question
Title: Smart Groups - cannot get smart groups to refresh
I have read as much as I can about smart groups but I am having problems that I am not able to solve. I have a smart group which shows the same SQL as an Advanced Search but they produce different results.

If I refresh the smart group cache I get the same result.

# Answer
> 1 votes
Some clarification about 'getting smart groups to refresh'

I assume you are using the button 'update smartgroup counts' from the Manage groups screen. This could perhaps be better called 'calculate missing smartgroup counts' (although that wouldn't fit on the button.....) - that button causes the count to be calculated for all groups that the cache has not been built for.

Groups are only recalculated if they have aged out - by default the smart group timeout is 5 minutes. Pretty much whenever you save a contact it attempts to delete the cache for any smart groups that are more than those 5 minutes old (you can set the cache to less than 5 minutes or 0 for more caching). It will then re-fill the cache for that group next time you access it.

If you barely ever edit contacts I guess the cache might not get cleared as often as it 'should' - you can schedule a job (Job.group\_cache\_flush) to run however often you want - if you do this it makes sense to set the setting 'smart\_group\_cache\_refresh\_mode' to 'deterministic' to stop it from also clearing on contact edit (note that this is often good to do for performance reasons)

# Answer
> 0 votes
I think you have a participant/event item in there - so that means some of your Contacts would have participated in more than one event!

Try: Search Builder - it only returns the Contacts (unique)

# Answer
> 0 votes
This answer was a comment by Joanne which I think deserved to be an answer

> I have tested this on 4.7.12 and found that Rebuild Smart Group Cache might not remove the contact whose criteria no longer comply with the smart group but Administer \> System Settings \> Cleanup Caches and Update Paths \> Cleanup Caches does. So it seems to be a cache issue rather than a problem with the underlying smart group functionality

# Answer
> 0 votes
I think there is a bug : I could reproduce it on the demo site :

* Create a group : TEST
* Advance search Individuals whose name contains "Adam" \> You get 12 instances \> Create smart group G1 under TEST
* Advance search Individuals whose name contains "ck" \> You get 8 instances \> Create smart group G2 under TEST
* Advance search Individuals whose name contains "y" \> You get 52 instances \> Create smart group G3 under TEST
* Advance search Groups G1, G2, G3 \> You get 70 (you could expect 72, but there are some common results) \> Create smart group "Total" under TEST

Now,

* open G1 and modify search criteria : "Ad" instead of "Adam" \> you get 18 instances (instead of 12), thus 6 more \> Update the smart group
* Open group "Total" \> you get 77 instead of 70, thus 7 more : why 7 and not 6 ?

Now again,

* open G1 again and modify search criteria : "d" instead of "Ad" \> You get 71 instances (instead of 18, thus a lot more) \> Update the smart Group
* Open group "Total" \> you still get 77 (while it should contain much more than that)
* Open "test" \> you get 104 while there is no reason why it should be different from "Total" result

I have just openned an issue : https://lab.civicrm.org/dev/core/issues/694

---
Tags: smartgroups, cache
---


# Question
Title: Cannot Tags and Groups fields in Webform CiviCRM Integration - Drupal 8
I try to create a contact in CiviCRM 5.9.1 with a **Webform** and **Webform CiviCRM Integration** (all in Drupal 8.6.7),

But when I choose the needed fields in CiviCRM and I use the **ENABLE TAGS AND GROUPS FIELDS** : no field appears.

If I still save then I get in Drupal an `Error: Class 'Drupal\webform_civicrm\CRM_Core_BAO_Tag' not found in Drupal\webform_civicrm\FieldOptions->get()`

To recover the use, I need to delete the Webform. All of the other fields appears and can be selected in the Webform : Phone, Email, etc.

Is this, reveals a bug in Webform CiviCRM Integration or could it be something wrong in the Tags and Groups ?

Also if I select Yes for Tags and Groups fields, then impossible to get fields for Phone, Email, etc.

With Tags and Groups fields on No

With Tags and Groups fields on Yes, no other fields can be selected

# Answer
> 1 votes
I suspect d8 webform\_civicrm does not yet have those fully functioning. KarinG is leading the project and would welcome assistance and/or funding I suspect. I think the most recent update is in this blog where she says

> Drupal 8 port! The D8WFC project kicked off in August 2018 and we've already got Contacts, Memberships and ... Contributions working. Yes! We're transacting through live pathways. Try out the dev version: https://www.drupal.org/project/webform\_civicrm/releases/8.x-5.x-dev if you feel adventurous: it currently contains Contacts and Membership functionality. If you want to try Contributions you'll need to check our GitHub repo: https://github.com/colemanw/webform\_civicrm/tree/8.x-5.x \- and keep an eye on PRs against that branch

---
Tags: drupal, webform-civicrm, drupal-8
---


# Question
Title: Advanced Search Using Custom Profile as Display View that Includes Groups Not Working after Upgrading to 5.9.0
After upgrading Civi from 5.3.1 to 5.9.0 (with drupal 7.61) any search results that use a custom display view (profile) does not work properly if that profile includes the groups or tags fields in the profile. Instead of the advanced search displaying all the records found it only displays one record at a time. At the top it may say "showing 1 to 50 of 100 records", but actually only shows one record.

I also hadn't realised that before upgrading, the groups or tags fields had not displayed at all in the advanced search - those columns would be missing even though they were included in the profile.

Is it possible to include groups or tags fields in a profile used for search results?

Disabling or deleting the groups/tags fields from the profile fixes the problem of only showing one contact at a time in the search results.

Screenshot attached

# Answer
> 1 votes
Pretty sure the "1 row" problem only shows if you search using one custom Profile then switch to using a second custom Profile

Ie

Reset Form then use Default, (all rows show) then switch to profile with Groups field (all rows show) then switch to profile with Tags field - **only 1 row shows**.

Reset Form then use Default, (all rows show) then switch to profile with Tags field (all rows show) then switch to profile with Groups field - **only 1 row shows**.

So the problem seems to relate to switching between one custom search Profile and a second one.

NOTE: above came to light when trying to demo to Eileen that i could replicate https://lab.civicrm.org/dev/core/issues/679

UPDATE: Fix at https://github.com/civicrm/civicrm-core/pull/13533

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


# Question
Title: How to sort in descending order the results of CiviCRM API
I need to find the external identifier with highest value and hence need to sort in descending order .So I need to use sorting feature but unaware of what value should be added in screenshot shown.I tried with 'desc' but it gives an error.

# Answer
sort option takes the parameter followed by `sort_order` in civicrm api.

For eg - the following works fine -
> 5 votes

---
Tags: api, external-id
---


title: DB Error: No such table - custom fields

text:
# Question
Title: DB Error: No such table - custom fields
Below are log entires telling me what I know, but do not know how to resolve.

In reformatting custom data set, via import and export via phpmyadmin (need to switch from text to number field type), I changed the table name. Somewhere in the code, the "path" to the custom fields must be hard coded. As result, the custom field group lists displays the groups and fields, but when I attempt to do anything to the fields, i get spinning wheel of death. I attempted to use phpmyadmin to delete a field in the unlinnked table, and the result was same.

I need a "super privilidge" of some kind to delete the custom fields, then custom group and then recreate custom group/fields and then restore the data set.

I read another post about settings/developer/api. There exists api3 and api4.

Unawae of what to tell which api to do... Help...

Note: I was advised that my custom field group/table name was an issue in that it had (2) _ characters in a row, which caused the db issues. To resolve that, I changed db table name, eliminating one of the underscores, solving the db and phpmyadmin issue but compounding into issue with civicrm...

```
Feb 05 00:33:46  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] =>         ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase_date_62` [nativecode=1146 ** Table '<domain>_wpdb.civicrm_value_income_house__15' doesn't exist]
    [type] => DB_Error
    [user_info] =>         ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase_date_62` [nativecode=1146 ** Table '<domain>_wpdb.civicrm_value_income_house__15' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase_date_62` [nativecode=1146 ** Table '<domain>_wpdb.civicrm_value_income_house__15' doesn't exist]"]
)

Feb 05 00:33:46  [info] $backTrace = #0 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such table", -18, 16, (Array:2), "        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#3 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-18, 16, (Array:2), "        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#4 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), "        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...", "DB_Error", TRUE)
#5 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-18, NULL, NULL, "        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...", "1146 ** Table '<domain>_wpdb.civicrm_value_income_house__15' doesn't exist")
#7 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#9 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#10 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#11 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...")
#12 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1411): CRM_Core_DAO->query("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...", FALSE)
#13 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/SchemaHandler.php(339): CRM_Core_DAO::executeQuery("        ALTER TABLE civicrm_value_income_house__15 DROP COLUMN `home_purchase...", (Array:0), TRUE, NULL, FALSE, FALSE)
#14 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php(1867): CRM_Core_BAO_SchemaHandler::alterFieldSQL((Array:7), FALSE, TRUE)
#15 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomField.php(1153): CRM_Core_BAO_CustomField::createField(Object(CRM_Core_DAO_CustomField), "delete")
#16 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Custom/Form/DeleteField.php(104): CRM_Core_BAO_CustomField::deleteField(Object(CRM_Core_DAO_CustomField))
#17 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(489): CRM_Custom_Form_DeleteField->postProcess()
#18 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#19 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Custom_Form_DeleteField), "next", "Next")
#20 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Custom_Form_DeleteField), "next")
#21 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Custom_Form_DeleteField), "next")
#22 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#23 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Custom/Page/Field.php(264): CRM_Core_Controller->run()
#24 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Custom_Page_Field->run((Array:5), NULL)
#25 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#26 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
#27 /home/<domain>/public_html/wp-content/plugins/civicrm/civicrm.php(1248): CRM_Core_Invoke::invoke((Array:5))
#28 /home/<domain>/public_html/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
#29 /home/<domain>/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#30 /home/<domain>/public_html/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#31 /home/<domain>/public_html/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
#32 {main}

```

# Answer
to identify the key values, I hunted the db and found a table called;

civicrm\_custom\_field table custom\_group\_id lists all fields associated with group ID

In it, each custom field is listed. And, the indexes are by group ID and field ID.

I used API4, selected custom field, action delete, where, custom group id,=,what I saw in table. That eliminated the custom fields.
Then ... selected custom group, action delete, where, custom group id,=,what I saw in table. That eliminated the custom fields group.

verified deletion in both phpmyadmin and inside civicrm custom field groups list!!!
> 1 votes

---
Tags: custom-fields, mysql-5.7
---


title: CiviCRM References

text:
# Question
Title: CiviCRM References
We are a medium-sized non profit religious organization and are looking to see what CIVICRM can do for us. We are just looking to speak to other users or organizations our size ($10M budget give or take) to hear about how they use Civi and what their experiences have been like. Is that something you all can offer or direct us to the right folks? We have about 2 million contact records and dont want to dump them in to CIVI if it is going to be unusable because of the sheer size of our database.

# Answer
since this seems to be a question specifically about 'scaling and performance' there have been some other posts about this type of issue eg

Using civi for big data sets (1 million plus)

You can also see some stats here: https://stats.civicrm.org/?tab=sites showing more than 150 sites with over 250000 contacts in them.

We, Fuzion, and several other providers will have worked with large datasets. Each site is still a bit 'unique' in terms of where you might need to address performance issues.

Eg using a lot of Smart Groups, or worse parent-child Smart Groups, can definitely slow things down.

There are some internal settings such as for Search Preferences which you can tweak to improve performance, but clearly a fundamental issue is about the server's capabilities.
> 2 votes

# Answer
Welcome to Stack Exchange,

Greenpeace's Central Europe Branch is using CiviCRM and has a similarly sized contact base. As expected a couple of tweaks and adaptions were necessary for the system to run smoothly (such as not using smart groups).

If you are interested, please send me a message and I could connect you with someone there.
> 1 votes

---
Tags: sales
---


# Question
Title: Why does API get participants return all custom fields together with the specified return field?
When I do this:

```
$result = civicrm_api3('Participant', 'get', [
  'sequential' => 1,
  'return' => ["custom_14"],
  'event_id' => 3,
]);

```

In the results I get the desired custom field, but I also get all the other custom fields. At first I thought it's just the entire custom field set but then I tested it and it returns all the custom fields for participants no matter which field set they belong to.

```
 "is_error": 0,
    "version": 3,
    "count": 18,
    "values": [
        {
            "contact_id": "181",
            "participant_id": "46",
            "civicrm_value_ew_9_id": "1",
            "custom_14": "dsfa",
            "custom_14_1": "dsfa",
            "custom_15": "d",
            "custom_15_1": "d",
            "custom_16": "AAA",
            "custom_16_1": "AAA",
            "id": "46"
        },

```

The value I looked for is returned with civicrm\_value prefix, but why is the other data displayed as well? Is this a bug or am I missing something? This seems to be the case for the Participant entity only.

I tested this on CiviCRM 5.9.1 and Michael McAndrew docker image with CiviCRM 5.11.alpha1.

# Answer
This is almost certainly a bug, but unlikely to be fixed in v3.

As Aidan mentioned - there are non-standard APIs in v3, and the Participant API is one of them, along with Contact and EntityTag.
> 1 votes

---
Tags: custom-fields, api
---


# Question
Title: How to display CiviCRM menu for non-admin role using WordPress?
We would like to restrict access within the WordPress dashboard to the "subscriber" role settings but also have the ability for that user to access the CiviCRM. The only way we can get the CiviCRM link to show in the left navigation is to set the user's role to admin which we don't want. I found this thread here. How to show CiviCRM menu for non admin role using WordPress? However, we have not blocked any access to the menus so there does not seem to be an answer there for us.

We've adjusted the settings through CiviCRM \> administer \> Users & Permissions \> Permissions (Access Control) \> WordPress Access Control. So far, we haven't had any luck.

It looks like in the screenshot here that it is possible. (refer to the image in the WordPress Access Control section. https://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/ I only see the left navigation links for subscriber plus CiviCRM.

Thanks for any and all suggestions.

# Answer
Out of curiosity, is this with one of the default Wordpress themes applied? If not, it may be worth switching themes to a default theme and check the functionality. Additionally, if you have the WooCommerce plugin active, it removes the ability for subscribers to see the side menus by default. (You also can't see the WordPress user's Profile page.)
> 1 votes

# Answer
I apologize, I should have put a comment here.

I did finally get it to work with the right combination of settings.

Administer \> users and permissions \> wordpress access control \> CiviCRM: access CiviCRM ON for subscriber and CiviCRM: administer CiviCRM off for subscriber. I then selected which other modules I want the subscriber (in this case the employees entering contacts and cases) will need access to (reports, mail, cases...).

Now when my subscriber (employees) sign in they will see in the admin dashboard in the left navigation only links to dashboard, CiviCRM, and profile.

If we go with this solution that is. We still don't have the search functionality working as one think it should.

Thanks for the help and suggestions.
> 1 votes

# Answer
I got our Editor Role CiviCRM Dashboard to work by turning on the CiviCRM: access CiviCRM backend and API and turning off the CiviCRM: administer CiviCRM permissions.
> 1 votes

---
Tags: wordpress, permissions, roles
---


title: How to handle deadnames?

text:
# Question
Title: How to handle deadnames?
Are there any recommendations with how to store the deadname of a contact that is undergoing a gender change? i.e. They have not yet changed their legal first name and we want to communicate with them using their (corrected) first name, but legal/financial documents must use their deadname.

# Answer
A custom field works well, but I would also consider repurposing the nickname field via Word Replacements, since you can enable QuickSearch on nickname.

With regard to legal/financial documents, I'd probably repurpose the postal and email greetings for normal communications and communications requiring the deadname. If you're already using those, you could also create a deadname salutation using the Salutations extension.
> 4 votes

---
Tags: contacts
---


# Question
Title: Batch Data Entry payment_instrument is now required?
we've been using CiviCRM for several years and we've just recently version 4.7 to 5.8.2, but now we can't use the Batch Data Entry any more. We can create new batches, add entries and save them, but when I press Validate and Process the batch it just displays the batch again.

I guessed that it might be a validation problem and eventually put a log statement to get any errors on form validation. In my test batch there are two entries and this is the error I get:

```
Form Errors: Array
(
  [field[1][payment_instrument]] => Payment Method is a required field.
  [field[2][payment_instrument]] => Payment Method is a required field.
)

```

Nothing is displayed on the screen because there isn't a Payment Method--or Payment Instrument--field in the form, so that explains what is going wrong, but not why.

Looking at the DB for past batches, we've never had to specify the Payment Method before, I notice that there is a `payment_instrument_id` field on civicrm\_batch, but it's optional and null for all our past batches.

How can I make it optional so I don't need to add a field to the form?

Thanks!

# Answer
> 0 votes
We had one client inform us that they could not save Batch Data - everything we tried to replicate the issue failed. In the end we concluded that it was due to browser caching which the client was able to confirm by testing with a different browser.

Refreshing the chrome caching (https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en) sorted it for them.

May not relate to your situation at all.

---
Tags: wordpress, batches, validation
---


# Question
Title: Inconsistencies in the Contribution Detail report
I'm trying to chase down an inconsistency someone reported in the Contribution Detail report. It doesn't happen with all contacts (in fact I've only seen it in the one they reported, so far).

There are two donations in this person's history that don't show up correctly:

* A $15 donation shows up as $30
* A $25 donation shows up as $125

The summary at the bottom of report for a date range correctly counts 10 rows, but then indicates 15 contributions instead of 10.

If I pull the same contributions in a Bookkeeping Report, they come out correctly.

I can't find anything different about the contributions in question. Has anyone seen anything like this or have any idea where to go next in troubleshooting? I don't think it matters but this is a Drupal 7 site.

# Answer
> 2 votes
You could try Extended Reports extension ;-)

---
Tags: civireport, reports
---


# Question
Title: CiviMember price sets are depending on CiviContribute?
When only CiviMember is enabled as active component, setting new price sets (civicrm/admin/price) throws am DB syntax error.

When CiviContribute is also enabled, setting new prices works.

Since these are two distinct components, I consider this as a bug. Please advise.

I'm on the lates CiviCRM version of 5.9.1

# Answer
welcome to CiviCRM StackExchange!

Price sets are meant to create/interact with contributions which require CiviContribute to be enabled. Hence it makes sense that they only work if you have CiviContribute enbaled.

However it would make sense to not show any price set options in the UI as long as CiviContribute is enabled. You could create an issue for that on https://lab.civicrm.org/dev/core
> 4 votes

---
Tags: civicontribute, civimember, price-sets
---


# Question
Title: Smart Group dropping search criteria on save
I've searched the archives and see there are a number of posts pertaining to smart groups not saving criteria, but it seems those were bugs addressed in updates, and we are running the latest version of CiviCRM (5.9.1).

I have smart group made up of organizations whose membership is current (our memberships are company-based). However, I can't get the smart group to save the "Is a current member" search string. Instead, every time I update and save, it drops that setting and goes back to just "Contact Type In Organization" as the only criteria. This happens regardless of how I try to create or edit the smart group - it drops all selections from the Memberships tab. Is there a known bug or some other issue that could be causing this?

Edited to add - the smart group count is also not updating when clicked - all of the smart groups still say "unknown." Could this be a caching issue?

**Edited 6/17/2020** \- still observing the same issue on CiviCRM 5.25.0. Interested to know if anyone else is having this problem.

# Answer
Had a test site upgraded to 5.10.0 today, and the smart groups settings (for case contacts- see comment above) are now working as expected.
> 4 votes

---
Tags: smartgroups, advanced-search
---


# Question
Title: Can you create a dedupe rule to include individual and organisation details
Following recent Events/bookings we have found several duplicate organisations have been created. We used the Name and Email (reserved) Supervised dedup rule and while duplicate individuals have not been created we now have many duplicated organisations.

Any assistance with this issue would be most appreciated as we are due to launch another event which will probably have well over 100 bookings.

Thank you Allison

Hi Allison

Does the settings for the Organisation Name field look like this?

# Answer
> 5 votes
The short answer is no. Dedupes for individuals and oranisations are handled separately in Civi.

I'm assuming (and feel free to correct me if I'm wrong) you've got an event booking profile for an individual which includes the current employer field.

From Manage events list. Find the event in question. From the configure options at the RH side of the screen select configure, then online registration.

Under the heading Registration Screen you'll find links to the profiles used to gather contact details. Check the Organisation Name field to see how it is configured. Frequently this uses the current employer field from the contact record.

Soenthing like this

Civi will apply the specified dedupe rule to the new individual details and match as required.

There won't be a dedupe rule specified for the organisation so Civi will apply the Organisation- Unsupervised Rule (Default setting for any situation where members of the public are adding contact details)

From Contacts\> Find and Merge Duplicate Contacts Scroll down to the Organisation, Unsupervised rule. Edit the rule to check how it is configured.

If your organisation- unsupervised rule is anymore complicated than match by organisation name only. Civi will decide there is not enough info to match, and then create a duplicate organisation.

If you have permissions you can edit the rule to match on the Organisation Name only field

If your matching rule is name only, you may still get duplicate organisations in a "Judean People's Front/ People's Front of Judea" scenario. As different users may record their organisation name in a non standard fashion.

Hope this helps.

---
Tags: duplicate-contacts
---


# Question
Title: Event doesn't display location on info page
After creating an event with an address the info page will not display the location nor the map.

# Answer
> 3 votes
If you are experiencing this it is most likely due to an old event template or you copied an older event. More recent versions of CiviCRM have an option on recurring events to display the location. It is on by default but older events were not retroactively set to On.

To fix this you can create a completely new event or in the mysql database on the civicrm\_event table set your event to is\_show\_location = 1.

---
Tags: civievent, location
---


# Question
Title: Implement CiviCrm SAML with Google Suite as IDP provider
I'm helping a small charity in volunteer capacity, most of their work was done on the spreadsheets earlier, they have now started using civicrm for their events and contributions as well as membership, and emails.

They have an intranet built using google suite, and now want to integrate Civicrm with intranet site using SAML authentication for civicrm.

there config is CiviCRM 5.8.2 on drupal 7 - I’ve looked around and tried for extensions for implementing SAML on Civicrm (service provider) using Google as IDP provider, but have not got end to end instructions. Can someone please point me in right direction? I'ld be very thankful and happy to document the step by step instructions and share with all once done.

# Answer
Civi uses the CMS for authentication so the question is about configuring Drupal 7 (in your case) with Google SAML IDP.

I've not tried it, but a bit of googling shows a few links that look promising:
> 1 votes

---
Tags: user-account, authentication
---


# Question
Title: Wordpress quick contact search render glitch
I have been trying to fettle this for a few hours - when quick searching for a contact on Wordpress, the results appear behind the Wordpress admin menu. I can't see anyone else who has reported this issue, is it a known problem?

Latest Shoreditch enabled (and only happens with Shoreditch enabled), Civi 5.10.0, WP 5.0.3

Thank you!

(PS, personal data shown in this image is a fake contact)

# Answer
> 2 votes
You should use https://wordpress.org/plugins/civicrm-admin-utilities/ instead to style Civi in WP.

It says shoreditch extension is optional https://civicrm.org/extensions/email-template-builder. I also just tested and Mosaico still works.

# Answer
> 2 votes
Whilst the extension page https://civicrm.org/extensions/shoreditch says that Shoreditch is CMS independent, the release notes https://github.com/civicrm/org.civicrm.shoreditch say that Drupal is a requirement, so I don't think you can expect it to work. Much as I would love to have it on Wordpress.

---
Tags: wordpress
---


# Question
Title: How can I alter next value of membership id (which would be auto incremented)?
I have an external identifier which has been imported and its max value is 10000,
whereas it needs to be used as membership id, but membership id
max value is 1500.Now to keep the Id of the membership consistent with
external identifier, I want to start next membership id as 10001
instead of 15001. Is there a way to incrememt the membership id from 1500 to 10000 in database?

# Answer
This is more of mysql than CiviCRM. You will need to reset the AUTO\_INCREMENT value for that table.

```
ALTER TABLE civicrm_membership AUTO_INCREMENT= 10001

```

Thanks Pradeep
> 6 votes

---
Tags: civimember
---