# Question
Title: How to clear the caches in WP / Wordpress or Drupal via url?
How does one clear the caches in Civicrm via a URL?

# Answer
I just found this, so thought I'd post it :)

The URL to clear all Civi caches in **Drupal** is **\[site-url\]/civicrm/clearcache**

The URL to clear all Civi caches in **Wordpress** is: **\[site-url\]/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/job&action=export&id=13&reset=1**

this can be found by going to "**Administer \> System Settings \> Scheduled Jobs**" and saving the link url of the "**edit \> execute now**" link of the **Clean Up Temporary Data and Files** job (via right click?).

One can also execute the scheduled job there....
> 6 votes

# Answer
Also at Administer \> System Settings \> Cleanup Caches and update Paths at this path civicrm/admin/setting/updateConfigBackend?reset=1
> 4 votes

---
Tags: urls
---


title: Excluding in search doesn't work

text:
# Question
Title: Excluding in search doesn't work
It seems that it's not possible to find contacts who are in group A, but not in group B. The only place where it's possible to exclude a group is Search Builder, but when I give two criteria (contact is in group A) and (contact is not n group B) CiviCRM ignores the second clause.

I tried to convert the second clause to use a Tag. So I've created a tag for group B, and searched for contacts in group A and contacts not in tag B.

The result is really puzzling, and it seems I am not following CiviCRM's logic:

(this is polish l10n, but "Etykieta" and "Kategorie" are both translations for "Tag") Could someone clarify, what is happening here?

# Answer
You should use the custom search "Include / Exclude Search" that does exactly what you want

civicrm/contact/search/custom?csid=4&reset=1 on my install, likely the same custom search id on your install
> 9 votes

# Answer
The issue with the Search Builder is that it's not doing an exclude when you say NOT IN. Instead, it's selecting contacts who have any tag besides the one you listed.

This is because groups and tags are entities themselves, and contacts may be related to an unlimited number of them. Having a tag that is not X is a different thing than not having the tag X.
> 4 votes

---
Tags: search, groups, tags
---


# Question
Title: CiviCRM on Drupal begins Install and then reverts to "Page not Found"
The Title pretty much sums it up. 2 databases, each is correct, I'm running on a Bluehost dedicated server. It has it's own Cpanel account for static IP and SSL (eventually). But first I have to get it installed. The installer runs for 30-40 seconds and then goes to: "The requested page "/sites/all/modules/civicrm/install/index.php" could not be found." Does anyone have any ideas????

# Answer
Check to be *absolutely* sure you've got CiviCRM installed to `sites/all/modules/civicrm`.

Also check that you aren't getting bounced from host A to host B, or from http to https, during the installation.

If that doesn't work, watch the PHP error log and webserver access log during the installation; that may show you what's not otherwise obvious.
> 1 votes

---
Tags: drupal
---


title: Unable to write file

text:
# Question
Title: Unable to write file
I am getting this message:

```
Unable to write file: /var/www/vhosts/examplesite.com/httpdocs/wp-content/plugins/files/civicrm/upload/version-info-cache.json
Please check your system file permissions.

```

But this files doesn't seem to exist in that location. Should it exst there or could there be something wrong in my settings?

(CiviCRM 4.6.8 and Wordpress 4.3.1)

# Answer
> 4 votes
Make sure that the folder `/var/www/vhosts/examplesite.com/httpdocs/wp-content/plugins/files/civicrm/` is writable to the webserver user.

The simplest solution is to set the permissions on that folder to be read/write for ALL users.

A better solution is to configure the permissions so that they are open to your user account and the webserver alone, but not other users on the same hosting server. How you approach this depends on the hosting environment and probably requires learning how to manage filesystem permissions.

See also:

# Answer
> 3 votes
Check your permissions for /var/www/vhosts/examplesite.com/httpdocs/wp-content/plugins/files/civicrm/upload. It's not surprising that the file in the error doesn't exist when you check--CiviCRM hasn't had the ability to create it!

The most common issue is that the folder is owned by your SSH user, not the user that Apache runs as.

---
Tags: permissions
---


title: Medical Certificates expiration

text:
# Question
Title: Medical Certificates expiration
To contact athletes need to register medical certificates. I added a custom field multiple date expired. How do I retrieve all the contacts that do not have a date or that date has expired? How do I get a monthly list of certificates that expire? Thank you.

Marco

# Answer
> 4 votes
You can use the search builder to search any fields that are empty or null:

civicrm/contact/search/builder?reset=1 (should be in your Search menu item)

We also use a report for tracking a very similar thing. We use the Contact Report (Summary) Template (it might say Constituent instead of Contact)

As long as you've built the field to be searchable, it will be included in your report (this is a check box at the bottom of the field)

You can then select the fields your interested in seeing and filter the report to show those where the field "Expiry Date" = This Month

We trigger this report to be emailed on the first of the month so you can immediately see who requires renewing.

As you're using a relative date, it will always be current for the month you're in.

You can also build a smart group this way, and always have a current list of those who will expire this month which you can use in searches / mailings as you need.

Hope that helps.

---
Tags: wordpress, custom-fields
---


title: What does Group Type = Mailing List do?

text:
# Question
Title: What does Group Type = Mailing List do?
When you create a group in CiviCRM there are two tick boxes for Group Type: Access Control and Mailing List. I presumed that the latter controlled whether that group was available in CiviMail, however this doesn't appear to be the case.

When you create a new mailing you can select a group whether or not this tick box has been ticked. So, I was wondering if this tick box actually does anything or if it can just be ignored?

I'm using CiviCRM 4.4.15

# Answer
I just created a smart group on demo 4.6 and I am not able to select it in a mailing, unless it's checked as a Mailing List.

But interestingly Demo 4.4 does allow it. I suspect we are seeing a bug in 4.4.
> 2 votes

# Answer
I think I have discovered the answer to this.

If the 'Mailing List' box is ticked and the visibility is set to public the group is listed on a page (yourdomain.org/civicrm/mailing/subscribe) that allows people to subscribe to the mailing list. If the box isn't ticked it won't be displayed on this page.

It doesn't appear to affect whether the group can be used to select recipients for a mailing, which is what I first thought it did.
> 3 votes

# Answer
Sanjay is right--you're seeing a bug. The list should only show mailing lists, and for good reason: people can unsubscribe themselves from mailing list groups. If you're relying on a group for access control or segmentation, you probably don't want that group's membership to be fluid, with people joining and leaving all the time.

Of course, you could always search for a non-mailing-list group and send CiviMail from the results, but then you'd be prompted to select a mailing list group as an unsubscribe group--the group from which unsubscribers remove themselves.
> 3 votes

# Answer
One additional point to this-

If a Group is created with both Access Control and Mailing list checked. This group will not be available to select if the logged in user doesn't have the required permission.

