# Question
Title: Fatal error: Out of memory - unable to create or edit Contribution page or membership
We went live with new website including CiviCRM last month. On test system our membership, payment and contribution page were all working OK. Pretty sure they were also OK post launch, and post upgrade to Civi 4.7.10. Now however we get blank page (HTTP error 500) on front end when accessing the contribution page with shortcade \[civicrm component="contribution" id="1" mode="live" hijack="0"\].

Turned on debug and get out of memory errors when:

1. Create new contribution page. At first continue button when using the CiviContribute dashboard, but immediately when through Administer -\> CiviContribute -\> New Contribution Page
2. Edit existing contribution page, configure 'Title and settings' or 'Contribution Amounts'. Other sections open and save OK.
3. Membership dashboard - immediately

Tried doubling the php memory up to 512M. Reinstalling 4.7.10. Checked 'CIVICRM\_UF\_BASEURL' in civicrm.settings.php. Deleted and recreated all payment processors, price sets and steps in the setup doc.

At a loss of where to go next. Any clues?

The detail of where the out of memory report comes changes but here's a sample:

> Fatal error: Out of memory (allocated 118489088) (tried to allocate 49152 bytes) in /home/sites/bristolcyclingcampaign.org.uk/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Campaign/BAO/Query.php on line 414

Backtrace:

> CRM\_Contribute\_Exception\_InactiveContributionPageException: "The page you requested is currently unavailable."

```
#0 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(63): CRM_Contribute_Form_ContributionBase->preProcess()
#1 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(519): CRM_Contribute_Form_Contribution_Main->preProcess()
#2 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#3 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_Contribution_Main), "display")
#4 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Main), "display")
#5 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#6 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#7 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#8 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#9 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:3))
#10 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(132): CiviCRM_For_WordPress->invoke()
#11 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#12 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-includes/plugin.php(600): call_user_func_array((Array:2), (Array:1))
#13 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-includes/class-wp.php(738): do_action_ref_array("wp", (Array:1))
#14 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-includes/functions.php(963): WP->main("")
#15 /home/sites/bristolcyclingcampaign.org.uk/public_html/wp-blog-header.php(16): wp()
#16 /home/sites/bristolcyclingcampaign.org.uk/public_html/index.php(17): require("/home/sites/bristolcyclingcampaign.org.uk/public_html/wp-blog-header.php")
#17 {main}
 Sorry but we are not able to provide this at the moment.
The page you requested is currently unavailable.
Return to home page.

```

Update: Spent a good while investigating the memory issue, but it wasn't the root of the problem. It was helpful to put in some echo lines in civicrm.settings.php. They came up every page but on the 'fatal' pages helped to confirm that memory\_limit was being set correctly, but didn't affect the error.

> echo "memory\_limit: " . ini\_get('memory\_limit') . " $memLimit: " $memLimit;

# Answer
The problem was in enabling default language to English (United Kingdom). If default US then all OK, change to UK or Aus and it breaks. The US setting is OK.

To find this I striped back down to a clean and empty install:

* Delete (rename) the civicrm plugin.
* Select and drop all tables from the civi db
* Delete (rename) the uploads/civicrm folder (having taken copy of civicrm.settings.php)
* Clean install of civicrm 4.7.11, using existing empty db.
* Tested the memberships desktop as canary page. OK to begin with, but when set to UK localisation it breaks.

Having found this I was able to restore backed up db with full data that I feared was corrupt, and after changing language back to US, all seems OK.

Don't know where or what is the problem with the localisation...

Update: There may have been other underlying problems with the installation as well as there had been domain name and database name changes along with a switch from Joomla to Wordpress. After migration to a new server all problems, including reported memory use, appear resolved.
> 1 votes

---
Tags: civicontribute, civimember, contribution-page, localisation
---


# Question
Title: How do I configure CiviMail to send through sendgrid?
This is a little embarrassing for me to ask, because years ago I set this up multiple times, however, I've been out of the CiviCRM world since 2012, and can't, for the life of me, figure out how to configure a CiviCRM 4.6 to send via sendgrid for an organization I volunteer with. I have a sendgrid account, I have CiviCRM 4.6.11 configured with wordpress.

Is there a special module/extension/plugin? custom script or code?

# Answer
> 4 votes
Go to Administer\> System Settings\> Outbound Email (SMTP/Sendmail)

Select SMTP

server: smtp.sendgrid.net port: 587 authenticate: Yes *Username*: your sendgrid username *password*: your sendgrid password

# Answer
> 4 votes
For anyone looking at this now if you are having issues with credentials that you think should not be blocked but are it is probably your firewall.

# Answer
> 3 votes
I had exactly the same problem: port 587 doesn't work for me either .. 2525 does

---
Tags: civimail, smtp
---


title: Help with PayPal IPN

text:
# Question
Title: Help with PayPal IPN
Sometime, I think in May, our PayPal IPN communication broke. We haven't had a lot of PayPal use since then, so I haven't discovered it until recently. I'm having a lot of trouble straightening it out.

I've gone back over the troubleshooting ideas here. But still no luck.

That did help me narrow it down. I know this:

* PayPal sends the IPN.
* Civi logs the IPN in the Civicrm\_system\_log table, and I can't see anything strange about it, but I'm not sure what it's supposed to be. Here's the text

{"reset":"1","contactID":"4280","contributionID":"8377","module":"event","eventID":"33","participantID":"851","mc\_gross":"900.00","invoice":"414ae4f493f47e11619bf7efc10b9f7b","protection\_eligibility":"Ineligible","payer\_id":"XSJW7PJ3W2WTE","tax":"0.00","payment\_date":"16:59:26 Sep 14, 2016 PDT","payment\_status":"Completed","charset":"windows-1252","first\_name":"Ed","mc\_fee":"20.10","notify\_version":"3.8","custom":"","payer\_status":"unverified","business":"office@MYDOMAIN.org","quantity":"1","verify\_sign":"Adbt8gdfutr1Z-T39jfFAojvxDVnASV9dlQzsWCS5U9rO.yPNTzpJ.RF","payer\_email":"him@hisDOMAIN.com","contact\_phone":"xxxxxxxxx","txn\_id":"77F61134Y5474453P","payment\_type":"instant","last\_name":"xxxx","receiver\_email":"xxxxxxxxx","payment\_fee":"20.10","receiver\_id":"VLKFZ88QB68QL","txn\_type":"web\_accept","item\_name":"4280-8377-Wine for Water","mc\_currency":"USD","item\_number":"","residence\_country":"US","receipt\_id":"2531-4793-0283-6721","handling\_amount":"0.00","transaction\_subject":"","payment\_gross":"900.00","shipping":"0.00","ipn\_track\_id":"d48d1e5a8c3da"}

* the IPN doesn't update the payment from Pending to Completed. The really bad thing is that event registrants don't end up getting their proper email confirmation.

What are some next steps to get to the bottom of this?

Joomla 3.6, Civi 4.7.11

# Answer
There was a pending/completed issue recently resolved in v 4.7.12 - link to JIRA ticket is: https://issues.civicrm.org/jira/browse/CRM-18483

Hope this helps, Tamar
> 1 votes

---
Tags: civievent, ipn
---


# Question
Title: How can I export civicrm contribution along with its price set fields?
I want to export the civicrm contributions. I want the priceset fields to be included in the report. I am trying to export them in Contributions-\>Find Contributions-\>Export Contributions While selecting the fields I want all the priceset fields in the option. How can I achieve this? Any help would be appreciable. Thanks in advance.

# Answer
Have a look at eileen's Extended Report Extension which includes

* Extended Report - Contributions with Price Set data
* Extended Report - Price Set Line Items
> 2 votes

# Answer
Currently, contribution level searches and reports will only show you the contribution level information, not the line item detail (a.k.a. the price field options selected on the contribution). Take a look at Reports \> Contribution Reports \> Bookkeeping Transaction report - this report will show you the financial type of each price field option selected.

Hope this helps, Tamar
> 0 votes

---
Tags: civireport
---


# Question
Title: How do i access the list of email addresses that bounced
I am using SparkPost for mail delivery of CiviCRM mass mailing. I can see the types of bounces that we had but i haven't found a list of email addresses that bounced. How do i find the email addresses that bounced?

# Answer
> 2 votes
Go to CiviMail -\> Scheduled and Sent Mailings -\> under Action, in the far right column of the Mailing Name line, select Report -\> Select Report to the right of Bounces

# Answer
> 2 votes
You can also perform searches for Bounces via Advanced Search provided that your Display Settings include it at civicrm/admin/setting/preferences/display?reset=1

---
Tags: civimail
---


# Question
Title: How to trigger creation of an Activity based on a Contribution being Completed - via CiviRules
The goal is that when a Contribution is Completed then an Activity is created for a Thank You Call.

I tried doing this with 'Contribution is Added' trigger, and setting Contribution Status is Completed as the Condition, but seems this is failing for online ones. It works fine for backend ones I am guessing because with backend the Contribution is set to 'completed' when it is created.

With the online payments is the Contribution record created initially, and then is the status set to 'completed' only after the result comes back from the Payment Processor?

Is there any other Trigger I could run this from? Any other suggestions of how to achieve this?

# Answer
> 1 votes
You might try with the "contribution is changed" trigger, as you have already done Pete. Alternative is to create your own specific trigger which combines the two? Or find another field to act upon for the online contributions?

---
Tags: contributions, activities, civirules
---


title: CiviMail not removing duplicate emails

text:
# Question
Title: CiviMail not removing duplicate emails
Using Joomla 3.6.2 and CiviCRM 4.7.11 and experiencing duplicate emails in CiviMail. We've tested with contacts with same email address + in same group, resulting in 2 emails received. We've also tested with contacts with same email address though in separate groups, resulting in 2 emails received. Attached image demonstrates 2 separate groups, each with 2 contacts in each group (different first/last names, though same email addresses... so 2 unique email addresses).

CiviMail component settings includes "CiviMail dedupes email addresses by default" as checked.

Edit: Connections

Also just tried to use the connections to provide a site profile assuming that might help troubleshoot this. Noticed in the image that the site url contains "administrator" twice. Perhaps this is a separate issue or maybe it's related?

# Answer
> 1 votes
Your issue has a related bug report: https://issues.civicrm.org/jira/browse/CRM-19353. You may have to wait until it gets merged and released or you start to test with the proposed PRs. Connections seems to be unrelated to this.

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


# Question
Title: URGENT HELP Account Suspended This Account has been suspended
Please help,

I cannot log into our database as there is an error message saying Account Suspended please contact your Hosting Provider for more information.

Does anyone know how to get around this or where to find help as we really need to log onto our database.

Thanks,

