title: Ideal Civi Setup for big database

text:
# Question
Title: Ideal Civi Setup for big database
New here and a few months ago we start working with Civi for a small project but now we are planning to use it for a project with a over 300.000 contacts and 40+ users. I would like some help and suggestions :

* What is the ideal Civi setup for a large project like this ?
* Shoud we use wordpress or drupal ?
* Local or Cloud hosting ?

Thank you in advance.

# Answer
As others point out, there are no clear answers. The number of simultaneous users is also an important factor. But here are some tips from my administration of a similarly-sized database:

* I run everything on a 4GB server. This is usually sufficient, but when my client had a very high-traffic event, I saw some monitoring warnings (though I couldn't detect slowdown in manual testing). If you're eligible for Microsoft Azure free hosting credits, you can get an 8GB server and not worry\*.
* Local vs. cloud doesn't affect performance. If "local" implies "not accessible to the Internet" that will mean you lose some features though.
* Install Redis. I have it on my live site but not my dev site and the difference is noticeable.
* Tweak your MySQL settings to give as much InnoDB cache as you can spare.

* As Alan points out in the comments, there are many political reasons to not host with Microsoft; data privacy issues, jurisdiction and a willingness of your host to fight for your rights are all important.
> 1 votes

---
Tags: wordpress, drupal
---


# Question
Title: Can all related contacts be notified about upcoming membership renewals?
We have an uncommon relationship between association managers and my client's member organizations. Since there may be multiple contacts in an association management firm and there may be significant turnover, my client wants to send membership renewal information, including invoices to all the related contacts for each organization (all the members are organizational entities).

Is there a straightforward way to accomplish this? In most cases, the only contacts we have on file are the association managers, instead of a central email for the association.

# Answer
There's a feature I wrote for Email API for use with CiviRules called "send email to a related contact". I haven't looked at it recently to see if you can specify "any relationship" as opposed to a specific one, but it should get you most of the way to a solution.
> 1 votes

# Answer
I think that if the related contacts all are 'current employee' and are 'permissioned' then they can all effectively use the 'on behalf of' feature to do the renewal. That doesn't answer your question about how to notify them - but i think it is a requirement for them then be able to perform the renewal.

The next step I think would be to have them all 'inherit' the membership, which is a setting in the Membership Types

The final step (which I am not certain about) would be to see if you can set up a Scheduled Reminder based on Memberships and have it be sent to those who have inherited it. That assumes that this is a Rolling membership cycle.

If you membership is static then you could presumably achieve that last step just by setting up a group of all with 'inherited memberships' and send out a Mailing with the renewal link in it.
> 0 votes

---
Tags: civicontribute, civimail, civimember
---


# Question
Title: Enforcing the uniqueness of fields/entities (e.g. phone numbers)
I'd like to ensure that phone numbers of a certain type (let's say Mobile) are unique across our Civi instance. A given contact should be able to have no more than one Mobile number, and no two contacts should have the same Mobile number. We'd still like to take advantage of Civi's existing infrastructure around phone numbers -- in other words, we don't want to use a custom field instead of the phone number entity.

Ideally, the uniqueness rules would be enforced when data comes into Civi. But there are many ways that data comes in: backend forms, contribution pages, event registration forms, import, api, etc. If we wanted to alert users about duplicates during the various GUI-driven workflows, and also handle situations where a user isn't directly controlling the process (e.g. automatic syncs using the api), we'd need to create several different mechanisms.