If the non-permitted user has the ACL created for it to "view Groups" or related, this group will be listed in CiviMail. (introduced in 4.6.7 https://issues.civicrm.org/jira/browse/CRM-13644)
> 1 votes

---
Tags: civimail, groups
---


# Question
Title: How do I use custom fields in Drupal views?
\[EDIT\] Totally editing this question. Custom fields do not work in my Drupal views, at all:

The interface to add the custom field worked just fine. It's only the generated sql thats wrong. Its refering to civicrm\_contact.custom\_3, but the value is actually stored in a related table called civicrm\_value\_\[PRIVATE\_PARTS\_HIDDEN\]\_1.

What could be causing this ? I need a solution pretty urgent :-|

PS. I did map the values in settings.php, and this in general seems to work. One of the entries is `'civicrm_value_[PRIVATE_PARTS_HIDDEN]_1' => '[MY_CIVIDB_NAME_HERE].',`

PPS. The checkbox used to add the field to the list, in the html source, reads

```
<input type="checkbox" id="edit-name-civicrm-contactcustom-3"
name="name[civicrm_contact.custom_3]"
value="civicrm_contact.custom_3"
class="form-checkbox viewsImplicitFormSubmission-processed">

```

# Answer
Saw the same issue here.

We noticed that the field appeared twice in the list of fields. We'd selected it as CiviCRM Contact: My Field - but it also appeared as CiviCRM Custom: My Field.

When we selected it as CiviCRM Custom: My Field, it worked.
> 7 votes

# Answer
You have to add a map of the civicrm tables to Drupal's settings.php for that to work. See http://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration for details.
> 3 votes

# Answer
If drupal and civicrm are sharing a database, then this will work without any further configuration. But if you have civicrm in a separate database, there is an extra step:

Every time you create a custom field in CiviCRM it adds a new table to the database. You have to tell Views about the new table by adding the new line to your `settings.php` file.

See http://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration for details.
> 3 votes

---
Tags: custom-fields, sql, drupal-views
---


# Question
Title: Could Civi or Drupal Rules be used to aggregate ratings for services?
We want to implement a feedback system for services (these would be CiviCRM Contacts). Think of it like eBay feedback with an overall rating and some sub-categories like speed of dispatch, comms, description of item, etc.

Each of these ratings would be stored as a Custom Field against each Contact.

Feedback would be gathered via Activities. Could Civi or Drupal Rules be used to calculate averages (based on multiple Activity submissions) and update the custom fields on the Contact?

# Answer
You would do this with an extension. Check out the Summary Fields extension for inspiration. It's similar to your goal, just geared toward donations and event participation.
> 4 votes

# Answer
Not that I know of. Probably you will need to write your own (relatively simple) sql query within a hook (or a function called by rules). Check out the mysql docs for AVG.
> 1 votes

# Answer
Not sure what you are trying to do exactly but possibly CiviRules (https://civicrm.org/extensions/civirules) would enable you to create specific actions and conditions for this
> 1 votes

---
Tags: civirules, drupal-rules
---


# Question
Title: What does the 'Validate Email Address from Mailings' scheduled job do?
Under Settings \> Scheduled Jobs there is a job called 'Validate Email Address from Mailings'. I'm not clear what this does exactly.

The documentation says:

> Updates the reset\_date on an email address to indicate that there was a valid delivery to this email address.

I'm not clear what this means and what affect it has on the email address.

Could somebody explain how this works?

Also could you explain what the parameters do:

> minDays, maxDays=Consider mailings that have completed between minDays and maxDays

I'm using CiviCRM 4.6.8.

Many thanks for your help.

# Answer
The purpose of this job is to avoid putting a hold on an email address which had a few bounces (e.g. mailbox full) and then got one or more successful deliveries before starting to bounce again. The job reviews all non-test mailing jobs which have completed between $minDays and $maxDays and sets "reset date" to the most recent date that an email was actually delivered to that email address. Bounces prior to the reset date are ignored when determining whether an email address should be placed on hold.
> 3 votes

# Answer
The scheduled job examines previously sent emails (in the range of dates if given) for any confirmation that the email was rec'd, typically opens or clicks, and if found the `reset_date` is updated.
> 3 votes

# Answer
only qualified and verified information is to be included on an actively working database. added entries change over time and info needs to be updated continually if proper verification methods are maintained. entries should be re-verified at a minimum of X amounts of days (so as not to bombard the recipient) and at a maximum of Y days so fresh new data is continually maintained. validation can be a reply or an auto-reply showing evidence of a valid email address.
> -3 votes

---
Tags: civimail, settings
---


# Question
Title: How do I create recurring events in 4.6?
I am using CiviCRM 4.6.8 and I don't find the new (supposedly since 4.6) recurring events feature. What am I doing wrong?

# Answer
Combining the question's comments into an answer:

The Repeat tab isn't available until the event has been saved. Create the event and save it, and you'll see the tab.
> 4 votes

---
Tags: civievent
---


# Question
Title: Could not find a valid session key when submitting opt out and unsubscribe forms
Using Drupal 7.39 and Civicrm 4.6.9 -

When submitting or cancelling the opt out and unsubscribe forms for anonymous users, I'm getting a 'could not find a valid session key message'. This does work however for authenticated users.

My site is fully SSL running off cloudflare. I have checked the following:

1. Resource urls are correct.
2. Base url is correct.
3. Cleared caches.
4. 0 user id in the database.

Can you help?

# Answer
> 2 votes
**Check that your webserver serves correct cache headers when accessing the unsubscribe URL.** It sounds like CloudFlare is caching the forms your CiviCRM install generates, and so a later anonymous visitor is seeing an expired form.

While CloudFlare offers additional ways to customise what gets cached, using standard HTTP cache headers is your best bet because it works the same for CloudFlare and other caches your userbase might encounter (ISPs, corporate proxies, whatever).

By default CiviCRM seems to set appropriate cache headers which tell CloudFlare not to cache forms, including unsubscribe forms.

Let's see if CiviCRM sets cache headers suitably on an unsubscribe form. I searched my email for `civicrm/mailing/unsubscribe` to find an example URL.

Fetch just the page headers using `curl` -

```
$ curl --head "http://example.org/civicrm/mailing/unsubscribe?reset=1&jid=XXX&qid=XXX&h=XXXXXXXXXXXX"

```

And check that you see headers in the response that should prevent CloudFlare caching that page:

```
HTTP/1.1 200 OK
Server: nginx/1.6.3
Date: Tue, 13 Oct 2015 18:08:55 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
X-Micro-Cache: MISS

```

The interesting headers here are **Expires** (in the past) and **Cache-Control** (no-cache).

You can compare those results to headers returned by your CiviCRM site for a similar request. Test using the URL that connects directly to your site, not using the CloudFlare URL, and confirm that appropriate cache headers will be set for requests to those URLs on your server.

It *might* be that you have some other customisation or module which changes the cache headers for CiviCRM URLs, and that would then lead CloudFlare to believe that the forms should be cached.

FWIW, we use CloudFlare on a few sites, and have no custom page rules in place; as far as I know it's worked with no special tweaks.

---
Tags: email, session
---


# Question
Title: Widget broken after site switched to https
I changed my wordpress site to use https Now the widgets for donations do not load anymore. they only display the placeholder text

any ideas?

thanks Conte

# Answer
> 3 votes
Two separate problems with the same source, which is that your widget is static HTML and Javascript that you copied and pasted in place. It *does not* update by itself when you make changes.

If you just see the placeholder text, it means that the Javascript is failing to get the current totals.

1. Your widget may be trying to connect to your site, failing because it's not connecting through HTTPS. Depending upon how you implemented HTTPS, these sorts of connections may fail unless you specify the https://... URL.
2. Your browser may be refusing to connect via an insecure protocol. Recent versions of browsers will simply exclude Javascript and CSS that comes through HTTP when you're on an HTTPS page.

The solution to either problem is the same: fix the widget. You can read through the widget's code and replace each instance of "http://" with "https://". Alternatively, you can simply go manage your contribution page, go to the widget tab, copy the code, and paste it in place of the old code.

---
Tags: civicontribute
---


# Question
Title: email links not working - date.timezone function
I have used my CiviCRM email for many years. Today I had the following error message when I sent an email with links in it clicking through to an event on an external site. I have resolved the problem temporarily by not tracking click-throughs, but what could be causing this?

> It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date\_default\_timezone\_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

# Answer
I second Jon G's answer with this reference -- Jon actually helped on a similar issue I had. The issue was indeed that the php.ini did not specify the time zone. The answer on this question fixed it for me: https://civicrm.stackexchange.com/a/3589/105
> 3 votes

---
Tags: civimail, settings, timezone
---


# Question
Title: How to add captcha on Civicrm contribution pages and Events pages
Can any one help me configure `captcha` on Contribution pages and events. I can only find recaptcha settings here: `example.com/civicrm/admin/setting/misc?reset=1`

# Answer
> 6 votes
You can include a Profile in your Contribution Pages and Events and include recaptcha for it.

On newer sites via civicrm/admin/setting/recaptcha?reset=1 where you can also Force on all Contribution pages (and hence skip the below steps about setting on Profiles)

On older sites set up your reCAPTCHA keys visit Administer \> System Settings \> Misc (/civicrm/admin/setting/misc?reset=1)

Then to set it in your Profile visit

Administer -\> Customise Data and Screens -\> Profiles

1. Click on settings link for the profile added on your contribution page or event.
2. Expand the Advanced Settings tab
3. Enable the `Include reCAPTCHA?` checkbox and Save.

---
Tags: civievent, contribution-page, recaptcha
---


# Question
Title: After security update civi admin menu has twinned support menu-heading
Today I updated civicrm (4.6.8 to 4.6.9) on a Joomla website (version 3.4.4). All went well I was told in screen-messages. However after the update I now see the menu Support heading twice.

Both headings cover the same sub-menu headings. What triggers this? And, how can I de-select or delete one of these two? What is the best way?

Greetings, Paul

# Answer
> 2 votes
This is a very small bug, but to fix easily, here's my above comment again. This problem is also true for Drupal on a couple of 4.6.9 test systems of mine. I fixed by using the navigation menu update in administer/customise data and screens. I deleted the second Support item and all was well.

---
Tags: joomla, menu, admin, upgrade
---


# Question
Title: How to create script to delete smart groups
I have 300-400 CiviCRM smart groups I want to delete. I will know the id for the group but need to know what other tables I need to delete that may be related.

Also, is there any way to identify which groups are smart groups?

Here is some code I have tried.

`<?php
require_once 'api/class.api.php';
$api = new civicrm_api3();
$result = $api->group->delete ( $id=1544 );
?>`

Here is the result:

`PHP Fatal error: Class 'CRM_Core_Config' not found in /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/api/class.api.php on line 92
PHP Stack trace:
PHP 1. {main}() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:0
PHP 2. civicrm_api3->__construct() /home/daweb_dev/democratsabroad/drupal/sites/all/modules/civicrm/delgroup.php:3`

This worked using rest.php

wget -a delgroup.log -O delgroup.out 'https://www.example.com/sites/all/modules/civicrm/extern/rest.php?entity=group&action=delete&key=site-key&api\_key=api-key&version=3&json=1&id=923'

# Answer
I suggest you use the api.

Visiting yoursite.org/civicrm/api will let you try it out.
> 2 votes

# Answer
The challenge seems to be instantiating civicrm within a script - the easiest ways are

1) through the api explorer 2) through drush - ie drush eval"civicrm\_initialize(); script lines here" 3) through devel in the UI looks much like drush