Grace

# Answer
This sounds like an issue with your hosting provider rather than a problem with CiviCRM. I would suggest that you get in touch with your hosting provider as the error message says.

If you don't know who your hosting provider is, I would suggest that you contact the person who set up CiviCRM for you.
> 9 votes

---
Tags: hosting
---


title: How to write custom report SQL

text:
# Question
Title: How to write custom report SQL
I'm not asking for the actual solution, but more a pointer to references examples for the structure so I can move forward.

CiviCRM 4.7 or WordPress - I need to create a report that I think will be achieved by custom coding only.

My original request was here Custom Report By Relationship

Essentially I have a a 'street rep (individual)' that has a relationship with a 'household ( a physical address)' that makes 'contributions' and a 'household' has a relationship with an 'individual' as head of household.

So want to build a street collection report structured

Street Rep (page break) --- Street Name (sub section ) --- door number, head of household name, last years contribution (line)

Although the requirement is relatively simple it has a level of complexity that my unfamiliarity with Civi structures is making it tough for me.

I really appreciate any pointers or help.

# Answer
> 5 votes
There was a pretty good 101 session about custom report in CiviCon Denver 2015. Unfortunately, there don't seems to be a video about it. You can check resources here : https://denver2015.civicrm.org/sessions/civicrm-custom-reports-101 (pdf and custom extension).

My recommended steps for doing a custom report :

* you must first do the sql query you want in mysql - understand which tables, which joint, which columns are needed, ... - you might want to visually navigate on CiviCRM 4.7 database schema
* then create a new create module extension using Civix or by copying civireport101
    + in `CRM/MyExt/Form/Report/MyReport.mgd.php`, you will have all the information needed for CiviCRM to find your report and be able to create new instance of it
    + in `CRM/MyExt/Form/Report/MyReport.php` you will have the recipe for the report
* now, the hard part... you need to customize the `MyReport.php`. You should start from real CiviCRM report or extensions report (e.g. civireport101) and use the official documentation
    + column definition goes in the constructor `function __construct() {`, you need to understand how CiviCRM store the column definition
    + select `function select()` / where `function where()` : if your constructor is done correctly, you should be able to reuse one base report function
    + from `function from()` : you should be able to reuse one base report but if you prefer, you can simply put your from here - just be careful with aliases `$this->_from = "FROM civicrm_contact {$this->_aliases['civicrm_contact']}";`
    + Regarding the page break, you might be able to do it in the `alter_display()` function...

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


title: Searching for incomplete fields

text:
# Question
Title: Searching for incomplete fields
Is it possible to search for a list of records for which a specific field has not been completed? For example, if the options in the custom field are 'yes' or 'no', is it possible to find which records have not had either of these selected?

# Answer
> 2 votes
Yes, you need to use the Search builder : Menu `search -> Search builder`.

Then you can choose the record type, the field and most important the **operator** : you have `empty` or `is null` (not defined) which should work for your need.

---
Tags: custom-search
---


# Question
Title: Can't use button without forcing client to log back in and never redirects back to where it should
* CentOS release 6.8
* cPanel 56.0 (build 25)
* Apache (v. 2.4.18)
* PHP (v. 5.6.22)
* MySQL (v. 5.6.30)
* WordPress (v. 4.5.3)
* CiviCRM (v. 4.6.19)

When clicking a button the client is forced to log back in using wp-login.php with a long redirect appended to the URL which changes of course depending on which button they pressed.

This was brought up when one of the clients tried to export a constituent report as csv but after snooping around trying to resolve the issue I have found that it happens on every grey button when in the CiviCRM backend.

Also I have not been able to locate any output in any logs as it is just redirecting.

I had a hunch that it had something to do with SSL being enabled recently but I haven't made way with that assumption either.

I also went ahead and updated CiviCRM to 4.7.11 to see if this issue would resolve itself and it made no difference, so for the sakes of not changing unnecessary settings/files I reverted back to CiviCRM 4.6.19

Any help as to what to do to get this to stop would be greatly appreciated as it greatly hinders what can be done in the backend.

# Answer
It could be the SSL. Verify the home url (WordPress General settings) and the CIVICRM\_UF\_BASEURL in the civicrm.settings.php file.

These should match exactly including the https:// If not that can be the issue.

If it matches I would look for a plugin or theme conflict next.
> 4 votes

# Answer
In order to resolve this issue, I had to match the home URL in WordPress General Settings to the CIVICRM\_UF\_BASEURL in civicrm.settings.php file. Thank you @Kevin Cristiano for your help!
> 0 votes

---
Tags: wordpress, redirect
---


title: How to localize opt-out link in mailing

text:
# Question
Title: How to localize opt-out link in mailing
My organisation has members who speak different languages, and we send them emails written in the language they speak.

These emails have an opt-out link, generated by the token `{action.optOutUrl}`. Our problem is that the link always leads to the English version of the form, while we would like it to be in the same language as the email. Same thing for the optout confirmation. So for example the token should generate www.example.com/**de**/civicrm/mailing/optout? when sending an email in German (our CMS is Drupal).

I can see two ways for CiviCRM to do that:

* Use the preferred language of the user
* Use the language used by the person who creates the mailing