Has anyone tried to do this, particularly with something like phone numbers which have a many-to-one relationship with contacts? (A question from 2015, Enforce uniqueness of custom field, is related, but I'm asking a broader question. Civi and its ecosystem of extensions have also evolved in the last 5+ years.) Are there best practices for enforcing uniqueness of a field/entity in CiviCRM, in a way that gives users a chance to correct duplicates during data input whenever possible?

# Answer
I think `hook_civicrm_check` with the following SQL would handle notifications of duplicates:

```
SELECT phone FROM civicrm_phone GROUP BY phone_numeric HAVING count(*) > 1;

```

For back-end forms, you could modify the Supervised dedupe rules, though this wouldn't catch non-unique numbers belonging to different contact types.
> 1 votes

---
Tags: import, forms, workflow, data-model
---


# Question
Title: Wordpress Civicrm -Uncaught ReferenceError: CRM is not defined for contribution page
WordPress - 5.4.4 , CiviCRM - 2.62 , Theme Avada

Using shortcode added contribution to page but in console, we are getting error **Uncaught ReferenceError: CRM is not defined** so the page is not loading fully and payment option - PayPal and credit card not displaying how we can fix this issue.

Also when we logged-in as admin there is no error in console and payment option showing properly

thanx

please check -

# Answer
I'm also facing this problem (CiviCRM 5.3.0, WP 5.6.1, Avada 7.2.1).

The CiviCRM-Javascript-Resources are not loaded at all.

**Disabling the Fusion Builder** (so working with the regular WP editor) for the page where the CiviCRM-shortcode is inserted **gets the resources loaded and the payment form working**.

We're still facing Avada layouts issues on the next page though. But at least registration and payment work now.
> 1 votes

---
Tags: wordpress, civicontribute, issues, javascript, error-page
---


# Question
Title: Deleted contacts considered duplicate in mailing
Some weeks ago clients reported problems of mass mailings not being delivered to a part of the destinees. After doing some research it occurred that the problem lied in contacts that had been merged.

When contact A is merged in contact B, contact A gets deleted (still in the database but status 'is\_deleted'). When creating a mailing both A and B seem to be added to the destinees.

When sending the mailing contact A obviously doesn't receive the mailing because 'is\_deleted' but contact B also doesn't get the mailing because the mail is regarded as a duplicate mail.

After some looking around I found https://github.com/civicrm/civicrm-core/commit/48b1ff58 which solved the issue for us on multiple installs.

Now I hoped this would quickly find its way into the releases, but when I just took a look at the freshly released 5.34.0 it clearly hasn't.

The error is so obious though that I feel I must be missing something myself, so I hesitate to file a bug report...

# Answer
> 1 votes
The release process means it takes a while from a PR being merged until it appears in a release. You can find details of the process here. The commit you mentioned will be in 5.35

---
Tags: mailing, deleted
---


# Question
Title: How to automatically generate a csv file?
I need to daily update a list of members between civicrm and an external website on an other web server.

Is there a way/extension to do so from a smart group ?

First step would be to automatically generate a csv file.

It seems that I can't do this with CiviRules.

Second step, would be to export to a certain folder on an external web server.

Any experience or ideas?

# Answer
> 1 votes
Civireports can send a file automatically so set up a CiviReport with the filter of your choice, then under the "Access" tab, you can enter an email to send the report to. From there, check out Scheduled Jobs to configure the report to send the .csv file at whatever interval you wish

(pete with appreciation to Justin for writing most of the answer)

# Answer
> 1 votes
In addition to CiviReport, the SQL Tasks extension can handle this.

---
Tags: export
---


title: Stopping robot registrations

text:
# Question
Title: Stopping robot registrations
Some months ago we started getting a bunch of robot spam users registering on the website. Both a CMS (Joomla 3.9.24) and Civi (5.33.2) user/contact are created with only firstname, lastname, and email. Here's what I've investigated:

1. I checked to make sure the reCaptchas were functioning and increased those settings.
2. I've looked at the Civi logs and tried logging page activity in the CMS (with extensions), but I'm not finding any clues as to what page these robots are registering on. It's clearly a Civi-related page, because a Civi contact is created.
3. I disabled the public mailing list sign-up profile temporarily and still got robot registrations.
4. I've changed the settings on public "stand alone" profiles to send me a notification email when someone uses them. Still getting registrations without any Civi notification.

What are some next steps to help me figure out where these are coming from and how to stop them? I know there is a Civi extension to up the game with reCaptcha, but if I'm not sure what page/profile to deploy it on, I'm not sure how that would help.

# Answer
Since a Joomla user is created, there are one of a few scenarios you could be encountering:

### Joomla's user registration isn't disabled

I don't know how to disable user registration in Joomla, and there are some scenarios where you can't. Your mitigations are:

* Turn off user registration (only admins can create users).
* Edit your web server configuration to return a 404 error on the User Registration.
* Check for Joomla-specific plugins to catch spam user registrations.

### A Civi profile is configured to create a Joomla user

Profiles can create CMS users. Check your profile settings to see if this is applicable to you - either one by one at **Administer » Customize Data and Screens » Profiles**, or with this SQL: `select id, title from civicrm_uf_group WHERE is_cms_user = 1;`.

If you have any, you can try to isolate the particular profile by adding users to a different group per profile. Simple mitigations here are just ReCAPTCHA

**Reading web server logs**

Finally, if you know how to read web server logs, check the `created_date` on one of the spam submissions, and find the timestamp in your web server logs that corresponds. It will show you the URL accessed that led to the user being created.
> 1 votes

# Answer
One of the steps we did in Civi was to set our Available Countries. This does not allow user registrations unless they are from within one of the countries on the list. Most of the spammers are operating in specific countries, so if you are not needing the whole world to have access to your forms, then you can do this to block out a large % of these guys.

Admin\>Localization\>Languages,currency,locations then scroll down to Available Countries and add the one(s) that matter to the approved list

Joomla might have something similar as well that you can add there.
> 0 votes

---
Tags: profile, recaptcha
---


# Question
Title: How can I set up an incoming email (or bounce) account on GMail with OAuth?
Google has announced that traditional username/password logins to G Suite mail accounts will be disabled and logins will require OAuth authentication in the future. The CiviCRM OAuth documentation partly explains how to configure OAuth with CiviCRM, but says, "After registering OAuth2 details with CiviCRM and Microsoft \[sic\], you can add an incoming email account." without explaining how.

How do I register my OAuth2 details with Google?

# Answer
> 12 votes
This assumes you've already created a G Suite user and can successfully log into their e-mail manually.

### On CiviCRM

### On Google.com

If the steps belong don't work, check the "Prerequisites" section of the "Using OAuth 2.0 for Web Server Applications documentation to see if anything has changed.

* Open the API Library in the Google API Console.
* Select **GMail API** from the list of APIs.
* Click the **Enable** button.
* Visit the Credentials Overview page.
* Click **OAuth consent screen** (may be labeled **Configure Consent Screen**).
* Select **External** *user type* and click **Create**. **Note**: Apps with external consent screens can require review from Google. However, "test mode" allows up to 100 users. Since you'll only have one user, you can keep your app in "test mode" indefinitely.
* Fill in the following information - **App Name** (whatever you like), **User support email** and **Developer Contact Information** (your email address), and the **Authorized domains**. This should be your site's domain. Note that you want only the "second level domain". E.g. if your site is "database.mysite.org", just enter "mysite.org".

* Press **Save and Continue**.
* On the *Scopes* screen, select **Add or Remove Scopes**.
* Add the *openid* and *https://mail.google.com* scopes.
* Click **Save and Continue**.
* For *Test users*, click **Add Users** and add the email address(es) of the incoming email accounts you created.
* Click **Save and Continue**.
* Click **Credentials** in the left navigation menu.
* Click **Create Credentials » OAuth Client ID**.
* Set *Application Type* to **Web Application**.
* Set *Name* to whatever you'd like.
* Click **Add URI** under *Authorized Redirect URIs*. Add the Redirect URL from the CiviCRM OAuth screen (see "On CiviCRM" above).
* Click **Create**.
* You should get a screen that says *OAuth client created*, with a Client ID and Client Secret.
* To retrieve these values at a later date, click the **Edit** icon next to the credentials you've just created.

### On CiviCRM

* On The Google Mail OAuth screen you should already have open, paste in the Client ID and client secret you just retrieved from Google.
* Click **Add**.
* Go to CiviCRM's **Administer menu » CiviMail » Mail Accounts**.
* *Add Mail Account* is no longer a button, but a select box. Select **Google Mail**.
* You should see a Google login screen. Log in with the incoming email account's credentials.
* CiviCRM should correctly autodetect all the correct values. Review and press **Save**. **Note** \- if this is a bounce account, you still need to set the "localpart". E.g. if your bounce address is "unsuccessful@example.org", your localpart is `unsuccessful+`.
* If you haven't already, don't forget to go to **Administer menu » System Settings » Scheduled Jobs** and enable the *Process Inbound Email* job (or *Fetch Bounces* if this is a bounce account).

---
Tags: email, google, oauth, inbound-email
---


# Question
Title: If my website in in WP, can i install CiviCRM in drupal?
Our NP site is made with WP, i did install Civicrm but wasnt a fan of how it looked, i learned there is a theme but its only for the drupal version.

I installed drupal as a subdomain and was planning to install Civicrm. Is there any reason to have CRM on the same CMS?

# Answer
Welcome! What Masswear says is not right. You can have your website in wordpress and have CiviCRM in a Drupal installation.

You can the connect your wordpress site to civicrm with a plugin called CiviMcRestFace. This plugin creates an api connection to civicrm. So you need an API key (of the civicrm user) and the site key.

When you want to send signup forms to civicrm you can then use Caldera Forms and Integration of CiviCRM Form Processor with Caldera forms. You then also need the Form Processor extension in CiviCRM.

I believe that the Contact Form 7 CiviCRM Integration plugin also works with CiviRestFace. But I am not sure about that what I do know is that it connect to an external CiviCRM

When you want to display data from your drupal CiviCRM installation you can use the wpDataTable plugin and the Data Source CiviCRM api for wpDataTable plugin to display data from a civicrm as a table on your word press pages. Eventually you can use the Data Processor extension in CiviCRM to create custom api's through the user interface.
> 3 votes

# Answer
Welcome! If your website is made with Wordpress and you would like to integrate civiCRM with this website, you have to use the Plugin for wordpress. If you want to use Drupal, you will need to create the website with Drupal as well. You might want to look into this Wordpress-Plugin that supplies a theme for CiviCRM admin screens that is more in keeping with WordPress: https://wordpress.org/plugins/civicrm-admin-utilities/
> -3 votes

---
Tags: drupal
---


# Question
Title: Is there an easy way to provide a link to an online event after user has registered?
To start, I am looking for a purely civicrm solution.

I simply want to include a link to the webinar, livestream, etc. When the user registers, in their confirmation email, a link to the online location of the event will be included in the body of the email, and hopefully in eventics.

Any suggestions?

# Answer
> 1 votes
CiviCRM uses the "system workflow templates" "Events - Registration Confirmation and Receipt (off-line)" and Events - Registration Confirmation and Receipt (on-line)" for its automated event emails.

You would need to edit those to include general information you would like to display for each event. This can be a bit tricky as all kind of process logic is crammed in the template but it should be doable. Be aware that you can use api calls to pull certain parameters in order to use within the template.

Additionally, in every event configuration screen (tab online registration) there should be a little text box that allows you to add some event specific text to the email.

If for some reasons that does not work for you, you may want to get in contcact with us as we are currently developing a coherent "event email extension" that allows users to easily set up event mails with certain trigger rules and provide many additional features. We are still looking for funding to complete the extension and it's documentation.

---
Tags: civievent, urls
---


title: Double registration form on wordpress?

text:
# Question
Title: Double registration form on wordpress?
I got something quite strange and do not how to solve it. In my Wordpress 5.6.1 /CiviCRM 5.34 integration (my first WP integration but have am also working with D7/Civi for 8+ years) I get a double registration screen. It shows in the main area AND in the footer.

I am using the native url and not the shortcode. https://www.mydomain.nl/civicrm/event/register/?reset=1&id=12

UPDATE: it is only when I use a selected page as a footer in my enfold theme

# Answer
You could use JetPack or another widget visibility plugin to prevent showing the page in the footer when you're on the CiviCRM Base Page.

EDIT: The following code prevents CiviCRM from overriding the content a second time:

```
add_action( 'civicrm_basepage_parsed', 'my_civicrm_disable_content_filter' );

function my_civicrm_disable_content_filter() {
    // Once the CiviCRM filter has run, remove it.
    add_filter( 'the_content', 'my_civicrm_remove_content_filter', 100 );
}

function my_civicrm_remove_content_filter( $content ) {
    static $done;
    if ( ! isset( $done ) ) {
        remove_filter( 'the_content', [ civi_wp()->basepage, 'basepage_render' ] );
        $done = true;
    }
    return $content;
}

```

This should mean that your second page renders as expected.
> 1 votes

---
Tags: wordpress, civievent
---


# Question
Title: Menu problem when web host upgraded from CPanel to Site Tools
Recently, my host provider Siteground upgraded the back-end of my site from using a classic **CPanel** to the new and improved **Site Tools**. Upon the upgrade, the main CiviCRM 5.34.0 menu no longer appeared in my Drupal 7.78 instance. Also, icons with **?** showed up as unknown boxes. After getting assistance at chat.civicrm.org, the problem was solved...

# Answer
> 3 votes
I replaced the full URLs in the *civicrm.settings.php* file with relative URLs as shown below:

**FROM**

> global $civicrm\_root; $civicrm\_root = '/home/customer/www/example.org/public\_html/sites/all/modules/civicrm'; if (!defined('CIVICRM\_TEMPLATE\_COMPILEDIR')) { define( 'CIVICRM\_TEMPLATE\_COMPILEDIR', '/home/customer/www/example.org/public\_html/sites/default/files/civicrm/templates\_c/'); }

**TO**

> global $civicrm\_root; $civicrm\_root = './sites/all/modules/civicrm'; if (!defined('CIVICRM\_TEMPLATE\_COMPILEDIR')) { define( 'CIVICRM\_TEMPLATE\_COMPILEDIR', './sites/default/files/civicrm/templates\_c/'); }

---
Tags: civicrm.settings.php, menu, drupal-7
---


# Question
Title: Is it possible to view smart group membership in Views?
I have a view set up to display the content of groups but it only works for viewing manual group membership, not smart groups. (I have the form set to require input rather than the basic form style.) I'm wondering if there is a way to display smart group membership in views or, because of the nature of smart groups, this is just not possible.

I'm in Drupal 7, CiviCRM 5.27.7, Views 7.x-3.23 and CiviEntity 7.x-2.2

(Use case: I'd like to have a form where users can quickly pull up the membership of a group set to be used in a bulk mailing. The users could then review membership. While yes, this can be done in advanced search we were looking at a more Drupal style report where we can also easily display specific columns of information.)

# Answer
> 1 votes
We wrote and used this a few years back but haven't had cause to try it recently - not sure if it offers what you want https://github.com/fuzionnz/civicrm\_views\_smartgroup

# Answer
> 1 votes
You can join to any CiviCRM table with the Views CiviCRM Expose Tables module, so you can join to `civicrm_group_contact_cache`.

I'm not savvy enough about smart groups to know when this is reliable - this table gets destroyed and regenerated on a regular basis, and may come up empty sometimes. However, since this is for internal use, you could have some way to guarantee that the cache is full (e.g. by regenerating it as part of the user's workflow).

Another option to consider is Search Kit, if you can upgrade to newer versions of CiviCRM. It's very Views-like, and can give you a configurable set of columns.

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


# Question
Title: Providing opt-out link when sending an email directly from a contacts record
does anyone know if the "{contact.is\_opt\_out}" token works when sending an email directly from the contact record. On testing, I can't seem to get it to work. No link appears in the message in the email inbox. Thanks!

# Answer
is\_opt\_out isn't a link, it's the privacy preference checkbox on the contact record.

I don't believe the bulk mailing link tokens are available in this context, since you're not sending bulk mail.

But you can use the checksum token to include a link to a contact profile you set up. https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#checksum
> 2 votes

---
Tags: mailing, unsubscribe, opt-out
---


# Question
Title: Upgraded to CiviCRM 5.34.0 and extensions broke
I have upgraded to CiviCRM 5.34 and things seem to have gone astray. When loading the extensions page (Administer -\> Systems Settings -\> Extensions) the following error message is displayed:

> Extension download error The CiviCRM public extensions directory at could not be contacted - please check your webserver can make external HTTP requests or contact CiviCRM team on CiviCRM forum.

I cannot refresh the extensions list, not install any new extensions (I guess since the catalogue cannot be reached). I fired up a terminal into the server and Curl seems to work, and I cannot see any PHP options which may prevent connections.

Any help here?

# Answer
Looking at `CRM/Extension/Browser.php` where that error is generated, I would expect it to show a URL between the `at` and `could` in your message. So Civi isn't calculating the repository URL.

Tracing the code a bit, it seems that the URL should be calculated in `CRM_Extension_System::getRepositoryUrl()`, which pulls it from the `ext_repo_url` setting.

Here's what I would try, in order:

* Clear the CiviCRM cache, that's probably the issue anyway.
* Confirm that `<civiroot>/settings/Extension.setting.php` defines `ext_repo_url` with the default value of `https://civicrm.org/extdir/ver={ver}|cms={uf}`.
* Check the `civicrm_setting` table for a record with a `name` of `ext_repo_url`. If one exists, this is overriding the default; remove it.
* Alternatively, add a setting (via API Explorer, or in civicrm.settings.php - see Override settings in the docs) to set `ext_repo_url` to `https://civicrm.org/extdir/ver={ver}|cms={uf}`. This should force the correct URL to be generated.
> 2 votes

---
Tags: extension
---


# Question
Title: Warning: count(): Parameter must be an array or an object that implements Countable
I am not a PHP/SQL programmer. Our CivicCRM is Version 4.7. PHP is 7.3.27. I upgraded our WordPress site to WP 5.6.1 and now get these errors:

```
Warning: count(): Parameter must be an array or an object that implements Countable
in /home/rembrand/public_html/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB.php
on line 793

Warning: Cannot modify header information - headers already sent by (output started
at /home/rembrand/public_html/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB.php:793)
in /home/rembrand/public_html/wordpress/wp-admin/admin-header.php
on line 9

if (!count($dsn)) {
            return $parsed;
        }

```

Warning appears at top of screen when I enter Wordpress admin dashboard for our website and edit any page.

How do I fix this?

# Answer
It sounds like you're running PHP 7.2 or greater with a version of CiviCRM that doesn't support PHP 7.2+. If you edit your question to include your CiviCRM version, that could help folks troubleshoot. However, it sounds like you may need to upgrade your CiviCRM to a version that supports 7.2.
> 2 votes

---
Tags: wordpress, 4.7, php7
---


# Question
Title: Where is the privacy filters located in report templates?
By default all privacy filters i.e. do not email, do not mail, etc is loaded in the report, except for **do not trade.**

Where in the report (contribution details )template this filters are located? How can I find out? Thanks

# Answer
I think it's at the below link and yes it's strangely missing. Do you want to open a lab ticket?

https://github.com/civicrm/civicrm-core/blob/33307b5a0da280c63ed0d8fa1f8a3e899a217ad0/CRM/Report/Form.php#L5473
> 1 votes

---
Tags: civireport, reports, privacy
---


# Question
Title: How do I allow multiple monetary display formats on the same installation?
I'm trying to duplicate a donation form in two different languages, Canadian French and English. I have the correct languages installed with i18n Internationalisation and translation is working based on the language inherited from Drupal 7. There is only one currency required, CAD.

Money and date formats differ between Canadian English and French, however. The cheat sheet here outlines the settings I want, but I only need it for a single page.

http://wiki.civicrm.org/confluence/display/CRMDOC41/French+Canadian+localization+settings

As far as I can tell, the localization settings at civicrm/admin/setting/localization?reset=1 apply to the entire site and won't switch with the language. I have made numerous jQuery functions in my Main.tpl, OnBehalfOf.tpl and BillingBlock.tpl override templates to perfect the colloquial wording in various sections, but the money format also needs to change dynamically. This is an example:

$1,000.00 === 1 000,00 $

Is there must be a better way to run a bilingual site? Can you override the localization settings for a single page?

# Answer
Here is an extension that might help a bit with money formatting issues in Canada:

https://civicrm.org/extensions/canadianbacon

It basically sets the CiviCRM money settings dynamically when it detects the `fr_CA` or `fr_FR` language. We have been using these kind of hacks for a while, but had never bothered to make a proper extension, hoping it would be fixed in core (which is more complicated to fix than expected).
> 3 votes

---
Tags: localisation, currency
---


# Question
Title: CiviCRM Spark fees, database migration/export and cancellation
I need to cancel my monhtly fee as we have transfered to our server. Can you tell me how to do this please. I have tried to log in but says I have worng info to log in. Also would like to know f the 18.48 monthly fee includes HST or not

# Answer
> 1 votes
You can export your CiviCRM Spark database by going to Administer \> Backups. This should be sufficient to get started on your own instance, but you may need to also download CiviCRM extensions (CiviCRM will display errors on the admin pages telling you which extensions are missing, most of which are not critical).

The monthly fees do not have any HST, since the service is run from the United-States (assuming that by HST you mean Canada's taxes?).

Once you are ready to cancel, there are links in the monthly renewal emails to allow self-serve cancellation.

Please do not hesitate to contact us at spark@civicrm.org for any billing or cancellation questions.

---
Tags: civicrm-spark
---


# Question
Title: How to display remaining event participants?
If you want to display the number of remaining event participants (based on their **role**, too) until an event is fully booked, you could implement the following in EventInfo.tpl:

```
<div class="crm-section event_remaining">
    <div class="label">Participants</div>
        <div class="content">{crmAPI var="ParticipantS" entity="Participant" action="get" role_id="1" sequential="1" event_id=$event.id }
    {if $event.max_participants<=$ParticipantS.count}
        0 remaining
    {else}
    {math equation="x - y" x=$event.max_participants y=$ParticipantS.count} remaining
    {/if}
         </div>
</div>

```

# Answer
Watch out: role\_id="X" \> adjust to your needs. Tested and working.
> 0 votes

---
Tags: civievent, participants
---


title: install in subdomain with Joomla

text:
# Question
Title: install in subdomain with Joomla
we are moving from an access database to civcrm shortly. I have decided to load it on a subdomain. our public website is joomla based, so it probably makes most sense to stick with that. so loading joomla and having civicrm installed as the only component on the subdomain installation.

That being said, should the sub domain files be loaded in the public\_html folder or just in the home folder?

We want to keep the civcrm info private and i will be likely using the api to get data to the public site or performing some scheduled export from civicrm import into data table for extentions procedure we already have in place for showing events etc.

Does it matter? I dont think it should but first timer here! lol

# Answer
> 0 votes
This is more of a web server configuration question than CiviCRM-specific. Having a subdomain (that is, civi.mysite.org, not mysite.org/civi) doesn't even require the sites be on the same server, let alone in a directory of another.

I recommend a complete separation of their folders (assuming non-crappy hosting that doesn't make this difficult/impossible). When placing a CMS inside another CMS's folder, you can end up in scenarios where files that shouldn't be web-readable become web-readable.

---
Tags: joomla
---


title: Extrnal API access. Status_code 414

text:
# Question
Title: Extrnal API access. Status_code 414
I am progressing deeper and deeper into CivCRM intricacies, and work with External (https://) access of the database via API's. When performing a python requests.get(....,entity=Contact,action=get) it works OK, and I get the data I request.

Next I tried to update the contact/membership with a payment via requests.get(...entity=Contribution, action=create...) and the same for requests.post, both gave the same disappointing status\_code of 414. I also tried to get some more information and among the plethora of data dumped the following was "readable":

*"is\_error":1,"error\_message":"API permission check failed for Contribution/create call; insufficient permission: require access CiviCRM and access CiviContribute and edit contributions"},* as well as a status\_code of 414 (unknown to me)

I have now updated my access-capabilities (granted all "Edit Capabilities: Custom) in the role table in WP (where our CiviCRM resides), so I shall have all the rights mentioned above. Still the same problem. We run API 3 at present, but I do not think that is the problem here.

So here I am asking for some guidance, please!

Claes

# Answer
You'll have an easier time modifying the permissions from within CiviCRM - **Administer menu \>\> Users and Permissions \>\> Permissions (Access Control)**. When changing permissions from WP, you're usually dealing with machine names, not human-readable labels, so it can be hard to correlate error messages with the particular permission needed.

It sounds like your REST user still doesn't have the *Access CiviContribute* permission.
> 1 votes

---
Tags: api
---


title: Installation on local wordpress server

text:
# Question
Title: Installation on local wordpress server
I'm trying to run CiviCRM v.5.34.0 with Wordpress v.5.6.1 on a local server. Unfortunately the installation of CiviCRM crashes with the following error:

`Fatal error: Uncaught Civi\Setup\Exception\SqlException: Cannot execute CREATE TABLE `civicrm_address_format` ( `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Address Format Id', `format` text [...]`

The server is running via xampp v3.2.4:

* Server-Typ: MariaDB
* Server-Verbindung: SSL wird nicht verwendet Dokumentation
* Server-Version: 10.4.17-MariaDB - mariadb.org binary distribution
* Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/8.0.2
* Datenbank-Client Version: libmysql - mysqlnd 8.0.2
* PHP-Erweiterung: mysqli Dokumentation curl Dokumentation mbstring Dokumentation
* PHP-Version: 8.0.2

The mysql user has all privileges and GRANT access.

I really would like to test CiviCRM to see if it satisfies my needs, which it promises to do.

Hope someone can help me.

# Answer
This appears to be an incompatibilty with php 8, even though the message initially suggests a SQL problem.
> 0 votes

---
Tags: wordpress, installation, failure
---


# Question
Title: Recent Items Block Does Not Show Recent Items Unless There Are Report Results
I am having a strange issue with the Recent Items block. It does not show all the results it should unless you are on a report that is showing results.

If I am just in CiviCRM I see this.

If I go to report and refresh the results I see something more like this.

I do not see any errors being generated or anything else I can put my finger on. I cannot replicate the issue in DMASTER. DMASTER is Drupal 7 and we did not have this issue in Drupal 7.

We are running running CiviCRM 5.31.1 and Drupal 8.9.10.

Any ideas are greatly appreciated.

Thanks, Josh

# Answer
> 2 votes
Can you try this patch? https://github.com/civicrm/civicrm-drupal-8/pull/62

More discussion in ticket https://lab.civicrm.org/dev/core/-/issues/2387

UPDATE: should be fixed in 5.36.0

---
Tags: drupal
---


# Question
Title: When using PayPal, we DON'T want to collect credit card info!
I've searched for the answer to this, but haven't found it. Our issue is we want to have a contribution page with PayPal and Pay Later capability but don't want credit card information entered on our server.

I've just set up a contribution page, and the PayPal section requests all the credit card information be entered ON OUR SERVER before going to PayPal to complete the transaction. We really don't want this info on our servers, even temporarily!

For event ticket sales, choosing PayPal for the fees sends us to PayPal where the PayPal account or other credit card information is then entered on their servers. This is the way we would like the contribution pages to work.

Am I doing something wrong here? I can't remember ever seeing a credit card information form on any of my sites.

We're running CiviCRM 5.32.2 on Wordpress.

Thanks, Rick

# Answer
I've not tried all these options out, but looking at the documentation for Payment Processors (user guide and system administrators guide there is more than one PayPal payment processor. With PayPal Standard all the credit card details are collected on the PayPal site and with PayPal Pro they are collected on your site and transferred by SSL but not kept. There is also PayPal express. I suspect that you maybe using different Payment Processors for your two cases. Certainly worth checking what you have and adding that to the question. I'm not sure what the relevance of Pay Later is having never used that, but I think that's for offline collection of the payment.
> 4 votes

---
Tags: paypal, security
---


title: Events or Booking for Tour managment?

text:
# Question
Title: Events or Booking for Tour managment?
I work for a NP that organizes performing arts and visual arts tours for our members. We handle the booking, contracting etc for our members. We are making the move to civicrm. Tours can have up to 30 dates/entries

I feel confident I will be able to move contacts over, but am starting to strategize on how to recreate or reimagine our tour management process. We do not manage the registration or selling of tickets for our members. That is all handled locally.

Currently the flow is( This is currently in access in a tabbed form view)

Tour details(Tour name, Program, Description, image url, Agent, etc.)

> Bookings ( Presenter, Date, time, location, fee, contact person, ticket link, commission, etc) Artist payments ( summary of artist fees from bookings tab, payment, type, date, cheque payable to, amount) Evaluation (submitted dates, attendance, capacity, gross receipts, comments)

I have reviewed some videos on the Events and on the Bookings extension. neither seem to replicate this flow. I will likely have to either change the flow or create/alter an extension to recreate this flow. Has anyone replicated this scenario or have any suggestion on how this may be accomplished. I am what I would call a shade tree mechanic when it comes to php. I can handle the basics, and edit existing code pretty well, but building from the ground up would be a challenge.

# Answer
we support a client doing Tour stuff for a theatre company. we/they manage their process via Activities and (drupal) webforms. so someone makes an enquiry, that creates an activity with custom field storing all the necessary goodies. since it sounds like you are not dealing with the registrations perhaps consider this approach rather than Events or Bookings
> 1 votes

---
Tags: civievent, civibooking
---


# Question
Title: "Created by" field of CiviMail pulls the name of the latest subscriber
I am a new user of CiviCRM. My organisation uses CiviCRM 4.6.36. and I have a small problem: for some reason, CiviMail shows the name of the latest subscriber in the "created by" field when I create an email. It is not a big issue but causes some confusion. I went through the settings but was unable to resolve the issue. My question is: what might cause the problem?

Thank you very much in advance for your help!

# Answer
CiviCRM 4.6 has not been supported for some time. It has known security issues and PHP compatibility issues.

There may still be people in the community with CiviCRM 4.6 sites who can assist in troubleshooting but you should absolutely raise within your organisation that they should be upgrading CiviCRM to a supported version.

The end of life for CiviCRM 4.6 and 4.7 was announced on 2018-12-02 here: https://civicrm.org/blog/josh/extended-security-release-update
> 1 votes

---
Tags: civimail, 4.6
---


# Question
Title: on logging into civi we are getting the following error message, can anyone direct me as to a solution?
Initialization Error

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

```
[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] =>  [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']
[type] => DB_Error
[user_info] =>  [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']"]

```

) Initialization Error

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

```
[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] =>  [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']
[type] => DB_Error
[user_info] =>  [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=Access denied for user 'pascrm49_drupa86'@'localhost' to database 'pascrm49_civicrm']"]

```

)

# Answer
You'll need database access and grant all permissions to the user 'pascrm49\_drupa86'@'localhost' for the 'pascrm49\_civicrm' database.

Something like

grant all on 'pascrm49\_civicrm' to 'pascrm49\_drupa86'@'localhost';

Theres probably an official direction somewhere but this is just to get you out of a bind if your civicrm install is broken.
> 1 votes

---
Tags: drupal, siteground
---


# Question
Title: Only in WORDPRESS: REST.php ---> Unable to decode supplied JSON
This is my first post for CiviCRM.

Hi to all.

I have seen others post related and nowadays the problem remain.

Different from this post: REST API: Unable to decode supplied JSON \- with wordpress I got always the same response "**Unable to decode supplied JSON**".

I tried clear installation with Joomla and also Backdrop, and both works correctly.

I am not a good programmer but I tried to do some stuff myself, here you what I prepared on my little server:

WordPress+CiviCRM with the problem: link clear installation

WordPress+CiviCRM fixed myself: custom

Here you what I modified to the file REST.php...

after line 326

```
    if (array_key_exists('json', $requestParams) && $requestParams['json'][0] == "{") {
      $params = json_decode($requestParams['json'], TRUE);

```

my modification start here

```
      $new_requestParams= $requestParams['json'];

      $new_requestParams= str_replace("\\", "", $new_requestParams);
      $new_requestParams= str_replace("\\", "", $new_requestParams);

      $params = json_decode($new_requestParams, TRUE);

```

I practically saw a lot of "\\" before the JSON DECODE.

So removing this "\\" now works regularly.

If you wish can check directly on both sites: Clear ----\> http://144.91.105.68/cms/wordpress

Custom ---\> http://144.91.105.68/cms/cust/wordpress

The user and password are both same: **admin** / **admin**

And also siteKey and api\_key are always: **a42bfc2b33cf13184711bff14fe1fb19**

Regards Roberto T.

# Answer
The correct endpoint for WordPress is `wp-json/civicrm/v3/rest`. Its documented in the developer manual, see https://docs.civicrm.org/dev/en/latest/api/v3/wp-rest/#endpoints. When you just copy the URL that is suggested in the API explorer you are left in the dark.
> 2 votes

---
Tags: wordpress, api, rest, json
---


# Question
Title: End-of-life for Web Spell Checker (WSC) dialog plugin for CKEditor 4
A client of ours recently brought to our attention that the spell checker functionality that’s partnered with CKEditor 4 is coming to its end of life for the free version by the end of June 2021.

https://webspellchecker.com/blog/2020/12/02/end-of-life-for-spell-checker-dialog-plugin-for-ckeditor-4/

It’s a functionality they wish to continue to use, what alternatives/options are available?

# Answer
This is a solution that the client accepted so thought I’d share –

Enable the browser spell check functionality.

Administer \> Customize Data and Screens \> Display Preferences \> Configure CKEditor

By default, native browser spell check functionality is disabled in the editor. Use the config.disableNativeSpellChecker configuration option to enable it:

```
config.disableNativeSpellChecker = false;

```

With this addition to the CKEditor configuration you should be able to see the spelling corrections underlined in your editor content.
> 1 votes

---
Tags: ckeditor
---


# Question
Title: When did IIF amount formats change and how can I get it back to old format?
How does the IIF export from Accounting Batches get its information to determine the format of the amounts? Batches created before 5.34 export simple value amounts:

```
12.00
-12.00

```

Batches after the upgrade to 5.34 adds a dollar sign to the amount:

```
$12.00
-$12.00

```

I can't get these files imported without loading them into Excel and changing the formatting. How can I get the amounts to return to the earlier format? What changed in Civi to cause this?

# Answer
> 2 votes
There's been some changes to support php 7.4 which doesn't have money\_format() and also some work towards locales. Most likely that's the cause. I'd open a lab ticket.

I'd guess this line needs to be changed to match the other changes that have happened:

https://github.com/civicrm/civicrm-core/blob/33307b5a0da280c63ed0d8fa1f8a3e899a217ad0/CRM/Financial/BAO/ExportFormat/IIF.php#L354

Like this example: https://github.com/civicrm/civicrm-core/pull/19602/files

# Answer
> 0 votes
It seemed at first this was due to a customization, and was not able to be replicated on dmaster. We have changed this output file however to better support the right number of digits for the localized currency, and appropriate rounding. Eventually problem was isolated to new code that runs when php-intl library is available, and fix merged into 5.34.

See https://lab.civicrm.org/dev/financial/-/issues/166

---
Tags: accounting, quickbooks
---


title: Date and hour format with seconds

text:
# Question
Title: Date and hour format with seconds
this date and hour format should work: `%d/%m/%Y %k:%M:%S` but I'm not getting the seconds: `17/02/2021 9:15:%S`

Is `%S` compatible in CiviCRM?

# Answer
Normally, (custom) date formatting in civicrm is handled by this function:

https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/Date.php#L300

You'll see at about line 410 that there's no substitution for seconds.

Sounds like a not-very-difficult feature waiting to be added.
> 0 votes

---
Tags: date-preferences
---


# Question
Title: Can I set up PayPal integration so all purchases and donor information are automatically recorded on CiviCRM?
Can we integrate CiviCRM with PayPal so that any purchases through our website are recorded on the CiviCRM donor info?

# Answer
Welcome to SE. You can integrate PayPal with CiviCRM - See Payment Processors in the documentation (https://docs.civicrm.org/user/en/latest/contributions/payment-processors/). This will mean you can take payment for any CiviCRM contributions via PayPal and it will be recorded against the contact. This includes memberships, events and donations and you can link this from a web page. However, if you have existing purchases via some other package on your website using PayPal, it won't show these. Just those originating in CiviCRM.
> 1 votes

---
Tags: paypal
---


title: Cannot delete contributions

text:
# Question
Title: Cannot delete contributions
I am trying to delete a contribution and after I confirm that I want to it just hangs with the pop up and a spinning CiviCRM logo indefinitely. I get the following in the error log.

Feb 24 10:07:53 \[error\] $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -26
[message] => DB Error: insufficient permissions
[mode] => 16
[debug_info] => DELETE FROM civicrm_activity WHERE source_record_id IN ( 3710 ) AND activity_type_id IN ( 6 ) [nativecode=1142 ** TRIGGER command denied to user 'coma6771_crmwp'@'localhost' for table 'civicrm_activity']
[type] => DB_Error
[user_info] => DELETE FROM civicrm_activity WHERE source_record_id IN ( 3710 ) AND activity_type_id IN ( 6 ) [nativecode=1142 ** TRIGGER command denied to user 'coma6771_crmwp'@'localhost' for table 'civicrm_activity']
[to_string] => [db_error: message="DB Error: insufficient permissions" code=-26 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM civicrm_activity WHERE source_record_id IN ( 3710 ) AND activity_type_id IN ( 6 ) [nativecode=1142 ** TRIGGER command denied to user 'coma6771_crmwp'@'localhost' for table 'civicrm_activity']"]

```

)

The user has full access for the database, but I can't see anything about table specific access.I know it was working quite recently and don't think I have changed anything relevant.

I'm on WordPress and CiviCRM 5.26.2

# Answer
Did you move the database with `mysqldump` and `mysql`? Then trigger can fail because he has rights in the old database, and not in the new. The solution is to recreate all triggers. This can be done with the following command.

```
wp eval "Civi::service('sql_triggers')->rebuild(NULL, FALSE);"

```
> 3 votes

---
Tags: civicontribute
---


# Question
Title: Can I dump all Caldera form submission data into the "details" of a CiviCRM activity?
Caldera will email all form submission data in an email. Can I have that same form submission data added to the details field of CiviCRM activity records?

I don't see a tag to be able to do so from the CiviCRM Activity Processor, but surely this must be possible.

Thanks!

# Answer
> 3 votes
You can use the `Integration of CiviCRM's Form Processor with Caldera Forms`. See https://wordpress.org/plugins/cf-civicrm-formprocessor/

# Answer
> 0 votes
I'm not sure what you mean by "tag" but if by "Activity Processor" you mean the Email Processor then you can set the recipient email to be the email address of the email processor and it will file it in civi with the email body as the activity details. See https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/inbound/#autofiling-email-activities-via-emailprocessor

---
Tags: activities, activity, caldera-forms, data-processor
---


# Question
Title: Select contacts to register for events does nothing - how to fix?
User selects one or more contacts, then selects action 'Register participants for event' and nothing happens - zilch. In fact, none of the actions work at all. This system was restored last Sunday after a migration failure, so I rebuilt triggers with civicrm/menu/rebuild?reset=1&triggerRebuild=1 but this didn't fix the problem. So perhaps something broke in the restore? Release 5.28.3 / Drupal. Ideas on how to fix, please?

# Answer
I fixed this by disabling the Bootstrap theme and then re-enabling it. Other users had also had this problem, usually involving Shoreditch and/or Bootstrap.
> 2 votes

---
Tags: civievent, drupal, actions
---


# Question
Title: I want someone BCCd to an email genearted by a System Workflow Message
I want to add a CC or BCC email to an email generated by System Workflow Messages. For example, when the "Memberships - Signup and Renewal Receipts" message gets emailed to a donator, I want another person BCCd on that email. Where do I go to configure how, who, and when those System Workflow Messages get sent?

# Answer
> 1 votes
On a Contribution Page on the Receipt tab, you can add CC and BCC

---
Tags: civimail, email, message-templates, system-workflow-messages
---


title: Searchkit Buttons not working

text:
# Question
Title: Searchkit Buttons not working
Using beta version of SearchKit. Buttons for Add, Compose Search and AND,OR,Not options are not working/unresponsive.

# Answer
> 2 votes
Problem a result of using Shoreditch as Civi theme. Same problem exhibited when using API Explorer UI.

SearchKit and API Explorer both use bootstrap theme which seems to have conflict with Shoreditch.

Only solution found was to uninstall Shoreditch. (Disabling shoreditch was not sufficient)

---
Tags: shoreditch, bootstrap, apiv4, searchkit
---


# Question
Title: Why are only some membership status rules working?
Using CiviCRM 5.31 on Drupal 7.75, but this has been a long-standing issue for me. It has never worked...

I have several membership status rules as outlined in the screenshot below. All of them work as expected and membership status gets updated when it should, EXCEPT for the "Old" status. Memberships that are "Expired" never get changed to "Old". We need that distinction in our system and I have had to do it manually for years.

Any ideas on why this might not be working? Thanks in advance.

# Answer
Not sure how else to mark this as answered, so I am accepting the explanation from Parvez in the comments below. Basically, it seems that once "Expired" status is achieved, it no longer gets changed.
> 2 votes

# Answer
We have the exact same problem, as described below. However, to cut to the chase: We were updating memberships by importing new membership end dates but status was never changed from expired. ***Finally we realized that importing an appropriate membership status (or for that matter *any* status that is not expired) is necessary. This produces a membership that now will be processed by the next run of the cron job and correctly categorized. Problem solved, and more importantly, problem understood!*** More details below -------------

Once a membership is set to "Expired" it never seems to be examined again. We have 900 memberships, 350 of which should be either current, new or grace, but only 123 of which are currently indicated to be current, new or grace. Whenever we run the membership status rules, it only processes 123 memberships, and doesn't change any of those.

We modify membership end dates via a membership upload process and maybe that is the issue. We know that the upload won't change the status, but when we run the update membership status cron job, it does not change the status of someone whose membership end date is months or years in the future. They are still "expired", . and seemingly, once "expired" the membership stays that way. If I use "edit" on the membership and move the end date by one day, it then is evaluated as current and all is well. Somehow the membership status rules cron job doesn't examine any memberships whose status isn't current, grace or new.

Update: Changing the order of status rules didn't change the behavior - we put the Expired rule at the top, and it still only seems to look at the 123 that were current memberships.

UPDATE - as a test: exporting four of the incorrectly labeled Expired memberships and then importing them as New, Current, Grace and Pending, we find that all four memberships have their status's changed to these four, and then running the membership status cron job changes all of these to the correct "current" status.

UPDATE 4-28-21 @petednz mentions that this answer isn't completely clear. So to clarify: updating membership end date using the membership import process requires that a membership status also be uploaded at that time. Just changing the end date to a future time does not remove the "expired" status, and the cron job doesn't apparently examine expired memberships. So importing any of the active statuses (new, current, grace, and pending) is all that is needed to make the memberships eligible for examination and categorization by the cron job. ***Don't upload just dates, but instead include an appropriate status.***
> 2 votes

---
Tags: civimember, status
---


# Question
Title: Has any work been done to integrate Zoom and CiviCRM
Outcome would be something along the lines that an attendee of Zoom meeting (eg Zoom id 234) gets added as a participant to Event X (which would have a custom field with 234 in it to help link to Zoom data)

# Answer
Seems like NCN Civi Zoom may already provide integration between Civi and Zoom webinars - thanks to Raphael for sharing so we or others can hopefully build more features in to it.
> 2 votes

# Answer
Repo has moved to https://github.com/veda-consulting-company/ncn-civi-zoom thanks to Veda Consulting
> 1 votes

# Answer
There is also CiviZoom by LCD.
> 1 votes

---
Tags: zoom
---


# Question
Title: Open CiviCase via Webform with manager role assigned
We are trying to set up a webform to open a case and assign a case role (manager).

I configured two contacts - coordinator and client - and assigned them to the case in the webform. The client as client and creator and the coordinator to the managing role of the case. For the coordinator contatc I set a static field with a default contact value.

The open case part works fine, but assigning the coordinator as manager does not work. Instead, the first contact (client) is also assigned as manager.

I also tried opening a case without a manager being set. But in this case, the manager role is also assigned to the client contact.

Does anyone have an idea what the problem could be?

**System**

CiviCRM v5.28.2

Drupal v7.78

Webform CiviCRM Integration v7.x-5.4

# Answer
> 2 votes
**Finally it is working!**

Two where important:

1. Disable "Enforce Permissions" for the contact field in the webform config, filled with a default value.
2. Look out for the field "Update Existing Case" on the CiviCRM tab. It was set to a case status value, so it would change an existing case.

Many thanks to @AndyClark and @RayWright!

# Answer
> 1 votes
All the screenshots are super helpful. I think because you have set it to be a static contact but did not tell it which contact, you are seeing an issue. Can you place the ID number of the desired case manager in the Contact (Kontakt) field right below "Set default contact from: Specified Contact"?

To test that it's working, you might turn on Display Contact Name - just to check that then the form is dispalying the name of the contact you set.

---
Tags: webform-civicrm, civicase, roles
---


title: Year only import

text:
# Question
Title: Year only import
Is it possible to do a Contact import where a date column is in year only format (2018,2020 etc)? I tried looking at the Administer -\> Localization -\> Date Formats and noticed year only is an option for "Date Display", but it doesn't appear as an option in Contacts -\> Import Contacts. I can't find anything about it in the official documentation.

Furthermore, If it cannot be done, are there any negative effects functionality wise (Filtering data/ Reports) if I was to change the format to Alphanumeric? The customer really wants it to be date format.

Edit: I'm guessing that even if it is in year only display, it needs to have an actual real date associated with it to be a valid "Date". I'm just concerned for functionality reasons.

# Answer
When I have had something like this I have just set the dates to 01/01/2018 or 01/01/2020 in the file to be imported, which means that if you set the date more precisely for future contacts entered in directly that you can still sort by the date. Just means that if its the first day of the year it might not be precise. As long as users are aware of this, then I can't see that causing any problems.
> 1 votes

---
Tags: import, date-preferences
---


title: Personalized Drupal login link

text:
# Question
Title: Personalized Drupal login link
I can send out personalized links from CiviCRM, as described here. https://aghstrategies.com/content/how-create-one-click-personalized-links-civicrm-emails

They contain the contact id and a checksum that civicrm manages. Following the link will 'identify' the user.

Can I use such a link to have a contact that has a Drupal account log in to Drupal ?

I have a module in which I can create a menu router, validate the url, find a drupal id, log a user in, and redirect, I reckon. But to validate the url, I have to validate the checksum which afaik is not in the API, so I have to call the deep dark Core::BAODAO magic.

Is there an easy way to do this ?

If not, can someone sketch the BAODAO part ?

# Answer
> 2 votes
I was looking for a way to validate the checksum at one point, too. Here's what I found:

```
CRM_Contact_BAO_Contact_Utils::validChecksum($cid, $_GET["cs"])

```

which takes a CiviCRM contact id (`$cid`) and compares it to the checksum in the URL and did the trick for me.

**UPDATE:**

It looks like the usage has changed slightly in core since I pulled the above out of there (although the above was still working for me). Below was taken from here:

```
    //check if this is a checksum authentication
$userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this);
if ($userChecksum) {
  //check for anonymous user.
  $validUser = CRM_Contact_BAO_Contact_Utils::validChecksum($tempID, $userChecksum);
  if ($validUser) {
    return $tempID;
  }
}

```

# Answer
> 1 votes
*CiviCRM intentionally doesn't provide login functionality for the CMS. Access bypass could have serious implications for your org - use with caution. You don't want to wake up in the newspaper because your membership DB got disclosed.*

*Similarly, CiviCRM emails aren't treated the same way that password reset emails are. People forward CiviCRM emails a lot, and if you're providing login functionality you risk exposing user information when doing so.*

***Use the examples below with care.***

---

If you want to use CiviCRM checksums to implement the same functionality as a Drupal login, you could do the following perhaps?

* Create a custom extension which provides a custom menu callback (eg `civicrm/user-login`).
* In your custom callback, identify the Drupal user and log them in. (This is really easy.
* Send out an email with a CiviCRM checksum pointed at this callback and perhaps with an additional parameter indicating the final destination URL.
* Perhaps add some checks to prevent it working for any users with "administer site configuration" permissions to limit the chance of abuse.

You have code to validate a checksum above, so from here you'd want to -

**Identify the user to match**

```
$params = array(
  'version' => 3,
  'sequential' => 1,
  'contact_id' => 1,
);
$result = civicrm_api('UFMatch', 'get', $params);
// $uid is $result['values'][0]['uf_id'] or similar here.

```

**Load the matching user**

```
$account = user_load($uid);

```

**Check they aren't an admin (fairly arbitrary this)**

```
if (!user_access('administer site configuration', $account)) {
  // ...
}

```

**Log them in**

```
global $user;
$user = $account;

```

---

CiviCRM provides multiple concurrent checksums, since a user may have received one of several emails recently. Drupal provides only a single user login URL at a time.

It is possible to add Drupal login URLs to an email, and you could do this by implementing your own custom token, BUT you'd have to play along with Drupal's login lifespan (24 or 48H?) and any other limitations. CiviCRM checksums will be easier to handle here, provided you can account for the security implications of doing this :)

# Answer
> 1 votes
This extension is a bit experimental (read: not extensively tested, was old code, now bundled into an extension): https://civicrm.org/extensions/d7onetime

It provides a CiviCRM token called `{d7onetime.url}` which can be included in emails or Scheduled Reminders (which can be practical for implementing better-looking welcome emails to users, adapted to their membership type).

# Answer
> 0 votes
If you are really wanting to mail out a link that logs the user in, then it's not really a CiviCRM question, since authentication is handled by Drupal. Here are some modules that might help you:

---
Tags: email, php, personal-campaign-pages
---


title: what time zone does Civi think its in?

text:
# Question
Title: what time zone does Civi think its in?
I am trying to send a scheduled mailer and need to know what time CIVI believes it is in ? Right now CIVI appears to be 2 hrs. ahead of my time zone but there is not indication of time zone anywhere. Thanks.

# Answer
Welcome to SE. As far as I know, the timezone is just inherited from the host CMS. I did not have to select any on install and I can change it in the CMS (WordPress in my case). So check what time the CMS believes it to be in.
> 1 votes

---
Tags: scheduled-job
---


# Question
Title: Target emails based on contacts near a postal code
I am moving over to CiviCRM from The Action Network and am wondering if email blasts can be targeted by inputting a location (postal code or city) and choosing a set number of kilometers surrounding it to include. Thank you.

# Answer
See https://docs.civicrm.org/user/en/latest/the-user-interface/searching/#proximity-search then from the actions dropdown create a group or smart group out of the results and use the group in your mailing.
> 2 votes

---
Tags: civimail
---


# Question
Title: Upgrade database URL loops to WP login screen but works on a cloned staging site
Experiencing a strange situation where the database upgrade url worked perfectly for a testing site but not for the live site.

I successfully tested the upgrade with a cloned staging site without a hitch in the upgrade process.

https://staging.islandnaturetrust.ca/

By following the CiviCRM Wordpress upgrade guide: https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/

However, as soon as I attempted on the main site the updgrade database url loops back to the WP login page.

https://www.islandnaturetrust.ca/

Steps:

1. Login as administrator for wordpress site
2. Paste upgrade database url into browser http://islandnaturetrust.ca/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1
3. Page redirects to WP login page with no errors.
4. Login once more
5. Paste URL
6. Returned back to WP login page

I've checked the CiviCRM debug log but no errors reported.

Thoughts anyone?

UPDATE: Upgrading from 5.25 to 5.34

# Answer
> 1 votes
I stumbled across a work around purely by accident but to cut a long story short:

Problem is that since the upgrade database url points to an unsecure http file, my server then wants to redirect to the secure url - resetting the session - requiring an admin login (not sure why this is since automatic SSL redirects have been disabled). Using the upgrade url, I deliberately added an additional character/integer to the url end, forcing the browser to navigate to a http page that doesn't exist. Now that I was sitting in a unsecure 404 page, I simply deleted the previously added character/integer and voila; no redirect to a secure page and consequently the upgrade screen correctly loads.

---
Tags: wordpress, upgrade, database
---


# Question
Title: Failing to create Wordpress account with user name provided in profile on contribution page
**Initial situation**

We have a contribution page to purchase a membership. A profile is used to collect address data. Furthermore, this profile is configured to also create a Wordpress user account: The user can enter a Wordpress user name and also check its availability. And the user can enter the desired password in the two boxes.

**The issue**

Until recently, everything was working as expected. Upon confirming the contribution, the Wordpress user was created with the given name and the user was automatically logged into this account at the end of the transaction.

Now we have a changed behavior: The transaction completes without any error, but **the user is not automatically logged into the newly created account any more**. It is NOT possible to log into the account with the entered username and password. **In Wordpress, a new user is created, but not with the entered user name.** The username is instead derived from the address information (e.g. mr-frank-smith) and an unknown password is assigned. So the user has to use his e-mail address for login and initially he has to go the "forgot password" route to request a new, known password.

**System information**

CiviCRM 5.34, but the behavior was probably also present with 5.32.

Wordpress 5.6.2 with the most recent Member Sync and Profile Sync plugins.

**Additional Information**

Setting up just a page with a profile to enter an e-mail address and create a Wordpress account does work as expected. Upon completion of the form, the account gets created with the given username and the user is automatically logged into the account.

So, somehow the problematic behavior is linked to the contribution page/signup process.

I tried it with the Stripe payment processor as well as with the dummy processor and the issue occurred in both cases - so it is probably not related to a particular payment processor.

**The Question**

Can this changed behavior also be observed on other installations? Wondering, if some settings etc. might interfere. If this is a known issue: Are there any good workarounds? Asking new members to request a new password after they entered one during sign-up is not so ideal...

**Edit: Further investigation**

On a newly created virtual server I set up the lastest Wordpress without any plugins and also the latest CiviCRM (5.34) without any plugins. I experience the same behavior:

A profile with settings to create a Wordpress account does create this account, if it is used standalone on a page. If it is used on a contribution page, the Wordpress account does not get created. Seems to be a bug most likely introduced in one of the latest versions of CiviCRM.

# Answer
> 1 votes
It is indeed a confirmed bug in CiviCRM 5.34 which is now tracked under the following issue: https://lab.civicrm.org/dev/wordpress/-/issues/94

---
Tags: wordpress, civicontribute, civimember, user-account
---


title: Twilio Inbound SMS: 404/502 Responses

text:
# Question
Title: Twilio Inbound SMS: 404/502 Responses
CiviCRM: WordPress V5.6.2, hosted on CiviHosting

We can successfully send outbound SMS messages but cannot receive replies back through the webhook in Twilio. We either get HTTP 404 Not Found, 502 Bad Gateway (both encountered on version 5.X), or Schema Validation required responses (encountered on version 4.7).

Twilio Error example:

We followed the CiviCRM setup documentation here, including using the example callback URL.

I have noticed other posts on Stack Exchange highlighting similar issues with different suggestions for callback URLs but all of those different URL configurations have failed, and none of the posts seem to define a clear answer/solution.

# Answer
> 1 votes
The problem may have had to do with SSL certificates. Callback was using a HTTPS POST callback URL but no SSL certificate was in place. After switching the callback URL to HTTP POST, we are now receiving inbound texts. We are still getting Schema Validation Required responses. Will post again if having an SSL cert makes those go away.

---
Tags: wordpress, sms, civisms, twilio
---


title: How to disable nickname field

text:
# Question
Title: How to disable nickname field
I'm trying to add an option to disable the display of nickname in the setting preferences. The checkbox is appearing but it doesn't work, when the option is not checked the nickname field shouldn't appear in the contact. I added the option value with Apiv4.

btw Surnom = Nickname

# Answer
You might also need to use hook\_civicrm\_buildForm in an extension to override what's happening in CRM/Contact/Form/Edit/Individual.php, e.g. check the value of your setting something like this but less goofy, and then remove the nick\_name field from the form.
> 1 votes

---
Tags: display, preferences, fieldoptions
---


# Question
Title: Civi Volunteer 2.4.1 fatal errors on install CiviCRM 5.33.2 Drupal 7.78
I have just installed Civi Volunteer on Civi 5.33.2 with Drupal 7.78. No errors were displayed on install. I am seeing errors, including fatal ones. I have worked through the Volunteers menu items and found the following: New Volunteer Project CiviVolunteer and nothing else

Manage Volunteer Projects relationship\_type\_id is not a valid integer

Configure Roles Working

Configure Project Relationships getFieldValue failed

Configure volunteer Settings 'volunteer\_project\_relationship' is not a valid option for field option\_group\_id

Volunteer Interest Form Form displays

Search for Volunteer Opportunities Form working

I followed the various advices, including uninstall and reinstall, running the job to remove the tables, removing the extension files, clearing caches and resetting paths. I have a log file of the errors. I am not sure how to include this.

Any help would be most welcome, as I am trying to persuade a possible new user with some 80 volunteers to take CiviCRM.

Regards Graham

# Answer
I think I'm seeing that the only issue is the option group for volunteer\_project\_relationship did not get created.

If this is just a demo,it might be fine to create the option group manually. I would worry about what else failed if this is a permanent setup.

The install step in question is in the Upgrader.php file in installProjectRelationships(). You can see it is calling  `civicrm_api3('OptionGroup', 'create'...` and `civicrm_api3('OptionValue', 'create'...`.

Try going to Administer \> System Settings \> Option Groups. and create the option group with the settings in the installer.

You can then visit Volunteer \> Configure Project Relationships to add the OptionValues. Again, look to Upgrader.php for the defaults.

If you want to get to the root of the matter, I would confirm that all available logging and debugging is enabled and try the install from the ground up. If it still persists with a fresh install of Civi, I would try some other recent releases to see if there really is an incompatibility introduced in the CiviCRM release.

Let me know if you would like to chat about the suitability of CiviVolunteer for the organization you are creating this demo for.

Cheers
> 0 votes

---
Tags: civivolunteer
---


# Question
Title: Since upgrade to 5.34, Drupal accounts are not being created when a member signs up
This morning, I updated my dev sites from CiviCRM 5.25 to 5.34 and since then, I have found that Drupal accounts are not being created when a member signs up in CiviCRM.

We have a page for signing up for a membership, here - https://civi.artspan.org/civicrm/contribute/transact?reset=1&id=3

On the live site, if someone fills out this form, a Drupal account is created for them and they are automatically logged in. On the dev site, only a CiviCRM account is being created.

Nothing has changed between these two sites except for the CiviCRM update.

Under the profile settings for that form, "Drupal user account registration option? is marked as "account creation required".

# Answer
We figured out a fix for this yesterday (it was reported yesterday as a wordpress issue)

There is a patch here https://github.com/civicrm/civicrm-core/pull/19696

It will be part of 5.35.0 which will be released on Wednesday

If you are not comfortable patching and can't wait 2 days the other option is to upgrade to the rc version of 5.35.0

https://download.civicrm.org/latest/

(it won't change that much over the next 2 days but you can update the code base with the released version when it does drop)
> 3 votes

---
Tags: drupal, civimember
---


# Question
Title: Thank-you letters sends email immediately
we are emailing the receipts of last year's contributions. From "find contributions" we select "Thank-you letters - print or email" and then "Send emails where possible. Generate printable PDFs for contacts who cannot receive email.".

I thought it was using the CiviMail component to send (and its configurations, like Mailer Batch Limit, Mailer Throttle Time), but **emails are sent immediately**, occupying a lot of memory resources. And my **SMTP server rejects them as spam**.

Have I forgotten a configuration? Or is it the behaviour for this process? Or is there another way to send receipts of last year's contributions? Or should I use SparkPost which distributes the email delivery?

Any help is appreciated.

# Answer
I think there are two issues at hand here:

CiviCRM does not use the CiviMail/it's mailing feature for the thank you letters. In many case that would make a lot of sense but I guess when the feature was built no one considered using it for so many emails. You may use another extension that sends contribution receipts via CiviCRM's mailing feature such as this one: https://github.com/systopia/de.systopia.donrec

The other issue is that you should probably configure your mail server in a way that it is less likely to be classified as spam. There should be many questions & answers regarding such configurations here on Stackexhcange, most important would probably be so set up proper spf records. This will not necessarily solve the problem described above (e.g. Mailer Batch Limits or resource usage).
> 1 votes

---
Tags: civimail, contributions
---


# Question
Title: How to query "delivery status = unknown" on CiviMail report
I am trying to see all the emails, where the delivery status was "unknown". I have been trying to change the URL parameter "delivery\_status\_value" to "unknown", but that gives a fail as a response. Which value should I use for querying? Or is there another way of filtering the recipients, which's delivery status is unknown? I would have downloaded the excel/CSV file, but that does not seem to work on our system.

The version we use is 4.6.36.

Thank you very much for your help!

# Answer
Welcome to SE! The first thing to note is that if you're on 4.6.36 you really need to upgrade. There have been numerous security fixes and functionality enhancements since then. You will also need to upgrade your version of php. But that's not what you asked...

I needed to investigate mails with a status of 'unknown' recently. The standard reports did not show what I wanted but the SQL behind them is a useful starting point.

From the `Mailings > Scheduled and Sent Mailings` screen, find the mailing of interest and click on `Report`. On the `Successful Deliveries` line, click on `Report` and then go to the `Developer` tab. From there you can copy the SQL, modify it a bit and paste it into a SQL session. How you modify it depends on what you want to know, but you will want to remove the 'where' clause that limits it to successful mails.

Things have changed a lot since 4.6 so this may not work for you.
> 2 votes

---
Tags: civimail
---


# Question
Title: Is there a way to see CiviMail logs through the interface (v. 4.6.36.)
I am trying to troubleshoot some failed deliveries of emails in CiviMail. I would like to see the error logs. According to the documentation, they are stored in the local file system (well, obviously), but I do not have access to that. I am unable to find a view in the interface, where I could see the logs. Is it possible through the admin panels?

We use version 4.6.36.

Thank you very much in advance for your help!

# Answer
> 1 votes
If you look under Administer - System Settings - Extensions and click on the Add New tab you'll see one called CiviCRM Log Viewer. Install that and then admins will be able to view the logs using the user interface.

Since you're on an old version of Civi you may need to download an older version of the extension from https://civicrm.org/extensions/civicrm-log-viewer, but if you don't have access to the file system then I'm not sure how you'd install it. Tricky.

---
Tags: civimail
---


title: Can't proceed a simple search

text:
# Question
Title: Can't proceed a simple search
Hi after a migration on Drupal 7.69 / CiviCRM 5.33.2 everything went fine except that now we can't perform a simple search https://domain.net/civicrm/contact/search?reset=1 when there should be contacts.

If there is no contact (i.e searching inside a specific tag that is empty), it quickly returns the right information saying 'no results'. But if there are some contact (in type, group or tag), it keeps searching and after a while comes to an internal error (500).

The quick search top-left works fine but the advanced search also fails.

We guess that CiviCRM tries to write the search query in the civicrm\_cache table in the database but fails, maybe this hypothesis is not relevant.

How could we improve this point? Any advice?

# Answer
> 1 votes
I had the same issue. After updating to 5.34.0, this issue was fixed for me.

---
Tags: search
---


# Question
Title: Unable to edit existing contributions after CiviCRM upgrade
Issue arises after upgrading from 5.25 to 5.34.

When attempting to edit any contribution and consequently saving, the form returns an error 'please enter a valid amount'

It appears that the system is auto placing a "CA$" acronym before the numerical value (amount). Unfortunatley, the field isn't editable, therefore prohibiting the opporunity of removing the offending acronym to enable form saving.

I've tried to adjust settings in *Administer \> Localization \> Languages, Currency, Locations* to no avail.

Does anyone know how I may fix the issue?

Wordpress: 5.6.4

# Answer
> 2 votes
Thanks to a couple of members, there is a patch in circulation to define decimals in place of the currency symbol that's causing the problem.

https://github.com/civicrm/civicrm-core/pull/19680/files

---
Tags: civicontribute
---


title: adding btcpay as a payment processor

text:
# Question
Title: adding btcpay as a payment processor
Is there a simple way to add btcpay as a payment processor? They have the same api structure as bitpay, and there is a plugin for that. But Is hardcoded to bitpay, and would need to be changed to work with btcpay.

I tried making this an issue on github, https://github.com/nickcalyx/Bitpay-for-Civicrm/issues but they just wanted me to pay them. understandable, but I dont have a budget for this project yet, thats why i'm trying to setup crowdfunding.

# Answer
There is a new BTCPay extension for CiviCRM. Source
> 2 votes

---
Tags: payment, plugin
---


# Question
Title: Keep getting this error on Composer require
I'm using the current instructions to get the current version of CiviCRM for Drupal 8

```
[play@ceres web]$ composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.35'

```

It keeps giving me this error

```
- The requested package civicrm/civicrm-core ~5.35 is satisfiable by civicrm/civicrm-core[5.35.x-dev] but these conflict with your requirements or minimum-stability.

```

I'm then trying

```
composer require civicrm/civicrm-{core,packages,drupal-8}:'~5.34.0’

```

and it just hangs.

Any ideas?

# Answer
The memory problem is real - composer does that. You always need to `export COMPOSER_MEMORY_LIMIT=-1`.

For the conflict, is this drupal 9.1? You can try adding `"minimum-stability": "dev"` to composer.json.
> 1 votes

---
Tags: drupal, installation, composer
---


# Question
Title: When Sending a Mailing the Reply-to email is different than the From Address
I sent out a mass mailing via CiviMail and the reply-to email is default+r{seemingingly\_random\_string}@gmail.com I am using Sparkpost to send these mailings. CiviCRM 5.29.1 Any idea why the reply-to email is this odd-looking email and not the same as the From address?

# Answer
> 1 votes
This is a mechanism for handling bounce messages and replies in response to the mailing so that they are associated with the individual that mail was sent to. It is quite complicated and you should start by reading https://docs.civicrm.org/sysadmin/en/latest/setup/civimail/ and probably also the Sparkpost documentation as well. Too much to explain here. I presume that you didn't set the Sparkpost up. You could talk to whoever did.

# Answer
> 1 votes
Is reply-to tracking enabled? It might be adding VERP tracking, as Mick mentions.

Otherwise, I recently noticed that CiviMail will use the default site "From" as the Reply-To, unless the Reply-To override option was enabled in the CiviMail Settings. (this seemed a bit counter-intuitive to me, I would have assumed that the Reply-To would default to the same address as the From)

---
Tags: civimail, mailing
---


# Question
Title: word replacement with accent "Événement" by "Missions et PAD" not working but word replacement is OK
I try to replace the Menu Title "Événement" by "Missions et PAD". But it is not working. I tried different word replacements and they are working well. Is it due to the accents ? to a bad coding ? I am using CiviCRM for wordpress.

# Answer
> 2 votes
For word replacements you often have to use the english word as the original word, so you would put:

Events =\> Missions et PAD

For menu entries you can also edit it at Administer - Customize Data and Screens - Navigation menu. Right-click on Events and edit it to change the title.

# Answer
> 0 votes
The problem with this method is that a word in a help text for example is no longer displayed in French but only in English with a French word replaced.

---
Tags: wordpress, civievent
---


# Question
Title: CiviMobileAPI Extension vs APIv3 for mobile app integration
We are building a react-native mobile app for our members and want to include some CiviCRM data and functionality in the app. Starting with some rudimentary data display eg:

* How long you've been a member
* Renewal date
* Lifetime giving totals etc

Later we'll look to add some more of Civi's functionality within the app.

Does someone have any experience in doing something similar? Is it better to work from the open source CiviMobile API extension (not using the CiviMobile App) or from CiviCRM's native APIv3?

Thanks,

# Answer
> 4 votes
The CiviMobile API extension was developed specifically for the *CiviMobile App*. It's not a generic end point for other apps to use. If you were planning on using it in this way, then at the very least it would be wise to reach out to those developers to let them know that this is what you were doing, so they *might* re-consider implementing breaking changes.

CiviMobile is a closed source app. Open source back-end extension.

For comparison, CiviContact is open source app and open source back-end extension, https://civicrm.org/blog/justinfreeman/civicontact-for-android-and-ios-released-manage-civicrm-contacts-groups \- and was developed as a platform, reference for building other CiviCRM mobile apps. Although, no one so far has taken up that challenge.

Both apps utilise a back-end extension to provide API end points for the app. That's a valid model to follow.

The question really should be whether or not CiviCRM APIv3 or CiviCRM APIv4 should be used. Given that at this point in time v4 does not have a REST end point implementation, any integration which uses REST must therefore use APIv3.

There's no problem in mixing and matching APIv3 and APIv4 calls. Since they both work fine and APIv3 is not going to be deprecated anytime soon.

Personally, I would use Flutter for any new app development. That's just my opinion - do you own research.

---
Tags: api, integration, mobile, civimobile
---


title: Howto hide/disable fields not needed

text:
# Question
Title: Howto hide/disable fields not needed
My company does not make use of many of the fields provided by civicrm. Our users told me the sheer mass of empty fields is overwhelming them.

I know I could walk the hide-by-jquery-to-death way, but:

Is there a designated or recommended way to disable or hide civi core fields like "nickname" or "legal\_name"?

# Answer
The "hide-by-jquery-to-death" way is the way to go for now. (Great name :) )

There are discussions to do that via the web interface in a future version, but that's not there yet.
> 4 votes

# Answer
You can hide some of them via the UI at **Administer \> Customize Data and Screens \> Display Preferences**

e.g. http://d46.demo.civicrm.org/civicrm/admin/setting/preferences/display?reset=1
> 11 votes

# Answer
The new Extension called Contact Summary Layout Editor is a new tool that may help folk dealing with this type of problem
> 5 votes

# Answer
I believe you can create a modified version of the default contact page templates as described here.

*Excerpt from that page:*

> These steps are for any "built-in" screen (e.g. the Contact Summary screen)...
>
> * Navigate to the screen you want to customize and use your browser to View Source.
> * Search for ".tpl" in the source. You will find a comment line which gives you the path and name of the template used for the screen you are viewing.
>
> `<!-- .tpl file invoked: CRM/Contact/Page/View/Summary.tpl. Call via
>  form.tpl if we have a form in the page. -->`
>
> * Locate this file on your server under your ../civicrm/templates path. Make a copy of file in the equivalent path under your new custom templates directory.
> * Edit the file as needed and save.
> * Then clean-up the compiled templates directory, usually by deleting all the directories under your templates\_c directory. You can also do the cleanup by enabling CiviCRM debugging and running the directory cleanup command. (NOTE: You do NOT need to delete the standard version of the template from your main CiviCRM codebase. CiviCRM will look for a customized version first, and use that one if found.)
> * You should see your modified version when you reload the CiviCRM screen. If you need help with the templating language, check out the Smarty Documentation
> 3 votes

# Answer
Some example code if you want to remove certain elements on the contact add and edit forms:

```
/**
 * Implements hook_civicrm_buildForm().
 *
 * Changes some fields on the add and update contact forms
 *
 * @param string $formName
 * @param CRM_Core_Form $form
 */
function MODULE_civicrm_buildForm($formName, &$form) {
  // print_r($formName);
  if ($formName == 'CRM_Contact_Form_Contact') {
    if (($form->getAction() == CRM_Core_Action::ADD) || ($form->getAction() == CRM_Core_Action::UPDATE)) {
      // print_r($form);
      // Add a javascript file for changes in display
      CRM_Core_Resources::singleton()->addScriptUrl('https://EXAMPLE.ORG/sites/all/themes/EXAMPLE/EXAMPLE.js');

      // Remove field override geocoding
      for ($i = 0; $i <= 5; $i++) {
        if ($form->elementExists('address[' . $i . '][manual_geo_code]')) {
          $form->removeElement('address[' . $i . '][manual_geo_code]');
          // $element = &$form->getElement('address[1][manual_geo_code]');
          // crm_Core_error::debug( 'options', $element->_options );
          // also you can add new options w/ $element->addOption( );
        }
      }

      // Remove field signature text
      for ($i = 0; $i <= 5; $i++) {
        if ($form->elementExists('email[' . $i . '][signature_text]')) {
          $form->removeElement('email[' . $i . '][signature_text]');
        }
      }

      // Remove field signature html
      for ($i = 0; $i <= 5; $i++) {
        if ($form->elementExists('email[' . $i . '][signature_html]')) {
          $form->removeElement('email[' . $i . '][signature_html]');
        }
      }

      // Remove field external id
      if ($form->elementExists('external_identifier')) {
        $form->removeElement('external_identifier');
      }

      // Remove field nickname
      if ($form->elementExists('nick_name')) {
        $form->removeElement('nick_name');
      }

      if ($form->getAction() == CRM_Core_Action::ADD) {
        // we can get the contact type from the url ct parameter: Individual/household/organisation
        $contactType = CRM_Utils_Array::value('ct', $_GET, '0');
      }

      elseif ($form->getAction() == CRM_Core_Action::UPDATE) {
        // there is no info in the url so we need to use the contact id and check
        $contactId = CRM_Utils_Array::value('cid', $_GET, '0');
        if ($contactId != 0) {
          $contactType = CRM_Contact_BAO_Contact::getContactType($contactId);
          // $subType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
        }
      }

      // Household
      if ($contactType == 'Household') {
        // Remove custom block
        unset($form->_groupTree[3]);
        // Remove custom block
        unset($form->_groupTree[7]);
        // Change label of household name
        if ($form->elementExists('household_name')) {
          $element = &$form->getElement('household_name');
          $element->setLabel('NEW LABEL');
        }
      }
      elseif ($contactType == 'Organization') {
        // Remove custom block
        unset($form->_groupTree[1]);
        // Remove custom block
        unset($form->_groupTree[7]);
        if ($form->elementExists('sic_code')) {
          $form->removeElement('sic_code');
        }
      }
      else {
        // Individual
      }
    }
  }
}

```
> 2 votes

# Answer
Building on Hans Rossel's helpful answer, below are paired PHP and javascript to remove some contact fields when adding or editing contacts.

Note there is a WordPress-specific function call to obtain the path to the javascript file, which I assume is stored in the `.../plugins/CUSTOMPLUGIN/assets/` folder, with a `define('WP_CUSTOMPLUGIN_FILE', __FILE__);` directive in the main plugin PHP file.

**PHP hook**

```

/**
 * Implements hook_civicrm_buildForm().
 *
 * Changes some fields on the add and update contact forms
 *
 * @param string $formName
 * @param CRM_Core_Form $form
 */
function MODULE_civicrm_buildForm($formName, &$form) {
    if ($formName !== 'CRM_Contact_Form_Contact') {
        return;
    }
    if (($form->getAction() !== CRM_Core_Action::ADD) && ($form->getAction() !== CRM_Core_Action::UPDATE)) {
        return;
    }
    // ***WORDPRESS-SPECIFIC: javascript for contacts edit page
    $jsUrl = plugins_url('assets/cv_editcntct.js', WP_CUSTOMPLUGIN_FILE);
    CRM_Core_Resources::singleton()->addScriptUrl($jsUrl);

    // Remove some address fields
    for ($i = 0; $i <= 5; $i++) {
        // geocoding
        if ($form->elementExists('address[' . $i . '][geo_code_1]')) {
            $form->removeElement('address[' . $i . '][geo_code_1]');
            $form->removeElement('address[' . $i . '][geo_code_2]');
        }

        // county
        if ($form->elementExists('address[' . $i . '][county_id]')) {
            $form->removeElement('address[' . $i . '][county_id]');
        }
    }

    // See also cv_editcntct.js
    for ($i = 0; $i <= 5; $i++) {
        // Remove field signature text
        if ($form->elementExists('email[' . $i . '][signature_text]')) {
                $form->removeElement('email[' . $i . '][signature_text]');
        }
        // Remove field signature html
        if ($form->elementExists('email[' . $i . '][signature_html]')) {
                $form->removeElement('email[' . $i . '][signature_html]');
        }
    }

    if ($form->elementExists('employer_id')) {
        $form->removeElement('employer_id');
    }
    if ($form->elementExists('job_title')) {
        $form->removeElement('job_title');
    }
    if ($form->elementExists('image_URL')) {
        $form->removeElement('image_URL');
    }

    $contactType = NULL;
    if ($form->getAction() == CRM_Core_Action::ADD) {
        // we can get the contact type from the url ct parameter: Individual/household/organisation
        $contactType = CRM_Utils_Array::value('ct', $_GET, '0');
    }
    elseif ($form->getAction() == CRM_Core_Action::UPDATE) {
        // there is no info in the url so we need to use the contact id and check
        $contactId = CRM_Utils_Array::value('cid', $_GET, '0');
        if ($contactId != 0) {
            $contactType = CRM_Contact_BAO_Contact::getContactType($contactId);
            //$subType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
        }
    }

    // Adjustments specific to contact type...
    if ($contactType == 'Household') {
        // no Household customizations
    }
    elseif ($contactType == 'Organization') {
        // // Remove custom block
        // unset($form->_groupTree[1]);
        if ($form->elementExists('sic_code')) {
            $form->removeElement('sic_code');
        }
    }
    else {
        // Individual
        // // Remove field nickname
        // if ($form->elementExists('nick_name')) {
        //  $form->removeElement('nick_name');
        // }
    }
}

```

**Javascript** `cv_editcntct.js` **file**

```
(function($, undefined){
    //console.log('hello from cv_editcntct.js');

    // for individual: employer and job title has been removed
    // adjust layout with or without nickname
    var $st = $('#contact_sub_type');
    var $nn = $st.closest('tr').find('#nick_name');
    if ($nn.length) {
        // remove all (empty) TD cells prior to nickname and adjust width
        var $td = $nn.closest('td').attr('colspan','2');
        $td.prevAll().remove();
        $nn.css('width',$td.width()+'px');
        // also adjust subtype width
        $td = $st.closest('td').attr('colspan','3');
        $st.css('width',$td.width()+'px');
    } else {
        // remove empty TD cells before subtype, and adjust subtype width
        var $td = $st.closest('td').attr('colspan','3');
        $td.prevAll().remove();
        $st.css('width',$td.width()+'px');
    }

    // remove (empty) image URL section (table)
    $('table.image_URL-section').remove();

    // remove (empty) signature blocks
    $('.email-signature.crm-collapsible').remove();
    // since new emails can be added, monitor the DOM for added elements
    // and remove signature blocks
    $emailSection = $('.crm-section.contact_information-section');
    if ($emailSection.length) {
        // Callback function to execute when mutations are observed
        const callback = function(mutationsList, observer) {
            // Use traditional 'for loops' for IE 11
            var bAdded = false;
            for (const mutation of mutationsList) {
                if (mutation.addedNodes.length) {
                    bAdded = true;
                    break;
                }
            }
            if (bAdded) {
                // remove (empty) signature blocks
                var $s = $('.email-signature.crm-collapsible');
                if ($s.length) {
                    $s.remove();
                    console.log("Zapped a signature block!");
                }
            }
        };
        // Create a DOM observer
        const observer = new MutationObserver(callback);
        // Start watching for element additions (or removals) in the email section
        observer.observe($emailSection.get(0), { childList: true, subtree: true });
    }

})(jQuery);

```
> 1 votes

---
Tags: fields, core
---


# Question
Title: How to make a daily bithday report at morning?
Every day a person receives a list of who has a birthday on that day. But this happend at evening, when it useless, How to make it at morning?

# Answer
My guess is you have a cron job scheduled to do this. See https://docs.civicrm.org/user/en/latest/initial-set-up/scheduled-jobs/#timing for how to adjust your timing.
> 1 votes

---
Tags: civireport
---