Otherwise for a standalone php script (that doesn't leverage drupal) you probably want to copy the way one of the scripts in the bin directory does it - but that way is more painful :-(
> 1 votes

# Answer
You could also use chaining in the api explorer ie.

civicrm\_api3('Group', 'get', array('id' =\> array('IN' =\> array(4,6,7,8,9), 'api.group.delete');

But test thoroughly on dev first!!!
> 0 votes

# Answer
I got it to work by calling rest.php with wget wget -a delgroup.log -O delgroup.out 'example.com/sites/all/modules/civicrm/extern/…;
> 0 votes

---
Tags: database, smartgroups
---


# Question
Title: Set cookies for petitions (and probably other online forms) as session cookies that will expire after signing
I set up an online petition using CiviCRM 4.6 on Drupal 7.

During the process, the status of the petition is stored in two cookies ("signed" and "confirmed"), which controls to process flow.

Both cookies are valid for 24 hours.

However, the drawback is, that it is not possible to enter another petition directly after the first one from the same pc - since the cookies remain valid fr 24 hours.

Is there a possibility to to limit the cookie lifetime to the session? So that the cookies are deleted, when the browser window is closed?

Thank in advance!

# Answer
Aah,

Indeed, the cookie should apply only to the petition (ie contain the petition id).

It's a bug and shouldn't be difficult to fix. Do you or someone in your team have the skills to fix it? PR welcome ;)
> 1 votes

---
Tags: drupal, civicampaign
---


# Question
Title: In CiviDiscount 3.1 why is there both a Membership section and Membership in Automatic Discounts?
In CiviDiscount 3.1 it seems you can set up discounts based on Membership ('Discounts for memberships') as well as in Automatic Discounts (discount for members of type, membership statuses). Why isn't membership + status just in the 'Membership' section? (and why no selection for Contact subtype in Automatic Discounts?)

# Answer
To answer the first question, the difference between the two is that the **Discounts for memberships** is where anyone with the code can get a discount when purchasing a membership (Civi help: "Discount the price of purchasing memberships. Only active memberships with start and end dates defined will appear in this list."). **Automatic Discounts**, on the other hand, is where any contact that meets the conditions outlined will get an automatic discount applied; no code required. And the discount will be applied to either memberships or events.

It might be clearer with a couple examples. In the first case, someone visiting the site can enter a code into the box and then get a discount on a membership they want to purchase. In the second case, someone might get a unique URL by email and Civi will know which contact it is. If, say, that contact meets the condition of being over 65 years old, they will get an automatic discount on an event. Or maybe they'll get a discount for an event because they're a Lifetime member.

To answer your last question, why no selection for Contact subtype: this does indeed look like a missing feature. I suggest posting an issue to the extension in github: https://github.com/dlobo/org.civicrm.module.cividiscount/issues It might be possible to get the contact subtype by using the api field that you see when adding a discount, but that is certainly not for a beginner.
> 2 votes

---
Tags: extension, cividiscount
---


title: Moving Angular extension into /ang/

text:
# Question
Title: Moving Angular extension into /ang/
I'm attempting to move code from an angular extension into core. I've created an ang/crmModuleName and moved the ctrl and partials into it, and crmModuleName.css into the ang/ and crmModuleName.js into the ang/. I've modified Civi/Angular/Manage.php to include js, css, partials, settings. Cleared cache on local server, but it is not working.

Is there another step I've missed?

# Answer
Here's the detailed steps I took to move the angular extension from an extension and into core.

1. if your angular files are not already name spaced, they should be changed. In the angularextension there should be a folder in ang/ named something similar to the module. Namespace this folder to crmModuleName. Outside of the crmModule folder, but inside the ang folder should be your css and the file that creates the module and has the router in it. Namespace these files to crmModuleName.css and crmModulename.js.
2. Move the crmModulename folder and files to the ang/ folder in CiviCRM core. It should mimic the directory structure of your extension.
3. There should be a file in the ang/ folder in your extension that is modulename.ang.php - it should have an array that points to where the files in your extension are located:

```
<?php
return array(
  'js' => array(
    0 => 'ang/crmModuleName.js',
    1 => 'ang/crmModuleName/*.js',
    2 => 'ang/crmModuleName/*/*.js',
  ),
  'css' => array(
    0 => 'ang/crmModuleName.css',
  ),
  'partials' => array(
    0 => 'ang/crmModuleName',
  ),
  'settings' => array(),
);

```
4. Find the file Civi/Angular/Manage.php. Within the public function getModules put the information from modulename.ang.php. It should look like this:

```
$angularModules['modulename'] = array(
  'ext' => 'civicrm',
  'js' => array('ang/crmModuleName.js', 'ang/crmModuleName/*.js'),
  'css' => array('ang/crmModuleName.css'),
  'partials' => array('ang/crmModuleName'),
  'settings' => array(),
);

```
> 3 votes

---
Tags: extension, developer, javascript
---


# Question
Title: Mail not working url for third party app
I’m doing a basic automation with scheduled reminders: I want to send a survey to every one where a certain activity is completed. For the survey I use a nice third party app: surveypal.com. As I want to personalise the survey, I need personal data from civi to surveypal to identify the response.

Surveypal has nice documentation on how to do this. The url send to a potential respondent should look like:

`https://my.surveypal.com/app/form/ext?_d=0&_sid=261570634&_k=2kpdVu0Y20GKuXoMnpsCYQ6c43g82T4PWT29J4Kj5TFRIBltoKRMpAng0p
iVLOtX&externalId=[ID]&meta=[{"key":"Gender","value":"Male"},{"key":"Age","value":"15"}]`

where sid and k are the id’s of the survey in surveypal, externalID could be the contact\_id from civi and the data in meta data could be other civi fields.

Building a message template in civimail, including some tokens for the personal data, this url so becomes:

`https://my.surveypal.com/app/form/ext?_d=0&_sid=xxx&_k=xxxxx&externalid=[{contact.contact_id}]&meta=[{"key":"email","value":"{contact.email}"},{"key":"SRdonorcontactid","value":"{contact.contact_id}"},{"key":"firstname","value":"{contact.first_name}"},{"key":"lastname","value":"{contact.last_name}"},{"key":"Aanspreking","value":"{contact.addressee}"}]`

When sending manually this message template using an individual email (activity -\> send an email). This works perfect. Civi does send an email to the particular contact, and the person gets a nice link, participates the survey in surveypal and I have all the response data I need.

But, when I use this same message template to set a scheduled reminder link to an activity, then the email is send automatically correctly, but the url is changed towards something like `&meta:[,,,,,,]` So no personal data is transferred. The potential respondent gets an error message when clicking the url that the url does not exist.

Any idea’s: what happened, what is wrong? I’m afraid it has something to do with the {} used for tokens in civimail, while used to group data in the surveypal-url.

# Answer
> 0 votes
Indeed, seems to be an issue with the reminder trying to read the "for surveypal"...

So you need to "escape" the { } that you want to keep for the end result so they aren't processed by civi and wrongly identified as token.

I think we are using smarty to process the token for the reminders, you can try putting {ldelim} instead of "{" and {rdelim} instead of "}".

Could you try if it works using scheduled reminder?

Unfortunately, civicrm has different ways of parsing the token using different tools (smarty is one way), so you might have one working for "normal" mails and that won't work on another part (reminders), and the workaround is potentially specific for each of these, so it makes the testing a bit more complicated than "just" sending an email.

X+

P.S. It's probably not as user friendly as surveypal, but you can quickly get something working with webform and webform\_civicrm to make simple surveys directly integrated in your site, including being able to store the response as an activity of the contact.

# Answer
> 0 votes
I think the bulk mail changes URL automatically to be a redirect, so that you could track mail click on URL.

You could achieve what you want by triggering CiviRules (together with the Email API) to send the same email, but as a transactional (single) email instead.

---
Tags: email, message-templates, smarty
---


title: This webpage has a redirect loop

text:
# Question
Title: This webpage has a redirect loop
I upgraded our test site to Civi 4.6.9 on WP 4.3.1 and all is ok. I upgraded Civi on our live site and the upgrade was successful. However, when I go into the Civi Menus sometimes I get "This webpage has a redirect loop ERR\_TOO\_MANY\_REDIRECTS". On the Administer menu I always get this error. What can I do to fix this problem? (ps. deleting cookies, etc. didn't help)

# Answer
> 4 votes
This issue was a WP Plugin "WordPress HTTPS" was conflicting with Civi |Administer| Resource URLs and Force Secure URLs(SSL) checked as Yes.

We deactivated the WP Plugin and all is ok!

---
Tags: upgrade
---


# Question
Title: How can do a bulk delete of users in Civi?
How can do a bulk delete of users in Civi? We have too many user accounts in civi and would like to delete may of them and only keep the ones that we need. Instead of looking up the accounts one at a time. I would like to select a group of records and delete them.

Thanks in advance Edward

# Answer
> 3 votes
This is actually a Drupal and not a CiviCRM question. A good answer is posted here; an alternate approach is the Bulk User Delete module, but for your use case I think that might not be as easy as some of the answers under the first link.

# Answer
> 2 votes
If you mean 'how do I bulk delete contacts', then you can do this via the Advanced Search (or Find Contacts). Find the contacts you want to delete, tick those records, then under Actions you will find Delete Permanently.

If you also want to delete the 'user accounts' then that will depend on the CMS. For example in Drupal, we tend to recommend deleting the Civi contact first, and then finding Drupal users who do not have a uf\_match record, and deleting those. We found that making a Drupal View using Bulk Views Operations to facilitate this.

---
Tags: permissions
---


# Question
Title: How to access the 4.7 Administrator Status Page?
I see a prominant feature of 4.7 is the "Administrator Status Page" and the Issue is https://issues.civicrm.org/jira/browse/CRM-13823 but I do not see a menu item for the status reports. How do you access the status reports?

# Answer
> 4 votes
@jdax worked on this at the Maryland sprint, and she's done except for a tiny bug to fix that a test just found. I expect it'll be included soon.

Alerts will have a link to the status page, and the bottom of each admin page will have the site's status as "System Status: OK", "System Status: Emergency", or something in between, with a link to the page.

You'll also be able to hush a message (have it never show up unless it increases in severity) or snooze a message so that it won't show up until a certain date.

# Answer
> 4 votes
You posted this question almost exactly at the same time that a PR to merge in this feature was posted - see the last comment on the CRM-13823 issue.

I was part of the team that worked on this during the Colorado sprint. The entity and APIs have been in place for months, and the 4.7 code all uses the new entity - but the status page, for the sake of easier development, was done in an extension, which the PR merges into core.

---
Tags: 4.7
---


title: Deleting log tables

text:
# Question
Title: Deleting log tables
Using CiviCRM 4.6.9.

While exploring debugging options I clicked on "Yes" for the "Logging" option in the Administration "Misc" page. That created hundreds of tables prefixed with "log\_" in the CiviCRM database. This isn't what I wanted.

I've turned off logging, but the tables are still there. Is it OK to manually delete any table beginning with "log\_"?

# Answer
> 3 votes
Rob - yes you should be fine to do that. Backup prior of course. Is it the fact you have tables, or the size of them that is the issue?

---
Tags: logs
---


title: Process Inbound Emails Failed

text:
# Question
Title: Process Inbound Emails Failed
after update from 4.6.2 to 4.6.9 i have this error in:

Entità: Job Azione: fetch\_activities Summary Finished execution of Process Inbound Emails with result: Failure, Error message: Process Activities failed

What can i do ? Thanks

I delete all email account and the error persiste.

# Answer
* Review the job log on your scheduled tasks page in the admin menu - the job results there for this task may show an error in them
* Review the PHP error log or output of your cron task which failed
* Review the CiviCRM logfile in `files/civicrm/ConfigAndLog/CiviCRM.*.log`

You can update your question here with additional details if the solution isn't clear.
> 1 votes

# Answer
Are you certain that this occurred because of the upgrade? You might try to connect to your mail account directly via Thunderbird, Geary, or Outlook using the same connection information in your Mail Accounts admin page.

Also, is it possible that you might have generated a new site key as a result of the upgrade (maybe if you moved the site back and forth with a development copy)? If so, there's the chance that your password may be garbled because of the change in key. Try typing the password into your Mail Accounts form again.
> 1 votes

---
Tags: email, cron-job
---


# Question
Title: Design bug? "Supported recurring units" for Membership contribution. Why?
I have a membership contribution page that has an options for monthly and biannual periods. I'd like to offer members the option for auto renewal when their memberships are up. When I check the box allowing for recurring contributions on my contribution page config, I'm offered choices, one that doesn't make sense for a contribution explicitly used for membership. (I do have my contribution set up this way.) The problem is this option:

Supported recurring units\* day week month year

Select recurring units supported for recurring payments.

For my specific problem, there is no biannual option. But more generally, if I had a membership type/ price set that was set for a period of 27 days, and I wanted to offer recurring payments, I'd want the recurring period to match exactly the length of the duration of the membership and happen after the 27th day. Am I doing something wrong or is this a design bug?

Why wouldn't people always want to automatically constrain their recurring payments with their membership length?

The period is already set by the duration of the membership. Isn't this redundant to be asked to set it again in the recurring contribution options?

Thanks

# Answer
> 2 votes
The big answer is that recurring contribution features were built with regular donations, not memberships, in mind. That memberships work is a nice bonus, but I think it would take a bit of investment to rework that the way you describe. With most memberships being more standard durations, nobidy has stepped up to build that.

In your specific case, many payment processors won't even support biannual recurring payments--their maximum interval is one year. A potential reason for this is the proportion of cards that would expire between each renewal.

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


title: Introduce CiviCRM in Italy

text:
# Question
Title: Introduce CiviCRM in Italy
who can I contact and how can I do to introduce CiviCRM in Italy? Translating Documentation in Italian? Thank you. Marco

# Answer
I can only give my experience in Hungary.

When I started contributing to CiviCRM first I translated the strings in Transifex. I took me a half year to translate nearly all strings.

Translation needed me firstly, beacuse we can use Civi UI translated. See the Italian pages: https://www.transifex.com/civicrm/civicrm/language/it/

Later I translated some presentation and tried to spread words about CiviCRM on Hungarian forums, and sites where I can find interested guys.

Visit the Get Involved page: https://civicrm.org/get-involved

The whole documentation translation big chunk of work.
> 3 votes

# Answer
I think an Italian translation exists - see all languages at: https://www.transifex.com/civicrm/civicrm/

To help click Help Translate CiviCRM
> 1 votes

---
Tags: wordpress
---


# Question
Title: Has anyone come up with an easy way to enter a household, the members, create the relationship, share the address, etc.?
Civicrm is extremely flexible with relationships. The downside of that is it's a pain to enter new household and their members. My users complain bitterly about how many steps it takes. Yes, there are some short cuts but it's still a lot of clicks. 99% of our households are husband wife and happen to live in the same house.

Some of the pain points mentioned are for hh to sort along with individuals in any list of contacts, you have to create the household with last name first, e.g. Smith, Barb and Steve. This means you then have to manually create the salutation manually, e.g. Dear Barb and Steve. They also complain about the address saying things like "why can't the individuals automatically inherit the hh address or if one of the ind has an address why can't the rest inherit it"

So has anyone create a form or maybe a webform that has something like this:

Contact 1: First Name, Last Name, email

Contact 2: First Name, Last Name, email (If last name same leave blank or prepopulate last name from contact 1)

Shared Address info:

Household info: Prepopulate household name from contact 1 and 2 (e.g. c1 Lastname, c1 first and c2 first or if c2 last is different C1 Last, C1 first and c2 Last, c2 first)
Prepopulate the salutations from c1 and c2 (e.g. Dear C1 First and C2 first)

Then when you save it, it creates the three contact records and the relationships, with hh having the address and the ind sharing it.

# Answer
We have setup a webform which enables the creation (or updating existing information) of

1) a household with its own data (phone number and physical/mailing address)

2) one or two adults with their own data (defaulting to our Spouse/Spouse relationship) and makes them share the address of the Household

3) 1-5 children with their own data who share the address of the Household and allows you to choose the relationship to Adults 1 and 2