Actually, it seems the second option is almost there: if I create the mailing from an interface in German (/de/civicrm/a/#/mailing/xxx), the **Test** mail has the link generated for German, but unfortunately the real mailing doesn't.

Is this something lacking from civicrm, or am I missing something? I would rather avoid having to create one token and one optout message per language, especially for the former as it requires development.

# Answer
Yes, it's a know limitation. The language used is the language of the cron job. If you manually launch the scheduled task with the proper language, you should be able to send in the proper language.

The way we intend to solve it is to add some option to tell in which language we want the mailing to be send - cf. https://issues.civicrm.org/jira/browse/CRM-16352
> 1 votes

---
Tags: civimail, tokens, i18n
---


# Question
Title: Removing avaliable languages from Localization
I have added some 5 to 6 languages, I want to remove few of them how can it be done.

# Answer
You can't do it right now using UI. It's a known limitation. cf. https://issues.civicrm.org/jira/browse/CRM-10006

It's not a high priority bug right now (not scheduled for a fix).
> 1 votes

---
Tags: localisation, i18n
---


# Question
Title: Styling the webform contact autocomplete box
I've been working on a site using bootstrap which has a dark background and white text. This seems to be causing some problems for the webform contact autocomplete box where the default background is white, but is presumably picking up the white body text also.

Could anyone point to the CSS file which styles the autocomplete box?

Many thanks!

# Answer
If anyone's looking for it in future, it's found in

> sites/all/modules/webform\_civicrm/css/token-input.css
> 4 votes

---
Tags: webform-civicrm
---


# Question
Title: Add people who have used contribution page to a group (or tag them)
I want to add everyone who made a contribution from a particular contribution page to a group.

Is there a way to do that?

# Answer
> 1 votes
To my knowledge - If you have set up an unique financial type for the contribution page it would be easy or if you have an unqiue label in the contribution source that might help too

Select all the contact using advance search - filter all the contact based on financial type id or using contribution source or date based on the contribution - in the contribution section

once you got the list - add to a specific group manually - done

But you need to do this each time manually - may be wait for someone to give you more precise answer

thanks !!!

# Answer
> 1 votes
I think there are two options.

If you use a unique civicrm Profile on that Contribution Page then you can set that Profile to add people who fill it in to a Group.

Second option is that I believe CiviRules extension can provide this sort of action based on a Trigger of Contribution Created together with the Condition of the source (not totally certain on that latter though)

---
Tags: contribution-page
---


title: Adding New Volunteer project times out

text:
# Question
Title: Adding New Volunteer project times out
I installed CiviVolunteer extension 4.6-2.1.1 on Civicrm 4.7.8 drupal7. From the volunteer menu, clicked link to add new volunteer project. After filling the form and submitting (save and done or continue), a black pop up shows saved. After that the screen grays out with spinning triangle logo and does not move.

Navigating away by clicking on CRM main menu and returning to Manage project gives a blank screen after heading Civi Volunteer.

Tried with backtrace on, but nothing showed up. Have cleared caches, reset menu, etc, and tried again, no help.

MySQL db lookup shows entry created in civicrm\_volunteer\_project, civicrm\_volunteer\_project\_contact and civicrm\_volunteer\_need table.

Any help in pointing how to troubleshoot further and resolve issue will be greatly appreciated.

Thanks

# Answer
> 0 votes
Same here. Installed Drupal 7.50 / CiviCRM 4.7.11, fresh install. No other extensions.

Installed CiviVolunteer 4.6-2.1.2 and Angular Profiles 4.6-1.0.2

When i wanted to add a new project, it does not save anything. Tried with backtrace on, but nothing showed up. Have cleared caches, reset menu, etc, and tried again, no help.

Any idea what might be the case? I want to demo it to a client, so hopefully someone can help me.

---
Tags: civivolunteer
---


# Question
Title: Cannot determine default context. CRM_Contact_Form_RelatedContact should implement getDefaultContext
When clicking Manage Case # on my contact dashboard, I am met with an error

> Cannot determine default context. CRM\_Contact\_Form\_RelatedContact should implement getDefaultContext

Is there a setting I am missing, or is this a bug?

# Answer
When I look at it on the public demo it almost seems like the link itself is a mistake, since it doesn't look like a link to manage case, it's a link to some other function. If you go to the case dashboard or the civicrm dashboard (as opposed to My Contact Dashboard), the links there are correct.

Edit: some more info:

What seems to be happening is that normally CRM\_Contact\_BAO\_Relationship::getContactRelationshipSelector (which is the thing that builds that table) will call CRM\_Contact\_Page\_View\_Relationship::links, which has the correct link for manage case. However for My Contact Dashboard it calls CRM\_Contact\_Page\_View\_UserDashBoard::links, which doesn't set anything for the CRM\_Core\_Action::NONE entry in the links array, and so something gets confused somewhere.

Untested but I think adding this code:

```
CRM_Core_Action::NONE => array(
      'name' => ts('Manage Case'),
      'url' => 'civicrm/contact/view/case',
      'qs' => 'action=view&reset=1&cid=%%clientid%%&id=%%caseid%%',
      'title' => ts('Manage Case'),
    ),

```

into the CRM\_Contact\_Page\_View\_UserDashBoard::links function might fix it.
> 0 votes

---
Tags: civicase, dashboard
---


title: Getting an error with mailchimp plugin

text:
# Question
Title: Getting an error with mailchimp plugin
We have installed the mailchimp plugin from veda consulting. The plugin was working until recently

when I try to access this page https://www.fremantlechamber.com.au/civicrm/mailchimp/settings?reset=1

I get the error below. I checked the groups and they are all correctly synced to the plugin and not referencing a list in Mailchimp that does not exist.

Sorry but we are not able to provide this at the moment. Invalid MailChimp List ID: e33355b9f6

Return to home page. https://www.fremantlechamber.com.au/

Can you please assist.

# Answer
> 1 votes
A CiviCRM group is mapped to the list ID of a Mailchimp list or interest which is not available (deleted on Mailchimp, or belonging to another Mailchimp API key, or ...). Review the groups which are syncing to Mailchimp, and make sure each one of those connects to a current / valid List or Group in Mailchimp.

There are DB tables you might be able to identify the specific group ID from. Look in `civicrm_value_mailchimp_settings`

```
mysql> select * from civicrm_value_mailchimp_settings;
+------+-----------+------------+----------------+-------------+-----------------------+
| id   | entity_id | mc_list_id | mc_grouping_id | mc_group_id | is_mc_update_grouping |
+------+-----------+------------+----------------+-------------+-----------------------+
|    1 |       123 | aabbccddee |                |             |                  NULL |
|    2 |       124 | 1122334455 | beadbeadbe     | aceaceacea  |                     1 |
|    3 |       125 | 9988776655 | facefacefa     | deadeddead  |                     1 |
+------+-----------+------------+----------------+-------------+-----------------------+

```

The column `entity_id` is the relevant CiviCRM Group ID, and you'll see `e33355b9f6` in one of your other columns I expect.

---
Tags: smartgroups, mailchimp
---


# Question
Title: CiviEvent registration & IATS payment processing fails to blank page
IATS plugin 1.5.3 in Civi 4.7.11 on Joomla 3.6.2

First off, CiviContribute works like a charm.

Second, in backend (test) and frontend (live), CiviEvent form comes up and goes to second step correctly. Upon submitting for payment times out with this error but the payment is processed as per IATS TEST88 portal:

On Chrome:

> **This site can’t be reached**
>
> The webpage at https://alcoholjustice.org/administrator/?option=com\_civicrm&task=civicrm/event/register might be temporarily down or it may have moved permanently to a new web address.
>
> ERR\_SPDY\_PROTOCOL\_ERROR

On Firefox:

> **Request Timeout**
>
> This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

I'm not getting any log reports even with debugging on. I increased the PHP input and execution time limits to 5 minutes. It times out at 2 minutes.

Also, just want to be sure this is the correct URL for iATS: https://www.iatspayments.com/netgate/ProcessLinkv2.asmx?WSDL

# Answer
1.5.3 (see info.xml) file is a release for CiviCRM 4.4 - 4.6

If you're on 4.7 - you can try our pre-release master branch - I just checked and Event registrations are processing fine w/ iATS

Though what you're seeing may actually be a server configuration issue... or a issue w/ your specific CiviCRM instance;
> 1 votes

---
Tags: civievent, payment-processor, registration, iats
---


# Question
Title: Migration from Lexware Vereinsverwaltung to CiviCRM
Has anybody moved from the Windows-based Lexware Vereinsverwaltung application to CiviCRM?

Might there be features, which CiviCRM is missing? How can I best migrate the data from that application into CiviCRM?

*As "Lexware Vereinsverwaltung" is probably an application with limited reach only used in Germany, I don't expect somebody has experience migrating from it to CiviCRM (surprise me!). But I will use this question to record my learnings from looking into it myself.*

*I decided to open a separate question to ask about general considerations for moving to CiviCRM.*

# Answer
You could also check with Systopia, who are CiviCRM partners based in Germany: https://systopia.de/
> 1 votes

# Answer
Looks like these folks have some relevant experience - see https://sfe-ev.org/?page=1
> 0 votes

---
Tags: migration
---


# Question
Title: Clicking Membership on View Contact Throws Error won't display page
Recently upgraded to civicrm 4.7.11 On joomla 3.6.2 php 5.6.23 mysql 5.6.29

I have just noticed when I click memberships Civicrm throws a unable to reach the server. Please refresh this page in your browser and try again.

I am able to click on contributions activities and events.

When I turn on logging and look at the log I'm getting in CRM\_Core\_Error::handleUnhandledException(Object(CiviCRM\_API3\_Exception))

\["error\_message"\]=\> string(41) "Expected one PaymentProcessor but found 0" \["error\_code"\]=\>

I have two payment processors setup. One that I have had for some time and another I just created after this issue. They each have a row for the production and test. Only think I can think of is the payment processor id field starts at 7.

I haven't seen anything else on this. Must be something specific on my site. We have been running civicrm joomla 5 years now.

# Answer
Donald, Could you help us with

1. From which version of CiviCRM did you upgrade to 4.7.11?
2. Are you using any payment processor extension like iAts, etc?
3. Could you check in db if you get 0 results by running the query below

`SELECT ccr.payment_processor_id FROM civicrm_contribution_recur ccr
LEFT JOIN civicrm_payment_processor cpp ON cpp.id = ccr.payment_processor_id
WHERE cpp.id IS NULL
GROUP BY ccr.payment_processor_id`
4. Could you also paste the result of below query?

`SELECT cr.payment_processor_id as ppID1, cp.payment_processor as ppID2
 FROM civicrm_membership mem
INNER JOIN civicrm_membership_payment mp ON ( mem.id = mp.membership_id )
INNER JOIN civicrm_contribution con ON ( mp.contribution_id = con.id )
LEFT JOIN civicrm_contribution_recur cr ON ( mem.contribution_recur_id = cr.id )
LEFT JOIN civicrm_contribution_page cp ON ( con.contribution_page_id = cp.id )`

Thanks Pradeep
> 2 votes

# Answer
I would check to see which Payment Processors are enabled on the Membership form. In Manage Contributions you will find the Membership one, look at the Amounts Tab (even though it's grayed out) and be sure a valid Payment processor is checked.
> 1 votes

---
Tags: civimember, joomla, error
---


# Question
Title: Configuring cronjob in wordpress installation (siteground)
I'm working on **my first installation of civicrm** (with wordpress) ever and I have a trouble configuring the cronjob. My host is on Siteground and I wolud like to create the cronjob from cPanel.

Before adding the command in cPanel, I've logged in via ssh. By following a previous thread, I've figured out to write this line:

`/usr/local/bin/php public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php`

But it throughts this **Fatal error**:

`Fatal error: Class 'CRM_Core_Page_Basic' not found in /home/amicsdel/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Job.php on line 37`

Any idea about how to solve it? Where this class is suposed to be declared?

Thanks!

# Answer
This should help you,

https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs#ManagingScheduledJobs-PHPclimethod

You can follow either of the methods mentioned on that page, depending on how your server is set up.

HTH, Edsel
> 1 votes

---
Tags: wordpress, cron-job
---


# Question
Title: Control Access to CiviCRM functions/actions available to Contacts
We have Drupal-CiviCrm setup with the sample data + Webform and WebForm\_CiviCRM and have successfully created a webform which displays a form that allows you to filter the list by Org or Contact name

Now not having much experience with Drupal or CiviCRM I am trying to work out how I can allow a CiviCRM Contact to Manage contacts she has access to eg take the Deforest Family where Ms. Alida Deforest can view and update information about Deforest family.

How do I allow Alida to do this when she comes to the website. Further once this is set up how can you restrict Alida from changing (eg) relationships

Please be specific as the documentation around Drupal Roles - CiviCRM ACls doesnt seem to provide an end-to-end example.

# Answer
> 1 votes
The way we approach self-management is

* use CiviCRM Permissioned Relationships extension
* in Views set up a display using the above relationships as View Relationships so you get a list of 'my' contacts
* set a Filter on Drupal user to 'is current user'
* provide the user with a block which will show them 'their children' and which provides links to a webform which will populate the URL with the ID of the child and hence allow them to edit 'their' child

# Answer
> 0 votes
I am developing a way to do this for the CiviCRM Entity project

I'm in the middle development which will bring big improvements to editing CiviCRM data from Drupal forms. There is much in place, but the allowance of custom permissions such as your case is not done yet. Watch for a new release to the -dev branch, coming within a week or two...

There will be a solution for this real soon!

---
Tags: drupal, acl, roles
---


# Question
Title: Why does civi sets employer relationship on sharing address – even if api triggered?
I wonder why civi triggers relationship and employer changes when our users let a person share an organization's address. Existing works-for-relationship is being deactivated. This also happens when we share an address by api call. I just wrote a script which migrates addresses of related contacts that are aequivalent but *not* shared to shared addresses. Civi duplicates the relationship :/

Problem here is that a significant part of our contacts works for multiple organizations.

If this is not configurable shouldn't it be restricted to work location?

# Answer
> 1 votes
I suspect this is the result of poor assumptions. When you configure an individual to use a shared address of an org, Civi creates an employer/employee relationship with that org -- which makes sense. But it also assumes that employer/employee relationship is the current employer for the individual, which may be too much of an assumption.

In your description you indicated that it "deactivated" the existing relationship. I ran a quick test and found that the org I've just shared an address with becomes the current employer, but the existing relationship is still preserved and enabled -- it just isn't flagged as the current employer. Are you seeing something different? If you're seeing the relationship become disabled, that is more significant IMHO.

---
Tags: addresses, core, location-type
---


title: Clean reinstall on Wordpress

text:
# Question
Title: Clean reinstall on Wordpress
New to CiviCRM. WordPress Version: 4.4.2 PHP Version: 5.5.32 MySQL Version: 5.1.73-log

I initially installed CiviCRM 4.6.14 LTS by mistake and rather than do an upgrade, I deactivated it, deleted it, and dropped all the tables from the database (It was installed to its own DB).

I neglected to remove the plugins/files directory or its contents, though.

I then installed 4.7.3 and when I activated it, I had green lights all the way on the installation page, so I just proceeded. However, any attempts to open CiviCRM resulted in errors (something about MySQL MyISAM).

So, I deactivated, deleted and then found that the db files were put in my Wordpress database, not the CiviCRM db. I deleted all those, and reinstalled 4.7.3.

Now, when I activate, I get a SQL Error -- table not found. Obviously, CiviCRM is still trying to use the WP database. I wholly expected to get the Install page again, but that never happened.

What setting is lurking around that uninstalling doesn't delete? How can I get a clean install that runs the installation check and lets me enter the alternate DB info. I tried https://MYSITE/wp-admin/options-general.php?page=civicrm-install, but all I get is "You do not have sufficient permissions to access this page.")

Thanks!

EDIT: Here's the error message I get when I try to activate civicrm: Initialization Error

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

```
[code] => -18
[message] => DB Error: no such table
[mode] => 16
[debug_info] => SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id

```

FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'db561663860.civicrm\_setting' doesn't exist\] \[type\] =\> DB\_Error \[user\_info\] =\> SELECT id, name, value, domain\_id, contact\_id, is\_domain, component\_id, created\_date, created\_id FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'db561663860.civicrm\_setting' doesn't exist\] \[to\_string\] =\> \[db\_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM\_Core\_Error::simpleHandler prefix="" info="SELECT id, name, value, domain\_id, contact\_id, is\_domain, component\_id, created\_date, created\_id FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'db561663860.civicrm\_setting' doesn't exist\]"\] )