The length of the Node Export was more than Stack Exchange allowed me to paste in, so you can find the CSV here: https://www.dropbox.com/s/e4vw5a9o15c1aiz/node-export-household-and-family-webform.drupal?dl=0

I don't know how this would work with importing back into your system with Node Export given that we'll have different relationships and tags and slightly different needs, but I think this will get you on the way.
> 4 votes

# Answer
In re-reading your question, we also came up with a jQuery solution for creating the Household Name from the names of the Parent and Spouse.

We added a class to the Parent First Name field, Parent Last Name field, the Spouse field, and the Household Name field (through the webform field UI itself, not on the Webform-CiviCRM section). (In our context most spouses have the same last name). Here's the script we put into a Mark Up field. Your markup text format input has to allow scripts:

```
 <script>
 $=jQuery;
 function HouseholdName(){
   var ParentFirst = $(".parent-first").val();
   var ParentLast = $(".parent-last").val();
   var SpouseFirst = $(".spouse-first").val();

   if (SpouseFirst != ''){
     $(".household-name").val(SpouseFirst + ' & ' + ParentFirst + ' ' + ParentLast);
   }

   else {
    $(".household-name").val(ParentFirst + ' ' + ParentLast);
   }
 }

 $(".parent-first").change(function(){
    HouseholdName();
 });
 $(".parent-last").change(function(){
    HouseholdName();
 });
 $(".spouse-first").change(function(){
    HouseholdName();
 });
</script>

```
> 2 votes

# Answer
Yes, you can create a webform to do exactly that. I have created one.

You just have to take the time to go through and set up the webform.
> 1 votes

---
Tags: webform-civicrm, households
---


# Question
Title: Civicrm with drupal 8 generating error while testing with behat
I have installed civicrm with drupal8 and I am trying to implement behat in my site. When I am trying to test my site for as logged in user using behat feature file I am getting an notice Notice: Undefined index: q in /var/www/html/drupal8aritnew/libraries/civicrm/CRM/Utils/System/DrupalBase.php line 487 (Drupal\Core\Entity\EntityStorageException).

Below is the debug backtrace output:

# 0 CRM\_Utils\_System\_DrupalBase-\>postURL() called at \[/var/www/html/drupal8aritnew/libraries/civicrm/CRM/Utils/System.php:502\]

```
  │ #1  CRM_Utils_System::postURL() called at [/var/www/html/drupal8aritnew/libraries/civicrm/packages/HTML/QuickForm.php:289]
  │ #2  HTML_QuickForm->HTML_QuickForm() called at [/var/www/html/drupal8aritnew/libraries/civicrm/packages/HTML/QuickForm/Page.php:71]
  │ #3  HTML_QuickForm_Page->HTML_QuickForm_Page() called at [/var/www/html/drupal8aritnew/libraries/civicrm/CRM/Core/Form.php:214]
  │ #4  CRM_Core_Form->__construct() called at [/var/www/html/drupal8aritnew/libraries/civicrm/CRM/Core/Controller.php:459]
  │ #5  CRM_Core_Controller->addPages() called at [/var/www/html/drupal8aritnew/libraries/civicrm/CRM/Core/Controller/Simple.php:81]
  │ #6  CRM_Core_Controller_Simple->__construct() called at [/var/www/html/drupal8aritnew/libraries/civicrm/CRM/Core/BAO/UFGroup.php:794]
  │ #7  CRM_Core_BAO_UFGroup::getEditHTML() called at [/var/www/html/drupal8aritnew/modules/civicrm/civicrm.user.inc:29]
  │ #8  civicrm_user_insert()
  │ #9  call_user_func_array() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Extension/ModuleHandler.php:394]
  │ #10 Drupal\Core\Extension\ModuleHandler->invokeAll() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/EntityStorageBase.php:172]
  │ #11 Drupal\Core\Entity\EntityStorageBase->invokeHook() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:385]
  │ #12 Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/EntityStorageBase.php:469]
  │ #13 Drupal\Core\Entity\EntityStorageBase->doPostSave() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:271]
  │ #14 Drupal\Core\Entity\ContentEntityStorageBase->doPostSave() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/EntityStorageBase.php:394]
  │ #15 Drupal\Core\Entity\EntityStorageBase->save() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:746]
  │ #16 Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() called at [/var/www/html/drupal8aritnew/core/lib/Drupal/Core/Entity/Entity.php:340]
  │ #17 Drupal\Core\Entity\Entity->save() called at [/var/www/html/drupal8aritnew/vendor/drupal/drupal-driver/src/Drupal/Driver/Cores/Drupal8.php:108]
  │ #18 Drupal\Driver\Cores\Drupal8->userCreate() called at [/var/www/html/drupal8aritnew/vendor/drupal/drupal-driver/src/Drupal/Driver/DrupalDriver.php:102]
  │ #19 Drupal\Driver\DrupalDriver->userCreate() called at [/var/www/html/drupal8aritnew/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php:363]
  │ #20 Drupal\DrupalExtension\Context\RawDrupalContext->userCreate() called at [/var/www/html/drupal8aritnew/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/DrupalContext.php:52]
  │ #21 Drupal\DrupalExtension\Context\DrupalContext->assertAuthenticatedByRole()
  │ #22 call_user_func_array() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:99]
  │ #23 Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:54]
  │ #24 Behat\Testwork\Call\Handler\RuntimeCallHandler->handleCall() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:125]
  │ #25 Behat\Testwork\Call\CallCenter->handleCall() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php:80]
  │ #26 Behat\Testwork\Call\CallCenter->makeCall() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:125]
  │ #27 Behat\Behat\Tester\Runtime\RuntimeStepTester->testDefinition() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php:73]
  │ #28 Behat\Behat\Tester\Runtime\RuntimeStepTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableStepTester.php:74]
  │ #29 Behat\Behat\Hook\Tester\HookableStepTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingStepTester.php:73]
  │ #30 Behat\Behat\EventDispatcher\Tester\EventDispatchingStepTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php:59]
  │ #31 Behat\Behat\Tester\StepContainerTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php:76]
  │ #32 Behat\Behat\Tester\Runtime\RuntimeScenarioTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableScenarioTester.php:74]
  │ #33 Behat\Behat\Hook\Tester\HookableScenarioTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php:103]
  │ #34 Behat\Behat\EventDispatcher\Tester\EventDispatchingScenarioTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php:83]
  │ #35 Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php:72]
  │ #36 Behat\Behat\Hook\Tester\HookableFeatureTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php:71]
  │ #37 Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php:63]
  │ #38 Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php:73]
  │ #39 Behat\Testwork\Hook\Tester\HookableSuiteTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php:72]
  │ #40 Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php:71]
  │ #41 Behat\Testwork\Tester\Runtime\RuntimeExercise->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php:70]
  │ #42 Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:146]
  │ #43 Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:108]
  │ #44 Behat\Testwork\Tester\Cli\ExerciseController->execute() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Cli/Command.php:63]
  │ #45 Behat\Testwork\Cli\Command->execute() called at [/var/www/html/drupal8aritnew/vendor/symfony/console/Command/Command.php:259]
  │ #46 Symfony\Component\Console\Command\Command->run() called at [/var/www/html/drupal8aritnew/vendor/symfony/console/Application.php:878]
  │ #47 Symfony\Component\Console\Application->doRunCommand() called at [/var/www/html/drupal8aritnew/vendor/symfony/console/Application.php:195]
  │ #48 Symfony\Component\Console\Application->doRun() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php:102]
  │ #49 Behat\Testwork\Cli\Application->doRun() called at [/var/www/html/drupal8aritnew/vendor/symfony/console/Application.php:126]
  │ #50 Symfony\Component\Console\Application->run() called at [/var/www/html/drupal8aritnew/vendor/behat/behat/bin/behat:31]

```