Warning: Invalid argument supplied for foreach() in MYSITE/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsBag.php on line 311content/plugins/civicrm/civicrm/Civi/Core/SettingsBag.php on line 311

# Answer
Uninstalling CiviCRM doesn't delete its settings which are stored inside `wp-content/uploads/civicrm` folder. The best option is to delete that folder (it solves this issue in my case).

**WARNING!** Remember about making backups before deleting anything.
> 3 votes

# Answer
My advice would be instead of fixing the existing instance please try to install an fresh copy which will be easier

please refer to the following link for installation process https://wiki.civicrm.org/confluence/display/CRMDOC/WordPress+Installation+Guide+for+CiviCRM+4.5

---

If you want to fix the existing Installation then please look for civicrm.settings.php file

you can find the file against .../wp-content/plugins/civicrm/civicrm.settings.php

you can see CIVICRM\_UF\_DSN and CIVICRM\_DSN this will say which DB is been linked make your changes also clear cache and try again it should work

thanks - I guess this helps!
> 1 votes

---
Tags: wordpress, installation
---


# Question
Title: Why do these characters - Â Ã Â - that were not added appear on Event registration pages created using CKEditor?
We're on Civi 4.6.21 and Drupal 7.

We can't figure out why these characters - like Â Ã and Â - appear in our Event pages. The text is not on the page we created, obviously, right in Civi.

See the screenshots below - the first is this page in the Chromium browser on my laptop running Ubuntu.

Any clues appreciated!

UPDATE: The problem appears to be with the built-in version of CKEditor, see the second screenshot below. This code - `Â` \- keeps getting re-inserted in to the page intro text source on Save after being edited out.

UPDATE 2: So - not sure why - and not a final fix - but editing the intro text source using Firefox, rather than Chrome, seems to take the weird characters out and not re-insert them on Save, pretty much. See the third screenshot below - the page after editing the source using Firefox, not Chrome.

UPDATE 3: Here's the CKEditor bug report from *four years ago* about this issue, it was fixed three years ago...maybe it's time to update the CKEditor version in CiviCRM 4.6.X? Is there a newer version of CKEditor in CiviCRM 4.7.X ?

# Answer
> 1 votes
Looks like you are using an older version of CiviCRM. If you upgrade to 4.7 then you will get the latest version of CKEditor.

Or you could help review this issue to get it updated in 4.6LTS. https://github.com/civicrm/civicrm-packages/pull/166

# Answer
> 1 votes
That type of thing is normally character encoding problems. The first thing I'd check is what the character encoding on your database tables are, e.g.

```
SHOW CREATE TABLE civicrm_event;

```

If it says charset=latin1 or anything instead of utf-8 at the bottom then I'd guess that's your problem. You can see here for ways to fix it: https://stackoverflow.com/questions/2150256/how-to-change-all-the-tables-in-my-database-to-utf8-character-set

Edit: To save anyone reading all the comments, in this particular case it has something to do with ckeditor and character encoding. Workaround is use a different browser like firefox.

---
Tags: civievent, drupal, ckeditor
---


# Question
Title: How do I add a 'CiviCRM ID' column to an activity report?
I want to add the CiviCRM ID to the csv report to allow for reloading the activities once some amends have been made? The problem is it is not an option anywhere within the create a report area.

Can anyone please help?

William

# Answer
The possible way to add CiviCRM ID (Internal Contact ID) is to use the find activities -\> From search , find activities, select search criteria ( some Activities status are default on 'Activity Status'), - hit search, use action menu to export activities, Select fields to export -\>continue, on the next page you can select individual fields to export (including Internal contact ID) and the activity fields you wish to export.
> 1 votes

---
Tags: civireport
---


# Question
Title: After a failed upgrade, is updating the table structure enough?
tl;dr: After a failed upgrade, is updating the table structure enough?

I had a failed upgrade due to a mysql crash a few days ago (4.7.6 to 4.7.11). The database worked fine once mysql was back up, but I had a warning about a partial upgrade. Putting the backup back in place and rerunning the upgrade didn't do the trick, so I went table by table, comparing it to a successful upgrade, and updated the table structures accordingly. I then went into the domain table and updated the version number. Assuming the table structures are perfectly updated, are there factors I haven't considered?

# Answer
When you do an import of an previous version of your database, you should first delete all the views / table because newer version of CiviCRM often create new tables that don't get deleted when you put the backup back.

If you do not want to (or can't) start the full update, you should :

1. look at domain table column version and find the version where it has crashed (e.g. 4.7.beta3)
2. go into CRM/Upgrade/Incremental/sql and find the last successful sql query - should be in the version immediately following your current version (e.g. 4.7.beta4.mysql.tpl if your version is 4.7.beta3)
3. get all the queries from the file you found and run them (e.g. 4.7.beta4.mysql.tpl) - you might have to change the .sql to change token (e.g. {$domainID} =\> 1, assuming you only have one domain)
4. change the domain::version to the new version (e.g. 4.7.beta4) in your database
5. check for any specific code in CRM/Upgrade/Incremental/php/FourXXX.php to check for specific upgrade code
6. relaunch the upgrade - it should be able to finish the upgrade
> 2 votes

---
Tags: upgrade
---


# Question
Title: Using civi for big data sets (1 million plus)
I love civi! But mainly i use it for small datasets of sub 10,000

I have the opportunity to suggest its use in an organisation with a voter pool of 1 million+ I know this is an open ended question but does anyone out there have experience of using civi with large datasets. Is there anything BAD I shoudl know!Hopefully I won't get told off for asking the question!

Any thoughts welcome

Thanks

# Answer
I've never used Civi with a dataset that large, but there are some general scaling principles that apply to Civi as with any other system.

The most important one I learned is that work = size * complexity. Okay, that might be a bit of an exaggeration, and in some ways, size doesn't matter very much at all (e.g. you can simply scale your servers to some extent to handle the extra records), but in any real project, there will be exceptions and workarounds and custom bits, and those little bits will be magnified, sometimes exponentially, with the size of your dataset.

For example - suppose you're importing some data that isn't perfect. On a small contact dataset, you might load it into excel and do a search and replace so that USA is replaced by United States. And after doing an import you might have to clean up a few extra records. But that kind of process isn't feasible if you multiply your dataset by 1000.

In other words, scaling is not simply linear. There are some aspects that will scale almost magically, and overall Civi is well-designed to scale and there are certainly Civi installs out there with that kind of size. But with any specific install, especially one that has some kind of migration that includes custom data and idiosyncratic requirements, you're going to get various kinds of unexpected points in your scaling that will require new things to learn, new processes, and quite likely, custom code.
> 2 votes

# Answer
CiviCRM handles large datasets fine. There are 100+ sites with more than 250k contacts (https://stats.civicrm.org/?tab=sites).

You will need to ensure that the server used is powerful enough. To save some money, you can improve performance on a smaller server by turning off some things, in particular Administer \> Customize Data and Screens \> Search Preferences, Include Order By Clause.
> 2 votes

# Answer
Skvare has worked with a number of CiviCRM implementations with data sets of significant size. As has been mentioned, do expect to have a bit of a "learning" curve - especially with the LAMP stack setup. It will require a well-tuned VPS.

Data handling will be another major challenge. First, small variations in addresses, prefix or suffix fields, etc. Standardization will be very important and will need to have pre-defined rules akin to a style guide for designers. That may include corrections of character sets, capitalization, and more.

Next, the built-in GUI import tools are not suitable for large and complex imports. We now have an internal library of methods that use Drupal's batch API with the ability to source the data, manipulate it according to established standards, and then insert it into appropriate fields within CiviCRM including the necessary conditions/dependencies/relationships.

Lastly, the number of contacts in a database is not a good indicator of the above requirements. 250K contact records with sparse related info will be a very different setup (both in ongoing server requirements and during data import) from 250K contact records with 30 years worth of contributions, memberships, event registrations, activities, relationships, groups/tags, etc.

As an option, we've also set up CiviCRM to interface with a 3rd party CRM from which the client wished to migrate off. Using the API we were able to dynamically pull data into CiviCRM upon specific user action (ie login, membership renewal, event registration), have the user validate/correct it, and then store it and mark it in the "old" CRM system as migrated. Depending on the level of user engagement that may be a longer timeline but the approach successfully crowd sources the "elbow grease" responsibility for cleaning up data.

Bottom line - CiviCRM is up to the task; the variable aspects for scaling it to accommodate large record sets is mostly a factor of organizational approach and methodology for data management.
> 2 votes

---
Tags: database, issues, performance
---


# Question
Title: How do I add options to Communication Preferences
Is it possible to add to the Communication Preferences in contact profiles? At present we only have 'NO BULK EMAIL' (USER OPT OUT) we would like to create 'NO BULK EMAIL (ADMIN OPT OUT) or similar. Is this possible? We would rather not remove them from the various tags and groups as this is useful info for us. Thanks in advance. William

# Answer
> 3 votes
I do not think you can simply add a Communication Preference like you can add an option group as there is also quite some processing involved rather than 'just' a way to inform you about something. So if you would want that you would also have to influence the code. You can add a preferred communication method, but that is different because there is no processing related.

# Answer
> 1 votes
We have quite a few communication preference fields, and use a combination of two approaches (which of course each have their own pros/cons...) 1) Word Replacements to change an existing Communications Preference field name, and 2) A Custom Field Set for other communication preferences beyond what already exist.

---
Tags: fields, preferences
---


# Question
Title: Importing Activity Error '1' is not a valid option for field custom_133
When i try and import activities I get the following error message '1' is not a valid option for field custom\_133 across all 5 activities that I am trying to import.

By a process of elimination it is the 'details' field that is causing the problem. Within that field we have a lot of free-flow text copy- paste of emails and stuff like we have 115 similar activities to upload that therefore hunting within them to eliminate what ever is cause the problem isn't an option.

Is there a simple solution to this.

Thanks

William

# Answer
> 1 votes
What is the field type of the custom\_133 field? I'm guessing it is an option group/ select list type of field. In that case, you would have to make sure that the value of the field you are supplying in the import matches to either of the option values that the field has.

HTH, Edsel

---
Tags: activities, upload
---


# Question
Title: Converting My Data to CiviCRM data formats
When importing data into CiviCRM, do I need to reformat my data in any way so that it is in conformance with CiviCRM data formats?

# Answer
one thing I have found has helped me and many others is to do an export from CiviCRM of a sample set of the fields you are going to import, then you can see how civicrm expects fields, tags and other data structures.
> 6 votes

---
Tags: import
---


# Question
Title: Complex multiple Selects in Custom Coded Reports
Following on from my query here How to write custom report SQL

(CiviCRM 4.7 on WordPress)

I built the SQL I needed as step 1, which works fine in mysql / phpmyadmin.

I have used civix, to generate a module and to clone the 'empty' report from 101 and register the report - so far so go, if I want a report that says 'hello'.

Next step slot in my SQL and test .... and within civi it gives sysntax errors.

Debug shows that it is inserting SQL\_CALC\_FOUND\_ROWS all over the SQL, where as I need it only on the final select.

Although my requirement is simple my SQL is complex, and I can't achieve it in one SELECT statement ( maybe possible by a SQL wizard ), as it requires contact relationships in two directions and a 'pivot' of contributions, it builds 3 temporary table and joins them up in a final select.

My main question is 'can CiviReport only handle a single select?' and the second question is is there something I can do, or should I just resort to coding outside CiviReport structures?

Thanks so far for the help given, it has been fantastic.

Eaxmple issue

```
CREATE TEMPORARY TABLE tmpcontrhist AS
   SELECT SQL_CALC_FOUND_ROWS house_id,
     YEAR(contr.receive_date) memb_year,
        contr.total_amount memb_amount
FROM
   tmpareareps,
   civicrm_contribution contr
WHERE
   house_id = contr.contact_id;

Database Error Code: You have an error in your SQL syntax; check the manual      that corresponds to your MySQL server version for the right syntax to use near    'CREATE TEMPORARY TABLE tmpcontrhist AS SELECT SQL_CALC_FOUND_ROWS house_id, ' at line 21, 1064

```

# Answer
In the CRM/Report folder: grep -r -i "TEMPORARY" *

This gives you some existing reports that use temp tables which you can look at to get some ideas.

`Form/Activity.php
Form/Contribute/Detail.php
etc...`
> 1 votes

# Answer
Maybe I have a limited MySQL knowledge, but I think you need to join the two tables? So I would do something like

```
FROM tmpareareps tmp JOIN civicrm_contribution_recur recur ON tmp.house_id = recur.contact_id

```
> 0 votes

---
Tags: mysql, reports, custom-reports
---


title: Autocomplete filter in Drupal Views

text:
# Question
Title: Autocomplete filter in Drupal Views
I have a view created that has Organisation Name and a contacts Display name shown.

Now I want to be able to use auto-complete/ajax to enable the end user to filter by Organisation Name. This helps the end users not having to remember the exact name of an Organisation. In the future we will have 50+ organisations in the system.

At the moment my only other choice it to initially manually add all the organisations to the filter and use a drop-down. But as more organisations come on board, this will soon end up unmanageable.

To add more clarity to my VIEW setup

RELATIONSHIPS

> CiviCRM Contacts: CiviCRM Relationship (starting from contact A)
> (CiviCRM Relationship (starting from contact A)) CiviCRM Relationships: Contact ID B

FIELDS

> CiviCRM Contacts: Organization Name (Organization Name)
> (CiviCRM Contact B) CiviCRM Contacts: Display Name (Display Name)

FILTER CRITERIA

> CiviCRM Contacts: Display Name (exposed)

This gives results (shown in a table) with Orgnisation Name in left column and Contacts Name in right column.

But no matter how I change the filter properties (apart from changing it from Single to Grouped and typing in the Organisation names to produce a drop-down) it has the issues described above.

# Answer
> 2 votes
I did a similar auto-complete feature on a Civicrm-based view with 'Search Autocomplete' https://www.drupal.org/project/search\_autocomplete. I liked that you can filter the data shown in the autocomplete list with a view, so you can filter to items related to the user.

I made a **view 'search\_name\_or\_email'** based on CiviCRM Contact with

* among other fields
    + 'contact ID', 'sort name', 'email address',
    + a custom text field named 'autocomplete text' that contains '\[\[id\]\] \[sort\_name\] :: \[email\]'
    + a 'CiviCRM Contacts: Text Link' that points to the contact page
* exposed filter Operator 'Contains'
* 'Choose fields to combine for filtering': 'name' and 'email address'
* in 'More' the 'Filter identifier' is 'term' (this one was important)
* (here add more fields and filters according to what you want to display and list, by example filter on Contact type for Organizations only)

the view format is 'Autocomplete JSON' with

* group fields by: 'Contact ID'
* input label: 'Contact ID'
* input Link: 'Text Link'
* Ouput Field: 'Autocomplete Text'

The view is limited to 10 items. Path: '/contact-id-autocomplete'

I made another display on the same view
that has input label 'Name' instead of 'Contact ID'
so when we click on the autocomplete list it fills the field with the contact name rather than the ID.
Path: '/contact-name-autocomplete'.

In the **admin/config/search/search\_autocomplete settings** I made 3 forms

* 'contact in relationship with' to have in a 'relationship contact B' views exposed filter with

+ HOW: 'Auto Submit' unchecked and 'Auto Redirect' unchecked
    + WHAT: callback url: /contact-id-autocomplete
    + ADVANCED: 'ID selector for this form': '#edit-contact-id-b-'
* 'contact name' to have in a 'contact name' views exposed filter

+ HOW: 'Auto Submit' unchecked and 'Auto Redirect' unchecked
    + WHAT: callback url: /contact-name-autocomplete
    + ADVANCED: 'ID selector for this form': '#edit-name'
* 'quick search' to have in the page header with

+ HOW: 'Auto Submit' checked and 'Auto Redirect' checked
    + WHAT: callback url: '/contact-id-autocomplete'
    + ADVANCED: 'ID selector for this form': '#edit-search', to be set depending of your page content

For the ADVANCED: 'ID selector for this form', you have to find a unique jQuery selector for your html input field

**To style the autocomplete list**, and have only one line by Contact, I made a custom autocomplete style named 'atd'
with a css file in my custom theme
and chose it in the search autocomplete settings in 'Select a theme for your suggestions'

```
/* AUTOCOMPLETE */
input[data-sa-theme="atd"].ui-autocomplete {
  position: absolute;
  cursor: default;
}
* html input[data-sa-theme="atd"].ui-autocomplete {
  width: 1px; /* without this, the menu expands to 100% in IE6 */
}

input[data-sa-theme="atd"].ui-autocomplete.ui-menu {
  background: none;
  border-radius: 0px;
  color: #2c2c2c;
  border: 1px solid #c8c8c8;
  box-shadow: 2px 2px 2px -1px rgba(128,128,128,0.6);
  position: absolute;
  background-color: #ffffff;
}

/* AUTOCOMPLETE MENU */
ul[data-sa-theme="atd"].ui-menu {
  font-size: 1em;
}
ul[data-sa-theme="atd"].ui-menu {
  list-style: none;
  padding: 0px;
  margin: 0;
  display: block;
  float: left;
  min-width: 650px;
}
ul[data-sa-theme="atd"].ui-menu .ui-menu {
  margin-top: -3px;
}
ul[data-sa-theme="atd"].ui-menu .ui-menu-item {
  margin: 0;
  padding: 0;
  float: left;
  clear: left;
  width: 100%;
}
ul[data-sa-theme="atd"].ui-menu div.ui-autocomplete-field-group {
  display: none;
}
ul[data-sa-theme="atd"].ui-menu .ui-menu-item a {
  text-decoration: none;
  display: block;
  padding: 0;
  font-weight: normal;
  margin: -1px;
  border:none;
}

/* Interaction States */
ul[data-sa-theme="atd"].ui-menu a.ui-state-focus {
  background: none;
  background-color: #BAE4F6;
}
ul[data-sa-theme="atd"] .ui-autocomplete-fields {
  padding: 5px 6px;
  overflow: hidden;
}
ul[data-sa-theme="atd"] .ui-menu-item-first {
/*  border-top: 1px solid white;                   // <= change here */
}
ul[data-sa-theme="atd"] .ui-autocomplete-field-title {
  text-align: left;
  font-size: 1.3em;
}
ul[data-sa-theme="atd"] .ui-autocomplete-field-term {
  font-weight: bold;
}

```

# Answer
> 1 votes
I can see how a select would make this a long list quickly. How about making the filter an Exposed Filter - Operator: starts with? You can do that out of the box with Views.

If you really want the autocomplete - give this a try: https://www.drupal.org/project/views\_autocomplete\_filters