Can anyone help me understanding what I am doing wrong?

# Answer
> 1 votes
It would help to know which version of D8 you tried with. The readme says "It it currently verified to work against Drupal 8 beta 14 and CiviCRM 4.7"

I am not clear if your issue is purely with Behat.

We have not had a chance yet to find the bugs that might have been introduced with Drupal 8 rc1.

If you can help progress this please do report back. If you can help fund the ongoing work of getting CiviCRM working with Drupal 8 then please consider donating via this MIH.

---
Tags: drupal-8
---


# Question
Title: API: Contact get/getcount by primary address country stopped working on upgrade to 4.6.9
I spoke too soon, there was one hiccup on the recent upgrade.

I have a bit of custom code on one site that pulls contacts based on 'Primary Address country' as follows (example):

`$contactcount=civicrm_api("Contact","getcount", array ('version' =>'3', 'contact_type' =>'Organization', 'country' =>'United States');`

When I try this on the API Explorer on the demo site, I get this error:

`"error_message":"A fatal error was triggered: United States is not of the type Positive"`

It seems to have stopped working with an upgrade from 4.6.7 to 4.6.9. Did something change in the API call?

Update:

I was trying to rough in some temporary code to make this functional by using the Country ID instead of the Country Name, and there seems to be a problem there, too. The country ID field in the API seems to be essentially ignored.

`$contactcount=civicrm_api("Contact","getcount", array ('version' =>'3', 'contact_type' =>'Organization', 'country_id' => 1228);`

I verified this on the demo site, too. I have opened a bug ticket for this.

# Answer
> 1 votes
This has been fixed at https://github.com/civicrm/civicrm-core/pull/6985 where you can get the Contact using different address fields specifying the names (country, state\_province, etc.)

---
Tags: api, upgrade
---


# Question
Title: In Wordpress, I want to convert my installation from an external database to use the default database
I am using CiviCRM on WordPress and I am moving my hosting to WP Engine - where I have all of my other sites hosted. Unfortunately, I set this instance of CiviCRM to use a separate database, however, WP Engine only supports one database per install. I am trying to convert my existing CiviCRM install to use the default WordPress database before I migrate the site to WP Engine. Is this possible?

If I can't convert the install, can I create a new install (using the WordPress database) and IMPORT the data from the old site?

# Answer
It's actually quite simple to combine your databases.

1. Do a database export of your WP database:

```
mysqldump -u [username] -p [wp database name] > wp-original.sql

```

It'll ask for your password and then output your WordPress database to the `wp-original.sql` file.
2. Do a database export of your CiviCRM database:

```
mysqldump -u [username] -p [civi database name] > civi-original.sql

```

It'll ask for your password and then output your CiviCRM database to the `civi-original.sql` file.
3. Create a new database that'll be your combined database. This way, you will still have your two original ones in case of emergency. Grant permissions on the new database to the user that has permissions for your WordPress database.
4. Load the two exports into the new database:

```
mysql -u [username] -p [new database name] < wp-original.sql
mysql -u [username] -p [new database name] < civi-original.sql

```
5. Edit your wp-config.php to have the new database name:

```
define('DB_NAME', '[new database name]');

```
6. Edit your civicrm.settings.php to have the new database name (and appropriate username/password, if you had different ones for CiviCRM). This will need to be done in both places--once for the CMS database and once for the CiviCRM database.

```
define( 'CIVICRM_UF_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );

define( 'CIVICRM_DSN', 'mysql://[username]:[password]@[hostname (probably just "localhost")]/[new database name]?new_link=true' );

```

You can probably just copy the `CIVICRM_UF_DSN` value once you've fixed the database name and paste it in place of the `CIVICRM_DSN` value.
7. Log in and make sure everything works on your existing server.

For Drupal and Joomla users, the principle is the same, just with settings.php and configuration.php, respectively, instead of wp-config.php. The only difference is that on Joomla, you need to fix both civicrm.settings.php files (in `administrator/components/com_civicrm` and `components/com_civicrm`).

Now, I used to say that you should never put your site on WPEngine because they used to only run a version of PHP that was too old for CiviCRM. That's been fixed. However, they still run very aggressive caching, and you may find it to be a problem with CiviCRM.

You should definitely do your first run over there as an experiment and test it heavily, logging in as various users and trying out a variety of CiviCRM features. There's a good possibility that it will either be unusable or take more of your time than you'd save by having things in the same place. If you think of it, please comment with your experience--whether it works or doesn't.
> 3 votes

---
Tags: wordpress, database, configuration
---


# Question
Title: SSL introduces warnings related to contact image
I recently introduced SSL across my entire Drupal-Civicrm site. Now when I visit the contact summary page, I'm confronted with warning errors (below) that are clearly related to SSL interfering with accessing the contact's image dimensions.

Note that the image is visible in the summary page but its aspect ratio is wrong (the image is squeezed), confirming that getting the image's dimensions failed (without SSL, the image aspect was correct).

I am using a self-signed certificate as I'm still in the development stage. I tried to disable certificate verification in php.ini (setting the parameters verify\_peer=false, allow\_self\_signed=true, verify\_peer\_name=false) but it did not solve the issue.