But it may not work with CiviCRM fields (see Pete's comment below):

# Answer
> 1 votes
Better than using a drop down and manually adding all the options, you could try views\_filters\_selective which on a test view does give me a dropdown of Display Names of civi contacts.

---
Tags: drupal, drupal-views
---


title: Opt out is looping

text:
# Question
Title: Opt out is looping
I have a WordPress website and I upgraded from CiviCRM 4.5.8 to 4.7.9 about a month ago and while the action.optOuturl token is still working (it's in the mail footer), today I discovered it just redisplays the opt out page, so the user thinks they have to do it again. The opt out flag is set in the database and an Opt Out Confirmation email is sent to the user.

How do I stop it from redisplaying the opt out page? Thanks...

# Answer
I upgraded to 4.7.11 today and the problem went away! See my comment...
> 2 votes

---
Tags: civimail
---


title: Where can i find CiviCRM volunteers?

text:
# Question
Title: Where can i find CiviCRM volunteers?
I'm volunteering for a new non-profit that has very limited resources and was wondering if there is any place that we can find volunteers for helping with CiviCRM. For finding FOSS developers i know about places such as idealist, sourceforge and openhatch, but what is the best place to find volunteers that are experts on CiviCRM specifically? (Doesn't have to be programmers)

Kind Regards, Tord

# Answer
You're probably best off recruiting for volunteers in general who are interested in volunteering in your sector, and offering that person the opportunity to upskill.

Good luck,

John
> 2 votes

---
Tags: civivolunteer
---


# Question
Title: Custom Search Unknown column 'contact_a.id' in 'field list'
I'm trying to code a custom search (CiviCRM 4.7.11 - WordPress) and I keep getting

```
 Unknown column 'contact_a.id' in 'field list'

```

I built the search by civix as per docs and that created a contact search by default

I stripped out the form code and have even simplified it all the way down to one column

The meat being as follows and should just list hello thousands of times

```
function &columns() {
// return by reference
   $columns = array(
  ts('Hello') => 'hool',
);
 return $columns;
}
/**
* Construct a full SQL query which returns one page worth of results
*
* @param int $offset
* @param int $rowcount
* @param null $sort
* @param bool $includeContactIDs
* @param bool $justIDs
* @return string, sql
*/
function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
// delegate to $this->sql(), $this->select(), $this->from(), $this->where(), etc.
return $this->sql($this->select(), $offset, $rowcount, $sort, $includeContactIDs, NULL);
}

/**
 * Construct a SQL SELECT clause
 *
 * @return string, sql fragment with SELECT arguments
 */
 function select() {
   return ' "hello" hool';
 }

 /**
  * Construct a SQL FROM clause
 *
 * @return string, sql fragment with FROM and JOIN clauses
 */
function from() {
   return "FROM civicrm_contact";
}

/**
 * Construct a SQL WHERE clause
 *
 * @param bool $includeContactIDs
 * @return string, sql fragment with conditional expressions
 */
function where($includeContactIDs = FALSE) {
 return "1";
}

```

But I get

```
Database Error Code: Unknown column 'contact_a.id' in 'field list', 1054
Additional Details:
Array
(
[callback] => Array
    (
        [0] => CRM_Core_Error
        [1] => handle
    )

[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT count(distinct contact_a.id) as total
  FROM civicrm_contact
  WHERE
1
 [nativecode=1054 ** Unknown column 'contact_a.id' in 'field list']
[type] => DB_Error
[user_info] => SELECT count(distinct contact_a.id) as total
  FROM civicrm_contact
 WHERE
1
  [nativecode=1054 ** Unknown column 'contact_a.id' in 'field list']
 [to_string] => [db_error: message="DB Error: no such field" code=-19   mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count(distinct contact_a.id) as total
  FROM civicrm_contact
 WHERE
 1
 [nativecode=1054 ** Unknown column 'contact_a.id' in 'field list']"]
o )

```

I don't understand what is trying to create the `SELECT count(distinct contact_a.id) as total` with an invalid column and how to stop it?

Ideas?

# Answer
Does your class extend a base class? A parent method in there might be expecting you to alias your main contact table "AS contact\_a".

You can either

* do what the base class is expecting, in exchange for it doing some of the work for you,
* override the methods as needed,
* not extend the base class and implement the required interface methods yourself.
> 1 votes

# Answer
Contact\_a isn't a table there as far as I can tell (on smartphone atm). Change it to civicrm\_contact.id :)
> 0 votes

---
Tags: custom-search
---


title: Multi-country use?

text:
# Question
Title: Multi-country use?
Our organization has a branch in the US and one in Canada. Can we use Civi for both combined and just filter info by country? For example, entering donor info in Canadian currency, then our Canadian accountant pulling that for the bookkeeping, and having our US accountant pull US donation info, etc. I just want to make sure that we can use it to streamline everything before committing.

Thanks!

# Answer
> 1 votes
You should be able to use one of the demo sites eg http://d46.demo.civicrm.org/ to test out some of these things. Eg at http://d46.demo.civicrm.org/civicrm/contribute/search?reset=1 you can see that Currency is one of the filterable options, and I fully expect that you could set up Report for each of them with the currency pre-filtered.

# Answer
> 1 votes
In short - **yes**, this is supported in CiviCRM!

Filtering by currency and/or country is doable on the three reports I checked, including the most commonly used contribution reports (Contribution Summary, Contribution Detail). Here's a screenshot of the filters for a report:

Filtering by currency and/or country is also possible from search (these two screenshots are two parts of the same page, "Advanced Search"):

---
Tags: user-experience
---


title: Edit contact inline

text:
# Question
Title: Edit contact inline
Recently we updated CiviCRM from 4.1 to 4.7 (yeah, we really need it).

We have custom code in the pre and post hooks that validates some contact fields.

Now, in the last version of CiviCRM, you can edit the fields inline, but we noticed that we have to duplicate our code if we want to edit inline.

My question is, is there anyway to not duplicate the code for the inline edit? Is there some hook that triggers both the inline and the edit fields?

# Answer
> 3 votes
If you use the validateForm hook you can probably use the same code if you include both forms in your if-statement, like so:

```
if ($formName == "CRM_Contact_Form_Inline_Address" || $formName == "CRM_Contact_Form_Edit_Address") {

```

---
Tags: contacts
---


# Question
Title: Custom report Action not working on new development
I have now, after a steep learning curve built a custom report based on the kind help I have has so far.

How to write custom report SQL

But I have an issue, that I don't know how to effectively resolve.

The report works online fine now with the desired output.

I built the report using the Example 101 - starting with 'Empty Report' and adding my SQL & columns as required.

But when I select an 'action' such as 'print' 'print to pdf' etc, there is a brief pause a refresh and nothing ..

Nothing is appearing in the php logs.

I have debug on. Nothing is showing in the CiviCRM log output.

There are no browser console JS errors.

All other reports perform as expected.

I'm working through CiviCRM debugging, any pointers here please - I'm so close but so far! (CiviCRM 4.7 - WordPress)

# Answer
OK,

I tried deleting the report and recreating the report from the template, and like magic the functions started working. Seems that CiviCRM has certain ways about it that developers need to know. ( is there a list somewhere ).

Moving on to the next part suppressing duplicate row content and page braking on sections. Getting closer to the goal :)
> 1 votes

---
Tags: custom-reports, debugging
---


# Question
Title: Allowing user to update their contact details while renewing their membership
I am trying to figure out how to allow user to update their contact details, such as address, VAT number and allowing them to upload necessary documents such as health and safety policy etc.

I also want renew page to be multi step such as step1: update details, step2: upload necessary document, step3: view total cost and final do the payment.

I would be thankful, if anyone can help me. I am now trying the hook: civicrm\_buildForm to add various additional field in the membership renew form. But I am still not sure how to make it multi steps.

# Answer
If you are using Drupal with a no-redirection payment processor, your best chance to do this is by using Webform CiviCRM. Webform comes with a lot of functionnality like multisteps, fields grouping and conditional fields.

Otherwise, if you are not in Drupal or want to have a cross platform solution, i can see 2 possibilities :

1. you do a contribution page with profile containing all the fields you need and then you add javascript to make it multistep (e.g. jquery steps). You might find it difficult to make CiviCRM embedded javascript to work in all context.
2. you do a contribution page that is the first step of the process and then redirect to a profile to let the user update its information when the payment is done (the user won't be able to see the thankyou page so you might want to add a thank you message in the profile). You should be able to do so using CiviCRM hook\_civicrm\_buildForm like :

```
function myextension_civicrm_buildForm($formName, &$form) {
  if ($formName == 'CRM_Contribute_Form_Contribution_ThankYou') {
    $formId = $form->getVar('_id');
    if ($formId == FORM_ID) {
      ...
      $url = CRM_Utils_System::url('civicrm/profile/edit', "gid={$gid}&id={$indId}&reset=1&context=thankyou" . $checksum, FALSE, NULL, FALSE);
      CRM_Utils_System::redirect($url);
    }
  }
}

```
> 1 votes

# Answer
In addition to samuelsov answer, if you want to redirect to a profile after a contribution page you can look at the Front End Page extension (note requirement for civicrm entity setting extension)
> 0 votes

---
Tags: civimember
---


# Question
Title: Disable opt-in e-mails for joining groups
I use a custom Drupal Webform for contacts to join groups. This happens within a restricted environment, the user is logged in and managing his/her own profile behind a password. I don't want any e-mail to be sent.

When a group is marked as 'mailing list', CiviCRM sends out a confirmation mail. If a group is marked both 'mailing list' and 'access control', no e-mail is sent.

I've unchecked 'Enable Double Opt-in for Profile Group(s) field ' in the CiviMail component. Doesn't seem to make a difference (this is not a 'profile groups checkbox' as per the description there i think - its a webform).

So I'm about to check the 'access control' for a dozen of groups, only to disable the e-mail confirmation. What am I doing wrong ? :-)

# Answer
You probably saw this but there is a second setting that deals with Double Opt-In - but since you only referred to one, the other one is

> Enable Double Opt-in for Profiles which use the "Add to Group" setting When CiviMail is enabled and a profile uses the "Add to Group" setting, users who complete the profile form will receive a confirmation email. They must respond (opt-in) before they are added to the group.

Also at this path - civicrm/admin/setting/preferences/mailing?reset=1
> 1 votes

# Answer
You may have been here / tested already, but I believe if you are in Drupal Webform, there is another 'confirm subscription' configuration under the 'Additional Options' tab which is checked by default.
> 1 votes

---
Tags: civimail, webform-civicrm, groups, confirmation
---


title: SIMPLE CiviCRM events interface?

text:
# Question
Title: SIMPLE CiviCRM events interface?
(on Drupal) Our organisation runs its own annual events with complex ticketing, but we also list a great many events posted by our users, across a number of categories. Some of these can get a bit complex such as one-weekend-a-month modular courses. We are doing a ground-up site rebuild, and I'm wondering whether to use CiviCRM for all events (so far we have only used it for our big annual ones).

Creating events via the civiCRM backend is probably too daunting for most of our users (plus access control is a challenge) - Is it possible (examples would be good) to create events via a webform? Or are we best to keep the Date/Calendar/Event modules approach in Drupal?

# Answer
> 1 votes
I looked quickly into doing this with civiCRM entity and rules integration modules (I would think this would be possible), but that seems difficult or not possible without some further customization to set the event parameters.

If you are comfortable with this type of work, I would imagine writing a short module that engages the civiCRM API to create an event on submission of a specific webform could take in the (validated) data from your simplified webform (submitted by a user, doesn't have to be staff) and create the events for you in civiCRM. Using event templates for your categories as Aidan suggested in comments would cut way down on the parameters you would have to feed in for proper configuration. See the API explorer on the relevant version of demo site as a resource for how that might be put together.

Whether doing that work is actually worth it for your use-case, I can't answer for you, depends on how much better it is to have all user events in civiCRM (but I think it would be pretty cool!).

---
Tags: civievent, webform-civicrm
---


# Question
Title: How about prioritized locations in export
When sending mass mailings the recipient's email address locations may be handled prioritized if authors want to: Use location x and if contact doesn't hold such an address use main address.

It would be great to provide such a decision for exports: Export address of location x but if it doesn't exist, use main address.

What do you think?

# Answer
When you specify the address fields to export, if you specify the location "Primary" you'll get the address that's marked as the primary in the contact record. There's also an address location field you can export so you can tell which location was exported.

If you need something specific (use work if it exists, otherwise use home), I'd export both locations and use spreadsheet formulas to select one or the other.
> 2 votes

---
Tags: export
---


# Question
Title: New Website Users Connecting to Existing Member Record
Is there a way to use an ID provided to members by our organization so that they may enter it (and say their last name) to create a new account by themselves and automatically assign the account to their membership record?

We're importing our membership records from a csv file to our contacts and adding them to the CiviMember data manager, but it is not likely that we'd want to create website user accounts for every member.

Is this possible, or is there a better way for me to handle the membership and user creation on our website? I'm new to CiviCRM and am still trying to get my head wrapped around it. Thanks in advance!

---

To separate this question from the duplicate question.

Basically, we want to host all membership management using CiviCRM. Some of the members will want to signup for website accounts to manage their information, and some will not (aka our 80+ year old individuals). But since our membership will already be hosted on our website, I want members to assign their membership details to their account automatically by entering in their Membership ID (and say, their last name) which would connect to the "External ID" in the membership record.

Or is there a better way to do this? I'd like to do this automatically, but if there was a way to do the above and manually approve it, that'd work too for the time being.

# Answer
> 2 votes
I believe how well this works will depend on your unsupervised deduplication rules set in civiCRM. If you used external ID, I think you would actually need to change the default rule as well.

If you haven't made any changes, then requiring first name, last name, and email address when creating a Drupal account will link the Drupal user to the correct civiCRM contact (and related membership) the vast majority of the time (As mentioned by petendz in the comments).

This is the setup that we use, where all membership is managed in civiCRM but not all members are Drupal users. The only times when we have user accounts mis-linked is when someone signs up for a Drupal account and uses an email address that we don't have in our database and spells their name differently.

In those few cases, a staff member can easily merge the civiCRM records and maintain the link to the Drupal account, not requiring any action from the users perspective.

---
Tags: drupal, civimember, user-account, user
---


title: RSForm! integration with CiviCRM

text:
# Question
Title: RSForm! integration with CiviCRM
A friend is using the RSForm! Pro extension with Joomla and wants to gather volunteer signup information and port the data to CiviCRM. Does anyone have any experience with doing this? What is involved. I do not find any reference to this product on StackExchange and a web search doesn't turn up much.

# Answer
> 1 votes
RSForm! Pro is made by RSJoomla (rsjoomla.com) and has the ability to post data to external (to Joomla) databases. This article at their site may help: https://www.rsjoomla.com/support/documentation/rsform-pro/custom-scripting/silent-post.html

---
Tags: joomla
---


title: Default CSS / Standard Directory Set Up

text:
# Question
Title: Default CSS / Standard Directory Set Up
I am new to CiviCRM environment.

My company asked me if I could modify the website to not have so much blank space (white space) on the sides. They want more content on the screen.

Please excuse my terminology. I am still learning the CRM terminology via Market Research.

Where could I find the CSS to modify this portion?

Is there a standard directory set up for CiviCRM?

Is it best practice to set a new CiviCRM for each project?

Thank you in advance.

Laurie

# Answer
I'd agree with trying the theme suggestion in the above comment, but if you do want to change css I would use "extras.css". See the hilited box on this page: https://wiki.civicrm.org/confluence/display/CRMDOC/Resource+URLs

> "You can also define additional CSS styles to be applied to all or specific page elements by adding CSS styles to the 'extra CSS' file: css/extras.css. This file is included in the downloaded code, but is empty by default."

It's difficult to answer the other questions because they're a little too general.
> 1 votes

---
Tags: best-practice, css
---


# Question
Title: Multiple Mailing Addresses Based on Time of Year
Is there a way to add multiple mailing addresses to a membership record?

Say a member is in Florida during the Winter and Colorado during the Summer, is there a way to add the second mailing address? I mean, I suppose we can add the address in billing or notes, but was curious to see if anyone came across this issue.

Thanks in advance!

# Answer
You could also add the two adresses as to different adress types. One is set as primary, and then you need some help on changing what adress is primary, based on time. I do think CiviRules could help you with that, giving a specific time of the year, where you change what adress is set as primary. If you want to go that route, let me know and I could help you with giving tip on specific trigger and condition to use.
> 2 votes

# Answer
Yes, there is a way.

But no, I do not recommend it, because of the overhead cost.

You could simply add a new adress type. And then you could have a custom field where you can set the time span for this adress to be used. Then, every time you want to send something in the postal mail, you need to search for this exception, and act after it. Or even write an extension, or pay someone to do it for you.

However, I don't think that it is any good idea to change such a crucial aspect of your workflow, over probably 1-2 cases. Then the overhead cost of working hours and complexity soon is much bigger than the benefit of those donors.

So, yes you could technically adapt CiviCRM to do it, but I would have reconsidered the cost/benefit ratio of doing it.
> 0 votes

---
Tags: civimember, addresses, address-labels
---


title: Section and Page Breaks in Reports

text:
# Question
Title: Section and Page Breaks in Reports
I'm trying to work out how this is done, it seems the standard templates have this coded in

```
{$l}if $sections.{$column}.type & 4{$r}
                    {$l}assign var=printValue value=$row.{$column}|crmDate{$r}
                {$l}elseif $sections.{$column}.type eq 1024{$r}
                    {$l}assign var=printValue value=$row.{$column}|crmMoney{$r}
                {$l}else{$r}
                    {$l}assign var=printValue value=$row.{$column}{$r}
                {$l}/if{$r}
                {$l}if $rowid neq 0{$r}
                  {if $section.pageBreak}
                    {$l}if $pageBroke >= {$h} or $pageBroke == 0{$r}

```

And I know the extended reports extension implements this.

I have been looking at the code, but it is very generic, in that it allows selecting sort fields & selecting section / page breaks. But I can't yet fathom out what I need for my simple use case ( I don't need user selectable option - just want to break on a sort field )

I'm hoping it is something straight forward `$this->_sections` but I am floundering around a bit.

`$this->assign('sections', $this->_sections);`

Any help or pointers to example much appreciated.

--- edit --- this is where I have got to

```
function orderBy() {  $this->_orderBy = "ORDER BY mycolumn";

                  $sections = array ( 'my_section' => array (
                  'title' => 'My Name',
                  'type' => 2,
                  'tplField' => 'mytable_mycolumn',
                  'section' => 1,
                  'pageBreak' => 1,
                  ));

                  $this->assign('sections', $sections);

                 }

```

Whilst it is promising, in that it puts out the at least the text of the first section and it doesn't fail or shout warnings, it just doesn't present any values?

I have tried combinations of mytable\_myfield / myfield in tplField and columns.

I have compared smarty debug variables between working versions and mine, and I haven't got it yet.

# Answer
> 1 votes
OK for others searching this is what I found works

```
 $sections = array ( 'mybreakcolumn' => array (
                  'title' => 'Rep Name',
                  'type' => 2,
                  'section' => 1,
                  'pageBreak' => 1,
                  ));

                  $this->assign('sections', $sections);

```

Where mybreakcolum is the full column name sent to the template

---
Tags: custom-reports
---


# Question
Title: Mail not send if preferred_mail_format is NULL
I had some contacts who complain of not receiving mailings. In communication preferences, email formats were 'both' for all contacts. Quite by chance, I went to look in the log file, where there were messages:

> CiviMail will not send an empty email body, Skipping: xxxxx

After having researched this message in the php code, I analyzed CRM/Mailing/BAO/Mailing.php and saw that the body of the message is deleted if $contact\['preferred\_mail\_format'\] is neither Both, Text or HTML.

I went in the database, and for all contacts who did not receive the mailings, I've seen that the preferred\_mail\_format column contained NULL.

I have corrected by hand and all mails are gone.

I wonder if we should not: \- Or, if preferred\_mail\_format is neither Both, Text or HTML, put a mail contains in a default format (Text, Html,?) \- Or, when calculating the number of recipients (in the mailing of the editorial page), display a warning indicating the potential problems.

Regards.

# Answer
We fixed this quite old behaviour by hacking CRM/Mailing/BAO/Mailing.php around line 1295 by overriding:

```
if ($text && ($test || $contact['preferred_mail_format'] == 'Text' ||
    $contact['preferred_mail_format'] == 'Both' ||
    ($contact['preferred_mail_format'] == 'HTML' && !array_key_exists('html', $pEmails))
  )
) {
  $textBody = implode('', $text);
  if ($useSmarty) {
    $textBody = $smarty->fetch("string:$textBody");
  }
  $mailParams['text'] = $textBody;
}

if ($html && ($test || ($contact['preferred_mail_format'] == 'HTML' ||
      $contact['preferred_mail_format'] == 'Both'
    ))
) {
  $htmlBody = implode('', $html);
  if ($useSmarty) {
    $htmlBody = $smarty->fetch("string:$htmlBody");
  }
  $mailParams['html'] = $htmlBody;
}

```

with:

```
$pmf = isset($contact['preferred_mail_format']) ?   $contact['preferred_mail_format'] : 'Both';
if ($pmf != "Both" && $pmf != "Text" && $pmf != "HTML") {
    $pmf = "Both";
}
if ($text && ($test || $pmf == 'Text' || $pmf == 'Both' ||
        ($pmf == 'HTML' && !array_key_exists('html', $pEmails))
)
) {
    $textBody = implode('', $text);
    if ($useSmarty) {
        $textBody = $smarty->fetch("string:$textBody");
    }
    $mailParams['text'] = $textBody;
}

if ($html && ($test || ($pmf == 'HTML' || $pmf == 'Both' ))) {
    $htmlBody = implode('', $html);
    if ($useSmarty) {
        $htmlBody = $smarty->fetch("string:$htmlBody");
    }
    $mailParams['html'] = $htmlBody;
}

```
> 1 votes

---
Tags: civimail
---


title: New Hosting - Blank Page in Wordpress

text:
# Question
Title: New Hosting - Blank Page in Wordpress
The organisation that hosts our Wordpress site (a Church Diocese) is migrating all their sites to a new host by moving the full cPanel configuration across. Our Wordpress site seems to have migrated OK with the exception of CiviCRM. When I access the CiviCRM menu in the Wordpress backend all I get now is a blank page.

Any ideas as to where I should look to resolve this problem?

Thanks for any help/hints.

# Answer
> 1 votes
Blank page normally suggests a PHP error, so your error logs are a good place to start.

---
Tags: migration
---


title: Drupal Views - Views Plugin - Gender ID

text:
# Question
Title: Drupal Views - Views Plugin - Gender ID
I'm making a Views Plugin, a 'format type', and when I use CiviCRM Contact Gender as a field, it returns a Gender ID. That's to be expected. But when I use the other Views formats (HTML, grid, etc) it shows the actual gender.

Does anyone know why it is changing it to male, female etc on the standard ones, but leaving it as an ID on my new format?

Thanks,

Update - to be clear I understand that this is stored in the contact table as an ID that is looked up elsewhere. My question is - does anyone know how it's being looked up in the options table by standard views plugins, but not by mine?

# Answer
> 2 votes
Take a look at the file civicrm\_handler\_field\_pseudo\_constant.inc \- this is what handles the option value lookup.

---
Tags: drupal, drupal-views
---


# Question
Title: How to use API to bulk delete contacts quickly?
In development I would like to use the API to delete all contacted except conctact\_id 1 and 2. With Contact

This:

```
$result=civicrm_api3('Contact', 'delete', array(
      'id' => array('NOT IN' => array(1, 2)),
      'skip_undelete' => "1",
    ));

```

.. won't work even though with get it does. Would seem there is no good way to do this fast, without making a complicated MySQL query. Who knows a quick work around. Mine were extremely slow and ran into error 500 timeout errors.

# Answer
Api4 will likely to be able to do this, but it is not yet released. It is not possible with api3. You'll need to write a custom php script to loop and call the api repeatedly, or else execute a sql query.
> 1 votes

---
Tags: contacts, api, developer
---


# Question
Title: authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Start TLS)]
```
authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Start TLS)]

```