> Warning: getimagesize(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3\_GET\_SERVER\_CERTIFICATE:certificate verify failed in CRM\_Contact\_Page\_View-\>preProcess() (line 164 of /var/www/prod/sites/all/modules/civicrm/CRM/Contact/Page/View.php).
>
> Warning: getimagesize(): Failed to enable crypto in CRM\_Contact\_Page\_View-\>preProcess() (line 164 of /var/www/prod/sites/all/modules/civicrm/CRM/Contact/Page/View.php).
>
> Warning: getimagesize(http://abdong.duckdns.org/index.php?q=civicrm/contact/imagefile&photo=500x500bb\_3\_a5ece8ea35cdb1947316bd7c98d5daf9.jpg): failed to open stream: operation failed in CRM\_Contact\_Page\_View-\>preProcess() (line 164 of /var/www/prod/sites/all/modules/civicrm/CRM/Contact/Page/View.php).

# Answer
* Check that you have set "Verify SSL" to "No" at `civicrm/admin/setting/url`
* Note that CiviCRM is storing absolute URLs in DB `civicrm_contact.image_URL` \- even once your SSL config is fine, you may see images not appear on SSL due to CRM-14207: Contact's image URL is full & absolute path
> 3 votes

---
Tags: contacts, ssl
---


# Question
Title: Relationship created by API does not add Membership until edited/updated
CiviCRM 4.6.8

I'm using `Relationship.create` in a civicrm post hook to create an inherited membership. My membership type is set to use this relationship. However after that API call is successful, the relationship exists but no membership follows.

I was reading the source for api/v3/Relationship.php and noticed this note for the setvalue method. It seems like I need to use it to invoke `disableEnableRelationship`.

However, I tried setting is\_active to 1 with `Relationship.setvalue` in my hook function right after creating the Relationship and still no membership. Is this expected behaviour?

Here's roughly what I have:

```
$id = $relationship['id'];
$params = array(
       'id' => $id,
       'field' => "is_active",
       'value' => 1,
);
$result = civicrm_api3('Relationship', 'setvalue', $params);

```

Curiously, I notice if I edit the specific relationship in the admin UI and save, the proper inherited membership gets created.

# Answer
> 2 votes
I wouldn't use the setvalue method, it was introduced as a stop gap measure when the api v3 was young and it's deprecated now.

Is the relationship already active when you call the create call? setvalue isn't going to do anything more anyway.

I don't know the specific of that api, but in general, the api calls tend to be "close to the metal" and if there is a chain of events (eg if relationship is created and lots of configuration magic, then add a membership too), they are often not included by default.

On your specific case, if you are lucky it's just a matter of finding the right parameter to trigger the "advanced mode", or create the membership manually.

You should check out how it's done in the code for the UI, the code handling the membership creation might be already into the BAO layer and you can easily modify (or add an extra param) to the api to benefit from it.

If not, it might need some re-factoring....

# Answer
> 1 votes
We've been in a same situation after mass users import and ended up re-saving all Contacts via API call, using "Create" Contact and passing an existing IDs, as it has been recently introduced as "Update" call replacement. So no real changes were made, method works exactly as if you hit "Save" button in browser for each contact, but obviously much faster.

---
Tags: civimember, api, relationships
---


# Question
Title: Custom field aggregation with Drupal Views
I have problems with showing aggregated custom data.

**Some frequently asked questions:**

* Yes, I have succesfully set up Drupal Views connected to the CiviCRM database, with the php.settings.file
* Yes, I have checked the Access custom data permissions.
* Yes, I have also set up the View with User field, and not the CiviCRM Contact field.

**I am trying to achieve this:**

The count of new contacts recruited this year (date of recruitment is a custom field).

**What I get:**

I only get the count of new contact recruited this year that is ALSO a Drupal user. But I cannot find any criteria or field that should refine the result like that.

Do anyone have a tip for what to check for?

# Answer
> 2 votes
If your View is based on 'users' then your result makes sense.

If your View is based on 'civi contact' then your result doesn't make sense unless you are using contextual filter, relationship or filter to specify 'user'.

---
Tags: custom-fields, drupal-views
---


# Question
Title: How to split Member Contribution page transactions to multiple financial types?
On our Member Contribution Page, we have a price set with two fields. 1. Membership Choice - financial type 'Membership' 2. Donation Amount - financial type 'Donations'

Users pay, but the result is one contribution entered on the contacts record with the 'Membership' contribution type only (it appears).

Is there a way to get the donation to be recorded separately, or at least as its own financial type.

Larger question - best way to have Member Join/Renews and Donations on the same page, yet keep the books straight. Thanks!

# Answer
> 4 votes
The data exists in Civi, but it's a bit tricky to get at.

When making a payment for a membership with additional donation the underlying database records a single contribution, but multiple "line items". Each line item is recorded with the correct financial type, as described in the price set. Oh yes - if you haven't enabled a price set on the contribution page in question, that's a required first step to setting different financial types on the different line items! Though be careful if you offer auto-renewing memberships - there's a bug that can break your auto-renew functionality if you use a price set if you don't patch it first.

Once you have the price sets, with each field using its own financial type, you're in business! CiviAccounts will export the data appropriately if you export data to your bookkeeping program. You can also use the Extended Reports extension to run reports on line items rather than contributions.

The one missing piece of the puzzle is to search on financial type data instead of contribution data. This doesn't exist currently in Civi. Someone started to write it, but doesn't have funding to finish it; if you need that functionality, please reply to this in a comment, I've been trying to round up folks to crowdsource funding for this feature.

EDIT: There's some work afoot to get line item search crowdfunded for core CiviCRM. Contact me if you're interested at http://palantetech.coop/contact. Meanwhile, some of you might be interested in this line item report extension.

---
Tags: civicontribute, civimember
---


# Question
Title: Redirect anonymous users to login when trying to view profile
On our Drupal 7.38 and CiviCRM 4.6.8 site, the "profile listings and forms" permission is set to authenticated users and above.

Accordingly, anonymous users receive the standard warning when trying to view a profile:

```
Sorry but we are not able to provide this at the moment.
The requested Profile (gid=20) is disabled OR … etc.

```

How do we redirect anonymous users to a login screen rather than receive this warning?

# Answer
Have you tried the login\_toboggan drupal module? Not sure if it works with Civi profiles but it might. It provides the option to add a login form on all "access denied" screens.
> 2 votes

---
Tags: profile
---


# Question
Title: Why does CiviMail 'track click through' redirect to incorrect URLs?
I seem to be having a problem that a number of people are running into that I'm hoping we can solve. When I sent out emails using the "track click through" enabled, I end up with URLs that direct to white screens.

What should direct to http://www.mysite.com/contribute/

instead directs to this url, which gives a white screen.

http://www.mysite.com/wp-content/plugins/civicrm/civicrm/extern/url.php?u=191&qid=5085

We're running Wordpress 4.3.1 CiviCRM 4.6.6

thoughts? suggestions? Would it help to post the actual site urls? Needless to say as this is a fundraising email, I've got a development director in the other room melting down over this, so any help would be greatly appreciated. Thanks!

# Answer
Devin, your description is eerily similar to a problem I had on our Drupal site. Without track click through, things were fine. Once those were enabled, no dice.

For our situation (CiviMail - when Track Click Throughs is enabled, links result in a white screen with warnings), it turns out it was due to a PHP setting issue. Jon G's answer explains the why. Richard's answer explains how we fixed it.

Hope this helps!
> 2 votes

---
Tags: civimail
---


# Question
Title: Change Case summary report to group by Case ID
When civicase is configured to have multiple case clients, the summmary report (report class: CRM\_Report\_Form\_Case\_Summary) shows one line for each client.

I'm trying to change this to show only one line per case. I've created a copy of the above report and i'm trying to change the group by clause, currently it's

```
  public function groupBy() {
    $this->_groupBy = "";
  }

```

I'm looking for some pointers to how to change this to group by CaseID.

Is this the right way to go and if so what would i need the function to say.

# Answer
In general this kind of thing depends what other fields you're including as columns. But ignoring that for the moment one approach is use the groupBy as you suggest and then in select() add an if statement for the contact sort\_name and use mysql GROUP\_CONCAT().

Another is remove the joins and anything related to contact.

Another is alter the from() to do some kind of derived table inner select on the contact tables so that at the outer level it's already flattened to one row per case.
> 1 votes

---
Tags: civireport, civicase
---


# Question
Title: What impact may deploying a changed Drupal DB have on CiviCRM?
We would like to push our Drupal development environment to production. We have CiviCRM integrated. Obviously our production Civi data has changed since we created Dev (Drupal+Civi).

Is there any documentation explaining best practices for pushing out Drupal updates from a development environment to production without affecting CiviCRM's current db?

Thanks

# Answer
Generally, CiviCRM's data is stored in separate tables and you can treat the CRM and CMS as separate entities.

Many people store the CRM and CMS in separate databases for convenience (eg *exampleorg\_drupal* & *exampleorg\_civicrm*).

Particular items to check, though:

* If you are using Webform CiviCRM or CiviCRM Entity, you may need to rebuild connections between referenced CiviCRM entities (eg contribution pages, contacts, ...)
* You may want to check your `civicrm_uf_match` tables for mismatches. This maps Drupal users to CiviCRM contacts, so changes on either side, eg users added on the old Drupal DB might trigger an incorrect match to a Drupal user in the new Drupal DB.

Once the transition is complete, you may need to give some well-placed kicks to get things running smoothly. These may include -

* Clearing Drupal and CiviCRM caches.
* Deleting the contents of CiviCRM's `templates_c` directory.
* Rebuilding Drupal's registry (`drush rr`)
* Correcting/deleting the Drupal variable `civicrm_class_loader`

---

If a CiviCRM install permits any anonymous input (including recording user actions like CiviMail opens, contributions or profile submits), working at the whole-DB level can mean choosing between downtime (disabling the site while you make changes) and potential data loss (losing data while you switch between a minutes-old backup and the current DB).

For that reason you might want to look into practices that let you deploy change in smaller parts, since that means you can integrate updates will reduced risk at each step. There is more established practice of this on the Drupal side, with tools like Features, WFTools, and (in D8) Configuration Management.
> 7 votes

---
Tags: drupal, best-practice, deployment
---


# Question
Title: Upgrade Now Button does not show when upgrading to 4.6.9
I usually run the upgrade process for CiviCRM and it usually works well. On 4.6.9 I noticed that the upgrade now button for step 11 in the upgrade documentation does not show. It says Upgrade CiviCRM to version 4.6.9 but no upgrade button shows. I did manage to upgrade on a non-ssl site but with the sites that have SSL there seems to be problem.

# Answer
If you disable the verify SSL certs and Force SSL certs before doing the upgrade (even if your site is on SSL) then the upgrade works fine.

So in the upgrade process before turning of CiviCRM additional modules disable the two fields of Verify SSL certs and Force SSL certs. You can find the settings under /civicrm/admin/setting/url?reset=1

Remember to turn them back on.

Cheers.
> 1 votes

---
Tags: upgrade
---


# Question
Title: Unable to give provider name by using SMS Api Extension
1. I downloaded SMS Api Extension (v1.3) in civicrm version 4.5.0.
2. After that i am unable to give Provider name.(As there is no option to give provider name)
3. Then i went to https://github.com/CiviCooP/org.civicoop.smsapi .... There in commits "fixed provider name fixed section". It showing two changing files which was missing in last released SMS Api version 1.3. 4.So i created CRM/Smsapi/CivirulesAction.mgd.php and CRM/Smsapi/CivirulesAction.php inside org.civicoop.smsapi (which is the extension diretory name)

When i opened --\> Settings - SMS Provider --\> Still creating of provider name option is not coming.

Please suggest.

# Answer
> 1 votes
Sandeep are you looking to setup SMS in CiviCRM?

We successfully setup SMS in CiviCRM 4.6.8 using Twillio - https://www.twilio.com/

We followed the exact steps here - http://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS

and use From=614111111111 where 61 is the country code (Australia in our case).

---
Tags: civisms
---


# Question
Title: Remove Default/Standard fields from activities
is it possible to remove some of the default/standard fields for activities?

For example, when creating a new activity type it includes "location" as a standard field. However, you can't search or report by this field. I'm not sure what it's purpose is, and I would rather create a custom field that can be searched.

Thanks

# Answer
You can not switch this off as a user I am afraid. But you can hide it with a little jQuery to the template if you know how to do this. Is this something you can do?
> 3 votes

# Answer
If you really just want the location field to be searchable, it'd be better to address that issue than to create a new field.

I'd also warn that activities have issues when scaling your site. A lot of activities get created by default, and the api tends to break with a lot of records (my experience was from 4.4, and the api implementation of the limit records was only throwing out the extra ones after loading them all).
> 0 votes

---
Tags: activities
---


# Question
Title: Add fields in Matching CiviCRM fields on Import Contact
We are importing contacts into our CRM. Our CSV file contains a District column, but while importing contacts, there's no such field present in CiviCRM--we need to add the district field.

URL: example.com/?option=com\_civicrm&task=civicrm/import/contact&\_qf\_MapField\_display=true&qfKey=7d325df8cb7e6a31c5c05551375c8292\_1176

Screen Shot: http://screencast.com/t/lDQAjxPXlJsJ

So as shown in the screenshot, we want to add district under the state in the drop down. So there should be a column called "district" when we view the contact list.

Also, when we're importing contacts, it is showing mismatched files. Is there any way to put all my contacts in a file to import without interruption?

On the last step, it is importing only 145 contacts out of 250. It is generating an Import Error CSV file with second column (Reason) containing "Invalid value for field(s) : Addressee must be one of the configured format options. Check Administer \>\> System Settings \>\> Option Groups \>\> Addressee for valid values."

As I do not have enough experience in programming, please guide me on the simplest way to proceed.

# Answer
> 2 votes
You can add custom fields for district. Once you add the field you can map it in the import. see http://gitbook.civicrm.org/organising-your-data/creating-custom-fields.html for how to add the field.

I'm not sure just what district is in this case. If the addresses are for a foreign country that has district as part of the address, it may already sort of be there. It may be stored in state province field. If it is this case, you can see what's there by going to a contact, change the country and seeing what's in the pull downs. If you are importing addresses from some other country you may need to add a field for country to your cvs.

I'm not sure I fully understand the mismatched file problem. If you have both individuals and households in the same file you will get a mismatched contact problem. Then you need to either run the file twice. Once for individuals and once for households and ignore the errors or split the file into two.

The problem with the addressee is most likely picking the wrong field to map to. The addressee field is expecting a smarty clause, like {contact.first\_name}{ }{contact.middle\_name}{ }{contact.last\_name}, which creates the addressee on the fly by using using the values in other fields. If you are trying import specific text to be the addressee then map it to "Addressee Custom". (The same is true for postal and email greetings as well).

# Answer
> 1 votes
It sounds like you're saying that "district" is the name for a division of a state or province. The American and English term for this is "county", and CiviCRM has built-in support for counties nested within their respective states. In some countries, multiple states will have a county with the same name--for example in the US, 18 states have a "Montgomery County", so CiviCRM knows to pick the right one once you pick a state (just like the process of picking a country and then a state/province).

You will need to do three things to get this set up. First, go to **Administer - Localization - Address Settings**, scroll down to Address Editing, and click the box for County. This will let you set counties for your contacts.

Second, you will need to populate counties. As long as I've known, CiviCRM has shipped with just a handful of counties, all in California. For a while, CiviCRM shipped with a SQL file with other American counties, but it was cumbersome for the average user to load them. Instead, I built an extension to load them--enabling the extension adds them all to the database.

If you have a list of all the districts for the country you're importing into, you can very easily build an extension to import them. Copy the extension that's in https://github.com/agh1/com.aghstrategies.uscounties and edit the array that has all the counties to have each item be the state/province id pointing to an array of the district names.

Alternatively, you could just go into the civicrm\_county table in the database and enter each district with the corresponding state/province ID.

---
Tags: custom-fields, import, county
---


title: CiviEvent & Wordpress

text:
# Question
Title: CiviEvent & Wordpress
I formerly used CiviCRM with a Drupal website and recently moved over to the same Civi install on a Wordpress website. The CiviDB is the same, but the CMS has changed.

Previously, when using CiviEvent, there was a dropdown calendar for selecting the time. Also, when choosing the event location, I could select a formerly used event and it would auto-populate the fields with the event data from that previous event.

Now, on Wordpress, those functions do not work. I have to manually enter the time and date, and while I can select a previously used event, it does not auto-populate the fields (I have to manually re-enter the info, and it will erase any fields that are left blank in the other events that share the location).

My question is whether this is a limitation of the Wordpress version of CiviCRM, or if something was messed up when moving from Drupal to Wordpress. Do other Civi/WP users have this problem?

# Answer
> 1 votes
This sounds like a problem on your site specifically.

You can always verify this by checking the public CiviCRM/WP demo site.

To me this sounds like a general javascript error on your site, likely caused by a bad WP plugin or theme. Check the javascript troubleshooting guide for more details.

---
Tags: wordpress
---


# Question
Title: Membership payments missing from contact's contribution screen
**Solution found:** *The Member Dues financial type was missing a designated Income financial account. It must have gone away during an upgrade. Adding it back in fixed this issue.*

---

Membership transactions have disappeared from the Contributions screen in Contact records. The top of this screenshot indicates the contact has 12 contributions, but only 7 are displayed. There are no next/previous links.

The missing contributions are all membership transactions. Any reason why these would stop showing up? Any way to restore them?

Thanks.

This is Civi 4.6.9 on WP 4.3.1

Here is an example of a search for all contributions and all contribution types from another member. Notice the summary says there are 9 results, but it only displays 4 transactions....

# Answer
> 1 votes
Adding answer by Eric as an answer so it can be 'accepted' and hence have this question 'answered'

The Member Dues financial type was missing a designated Income financial account. It must have gone away during an upgrade. Adding it back in fixed this issue

---
Tags: civicontribute, civimember, contacts
---


title: Global Dashboard

text:
# Question
Title: Global Dashboard
I just created a new dashlet via Views to show a list of case managers. Is there a way I can add this dashlet to all my current users' dashboards? I know there is the Default Dashlet extension, but that only seems to apply to new users.

Are there other workarounds that I could possibly reset all my users dashboards?

# Answer
A workaround:

You could add a (Drupal) block, and choose it only to display on a certain page; CiviCRM home. (And maybe also by selecting only to show with specific roles)
> 2 votes

---
Tags: drupal-views, dashboard, dashlet
---


# Question
Title: Shouldn't duplicate group titles be possible?
I'm wondering why duplicates in group titles are forbidden. Unique names should satisfy all bao and dao needs, don't they?

We need a repeated structure like

```
o project a
  o customers
  o services
  o orders
o project b
  o customers
  o services
  o orders

```

and it seems, civi is prohibiting this.

Any help would be appreciated, thx in advance // nielo

# Answer
I suspect the reason is that the requirement that names be unique predates the ability to have parent groups. That said, allowing non-unique groups would complicate UI design. For instance, I've seen the scenario where someone has permission to view a parent group but not a child group. In your case, if someone did that, they'd have no way to differentiate between Customers A and Customers B.

That said, I don't think there's any other compelling reason not to drop the unique index from the name column in `civicrm_group` and see what happens. Don't forget to create a new non-unique index once you delete the old one!
> 0 votes

# Answer
There are two (?!) fields giving name on groups:

* name
* title

I suspect the duplicate check is only on the name field and not on title field.

First create two groups in the UI with two different names. That creates the name field and the title field. Then you could change the title field again. Then you would have two unique name fields, and same title (which is the one shown in the UI)

**Update: This doesn't work after all**
> 0 votes

---
Tags: api, groups
---


# Question
Title: API Get Contacts which are members of a certain group
While trying this request

```
$result = civicrm_api3('Contact', 'get', array(
'return' => "id",
'group' => "Administrators", ));

```

we've got

```
{
    "error_code": "no such field",
    "sql": "SELECT contact_a.id as contact_id, contact_a.is_deleted  as `contact_is_deleted`, `civicrm_group_contact-Administrators`.id as group_contact_id, `civicrm_group_contact-Administrators`.status as status  FROM civicrm_contact contact_a  LEFT JOIN civicrm_group_contact `civicrm_group_contact-Administrators` ON (contact_a.id = `civicrm_group_contact-Administrators`.contact_id AND `civicrm_group_contact-Administrators`.status IN (\"Added\"))   LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_Administrators` ON contact_a.id = `civicrm_group_contact_cache_Administrators`.contact_id   WHERE  ( contact_a.is_deleted = '0' AND ( ( `civicrm_group_contact-Administrators`.group_id IN ( Administrators ) ) OR ( `civicrm_group_contact_cache_Administrators`.group_id IN (\"Administrators\") ) ) )  AND  ( 1 )  AND  ( 1 )   GROUP BY contact_a.id LIMIT 0, 25  [nativecode=1054 ** Unknown column 'Administrators' in 'where clause']",

```

whatever operator ( "=" , "Like", "In" ) is being used.

All we wanted is Contact IDs, which should be passed to another API call. Of course, we can get data by Search in Group in browser and export all values, when read csv file and extract IDs, but it would be much prettier with pure API calls.

# Answer
> 4 votes
You should then use another entity; GroupContact. Remember to add the Status=Added

# Answer
> 3 votes
I think you should target the Group entity and chain it with Group Contact like this:

```
$result = civicrm_api3('Group', 'get', array(
'sequential' => 1,
'name' => "Administrators",
'api.GroupContact.get' => array('status' => "Added"),
));

```

The GroupContact will return the contact\_id

# Answer
> 3 votes
Andrei and Flying answer seems good to me but if i look at civicrm api examples in the core code, you should be able to do this :

```
$result = civicrm_api3('Contact', 'get', array(
  'return' => "id",
  'filter.group_id' => array(0 => 1)
));

```

as found in : https://github.com/civicrm/civicrm-core/blob/master/api/v3/examples/Contact/GroupFilterUsingContactAPI.php

EDIT 2019-05-31: the API seems to have changed. Now it's :

```
$result = civicrm_api3('Contact', 'get', array(
  'return' => "id",
  'group' => [
    'IN' => [0 => 1]
  ],
));

```

---
Tags: api, contacts, groups
---


# Question
Title: Setting Up CiviCRM Multisite on Wordpress
I run 2 sites on a Wordpress multisite. One of the sites has CiviCRM installed, and I want to hook up the second site to be able to access the Civi db as well. The first site is our main organization's website and handles membership, events, etc. The second site is a dedicated to one of our large annual events.

I am hoping to be able to access the Civi database from the second site to display the events in CiviEvent and allow for event registrations from the second site. That way people who register for the site will be added to our main Civi user database, rather than keeping track of two separate databases on each website.

The instructions on setting up a multisite in Civi seem quite complicated, so I am wondering if it is worth it to use multisite... Is this something that multisite can do? Is it worth doing, or is it far too difficult for too little reward?

# Answer
> 2 votes
It should be vastly superior to run multisite for the very fact you state: "That way people who register for the site will be added to our main Civi user database, rather than keeping track of two separate databases on each website."

One of the main benefits of using a CRM is to have a centralized database of all constituent information, be it contacts, contributions, events, etc. If you split it up, you are only causing yourself headaches later on trying to merge it.

Getting multisite working is worth it. (Note: I haven't an idea how well Wordpress does multisite; my experience is usign Drupal.)

---
Tags: wordpress, multisite
---


# Question
Title: Using CiviCRM with Security Pro iThems plugin - page not found for contribution pages after SSL certificate loaded
I'm running the security pro plugin, created by iThemes, as I do with many of my wordpress sites. One of my many security steps I run through is "Hide Login Area" however once changing the standard wp-admin directory it seems my CiviCRM plugin has difficulties processing secure SSL forms due to that plugin wanting to access the now non-existent "wp-admin" connection.

It comes to a not\_found page and only started happening after the ssl certificate loaded and civicrm told to redirect contributions pages to ssl.

Is there a way to work around this in CiviCRM?

# Answer
> 1 votes
Check the URL set in `CIVICRM_UF_BASEURL` in your `civicrm.settings.php` matches the updated location of your site.

Protocol may now be `https://` instead of `http://` \- I'm not familiar with Security Pro plugin; it may need to be improved to account for CiviCRM URLs also.

There's no harm in making the entire site SSL, which keeps configuration simpler ... just redirect all HTTP traffic to the encrypted URL.

---
Tags: contribution-page
---


title: Pulling Reports with Custom Fields

text:
# Question
Title: Pulling Reports with Custom Fields
Ok, I have a customer that has created an event that has a rather extensive profile setup, which includes a field to upload a file.

When they pull the report, the full URL to access the file isn't include, it just shows ( ).

Is it possible get the full URL to populate that field when you pull the report?

Thank You!! Nicole

# Answer
> 2 votes
Are you working in drupal? If so, I recommend using a custom view, rather than trying to get a custom report.

---
Tags: custom-fields, profile, civireport, custom-reports
---


# Question
Title: Report of multiple different memberships per contact in one line
CiviCRM 4.6.8 and WP 4.3.1 Many of our members have two memberships, a main membership (ie. Professional or Student) and a State(or area) Chapter membership (ie. California or New England, etc.). How can I report in a single line what memberships a member has? Do I need to do this in SQL or can I do this in a native CiviReport. If SQL could someone get me started. THANKS.

# Answer
> 2 votes
Please use the below SQL to list all the membership related to single membership in an single row - I guess this helps

select GROUP\_CONCAT(b.name) from civicrm\_membership a,civicrm\_membership\_type b where b.id = a.membership\_type\_id and a.contact\_id in (select contact\_id from civicrm\_membership GROUP BY contact\_id having COUNT(\*) \> 1)

# Answer
> 1 votes
```
SELECT
membership.id,
contact.first_name,
contact.middle_name,
contact.last_name,
contact.job_title,
contact.organization_name,
address.street_name,
address.supplemental_address_1,
(
    SELECT
        NAME
    FROM
        civicrm_state_province
    WHERE
        id = address.state_province_id
) AS state,
address.city,
address.postal_code,
phone.phone,
GROUP_CONCAT(mem_type. NAME),
GROUP_CONCAT(membership.join_date) AS since_date,
GROUP_CONCAT(membership.start_date),
GROUP_CONCAT(membership.end_date),
(
    SELECT
        NAME
    FROM
        civicrm_membership_status
    WHERE
        id = GROUP_CONCAT(membership.status_id)
) AS membership_status,

contribution.total_amount,
line_item.qty,
line_item.unit_price,
line_item.line_total,
line_item.label,
email.email
FROM
civicrm_membership membership
LEFT JOIN civicrm_membership_type mem_type ON mem_type.id = membership.membership_type_id
LEFT JOIN civicrm_contact contact ON contact.id = membership.contact_id
LEFT JOIN civicrm_address address ON address.contact_id = contact.id AND address.is_primary = 1
LEFT JOIN civicrm_phone phone ON phone.contact_id = contact.id AND phone.is_primary = 1
LEFT JOIN civicrm_membership_payment payment ON payment.membership_id = membership.id
LEFT JOIN civicrm_contribution contribution ON contribution.id = payment.contribution_id
LEFT JOIN civicrm_email email ON email.contact_id = contact.id AND email.is_primary = 1
LEFT JOIN civicrm_line_item line_item ON  line_item.entity_id = membership.id
WHERE
membership.status_id IN (1, 2, 3)
AND membership.contact_id IN (
SELECT
    contact_id
FROM
    civicrm_membership
GROUP BY
    contact_id
)
GROUP BY
membership.contact_id

```

---
Tags: civireport
---


title: Mail-to-Account does not fetch mail,

text:
# Question
Title: Mail-to-Account does not fetch mail,
I have configured mail-to-activity but when I run the task to fetch mails, I get an error message in job's log (without any details) and this kind of message in IMAP server log:

```
Oct  8 14:00:01 bazylia dovecot: imap-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=10.117.113.20, lip=10.117.113.5, TLS, session=<OrpYmpYhbQAKdXEU>

```

This mail is 'kontakt@mydmain.com'. I have set user name ('kontakt') and password and obviously CiviCRM can connect to IMAP server. How can I debug this?

# Answer
> 1 votes
You need to use a IMAP password that does not contain weird/special characters. CiviCRM uses IMAP client that provides user password in such a way that my server (Dovecot) returns an information about bad password format/quoting.

I used tcpdump to track this error.

The password was #iCE+&G-UFF"D and I have changed it to alphanumeric ones.

# Answer
> 1 votes
According to this page, the most common reason for your error is that your server only accepts STARTTLS connections on port 143.

If this is your situation, then you can either connect over SSL on port 993 if your server allows it, or you can connect using STARTTLS. Note that there are some caveats to connecting over TLS: See here and here.

---
Tags: civimail, wordpress
---


title: Consequences of changing domain name

text:
# Question
Title: Consequences of changing domain name
We are considering to change our domain name from:

**reallylongandnotuserfriendly.example.com**

to:

**you.example.com**

We have a Drupal 7 site. What are the consequences / fixes we need to be aware of, to not harm our CiviCRM installation?

# Answer
Aside from any customizations, you should:

1. Check your civicrm.settings.php file to fix the base URL. (And double-check that your path hasn't changed).
2. Go to Administer - System Settings - Clear Caches and Update Paths and clear your caches and update your paths.
3. Confirm that the Resource URLs look right (they should be fine as a result of step 2).
4. Make sure you get a SSL certificate for your new domain name if you had one for your old domain name.
> 4 votes

# Answer
In addition to Andrew's answer, be aware that this may break your IPNs. See here for how to mitigate this.
> 3 votes

---
Tags: drupal
---


title: Export contact info from MailChimp

text:
# Question
Title: Export contact info from MailChimp
I just tried to export all my contact info from MailChimp. Basically, it worked and I am now the happy owner of a pretty CSV file... but all the data is saved in only one column, one row per contact.

For example, my data is stored as

```
axel.grunt@zukunft-statt-autobahn.at,Axel,Grunt,"Lieber Herr Grunt",,J,J,J,,,"Zukunft statt Autobahn",,,,"Deciders only, Deciders auch","progressive GroÃŸspenderInnen",Newslettertest,,,html,5,,,"2012-09-13 19:32:42",184.173.181.254,48.2092000,16.3728000,1,2,Europe/Budapest,AT,9,"2013-10-28 08:14:49",26171677,963968a07a,

```

When I want to import the data on CiviCRM, it can't read the data but thinks it would be a terrifying misspelled email address.

Any solution?

# Answer
If you are working with Microsoft Excel 2000 or later, you can use the following steps.

Select the "Data" tab. You should see an option that say "Text to columns". Highlight your column and choose that. A little window should pop up to walk you though, but you'll want to choose "Delimited" (next) and that your separator is a comma. When you click finish, this will put the data between each comma into a new cell.
> 1 votes

# Answer
Your file seems to be a valid csv file with a comma separator. It should be readable by CiviCRM but you have to ensure you tell CiviCRM about :

1. the separator, see the field "Import Field Separator" in the Contact Import page or change it globally in `Administration -> Settings -> Languages, Currency, Location` or `civicrm/admin/setting/localization?reset=1`
2. the encoding if it's not UTF-8, see the page `Administration -> Settings -> Languages, Currency, Location` or `civicrm/admin/setting/localization?reset=1`

If you want to read and edit this file using a Spreadsheet, you can follow Heather O. suggestion for MsExcel or use LibreOffice/OpenOffice which should be able to autodetect the csv file configuration.
> 1 votes

---
Tags: export
---


# Question
Title: Letter Templates Pre Populate with Membership Fields
I have email and letter templates that has the following

{contact.first\_name} {contact.last\_name}

{contact.contact\_id}

{membership.end\_date}

Now all these only show when you search for memberships and print from the search. The membership end date does not show when the 'print pdf' option is selected from the contact.

Is there anyway they can all show when you go to print from pdf on the contact.

thanks, andy

# Answer
you need to write an Extension for the membership tokens to be available in the contact summary - please use the below link to know more

http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension

if you need more help please let me know - thanks
> 1 votes

# Answer
As CiviCRM allow to have multiple Membership at the same time, there is no way for CiviCRM to understand what you want when selecting the token {membership.end\_date} in the context of a contact.

Is there a reason why you want to do this in the contact search rather than the membership search ?

If you want to limit the contact by some criteria not available in the membership search, i recommend that you use `Advanced search`, select your criteria and set `Membership` in `Display Results As`. You will then have all the action usually available for membership.
> 1 votes

---
Tags: templates
---


# Question
Title: Is Iframe based payment gateway integration with civicrm possible?
Is it possible to integrate a payment gateway which gives an iframe to collect user details.I tried it almost 2 years back and failed for some reason I dont remember now. If it's possible and someone has a sample code please do share, it would be a great help!

# Answer
I don't think it's easy. I have tried without success a couple years ago. The return page will go to the iframe rather than the parent page and i didn't find a way to close the iframe and having the Thank you page on the parent page.

I know that there is a lot of work that is being done lately regarding payment refactoring but i don't know if it tackle this kind of problem.
> 2 votes

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


# Question
Title: Is there a way to display the latest mail in CiviMail?
We use CiviMail for our organization's newsletter. In addition to a signup form, we would like to have a "click to view our latest newsletter" link which shows the most recent newsletter from CiviMail. Is there a way to automatically do this that doesn't involve changing the link manually every time a new newsletter is sent out?

# Answer
Option 1)

There is CiviCRM extension which seems to do exactly what you need: Public Mailings Archive filterable by date, template, etc. It says is compatible up to Civi 4.5 so you might need to contact the developer or test first if you are using 4.6

Option 2)

As you are on WordPress, check out Christian Wach's plugin, it creates a custom post for each public CiviMail mailing. You could link in your mailing to the custom archive page for that post, alternatively you could modify the archives-pages-template.php to output only the last post (ie last newsletter) if you don't want to expose previous newsletters.

Option 3)

Try out the Content Tokens extension and check if it fulfills your needs.

Option 4)

In conjunction with Christian Wach's plugin mentioned above, you could create your own token, as explain in this great post by Coleman.
> 3 votes

# Answer
Use the same (short) link in the e-mail template - and use a link shortener like bit.ly or goo.gl - and just make sure you have the latest newsletter loaded up at the link - with a short link to your Drupal node, WP site, a shared Google doc, wherever.
> 1 votes

# Answer
For Drupal users a View could do the required, based on Civi Mailing, set to 1, sorted descending, with just the Body HTML field, and pager set to show newer/older.

I attached a file to this blog in case it is useful. You would just need to 'add page display' and set your path.
> 1 votes

---
Tags: civimail
---