Hi

I am getting the above error message when trying to setup my outbound email. I'm using mailgun and have the drupal smtp module setup and working using identical details.

Any ideas where to start troubleshooting this?

Thanks

# Answer
> 2 votes
This question appears to be the same as Outbound mail fails after upgrading to 4.7.1 tl/dr i suspect your probably running on php5.6 or similar version and the ssl certificate for smtp.mailgun.org is not valid or is a CACert or similar and PHP5.6 is saying i can't validate certificate.

---
Tags: smtp
---


# Question
Title: What are the advantages of using one of the Sparkpost extensions for Civimail?
We're on Civi 4.6.21 and Drupal 7.

I've set up to use Sparkpost in Outbound email settings.

If I don't use one of the two Extensions for Sparkpost and simply enter the Sparkpost settings into Outbound e-mail settings, what are the disadvantages? Will bounces and track throughs not show in Civi, or not work correctly? Other disadvantages?

Thanks!

# Answer
With sending emails there is always the sending, and the return path. If you configure the Sparkpost SMTP server settings in CiviCRM you've resolved the sending, but not the return path. So you will not get the bounces and might end-up in trouble with Sparkpost or on blacklist because of repeated mailings to bouncing email addresses. You will still get click-through and unsubscribe as Sparkpost will forward to CiviCRM all links that users click, even if it intercepts these.
> 4 votes

# Answer
So these are the advantages of the PESC extension, taken from the blog post:

* Now processes bounces for Transactional and Bulk (CiviMail) emails
* Adds a tag to all outgoing CiviMail messages. The civi-generated return-path is added as a SparkPost tag, because like most SMTP services, SparkPost strips out the return-path header for its own.
* Adds a scheduled job that uses SparkPost API to fetch bounce events and processes their bounces in CiviCRM. I use the hash included in the SparkPost tag
* Adds Bounce type and Pattern that helps with marking emails on hold in CiviCRM that SparkPost has added to it's suppression list
> 1 votes

---
Tags: civimail
---


# Question
Title: Is it possible to force user log out if idle for a defined time?
We are using Drupal and CiviCRM 4.6.20.0. We have some shared computers in our office and CiviCRM Users do not log out and just close their browser. They do not get logged off CiviCRM. If someone else interacts with CiviCRM from the same device expecting to be an unauthenticated person registering for an event or making a contribution, CiviCRM identifies them as the person who was logged on. This is creating a problem where a users contact record is being updated with event registrations and contributions for others.

Can Drupal or Civi terminate the user's session if they are idle for a specified time and/or if they close the browser.

# Answer
This is really a Drupal question, since Drupal handles user login/logout and not CiviCRM. I suggest you ask at https://drupal.stackexchange.com/
> 3 votes

---
Tags: drupal, user
---


# Question
Title: Preferred mail format select does not set current value
When editing preferred email format in 4.7.10, the select is not prefilled with it's current db value. Any ideas?

# Answer
> 2 votes
It has been fixed in the updated version https://issues.civicrm.org/jira/browse/CRM-19135.

So it's recommended if you could upgrade CiviCRM to 4.7.11 or apply this patch to your site and check if it works for you https://github.com/civicrm/civicrm-core/pull/8777

---
Tags: ui
---


# Question
Title: How can I export contacts and tags, but only for a particular tag?
Is it possible to export contacts and related Tag information, but only for one particular Tag Set? Thanks.

# Answer
Yes, you can export tags for contacts with a particular tag. It doesn't seem you can export just one particular tag, but you could easily do this as a post-process once you've exported to CSV.

Checked on http://dmaster.demo.civicrm.org/ -

* Search =\> Advanced Search
* "Basic Criteria" group =\> Tags =\> Volunteer
* Submit "Search"
* Click "All 61 Records"
* Select "Export records" action
* Export PRIMARY fields
* Exported CSV contains tag information ...
> 3 votes

---
Tags: export, tags
---


title: Error 500 with KCFinder in CKEditor

text:
# Question
Title: Error 500 with KCFinder in CKEditor
I get an error 500 when trying to upload an image to server in CKEditor (for example when using print/merge document action), when the KCFinder new window opens. The URL called is :

https://subdomain.mysite.com/sites/all/modules/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=html\_message&CKEditorFuncNum=0&langCode=fr

I thought about a https related problem, but this URL :

https://subdomain.mysite.com/sites/all/modules/civicrm/packages/kcfinder/

...is working fine and opens the KCFinder file browser.

Does anyone encountered this problem ? I can't reproduce it on demo site, I am running CiviCRM 4.7.10 with Drupal 7.50. I don't have anything in Apache logs.

I suspect a file / folder permissions issue too, does anyone have an idea on what is going on ?

Thank you

**EDIT**

I was able to open the file browser using this URL :

https://subdomain.mysite.com/sites/all/modules/civicrm/packages/kcfinder/browse.php??cms=civicrm&type=images&CKEditor=html\_message&CKEditorFuncNum=95&langCode=fr (note the "??" just after "browse.php")

...but

https://subdomain.mysite.com/sites/all/modules/civicrm/packages/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=html\_message&CKEditorFuncNum=95&langCode=fr (only one "?" after "browse.php") still gives me an error 500.

very confusing...

# Answer
My mistake, I left a hack in civicrm.settings.php (and forgot it, it was months ago) which led to this weird behavior. Reverting the hack solves the problem :

```
// can't remember why I did this 18 months ago, but this is obviously a bad idea...
//require_once './sites/all/modules/civicrm/CRM/Core/ClassLoader.php';
require_once 'CRM/Core/ClassLoader.php';

```

Many thanks to XDebug, and lesson learned (again :) about hacking CiviCRM code...
> 3 votes

---
Tags: kcfinder
---


title: A question on my ability to import?

text:
# Question
Title: A question on my ability to import?
I cannot find a tab or any import button to import my data I have on excel. I'm not admin, but I have the ability to add cases, organisations and individuals. Do I have to be the admin in order to do this?

# Answer
You do need permissions like `import contacts` to import contacts. You will need to ask for that permission to be added to your current role.

The permissions for various import functionalities are defined in `CRM/Core/xml/Menu/Import.xml`
> 3 votes

---
Tags: import, permissions
---


# Question
Title: What is the API for class CRM_Civirules_TriggerData_TriggerData?
I only manage to get the value of contactID from my processAction using the variable of class CRM\_Civirules\_TriggerData\_TriggerData using getContactId().

I would like to know if I am able to get ParticipantId or EventId since the rule is triggered when participant status is changed ?

thanks, j.

# Answer
> 1 votes
What you could do is use the getEntityData? That should give you all data that is avaiable for the entity in the triggerData. The contactId is special as we tend to want to do things with contacts :-) Does that help? So an example:

```
$contributionRecur = $triggerData->getEntityData('ContributionRecur');

```

which in your case is likely to become

```
$eventData = $triggerData->getEntityData('Event');

```

---
Tags: civirules
---


title: Selecting multiple radio buttons

text:
# Question
Title: Selecting multiple radio buttons
Could anyone tell me how I can set up a customised field which allows me to select multiple options in each field?

Do you know if it's then possible to generate reports which show all records with a selected group of checkboxes checked for a specific custom field?

# Answer
> 3 votes
Setting up your custom checkbox field is fairly simple. See the chapter on Creating Custom Fields.

Yes you can create reports that filter based on multiple values in a custom field:

---
Tags: custom-fields
---


# Question
Title: Can we manually change recurring payment subscription statuses in the database if they're no longer linked to their original membership?
We have ended up with about 30 recurring payment subscriptions in Civicrm that are either not connected any longer to their corresponding ARB in Auth.net, or they are no longer connected to to the membership they originally belonged to. (Because someone has cancelled auto-renew on the membership without attending to the recurring payment.)

So, my question: How can we edit Recurring payment subscription statuses when they have become dysfunctional in relation to Auth.net or to their original membership?

The best way I can think of would be to go into the database and change the relevant recurring payment subscriptions' contribution\_status\_id to whatever is appropriate. Most of the time this will be the status id for cancelled.

Will I get away with this? Remember, the subscription is already dysfunctional. I'm aware that if I changed this on a functioning subscription havoc might occur.

One thing that may be relevant... as I mentioned above, there are situations in which we have a functioning ARB in Auth.net, a corresponding and functioning Recurring Payment subscription in Civi, but which is no longer linked to the membership that created it, cos that membership is no longer in auto-renew state. So Auth.net will be pinging this Recurring payment subscription in Civi... the money just won't be getting allocated anywhere.

Would that be a problem?

I'd like to be able to set these subscriptions' statuses to 'cancelled' even though they're active, since they no longer relate to a membership (we then report on them manually).

Or is there a better way to accomplish all this? Thanks for your help!

# Answer
More frequently than not I find myself tweaking records in civicrm\_contribution\_recur precisely for the reasons you mention.

You will need to be sure, however, to account for any amounts not collected and perhaps create new recurring contributions or pledges so that those amounts are not entirely lost. Depending on how payments were recorded after the subscriptions became dysfunctional, this might be a lengthy task.

In the case of dysfunctional subscriptions, updating the the contribution\_status\_id to whatever is appropriate should not impact anything else.

Regarding recurring contributions associated with memberships - contributions per force must have a financial type, this would be the financial type used to create the subscription, so there should never be a case where money doesn't get allocated somewhere, there would indeed be a problem on reporting financials if this were not the case - could you clarify further?

Hope this helps, Tamar
> 2 votes

---
Tags: recurring-contributions
---