title: Tips for using CiviCRM on Amazon EC2

text:
# Question
Title: Tips for using CiviCRM on Amazon EC2
Is someone running CiviCRM on the Amazon EC2 (Part of the Amazon Webservices)? I would like to know:

* What instance type is selected?
* Is the operating system AWS Linux (supported by Amazon)?
* Are there other Amazon Services in use (for example Amazon RDS, of Amazon EC2)?

# Answer
I'm not running Civi on EC2 but I am running other things on it and I can assure you it behaves just like any Linux server.

Personally I prefer Ubuntu to AWS Linux (it's one of the choices) - but Civi will run on either. I just like to use ubuntu because it's familiar and better documented. I use Apache web server (which you have to install using "apt-get") but you can use other web servers if you prefer.

My instance type seems to be "t2.micro" but I suspect it's the default - I don't know what it means, so I won't have picked it on purpose.

Takeaway message - no specific settings are needed for Civi over and above being a standard Linux server with a sensible web server running on it!
> 2 votes

# Answer
@Kainuk, I've implemented three instances of CiviCRM / WordPress / LAMP on AWS, and am in the process of converting two of them to public production, the third has been running private production for about 14 months now. All are implemented on t2.micro instances on Ubuntu (14.04.3 - LTS). Each has a very small audience (regional \< 1,000 expected public users and \< 10 backend / database users per instance) and is purpose built for a specific not-for-profit organization and its audience. @naomi says "no specific settings are needed for CiviCRM;" I agree. That said, it can be challenging, because there is not a large community in this space. The support you get is the general support available to CiviCRM and WordPress, not so much directly for AWS. So far, that has not been a major issue.

I am using these AWS Services: EC2 - compute / memory (EBS), Networking - VPC and Route53 - DNS, Cloudwatch - Basic monitoring, and IAM - User management. The first year of use is basically free, beyond that, for my groups, using reserved t2.micro instances on a 3 year basis, costs run ~USD 100.00 / year, each. With current low loading, performance has been entirely satisfactory.

I have put up a general how-to article on the CiviCRM wiki, which provides more details. I'm eager to continue the conversation and wish you success in your efforts.
> 1 votes

---
Tags: installation, amazon
---


# Question
Title: How to embed Drupal Views in a CiviCRM Email Template?
Has anyone added a Drupal view to a CiviCRM template?

For example, we have build a CiviCRM email template with a Latest news list on the right hand side of the template. We would like to pull in the latest news links from a Drupal view that is referencing a New content type.In theory it is similar to adding a block to the right hand side of the template.

This way users creating the template do not need to manually add the links to the right hand side of the newsletter. Thanks.

# Answer
Fuzion did create a module some time ago that lets a token pull a drupal view in to a mailing. Take a look at https://github.com/eileenmcnaughton/civicrm\_views\_token

It is sometime since we had to do any work on it but hopefully it still works.

At the time it was pretty limited in what it offered but it did mean that you could eg build a 'latest news' view in Views and then have that pulled in to a bulk mail.
> 3 votes

---
Tags: civimail
---


# Question
Title: Event registration without online payment
What is the configuration for an paid event that has no online payment option?

I have a Drupal/CiviCRM website running since quite some time for courses I provide. People register online, and only when there are enough people the course takes place. I then send people an invoice (per mail) that they have to pay.

I'm now stuck with a bug where I receive a "SQLSTATE\[23000\]: Integrity constraint violation: 1048 Column 'tid' cannot be null" error message, which I have the impression is linked to an error in my event configuration.

# Answer
You can configure this with the *Pay Later option*.

1. Navigate to the *Fees* tab.
2. Enable *Paid Event*
3. Check the Pay Later Option
> 2 votes

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


# Question
Title: Pointing to /civicrm breaks Wordpress site, 404 HTTP response
The requested URL /civicrm was not found on this server. CiviCRM 4.6.3 Wordpress 4.1.1

After having created a campaign widget the example.com/civicrm returns a 404 HTTP response, when clicking on "contribute"?

This instance of Wordpress is running on apache and virtualhosts with other Wordpress installations

Already tried whats here: Forum CiviCRM

Thanks keep up the great work!

# Answer
Can we verify a few things?

What are your WordPress permalinks set to?

They should be Post Name (%postname%) That setting is here: example.com/wp-admin/options-permalink.php

This will add to your .htaccess file the following:

```
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

```

Now can you go to example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/uf&reset=1

This is the menu option Adminsiter -\> System Settings -\> CMS Database Integration.

You should see 'civicrm' in the WordPress Base Page setting. If not, add it there.

Confirm that there is a WordPress page titled 'CiviCRM' in the list of WordPress Pages: example.com/wp-admin/edit.php?post\_type=page

This page should have a permalink of example.com/civicrm

Once all these settings are in place, you should be good.
> 6 votes

# Answer
I ran into this problem because my CiviCRM site is located at url www.blah.com/ and not at www.blah.com/civicrm. I fixed it by clearing the WordPress Base Page setting box (see Kevin's post on how to set the WordPress Base Page)
> 0 votes

---
Tags: wordpress, configuration
---


# Question
Title: How to send one email to multiple contacts with separate individual follow-up activities
If I send an email to forty contacts, I can opt to generate a follow-up activity (eg phone call). That's great, except that it creates one single follow-up activity for all the contacts. I would like to generate separate follow-up activities, one for each contact, so that I can record the different sequences of activities which follow on the from the initial mailing. Is there any way of doing this?

Alternatively would it be difficult to duplicate the one follow-up activity (with forty contacts) into forty activities, each with one contact?

Thanks.

# Answer
> 1 votes
(converting comment to answer)

If you choose to create an Activity from the search results then you can specify that there should be a single Activity per contact, not one for all the contacts selected. At that point, if you specify there should be a 'follow up' then the follow up should also be 'one per contact'

---
Tags: email, activity
---


# Question
Title: Should the link between an Activity and any Follow Up activity be visible through the UI
I checked that when creating a Follow Up activity, it adds a value to civicrm\_activity.parent\_id so that at least the database knows there is a connection between these, but afaik there is nothing visible on the Activities tab of the contact, nor within either of those Activities if you click 'View'.

While researching this I spotted Find Activities does have radio buttons for is / has a follow up Activity.

Would it make sense for the child and parent Activities to show there is a connection both on the Activity itself and on the Activity Tab

(info based on a 4.6.x version)

EDIT: Spotted this ticket (for civi 2.2.x - wow) that says:

```
5. Provide link back to parent activity when viewing a follow-up activity
Modify ActivityView to check if parent_id is NOT NULL
If NOT NULL, assign $parentURL to template - this should be a link to view the "parent" activity. (ActivityView.tpl already has logic to display this link if it's got a value).
"Prompted by..."

```

But I am having no luck seeing this in action on d46 or master. If this did exist and has been lost or removed can anyone confirm if this was intentional? Or is this a Regression?

# Answer
I'm pretty sure there never was a visible link. I certainly don't remember seeing one, and I've always treated the follow-up feature as simply a convenience for creating multiple activities rather than establishing some kind of relationship.

If there were to be a visible link, I (as a user) would expect the ability to break links and create new links between existing activities.
> 1 votes

---
Tags: activities
---


# Question
Title: How to translate the "Confirm Contribution" button on Contribution pages
I have a multilingual CiviCRM install with 3 languages. "Multiple Languages Support" is activated, and the fields with translation icon next to them have all been translated.

But I also need to translate the button "Confirm Contribution" at the bottom of the Contribution pages. How can I achieve this?

Since this needs to be translated to 3 languages, I can not use Word Replacements (word replacements is not multilingual, so it uses the same replacement in all languages)

# Answer
Multilingual word replacement support is the topic of both CRM-14349 and CRM-19683. CRM-19683 just had a patch merged, which should be available in the January 2017 release of CiviCRM. You can patch it now if you're patch-savvy. Please try it and see if it solves your problem - or wait until January 2017, upgrade to CiviCRM 4.7.15+ and see if it solves your problem.
> 1 votes

# Answer
**One way of doing this would be:**

In this case you need to write an java script (Main.extra.tpl) to change the value of the button based on the language selected
> 0 votes

# Answer
I am not 100% sure but if I remember correctly there is actually a word replacement page for each language (at least it was like that in 4.3.x). If you are on the word replacement page and switch the ui language, it should provide you with a page that does replacements for English --\> Current UI Language.

Another option would be to translate the strings on transifex (if they are coordinated via transifex) and update your transltion afterwards. Please find more information on the translation process here: https://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=88408149
> 0 votes

---
Tags: contribution-page, translation
---


# Question
Title: How to make my custom report template appear?
This is CiviCRM 4.6.22 / Drupal 7 where I used civix to copy one of the give contact reports:

> civix --copy=CRM\_Report\_Form\_Contact\_Summary generate:report MCat null

It also appears registered in the Report manager. However I cannot find and therefore not use it when I look in Reports \> Contact Reports

I tried reinstalling the module, looked for clues in the log file. Any helpful advice is appreciated!

# Answer
(Expanding comment as an answer...)

Reports \> Contact Reports shows the Reports that have been created from Report Templates. Your extension adds a Report Template, so from Report \> Contact Reports, click 'New Contact Report' to see the templates. Select your template, configure and save as a new Report.
> 3 votes

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


# Question
Title: Best way to write module for 'unusual' payment gateway
We are looking at writing a module for Ezidebit. Ezidebit allow the setup of Direct Debit payments online. However, the initial request to Ezidebit includes the payment frequency and Ezidebit initiates these future payments on the frequency provided.

So once setup Civi does not need to request any further payments from Ezidebit. Instead it just needs to import the payment receipts - which are available from Ezidebit via an API.

I'm wondering what the best way to go about building a module for this will be? It's not really a payment gateway as there are no real-time payments available via this aspect of Ezidebits service. It is probably more like a bank account with payments being received by Ezidebit that need to be entered in to Civi.

In Civi it is most likely going to be used for Regular Donors and if so we would need to be able to track the commitment the donor has made and also the actual payments received. This doesn't seem to quite fit Pledges (as it is ongoing) or recurring payments (as Civi does not initiate the payment).

Any suggestions on the best approach for this?

# Answer
What you are describing is not unusual and is within the range of processes that CiviCRM can handle. See here for some details: https://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=184188933

Two key things you want to do for your specific payment processor code are: 1. Set the 'payment type' to '2' - this sets some default assumptions for debit cards as opposed to credit card (e.g. fields). 2. Create an automated job to pull in the completed contributions.

There are some complex things you may want to implement later, like being able to manage the recurring schedule from CiviCRM, but for now you can probably get the basics working without too much suffering.

You'll want to look at a few examples and also the core payment object that you'll be subclassing: https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment.php
> 3 votes

# Answer
CiviCRM's payment processing is much improved, but there may be some "baked in" assumptions about how things look which don't match new processor interfaces.

That said, what you describe sounds a lot like the structure of the Flo2Cash payment processor in NZ, and Fuzion's processors for Flo2Cash WSDL (merchant hosted) and Flo2Cash Donate (3-party) have what sounds like a similar structure.

On Flo2Cash side of the interface, the relevant terms are `Frequency_ID` (eg week, month) and `Installment_Number` (number of payments), see here and here

Take a look at those processors and see if that answers your question?
> 2 votes

---
Tags: payment-processor, developer, modules
---


# Question
Title: Unknown mailing status on few mailings recipients
Since the 4.7.8 update to 4.7.10 and 4.7.10 to 4.7.12 recently some mails are not reaching their recipients. If I look at the Mailing Detail Report the Successful Deliveries rate is between 90% and 100% and the status of the not received mails are "Unknown".

To see these mails on the report I have to filter as status "-any-" because there is no possibility to do it with the status "unknown".

Has anyone encountered the same problem? What may be due?

**Edit**

I investigated a little more and I see that "Unknown" status appears when there is no record on the civicrm\_mailing\_event\_bounce table AND when there is no record on the civicrm\_mailing\_event\_delivered. Then, it seems that for some users, there isn't registering the delivery of the mail.

~~I begin to suspect that the problem is related with an issue of inconsitency caches of the mailing recipients groups.~~

**Edit 2**

I found on logs messages like `[info] CiviMail will not send an empty mail body, Skipping: xxxxxxxxxx@xxxxx.xxx` corresponding to the contacts with mailing status marked as "Unknown".

# Answer
> 3 votes
This has been fixed for 4.7.15

PR https://github.com/civicrm/civicrm-core/pull/9463

# Answer
> 2 votes
I found the answer on this other question: Mail not send if preferred\_mail\_format is NULL.

The original problem seems reported and solved first on CRM-18037. But also persist and dragged in later versions as reported on CRM-18157, CRM-19135, CRM-19442, CRM-19423.

Otherwise in the latest fixes upgrade scripts that converts 'NULL' `preferred_mail_formats` to 'Both' are not executed. If I'm on right, last time is executed is in 4.7.7 upgrade.

Meanwhile to solve current inconsistencies it seems suficient to execute the following script on the database:

`UPDATE `civicrm_contact` SET `preferred_mail_format` = 'Both' WHERE `preferred_mail_format` IS NULL;`

---
Tags: civimail
---


# Question
Title: How do I add a new administrator to CiviCRM?
How do I give a person admin rights to civi?

# Answer
As JonG mentioned, it depends on your CMS. I use Drupal so in my case I either add a Drupal role I created called 'civicrm\_administrator' to the user or I create a specific new role and tick the permission 'administer CiviCRM'
> 2 votes

---
Tags: permissions, user-account
---


# Question
Title: Impossible to get the source field with the Contribution API
On CiviCRM 4.6.11. I need to get the source field of a contribution, but the api seems to fail. Testing the API on http://xxx//civicrm/api#explorer with entries giving the following PHP code :

```
$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "source",
  'contact_id' => 4889,
));

```

gives as results :

```
{
    "is_error": 0,
    "version": 3,
    "count": 1,
    "id": 4676,
    "values": [
        {
            "contact_id": "4889",
            "contribution_id": "4676",
            "id": "4676"
        }
    ]
}

```

Although the contribution DO HAVE a source value, no source entry in the result. Is-it a knonw bug, or what wrong in the trequest ?

Thanks for help.

Jean-Pierre

# Answer
There is an issue with the contribution 'source' field being accessed through the API, due to there being a conflict between the 'source' field of a contribution and the 'source' field of a contact.

To get around this conflict, add the prefix 'contribution\_'. So in the API call, change 'source' to 'contribution\_source':

```
$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "source",
  'id' => 1,
));

```

...becomes...

```
$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "contribution_source",
  'id' => 1,
));

```

This worked for me.
> 2 votes

---
Tags: api, contributions
---


# Question
Title: Add legal_identifier field to contact page and form?
I tried add legal\_identifier field by custom tempelate. It worked for pages, but not for forms. Then I added this code to sites/all/modules/civicrm/CRM/Contact/Form/Edit/Organization.php:

```
$form->addField('legal_identifier');

```

Now it works good in organization contacts, but I'm not shure if this is correct. Can I edit this file? What will happen after update? Is there some better way? Can I use some hook? How? Thank's, I'm getting started with civiCRM.

# Answer
There are a number of strategies for customizing CiviCRM! They have their advantages and disadvantages - but you should definitely be concerned about your change disappearing on upgrade.

The easiest change is to use a custom PHP page just like a custom template. Details are available on this wiki page. However, this is rarely a maintainable solution, because you'll need to compare your file to the original every time you upgrade and move your changes over.

A better solution is to create an extension and use a hook. The correct hook here is hook\_civicrm\_buildForm. I would insert a simple conditional to check that the `$formName` is the one you want to operate on, and if so to add your one line of code. This is far more maintainable.

Please join us at http://chat.civicrm.org in the #dev-newcomers channel and we'll be happy to help get you set up with civix or any other tools you need to create extensions!
> 0 votes

# Answer
Why not simply a civicrm custom field, that you could use in a Profile or a Webform (if you are based upon Drupal) ?
> 1 votes

---
Tags: forms, fields
---


# Question
Title: Older CiviCRM that does NOT require TRIGGER privileges?
As of title, I'm looking for a CiviCRM version that does not require trigger privileges, since the hosting service that I'm using does not support it, currently I'm on version CiviCRM 4.7.13 and getting this error when I try to create a new contact:
"Sorry but we are not able to provide this at the moment. DB Error: insufficient permissions"
these are the privileges on my user from MySQL:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `db1234`.\* TO 'usr1234'

# Answer
I'd recommend approaching the problem the other way round: find a hoster that works with the latest versions of Civi rather than find a version of Civi that works with your current hoster. You will be missing out on many new features and security fixes if you choose to run an old version. It will only bite you later.

Is there any reason not to move hoster? As ErikH points out, there are several specialist CiviCRM hosting services - but not all are equal. See eg How to evaluate hosted CiviCrm enviroments
> 5 votes

# Answer
I think earlier than CiviCRM 4.3 does not require trigger priviliges but I do expect you to run into other issues with your hosting service. I recommend you go to a experienced CiviCRM hosting service like CiviHosting?
> 4 votes

---
Tags: error, database
---


# Question
Title: Checking Inconsistencies between Users and Contacts Emails (via civicrm_uf_match table ?)
I am in Drupal 7.51 / CiviCRM 4.7.12

I want to check Users emails against their corresponding Contacts emails (which happen to be different in the DB though they should not).

I have developped a small program to identify those cases (querying civicrm\_email and drupal\_users tables, linked via civicrm\_uf\_match).

I thought that the civicrm\_uf\_match table managed the link between the Drupal User id and the corresponding Civicrm Contact id ; but it actually does not : it contains only 31 lines though I have 446 Users and 667 Contacts with a primary email.

For instance, the civicrm\_uf\_match table does not contain my own ids pair ; moreover, it contains lots of errors (e.g. old emails which were deleted).

Question : how and where is managed this link between the Drupal User and the CiviCRM Contact (which appears when you consult/modify the Contact) ?

# Answer
> 2 votes
The `civicrm_uf_match` table is the correct place to look. I can't explain why you're seeing what you're seeing!

# Answer
> 2 votes
There is a function that synchronizes users and contacts (/civicrm/admin/synchUser?reset=1). Not sure if this would help in any case I recommend trying it on a testing environment first.

# Answer
> 2 votes
When you create a User the user email, civicrm email and uf\_match table are all the same.

If you then edit the civicrm email, the uf\_match gets updated as does the User email.

If you edit the user email, the uf\_match is updated, as is the civicrm email.

BUT I don't think this has always been the case. I can't track when the new feature came in to 4.6.x but I have a strong memory that in the past these were not always kept in synch but can't recall whether it was editing the user email or the civicrm email that would result in only the uf\_match being updated but not the 'other end' of the pipe.

---
Tags: core
---


# Question
Title: Restrict Activity Types by Contact Type(s)
Is there a way to disable certain activity types based on the contact type?

# Answer
> 2 votes
As far as I know this has not been delivered by anyone as yet but there was some substantive discussion about ACL and Activity Types here

---
Tags: activities, contact-types
---


# Question
Title: API for Event Registration with Custom Fields?
I am trying to register event participants from code. I have created a custom field group for "Participants".

Using the API, how can I create a value for the custom fields and have them associated with the event that a contact is registered for?

Thanks!

# Answer
> 2 votes
Okay, I just figured it out. I just need to chain the API call with CustomValue create:

```
CRM.api3('Participant', 'create', {
  "debug": 1,
  "sequential": 1,
  "event_id": 145,
  "contact_id": 2,
  "role_id": "Attendee",
  "api.CustomValue.create": {"custom_223":3}
}).done(function(result) {
  // do something
});

```

---
Tags: civievent, custom-fields, api, registration
---


title: Workflow for New Event Registration

text:
# Question
Title: Workflow for New Event Registration
When I create a new event, I want someone to be notified via email when it is saved. How best to do this?

I see in the admin console that there is System Workflow Messages under Message Templates, but how do I create a custom System Workflow?

# Answer
> 1 votes
To my Knowledge this is not a straightforward thing - but can be done -

You need to create an extension and use post or postprocess hook

whenever an Event is been saved against database you need to trigger an action to send an email

---

Install Civix

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

Hook reference: https://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference

I guess this helps!!!

---
Tags: system-workflow-messages, workflow
---


# Question
Title: How can I record an offline contribution with multiple line items?
My use case is a donor who makes a donation that needs to be allocated to multiple funds. For instance, a check for $20,000, with $10K for general operating expenses and $10K for a special program fund.

While I'm clear how to make an online contribution page that allocates funds to multiple line items, I'm not sure if there's a way to do this from an offline contribution page.

# Answer
* Create a Price Set for contributions pointing to the multiple funds needed. Each fund should have a price of 1.00. You could include additional funds besides the two in question so that the Price Set is ready to be used like this in the future for other potential donation splits.
* If the donation needs to be attributed to a certain contribution page, create that contribution page.
* Enter a 'New Contribution' under 'Contributions' menu.
* Once the price set is created, next to the amount field, you should have the option to choose a Price Set.
* Choose your new price set, and split the donation as needed to each fund.
* Enter the check info and other pertinent contribution info.
* Pick Contribution Page under 'Additional Details' if needed.
> 3 votes

# Answer
To my Knowledge - you can use financial type for each line item

Each financial type should have a perentage of allocation of the given fund

For example :

If you have two line item Donation (10%) and member dues (90%) set up in the financial type

If a member makes a payment of 100 pounds then 10 pound is allocated to donation and remaining is been allocated to member dues

I guess this helps!!!
> 0 votes

---
Tags: contributions, line-items
---


# Question
Title: How to get Geocoding to use my Google API key?
I'm getting a Geocoding over-limit error, even though I've enabled a billing profile with my Google Maps Geocoding API key. (I hope! :) )

Using: Civi 4.6.14, Drupal 7.43, Geocoding settings: Mapping provided by Google, with my Google Maps Geocoding API key Geocoding provided by Google, with the same Google Geocoding API key, on a standard account. I have setup a billing profile with the key, so it should handle over-usage. Scheduled job: geocoding=1, address parsing=1, throttle=1.

The Scheduled job returns this error:

> Parameters parsed (and passed to API method): a:4: {s:7:"version";i:3;s:9:"geocoding";s:1:"1";s:5:"parse";s:1:"1";s:8:"throttle";s:1:"1";}
>
> Full message: Finished execution of Geocode and Parse Addresses with result: Failure, Error message: A fatal error was triggered: Aborting batch geocoding. Hit the over query limit on geocoder.

Also, my Google developer's console shows no activity on my API key.

So, I'm wondering if I have missed something in Civicrm... for instance I found this link: https://wiki.civicrm.org/confluence/display/CRMDOC/Mapping+and+Geocoding It says at the bottom:

> Usage Limits Some providers have usage limits on their Mapping and Geocoding APIs. If you go over the limits you may receive a overlimit error when trying to save an address. Currently there is no support for integrating the Google APIs Console license (which is needed for sites whose usage is over limit). Contact info at civicrm dot org if you are interested in helping implement this.

Does this mean that Civi can't handle over-billing?

OR: perhaps I have not configured my Google API key properly. I think I've set it to only accept connections from our server's IP, and with our domains.

Any ideas?

I've subsequently followed the advice here to switch mapping to Open Street Maps and Geocoding to Yahoo, and re-activated the Scheduled Job. That is currently running with no errors... :)

# Answer
> 2 votes
You weren't imagining things. CiviCRM 4.6 and 4.7 until recently was ignoring the Google API key altogether! I'm not sure the history of that, but it would have been great if someone had documented that in the settings. As of the latest 4.6 and 4.7 the Google API key is getting recognized again (https://github.com/civicrm/civicrm-core/blob/4.6.23/CRM/Utils/Geocode/Google.php). Once I upgraded, I checked the URL getting passed and it now attaches the key and uses https (the other requirement of Google). And in the API dashboard I'm now seeing activity.

So the answer to your question is: upgrade CiviCRM to the latest in order to get Geocoding to use your Google API key.

---
Tags: geocoding
---


title: What's CiviCRM's FQDN for mail?

text:
# Question
Title: What's CiviCRM's FQDN for mail?
We have an issue where CiviCRM sends mail on behalf of our client for newsletters, media releases etc.

But because we don't have their FQDN in our spf record some spam filters will reject the mail thinking civiCRM are spoofing the clients mail account

This is a problem ! does anyone know the fully qualified domain name they use so I can add it into our records to solve this issue?

Thanks

# Answer
SPF works by specifying what hosts can send email for a particular domain. Hence you should be thinking about adding *your* host to *their* SPF record (not 'their FQDN in our spf record').

If your client is sending email from addresses like info@client.org and that email originates from one of your hosts, for example host.provider.com, then you will need to ensure that something like 'a:host.provider.com' appears on the SPF record for client.org.

If they don't have an SPF record already, you'll want to chat with them about how they are sending email before setting anything up to ensure that you correctly identify all the different hosts that send email for this domain in the SPF record.

Here is a good SPF resource for further reference: http://www.openspf.org/SPF\_Record\_Syntax.
> 4 votes

---
Tags: email
---


title: CiviMail error when sending test

text:
# Question
Title: CiviMail error when sending test
When sending a test email in CiviMail and we go to send a test we get the following: Error in call to Mailing\_send\_test : Validation failed for: "(INVALID)" \<(INVALID)\>.

We are running Civi Ver 4.16 on WordPress 4.5.4.

Email for other processes is fine and I have switched to SMTP and the same error occurs. Same issue occurs on production server & dev server (different boxes). The dev server hosts several WP/Civi site with no issues in CiviMail.

Thanks in advance for any thoughts.

Here is the backtrace:

```

Nov 11 11:50:49  [info] $backTrace = #0 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(PEAR_Error))
#2 //public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 //public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("Validation failed for: \"(INVALID)\" ", NULL, 16, (Array:2), NULL)
#4 //public_html/wp-content/plugins/civicrm/civicrm/packages/Mail/RFC822.php(209): PEAR->raiseError("Validation failed for: \"(INVALID)\" ")
#5 //public_html/wp-content/plugins/civicrm/civicrm/packages/Mail.php(191): Mail_RFC822->parseAddressList("\"(INVALID)\" ", "localhost", FALSE)
#6 //public_html/wp-content/plugins/civicrm/civicrm/packages/Mail/mail.php(151): Mail->prepareHeaders((Array:10))
#7 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(705): Mail_mail->send("\"Kilakwa Associates, LLC\" ", (Array:11), "--=_fc0b6ada5c5414641163756e3eafc23e\nContent-Transfer-Encoding: 8bit\nConten...", "31")
#8 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(607): CRM_Mailing_BAO_MailingJob->deliverGroup((Array:1), Object(CRM_Mailing_BAO_Mailing), Object(Mail_mail), "", (Array:0))
#9 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/MailingJob.php(196): CRM_Mailing_BAO_MailingJob->deliver(Object(Mail_mail), (Array:12))
#10 //public_html/wp-content/plugins/civicrm/civicrm/api/v3/Mailing.php(644): CRM_Mailing_BAO_MailingJob::runJobs((Array:12))
#11 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_mailing_send_test((Array:10))
#12 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#13 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Subscriber/ChainSubscriber.php(196): Civi\API\Kernel->run("mailing", "send_test", (Array:10))
#14 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Subscriber/ChainSubscriber.php(72): Civi\API\Subscriber\ChainSubscriber->callNestedApi(Object(Civi\API\Kernel), (Array:35), (Array:5), "create", "Mailing", 3)
#15 [internal function](): Civi\API\Subscriber\ChainSubscriber->onApiRespond(Object(Civi\API\Event\RespondEvent))
#16 //public_html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func((Array:2), Object(Civi\API\Event\RespondEvent))
#17 //public_html/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:4), "api.respond", Object(Civi\API\Event\RespondEvent))
#18 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(221): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("api.respond", Object(Civi\API\Event\RespondEvent))
#19 //public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(98): Civi\API\Kernel->respond(Object(Civi\API\Provider\MagicFunctionProvider), (Array:9), (Array:5))
#20 //public_html/wp-content/plugins/civicrm/civicrm/api/api.php(23): Civi\API\Kernel->run("Mailing", "create", (Array:35), NULL)
#21 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(404): civicrm_api("Mailing", "create", (Array:35))
#22 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(640): CRM_Utils_REST::process((Array:3), (Array:33))
#23 [internal function](): CRM_Utils_REST::ajax()
#24 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
#25 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:12))
#26 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#27 //public_html/wp-content/plugins/civicrm/civicrm.php(1196): CRM_Core_Invoke::invoke((Array:3))
#28 [internal function](): CiviCRM_For_WordPress->invoke("")
#29 //public_html/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1))
#30 //public_html/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")
#31 {main}

```

# Answer
This issue was related to the from address. This install had been upgraded from 4.4 and CiviMail had not been used since then. The from\_name and from\_email fields in the civicrm\_mailings table showed as (INVALID). When looking at the from address setup in Civi it looked fine. I retyped the entry and everything is fine now. ot sure what caused the from address to become invalid?
> 2 votes

---
Tags: civimail
---


# Question
Title: Can cv handle custom Wordpress installs?
A wordpress install I'm adding CiviCRM to is setup in a non-standard way, specifically:

```
docroot
\- civicrm.settings.php
\- wp-config.php
\- content/
|  \- plugins
|  | \- civicrm
|  \- uploads
|     \- civicrm
\- wp (wp codebase in here)

```

I've got CiviCRM working fine, but I can't get my tests to run that rely on booting CiviCRM from `cv php:boot`. Trying to run `CIVICRM_SETTINGS=civicrm.settings.php cv -vvv ...` from the docroot just silently dies. I'm using cv version `b3db22c`.

# Answer
Thanks to the helpful comments, I conclude: Yes it can, with a bit of help.

## TL;DR

* you need to define `CIVICRM_CMSDIR` in your code
* you need set `CIVICRM_SETTINGS` as an environment var

## Longer version

As far as I can work out, `cv` sources `civicrm.settings.php` before it sources `wp-config.php`. So if, like me, you have config set in `civicrm.settings.php` that depends on constants defined in `wp-config.php` you'll have to find a solution for that (e.g. use `if (defined('...'))` or put them all in a separate file and `require_once(...)` it.)

Then you need something like this in your `civicrm.settings.php`:

```
define('CIVICRM_CMSDIR', __DIR__ . '/wp');

```

Basically CiviCRM is going to expect to find `wp-includes` inside that directory, so adjust as you need to.

You don't need to call `cv` from within any particular directory, according to my tests.

You need to set the environment variable `CIVICRM_SETTINGS` to point to the `civicrm.settings.php` file. This can be a relative or absolute path.

I was then able to get cv to run, e.g. to use the API. Now if only I could get my tests to run....!
> 2 votes

---
Tags: testing, cv
---


# Question
Title: Why is Activity statuses Scheduled and Completed added?
Is it a bug that in *Advanced Search* section *Activities* the **Activity Statuses** get filled automatically with **Completed** and **Scheduled**.

It happens when:

1. I open Activities section when doing **Advanced Search**;
2. I try edit Activities section of previously configured **Smart group**.

In (2) scenario, the previously set Activity Statuses are lost and replaced by these Completed and Scheduled, thus annoyingly disrupting the group settings which need to be manually redone.

The bug is present in CiviCRM Drupal sandbox v4.7.15.

Is there a bug report filled for this already?

**Screenshot:**

# Answer
This is a bug and has been reported here

Note, it closely resembles other issues affecting 'Edit Smart Criteria' eg
> 1 votes

---
Tags: activities, search, issues
---


# Question
Title: Is it possible to set up a custom field that requires a specific format eg xx-xxxx-xxxxxxx-xxx
We need to store bank account numbers and will set up a CiviCRM custom field for the data. Ideally we would like the field to be such that people only enter data in the following format xx-xxxx-xxxxxxx-xxx. Is it possible to customise the custom field format? if so how would I do it?

Or do I need to create a work around eg have 4 integer fields that display inline with dashes inbetween.

# Answer
> 3 votes
I'd suggest adding a javascript formatter to a single, custom input text field. I haven't tried it, but formatter.js looks like it would deliver what you want.

Their Credit Card demo illustrates what you want - accepts pasting of data with and without hyphens, prevents pasting / input of values which don't match the validation rule. It just needs a different pattern for hyphen placement to deliver bank accounts.

---
Tags: custom-fields
---


# Question
Title: Disabling Stripe extension breaks database
After clicking "disable" on the Stripe extension, visiting civi gave me an error 500 and does not make an entry in the error log. But going to Drupal home kicks out the following error message:

`Warning: require_once(CRM/Core/Payment/Stripe.php): failed to open stream: No such file or directory in Civi\Payment\System::getByProcessor() (line 59 of /home/ourbase/public_html/prbrc/sites/all/modules/civicrm/Civi/Payment/System.php).`

The file it's looking for does exist, BTW.

I've fixed this before (see answer), but I just want to uninstall the extension -- it never for us worked anyway.

# Answer
Getting your site back online, in phpmyadmin:

1. In table `civicrm_extension`, enable stripe (change 0 to 1)
2. In table `payment_processor`, disable any using stripe (change 1 to 0)

This should allow your site to load.

Deleting stripe (warning: stripe may be related to some transactions, check before doing this):

* Make sure none of your donation pages are using stripe
* Delete any payment methods using stripe
* Delete the payment processor "stripe"
* Disable extension "stripe"
* Uninstall extension "stripe"

You'll still see it on the list of extensions with an install link. To get rid of it, you'll have to remove the com.drastikbydesign.stripe folder in /sites/default/files/civicrm/extension (or whatever your extensions directory is).
> 5 votes

---
Tags: extension, stripe
---


# Question
Title: CiviDiscount "Specify api string for advanced filter"
I'd like to use CiviDiscount to create an automatic discount based on a custom data field on the contact record.

Looking at the options for the Automatic Discount, there is a field called "Specify api string for advanced filter" but when I put a value into this field and save, it isn't actually saved. I'm not sure if this is because the strong is wrong, or something else.

I was testing with a group value as this using the same advanced value that is used when creating contact reference fields:

action=get&group=532

# Answer
> 2 votes
There is an example here: https://github.com/dlobo/org.civicrm.module.cividiscount/blob/master/README.md

You need to specify the entity and format the api string as JSON.

---
Tags: api, cividiscount
---


# Question
Title: 404 css and js not found, wrong [civicrm.root]
a fresh install on Joomla 3.6.4 with CiviCRM 4.7.13 results in countless 404 errors

All files of those locations are not found:

* css
* bower\_components
* packages
* js

It tries to find the files from those folders in the wrong location: /home/...serverinfo.../www/...website.../components/com\_civicrm/civicrm

but the correct location would be: /home/...serverinfo.../www/...website.../**administrator**/components/com\_civicrm/civicrm

The variable: \[civicrm.root\] is set correctly including the **administrator** folder

The civicrm.settings.php is defined like this: $civicrm\_root = '/home/...serverinfo.../www/...website.../administrator/components/com\_civicrm/civicrm/';

Please, is there anywhere else where I can look for a wrong configuration of the \[civicrm.root\]?

Thank you

# Answer
You can configure the web resources in the screen *Administer -\> System Settings -\> Resource URLs* (That is different from file locations).

In this screen, you can set the resource URL (see (1)) as complete URL, as the relative path and with the use of URL variables. So you can avoid using the using `[civicrm.root]`. And it has another neat feature. If you ask help by clicking the question mark, the values of the URL variables are displayed.
> 1 votes

---
Tags: joomla, installation, civicrm.settings.php, css
---


# Question
Title: Personalised link using checksum tokens leads to empty page
When testing the functionality of checksum tokens for a mailing, the link is properly created according to this wiki entry for profile pages (.../?page=CiviCRM&q=civicrm/profile/edit&reset=1&gid=**N**&{contact.checksum}&id={contact.contact\_id}). However, clicking the link leads to an empty page that shows the profile title twice, but no other content.

Interesting: When clicking on Wordpress' customize button, the profile including the respective data is shown above the page – although home page instead of the CiviCRM page.

We're on CiviCRM 4.7.8 for Wordpress (Graphy theme) and are trying to set this up for the first time.

What I tried:

* Using a different browser (Firefox and Chrome) and different devices (Windows PC and Android Phone) didn't show any differences.
* I wasn't sure whether a reCAPTCHA would cause problems so I turned it off for this profile, but that didn't help.
* Clearing cache and resetting paths didn't change anything either.
* Not sure if this is relevant, but the sidebar is also shown despite having changed the WP template to "no sidebar".

Any other ideas what could cause this?

# Answer
> 1 votes
It seems only the link was incorrect and lead to the explained behaviour. The wiki entry over at civicrm.org is inaccurate (for Wordpress installations at least). The suggested link is

.../?page=CiviCRM&q=civicrm/profile/edit&reset=1&gid=**N**&{contact.checksum}&id={contact.contact\_id}

while in my case the correct link is

.../**civicrm**/?page=CiviCRM&q=civicrm/profile/edit&gid=**N**&reset=1&gid=16&{contact.checksum}&id={contact.contact\_id}

I realised the link was missing the "civicrm" part, when I tested the profile in "create mode", which gave me the correct (second) link. Hopefully, someone else may find this useful.

---
Tags: wordpress, civimail, profile, tokens, checksum
---


title: Scheduled Reminder Email is Empty

text:
# Question
Title: Scheduled Reminder Email is Empty
We are using CiviCRM 4.6 on a live site we built with WordPress 4.6.1. We ran into the problem explained below. Any help is much appreciated.

I have set up a scheduled reminder to send reminder emails to CiviCRM members 1 month before their membership expires. It works on my local VM and also on WPEngine's staging site. However on the live site on the same WPEngine environment the sent email is empty, no subject line and no body content.

This happens with both SMTP and "Redirect to Database" options in "Settings - Outbound Mail". CiviCRM's SMTP settings are correct and "Save and Send Test Email" works as expected. When redirecting to database, body field is NULL.

I get the following 8 PHP warnings every time a scheduled reminder email goes out. Smarty seems trying to include some missing php files with random names which change every time. Web server has full permissions on /nas/content/live/mysite/wp-content/plugins/files/civicrm/templates\_c/en\_US. I even renamed this folder and it was re-created. So file permissions on that folder should be OK.

Disabling Smarty in civicrm.settings.php or clearing/disabling cache did not help.

Does anyone have any idea what could be causing this weird problem?

Thanks

`[Thu Oct 27 22:07:51.221907 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%B8/B82/B82902AF%%14776060711886644419.php): failed to open stream: No such file or directory in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264`

`[Thu Oct 27 22:07:51.222042 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(): Failed opening '/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%B8/B82/B82902AF%%14776060711886644419.php' for inclusion (include_path='/nas/content/live/mysite/wp-content/plugins/wordpress-seo/vendor/yoast/api-libs/google:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/packages/:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm//packages:.:/usr/share/php:/usr/share/pear') in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264

[Thu Oct 27 22:07:51.223342 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%E1/E1B/E1B25959%%147760607183913258.php): failed to open stream: No such file or directory in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264

[Thu Oct 27 22:07:51.223430 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(): Failed opening '/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%E1/E1B/E1B25959%%147760607183913258.php' for inclusion (include_path='/nas/content/live/mysite/wp-content/plugins/wordpress-seo/vendor/yoast/api-libs/google:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/packages/:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm//packages:.:/usr/share/php:/usr/share/pear') in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264

[Thu Oct 27 22:07:51.224501 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%91/910/9105E2BB%%1477606071414776177.php): failed to open stream: No such file or directory in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264

[Thu Oct 27 22:07:51.224611 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(): Failed opening '/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%91/910/9105E2BB%%1477606071414776177.php' for inclusion (include_path='/nas/content/live/mysite/wp-content/plugins/wordpress-seo/vendor/yoast/api-libs/google:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/packages/:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm//packages:.:/usr/share/php:/usr/share/pear') in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264

[Thu Oct 27 22:07:51.225795 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%CB/CBC/CBC1541F%%14776060711283623884.php): failed to open stream: No such file or directory in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264`

`[Thu Oct 27 22:07:51.225911 2016] [:error] [pid 1516] [client 208.124.188.134:42618] PHP Warning: include(): Failed opening '/nas/content/live/mysite/wp-content/plugins/files/civicrm/templates_c/en_US//%%CB/CBC/CBC1541F%%14776060711283623884.php' for inclusion (include_path='/nas/content/live/mysite/wp-content/plugins/wordpress-seo/vendor/yoast/api-libs/google:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/packages/:/nas/content/live/mysite/wp-content/plugins/files/civicrm/custom_ext/com.drastikbydesign.stripe/:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/:/nas/content/live/mysite/wp-content/plugins/civicrm/civicrm//packages:.:/usr/share/php:/usr/share/pear') in /nas/content/live/mysite/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1264`

# Answer
> 3 votes
For anyone who may face this issue, it was finally fixed by WP Engine through adding an exception on the firewall for CiviCRM cron URL.

---
Tags: wordpress, email, scheduled-reminders, smarty, cache
---


title: I want to list civievents in a civimail

text:
# Question
Title: I want to list civievents in a civimail
Is there some way to provide a list of events in civimail? Or failing that generate a custom listing (just the fields I want) of my events so I can copy and paste it into civimail?

# Answer
Yes, you can achieve this by installing the Fancy Tokens extension.
> 4 votes

---
Tags: civievent, civimail
---


# Question
Title: Add an image for each address in contact form
As in a previous (unanswered) question, I'm trying to add an image with an anchor for each address in the contact form.

In my extension, through the buildForm hook I'm able to add (once) an image in the contact form, but not to add *n* images in each address section.

Thank's for your answer.

# Answer
> 1 votes
In general, tweaks to CiviCRM templates are not super simple and usually require a 2-step process:

1. Add a tpl.extra template with the same name as the template you wish to modify.
2. Add a `<script>` tag and some javascript to your new template which uses jQuery to place the markup in the spot you want.

---
Tags: contacts, extension, addresses
---


title: How can I customize the user dashboard?

text:
# Question
Title: How can I customize the user dashboard?
I'm talking about the user dashboard displayed for each contact who is logged in. In wordpress this is displayed on a page using this shortcode: \[civicrm component="user-dashboard" hijack="0"\]

By default it displays (for the logged in user) Groups, Contributions, Events, Memberships,Related Contacts and Organizations.

I would like to display only the Groups and the Membership information, for example. Is there a way to customize this user dashboard? (I'm using wordpress and civicrm 4.6.23)

# Answer
Under Administer - Custom Data and Screens - Display Preferences menu item there is a section for "Contact Dashboard"

You can turn on or off the display of Groups, Contributions, Memberships, Events, My Contacts/Organizations, Pledges, Personal Campaign Pages, Assigned Activities, Invoices / Credit Notes
> 11 votes

---
Tags: user-dashboard
---


# Question
Title: How to send a contribution receipt through a text message when receiving a donation
I would like to know if it is possible to send a text confirmation message or a WhatsApp when we receive a contribution from a donor.

# Answer
> 1 votes
You can send text messages with CiviCRM. Look at Setting up an SMS provider! But you want to send a message the moment you register a contribution. The extension CiviRules can do this task for you. It allows you to configure an action (for example sending a text message) that must be executed when a predefined event happens (for example, adding a contribution). See the \[CiviRules Cookbook\] (https://wiki.civicrm.org/confluence/display/CRMDOC/CiviRules+Cookbook).

---
Tags: civicontribute, civirules, sms
---


# Question
Title: Site not working after using CiviCRM its shows error in wordpress site
Error :

Error: Could not create directory: /home/abcdraw/public\_html/wp-content.

If you have moved an existing CiviCRM installation from one location or server to another there are several steps you will need to follow. They are detailed on this CiviCRM wiki page - http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location. A fix for the specific problem that caused this error message to be displayed is to set the value of the config\_backend column in the civicrm\_domain table to NULL. However we strongly recommend that you review and follow all the steps in that document.

Even Admin panel shows same error. when i rename civicrm then site will blank.

# Answer
> 1 votes
Looking at the error messages, this looks like an issue with WordPress rather than CiviCRM specifically. There are several error messages for other WordPress plugins in addition to CiviCRM.

As a first step, I would suggest that you disable all of the plugins (including CiviCRM) and see if WordPress itself is working correctly. If that works, you can then try enabling the plugins one by one to see which is causing the issue.

I notice that most of the errors refer to the path `/home/jumpcbu/...` but the CiviCRM error refers to `/home/abcdraw/...`. This leads me to believe that you may have recently moved server. In which case, this may be the cause of your problems. I would suggest that you look at the documentation about moving to a new server that is mentioned in the error message you posted.

---
Tags: wordpress, civicrm-home
---


# Question
Title: Drupal views: How to aggregate CivCRM Relationships?
I was able to create Drupal Views that nicely lists Organization with their related individuals. It worked with both approaches with CiviCRM Relationships as well as CiviCRM Contacts as base view. Once you have this, it would seem simple then to switch on Aggregation and then count the contacts, but no. I tried what I could but with both approaches it returned illogically unexpected results.

Anyone successfully made a view to that can list Organizations with the number of their related Individuals? I would appreciate if you could share your experience.

# Answer
> 1 votes
In the past when I have tried doing this sort of thing I have had to use a Drupal module.

Maybe try this module: https://www.drupal.org/project/views\_aggregator

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


# Question
Title: Can users (non-administrators) log their hours in CiviVolunteer
I'm working to setup CiviVolunteer for an organization that wants to track volunteer hours throughout the year. They'd like for individuals to log their own hours. Is this possible yet? I looked in the documentation, though, couldn't tell or not: http://civicrm.github.io/org.civicrm.volunteer/docs/320-manage-volunteer-projects/.

I did allow "CiviVolunteer: log own hours" and "CiviVolunteer: register to volunteer" to "authenticated users".

Please let me know if this is possible and if so, how to set it up so that they can.

Thanks!

# Answer
> 0 votes
Not yet, though we'll be pushing this into a release before the end of the year. (Sorry about the misleading "log own hours" permission -- we got a little ahead of ourselves there!)

---
Tags: civivolunteer
---


# Question
Title: How do you filter by campaign from the volunteer listing page in civivolunteer?
On the regular volunteer listing page (/civicrm/vol/#/volunteer/opportunities) is there a way to filter by campaign like there is within Manage Volunteer Projects?

I'd like to be able to filter within the URL with campaignid or something like that.

In our case, we have a volunteer event that happens at multiple locations with different and different opportunities at each location. All are on the same day and all are related to one theme. I'd like to be able to link to just those opportunities in a list.

# Answer
Pretty sure the code needs to be modified a little bit to allow you to do it by URL param. Shouldn't take but an hour or two.
> 1 votes

---
Tags: civivolunteer, civicampaign
---


# Question
Title: CiviVolunteer: is there a way to send mailings to smart groups targeting shifts for volunteers
We have a group using CiviVolunteer v4.6-2.1.1 with Angular Profiles v4.6-1.0.1 on CiviCRM 4.6.17.

The scenario - which is basically what most groups need when doing volunteer management is to be able to send reminder emails to people, letting them know the shifts they've committed to. Now there can be multiple shifts during the day with the same role - for e.g. You have an upcoming fundraiser and you want to manage volunteers to do phone calling for a a few days, and you have a role called "Phone Caller" with four 2-hour shifts per day.

Currently, CiviVolunteer isn't integrated into CiviMail, and you can email your volunteers INDIVIDUALLY through your email client of choice (you select the email application to use when you want to email an individual inside CiviVolunteer).

So I'm poking around Civi to see if we can create smart groups of the individuals who signed up for a particular shifts by looking at the activity record that CiviVolunteer creates.

I see that that the Volunteer Role, and Volunteer Need (which has the actual date and time the individual signed up for - but looks like it's in a separate table with another ID) are exposed in the activity record. CiviVolunteer also records the activity type as Volunteer, the Date, the Time, and sets the status to SCHEDULED when someone signs up.

Now in the UI, you can't search on the TIME in the activity record (which would be very helpful for targeting groups who signed up for a shift during a particular day).

I also see that you can get to the Volunteer Need field (which is a reserved field for CiviVOlunteer) via the Search Builder, but have no way through the UI to know what value to put there to get to the actual volunteer date and time shift to be able to conduct the search.

There is also no token available for the Volunteer Need field in the Mailings feature - which would be another way to send reminders to folks so they know what shift they signed up for.

It seems that this piece is huge for volunteer management. I remember Frank talking about more work on the mailing piece, but I was wondering if there's a current solution or work around to be able to send targetted emails to remind people of the shift they signed up for.

There is one wacky way, where you can create a role such as "Phone Caller Sept 12 5pm shift" or something - since volunteer roles are available in the search. But this would be so inefficient and wacky that I wouldn't advise this workaround at all, especially if it's a huge volunteer project.

Any ideas?

# Answer
The "who signed up for a particular shifts" part is the problem right now. At present, you could use scheduled reminders to send an email to anyone with any volunteer activity between X and Y o'clock, but if you have two shifts (or projects, for that matter) you won't have a way to distinguish between them, so they'll all get the same message.

We're expecting to finish a proper integration with scheduled reminders sometime before March 2017, but probably not in 2016.
> 0 votes

---
Tags: civivolunteer
---


# Question
Title: How can arrange custom fields so they are side by side?
I have a high number of 'outcomes' for a client in the format of 3 fields for each outcome as below:

'outcome words', date identified, date met

Problem is that custom fields are formatted as one below the other as:

* 'outcome words'
* date identified
* date met

Which means that the screen will be very deep causing the user to scroll down a lot. What would be involved in re-formatting the screen so that these fields are all side by side?

# Answer
> 4 votes
The case custom fields are formatted as a series of one row tables. You could add some jQuery to move them around.

For example:

```
CRM.$(function($) {
  $('#Outcomes table:nth-of-type(3n+1)').each(function (index) {
    // Combine 3 rows into 1
    for (var i = 0; i <= 1; i++) {
      $(this).find('td:last').after($(this).next().find('td'));
      $(this).next().remove();
    }
    // Merge tables
    if (index > 0) {
      $(this).prev().find('tr:last').after($(this).find('tr'));
      $(this).remove();
    }
  });
  // Remove labels if not wanted
  $('#Outcomes td.label').remove();
});

```

You can add it to your page in various ways, but I'd create a tiny extension and drop it in there. See also wiki.civicrm.org/confluence/display/CRMDOC/Javascript+Reference

Without jQuery:

With jQuery:

---
Tags: custom-fields, civicase, 4.7, jquery
---


title: batch members communication settings

text:
# Question
Title: batch members communication settings
Is it possible to change a communications preference for several members using profiles? I can't find how to do it. If I select "Contact" while having members filtered Civi won't find the profile. But if I select Member from profile I can't bulk-change communication preferences.

Am I doing stuff wrong?

# Answer
1/ Create a Profile that includes the required Comm Pref fields (this would be a Profile that ONLY contacts Contact type fields, not membership fields)

2/ Adv Search

3/ set your 'membership criteria' as required to find the relevant contacts

4/ use the 'batch update' or 'update multiple contacts' Action (4.6 and 4.7 have different descriptors

5/ you should then be able to bulk update

i just did this on dmaster.demo.... and it worked fine but maybe i am misreading your problem
> 3 votes

---
Tags: profile
---


# Question
Title: Why would bounce processing put all emails into CiviCRM.ignore mailbox?
I did a first mailing and then got the bounce processing job working. It just moved all the bounce responses (about 100) to the ignore mailbox and did not mark any of my contacts. How do I tell what went wrong? There is no info in the log other than saying that it rand the job successfully.

Also I got emails of the form: To: u.68.3087.7ed8aa555f763f19@californiacalvary.org iOS Mail sent this email to unsubscribe from the message “One Week To Go!”.

Should these get processed?

# Answer
> 1 votes
It looks like CiviCRM uses the domain specified in the bounce mailbox settings to generate a regex to match incoming bounce messages.

From the info in your question, I suspect CiviCRM is directing bounces to a (subtly) different domain name. As a result, it doesn't think the bounces are intended for CiviCRM to process, and moves them to the ignored folder (as CiviCRM would with other "not for me" email).

See your mail account settings (Admin \> CiviMail \> Mail Accounts).

Try ensuring both the return address and site domain match, and see if the problem persists.

Once correctly configured (or, temporarily misconfigured to match the misspelled inbound address!), you can move those messages back from the CiviCRM.ignored mailbox to the INBOX, and re-process them.

---
Tags: civimail
---


# Question
Title: Can I customize the columns that are displayed on the Manage Events page?
IS there anyway that I can modify the table that is displayed on the Manage Events page. Ideally I'd like to be able to change the columns that are displayed. I couldn't see where this can be done in the admin/config menu but can this be done by editing the relevant page template? If so can someone provide me with details as to which file needs to be edited? thanks!

# Answer
> 2 votes
You can change that display by writing some code using hook\_civicrm\_searchColumns

The template is CRM/Event/Form/Selector.tpl but you may not need to change that.

---
Tags: civievent, column
---


title: Change URL only on WordPress+CiviCRM

text:
# Question
Title: Change URL only on WordPress+CiviCRM
We have been setting up a `WordPress + CiviCRM` installation on a test subdomain, let's call that `wewantthis.testdomain.org`.

I also have a domain name `wewantthis.org` that I wish to simply point to the exact same installation directory as `wewantthis.testdomain.org`, but with (hopefully minor) changes to settings and the database as we are not changing servers or even file locations on the server.

Note that I can do this easily for Wordpress only by

1. using phpMyAdmin to modify the wp\_options table's "siteurl" and "home" rows to point to wewantthis.org;
2. fire up WP/wp-admin and run a Wordpress plug-in "Velvet Blues Update URLs";
3. under WP \> Settings, change the Site Address and WordPress Address to wewantthis.org. That is all there is to it. Btw, for reasons I don't want to go into, I'm not interested in a redirect solution.

Is there something similar I can do for the CiviCRM database and settings? I've read some Q/A's regarding both moving the server and changing URL, but they seem to suggest a completely new install of CiviCRM and starting over, but at least making use of the previous database, whose creation was the bulk of the work.

Any advice would be appreciated as we have a test configuration that we want to go live by simply changing DNS pointers from the existing wewantthis.org (no CiviCRM) to our new one that will have CiviCRM fully integrated.

Thanks to the experts out there. This is our first CiviCRM setup.

# Answer
The advice in the documention is fairly old and much of it is no longer appropriate. In the most recent CiviCRM versions, more and more of the url settings are automatically calculated from the 'base url' and are relatively easy to update just by editing the CIVICRM\_UF\_BASEURL in your civicrm.settings.php file, and then clearing your caches for good measure. In fact, most of the time you don't even have to worry about that, you can access much of your civicrm from multiple domains (e.g. with and without www). Of course, that's not usually a good idea, and the one key time that the settings file matters is when your civicrm is invoked via a non-CMS entry point (e.g. the click-through tracking url from CiviMail).

Usually, it's when you also have to change file locations that it gets the most icky.

The one recent gotcha I've seen is a ckeditor security check for file uploads that will break things in a small way if you don't have the file locations right (e.g. you need the actual file path instead of a symlinked one). But that's a digression for completeness and unrelated to your question....
> 2 votes

---
Tags: wordpress, urls
---


# Question
Title: Mailchimp extension not pushing new Civi group members to the Mailchimp list
I've been setting up the excellent Mailchimp extension from Vedaconsulting.

It all seems to be working correctly (thanks to this page), except for when posting on the fly from Civicrm to Mailchimp:

I've setup a smart group to correspond to a list in Mailchimp. If I unsubscribe someone from Mailchimp then Mailchimp's webhook fires and the person is correctly removed from the smart group.

But if I add someone to the smartgroup they aren't being pushed to Mailchimp. There is immediate activity in the Civicrm log, but the name of the person isn't included. (Arrays contain info about the list and groups etc, but not the person.) And no change in Mailchimp.

Nevertheless, syncing Civi from/to Mailchimp seems to be working fine.

What could I do to troubleshoot this?

We're on Drupal 7.50, Civicrm 4.6.17, Mailchimp 1.8.7. Our server is locked down pretty tight... but if syncing is working then I would have thought the database post should be working too?

Thanks for your help!

# Answer
The instructions page you linked to is for an old version, which you must be on if you have 1.8.7.

I wrote version 2 of this extension and it's fairly a complete rewrite, so while I can't promise it solves your problem, I can say that no further development is going to happen on 1.8.x.

You need to update to v.2 before the end of 2016 as Mailchimp are apparently pulling their old API, so your integration will probably stop working. Veda have most of my code "merged in master" (means they've accepted it) but have not published a release.

I have published a release, though, at https://github.com/artfulrobot/uk.co.vedaconsulting.mailchimp/releases

It's flagged with a red beta tag at the mo because it brings in an experimental webhook thing for WordPress users, but I'm guessing you're on Drupal, so you can ignore the beta bit - I have been running this version in production for a few months now. But you should see the README as the new Mailchimp API changes a lot. I'd definitely recommend a backup of your Mailchimp lists ("exports" from Mailchimp) and your CiviCRM set up before you go upgrading. Of course you would anyway :-)
> 1 votes

---
Tags: smartgroups, mailchimp
---


title: PDF formats page margins not applied

text:
# Question
Title: PDF formats page margins not applied
I have recently upgraded from CiviCRM 4.6 to 4.7. I have custom PDF page formats set up for PDF letters for mailing. When I apply these custom PDF formats to the PDF letter templates, the page margins I set up in the PDF formats are not applied to the letter templates and don't display in the margins fields in the expanded template section.

How can I fix this?

# Answer
> 1 votes
It could be related to this bug, fixed in 4.7.14:

https://issues.civicrm.org/jira/browse/CRM-17879

Could you re-test in the latest version to see if it has been resolved?

---
Tags: pdf
---


# Question
Title: Mailchimp extension compatibility with CiviCRM 4.7
Can I install the latest Mailchimp extension on Civi 4.7.10 (Wordpress)? Are there any comparability issues?

# Answer
> 1 votes
In general, extensions marked as compatible with 4.6 will usually work with 4.7 as well. It may be that the extension author just hasn't had a chance to test it and tag a new release for 4.7. I recommend you:

1. Install the extension and try it out
2. Notice if it works correctly or not. Gather specific details of anything that may be amiss.
3. File an issue on the extension's github page noting your findings so that the maintainer can either fix the bugs or else tag a release as-is for 4.7.

---
Tags: extension, 4.7.10, mailchimp
---


# Question
Title: How can we get Custom data Used For: Relationships to display in a Drupal View?
Relationship is e.g. Board Member - custom data on that Relationship is e.g. Treasurer (or President).

We can pull the Relationship into a View but even using CiviCRM Relationships as a base table - we can't seem to add the Custom data as Fields.

We double checked that the specific table got copied into the settings.php: 'civicrm\_value\_committee\_relationship\_data\_7' =\> '`civicrm_project_org`.',

Curious if anyone has any ideas on how to get this working!

On 4.6 LTS for this project;

# Answer
Suggestion made on MM was that the Description field is available in Views and may be useful for folks in similar situations.

To get custom fields on Relationships available in Views will require some additional code in the 'civi views' module.
> 1 votes

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


# Question
Title: Why Membership and Other Amount doubles receipt amount
Weirdness I can't find answer to. I hope I can articulate this well enough. If not, I'll make a screencast. And is not the same as Contribution page "other amount" option causes weird behavior - possible bug?

Steps:

1. Create Contribution Page
2. Set contributions for only "Other Amount". No other entries for contributions.
3. Set for Membership signup
4. Tick "Separate Membership Payment"
5. Test Drive choosing a membership level (type) and leaving "Other Amount" blank is successful through end of workflow with correct amount for Membership showing only.
6. PROBLEM: (Test) Receipt sent by email shows correct amount for Membership but also includes same for 'Other Amount' doubling the total.

Then if I untick "Separate Membership Payment" then the correct amount appears through the workflow but then two receipts are sent; one for Contribution and one for Membership. But, the Membership receipt continues to fill in the "Other Amount" section with the Membership amount and doubles the total amount.

# Answer
> 1 votes
That definitely sounds like a bug. It's not really replicable on the demo server, because you can't get emailed receipts, but if you can replicate this on a site built with buildkit, you can file this at https://issues.civicrm.org.

To start tracking the bug down, I'd insert the `{debug}` Smarty token into your receipt. Hopefully there's an obviously wrong variable.

# Answer
> 0 votes
This appears to be the bug described in CRM-19298. A patch has been submitted in the last couple of days, but it's not yet in the review queue for the January release. If you have the ability to provide QA, please update the Jira ticket!

---
Tags: civicontribute, civimember, receipts
---


# Question
Title: How can you use Credit Card test credentials to test out a Webform-CiviCRM form that uses a Contribution page?
Title pretty much says it all. I want to be able to run some tests of Contributions via a Webform.

I have test credentials for the Credit Card, so i can use 'test mode' on the contribution page directly, but can't see any way to set the webform to use the test option.

Maybe it is just a feature waiting to be asked for?

# Answer
There is a field on the Contribution tab within the CiviCRM tab of webform. The field is called "Payment Processor Mode" and gives you the following options -User select- Live transactions Test Mode
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: Need help solving unserialize():Error at offset
Thank you all for your continued patience with me.

Since the past two updates, I keep getting the following error:

Notice: unserialize(): Error at offset 0 of 8 bytes in Civi\Core\SettingsBag-\>loadValues() (line 153 of /home/\[usrpath\]/public\_html/\[sitedirectory\]/sites/all/modules/civicrm/Civi/Core/SettingsBag.php).

I know this is related to a mySQL database problem, but for the life of me I cannot figure this out.

I am running CiviCRM 4.7.14 on Drupal 7.52

Thank you again

# Answer
> 5 votes
This line reads the data from the table `civicrm_setting` and specifically the column `value`. You could use a SQL client to run the query:

```
SELECT id, name, value FROM civicrm_setting;

```

Typical values would look these:

* `NULL`
* `i:0;` (an integer)
* `b:1;` (a boolean?)
* `s:20:"CRM/common/fatal.tpl";` (a string)
* `a:1:{s:3:"key";s:5:"value";}` (an array or dictionary)

Skim them and see if one of the values looks to have a different/unexpected format.

---

(UPDATE) Seamus Lee pointed me to https://www.drupal.org/node/1114304 which uses a clever technique for finding badly serialized data. Take the error message (`Error at offset 0 of 8 bytes`) and note the length (8 bytes). Search on that:

```
SELECT id, name, value FROM civicrm_setting WHERE length(value) = 8;

```

---
Tags: drupal, error, mysql
---


# Question
Title: How can I save Search results with preserving Views For Display Contacts (defined in Profile)?
I have a smart group which I would like to display with specific info in custom columns.

I can do **Advanced search**, select this group and choose predefined **Profile** in **Views For Display Contacts**. Then I get the group displayed with relevant custom columns.

How can I retrieve this view via link (to put it in Navigation menu)?

# Answer
> 1 votes
A partial solution is listed here: Change the default fields (columns) in contact search results

> You can set this custom search profile with the reduced columns as a default for all contact search results (besides participants) in /civicrm/admin/setting/search?reset=1.

A major drawback is that I'd like to use **different columns for different searches** rather than the **default profile for *all* searches**.

# Answer
> 1 votes
When you create (save) your smart group, following an advanced search, you also have a saved search in parallel, with an ssid (while the smart group has a gid) : look at the URL (that you can save and re-use).

I found no place in the User Interface where you can then retreive this ssid, but it is stored in the civicrm\_saved\_search table, that you can easily display with phpmyadmin.

# Answer
> 0 votes
I apologize : I think I was a bit optimistic : this is the point where I am :

Create your search (you can use a Profile, whih customizes the results display columns). Then, select all, create a smart group, and save it.

Look at the URL : it is in the form of : yoursite.com/civicrm/contact/search/advanced?force=1&reset=1&**ssID=12**&context=advanced&qfKey= ....

Depending upon your permissions (I did not check that), you can use either of :

* yoursite.com/civicrm/contact/search/advanced?force=1&reset=1&**ssID=12** or
* yoursite.com/civicrm/group/search?force=1&context=smog&**gid=32**

(where gid is your smart group id) but, actually, they give the same result (while I thought that ssid would save the display profile).

I will come back here if I (or anybody else) find(s) a solution (because I am interested in).

---
Tags: profile, search-results, custom-search
---


# Question
Title: Is this the correct patch for CiviCRM version 4.6 here CIVI-SA-2016-23?
After receiving the security announce, i have been trying to apply the patch given here CIVI-SA-2016-23 but had this error message `patch -p1 < 9482.diff
patching file CRM/Utils/API/AbstractFieldCoder.php
Hunk #1 succeeded at 123 (offset -5 lines).
patching file js/Common.js
Hunk #1 succeeded at 445 (offset -15 lines).
Hunk #2 FAILED at 639.
Hunk #3 succeeded at 690 (offset -105 lines).
Hunk #4 succeeded at 716 with fuzz 2 (offset -119 lines).
Hunk #5 succeeded at 753 with fuzz 2 (offset -122 lines).
Hunk #6 FAILED at 898.
Hunk #7 FAILED at 1041.
Hunk #8 succeeded at 968 (offset -184 lines).`

Can this patch also be used for version 4.6? because the reference Issue CRM-19709 says affected version is 4.7 and affected versions in security annouce are

1. 4.7.13 and earlier
2. 4.6.23 and earlier

Maybe I'm doing something wrong, i am using this procedure to apply the patch.

I'm on Civicrm 4.6.10.

# Answer
> 3 votes
## Specific answer on patching CRM-19709 for 4.6.10

* Go to the appropriate Github repo, civicrm-core
* Select the branch you want to find a backported patch for, 4.6
* Read the commit messages and find commit(s) you want to apply, `3a7376` and `675201`
* Append `.patch` to those commit URLs: `3a7376.patch`, `675201.patch`
* Try a `patch --dry-run` dry-run to see if the patches apply, in the order they were applied to the 4.6 branch.
* If that works (no errors), apply the patches by dropping the `--dry-run` option.

To perform the actual patch, I tend to use `curl PATCHURL(S) | patch -p1`, so the command I'd use to test if the patches will apply will be:

```
curl \
  https://github.com/civicrm/civicrm-core/commit/67520196442e493ea1c6ddfcd4954d0f3c7ab3fe.patch \
  https://github.com/civicrm/civicrm-core/commit/3a73760d967edab137fe8eae20fdf63967be9ecf.patch \
| patch -p1 --dry-run

```

Pulling patches directly from a URL saves a few steps, and means we don't end up with `abcdef.patch` left on disk after.

Please see also my separate answer on how to avoid getting into this situation :)

# Answer
> 2 votes
## General advice on patch-updating old releases

The recommended solution is to upgrade to the latest release in your series. Between 4.6.10 release date in Nov 2015 and time of this question, there have been multiple CiviCRM security releases. See https://civicrm.org/advisory for the full list.

As you're finding, patch updates are labour intensive, which is why we recommend upgrading to a supported release.

As the codebase to be patched (the 4.6.10 site) and the codebase the patch was made for (4.6.24) diverge, the odds of the patch applying cleanly are reduced. This can be an uncomfortable situation.

### How do people get here?

The need to backport fixes may indicate -

* A site is reluctant to upgrade because the CiviCRM codebase has been directly modified. Instead of customising CiviCRM directly by modifying the core code, we recommend customising via extensions, overrides, and the other interfaces CiviCRM provides for customisation..
* A site is reluctant to upgrade because the upgrade might bring unexpected changes. This may be addressed through testing (automated or manual). Currently the CiviCRM community is discussing ways to make upgrading a more predictable process for sites.
* A site may have opted to skip upgrades due to limited budget or resources, and now wants to track "bare minimal" updates for security only. This tends to increase the cost of maintenance over time.

Those are the most common underlying reasons sites find themselves having to backport fixes. These reasons may be valid, or they also might not apply to your instance at all, but I'm adding this additional answer in the hope that it helps some sites out there avoid the situation in question.

---
Tags: security-advisory
---


# Question
Title: Is there a way to email a link inviting people to sign up for an event that will be connect to their contact ID?
I have a list of people who I want to encourage to sign up for an event. I can send a link that allows them to update their contact information, using the contact hash. What I would like to do is send them a similar link that would create a new event registration for their contact ID. This would solve a couple problems:

* Avoid duplicate contact entries from being created.
* Auto-populate contact fields make the user experience more pleasant.

Am I missing a way to do this, or is there a way to implement it short of a new core feature?

# Answer
The contact checksum works equally well for a CiviEvent registration as it does for updating their contact info via a profile. The tokens page of the wiki has a section at the bottom that shows how to format the URL based on your CMS:

**Checksum for Event Registration Pages**: To send people to an event registration page use this path where N is the ID of your event:

```
Drupal: http://www.myorganization.org/civicrm/event/register?reset=1&id=N&{contact.checksum}&cid={contact.contact_id}
Joomla!: http://www.myorganization.org/index.php?option=com_civicrm&task=civicrm/event/register&reset=1&id=N&{contact.checksum}&cid={contact.contact_id}
WordPress: http://www.myorganization.org/?page=CiviCRM&q=civicrm/event/register&reset=1&id=N&{contact.checksum}&cid={contact.contact_id}

```

**Alternate approach**: Using checksums is a little complicated for some folks, especially end users! To make your life simpler, consider installing the Fancy Tokens extension. This gives you drop-in tokens for your next several events that include the checksum automatically.
> 3 votes

---
Tags: civievent, tokens, checksum
---


# Question
Title: Is there a way to update CiviCRM through the Drupal Admin/Modules panel?
This is getting so frustrating! It is a real PITA to update CiviCRM every single time there is an update.

We use several extensions. According to the documentation, I have to disable each extension (which you can't do in bulk, you have to disable them one at a time), back up the database, make a copy of the site, delete all CiviCRM files, download the update, unpack it twice (.gz and then .tar), upload it to the hosting provider, run the update script, figure out why the system still thinks it it's in update mode (causing many things to not work!), re-enable each extension individually, then try to find out why this stupid unserialize error at line 153 keeps popping up (I have yet to figure out what table is causing this, but I have determined it does have something to do with the database, I even downloaded an extension that is supposed to tell me, but I can't seem to get it to work).

We are on a shared hosting plan (non-profit so cheap cheap cheap), so sometimes the admin side is painfully slow and it is not unusual for it take 4 hours or more to do a simple update that should be able to happen like updating any other module through the Drupal panel and take about 15-20 minutes.

Is it every going to happen this way, or will I always have to do this manually?

Thanks.

# Answer
I feel your pain.

There is no way to do it through the modules panel.

However, I believe the instructions you are following are unnecessarily complex. What we do is back up, then delete the civicrm directory, upload the new version and then run the update script. We don't bother disabling and enabling extensions. We use maintenance mode if it's during working time - you don't need to unless you expect people to try and use the system during the upgrade.

To be fair we do have a test system that we do it on first. But we have not had any trouble (sometimes things don't work after upgrade but this has always turned out to be the result of bugs rather than anything we did), and in any case you are already backing up first so if something did go wrong you could restore.

I think this is quite a common approach, see for example https://civicrm.stackexchange.com/a/11436/465

As for the error that you say appears after upgrade - usually one or two clears of the drupal cache will fix such things http://www.inmotionhosting.com/support/edu/drupal-7/configure-caching/clear-caching
> 4 votes

# Answer
It sounds like you're using some very old-school approaches to system management. You can probably make your life easier by adopting some newer practices.

* Always run upgrades on a test server. I like to run it on my own laptop. You can use a virtual machine for that.
* Ideally, use a version control system like git, so you can push your upgrade from your fast local machine to your slow shared hosting.
* Most tools will unpack a .tar.gz file in one go. Consider using another tool.
* You'll probably get the most bang for your buck if you take 1-2 hours to learn the command line and start using `drush`. If you have to do ANY Drupal-related administration, drush will save you hours and hours of work. If you take the first two lessons at https://www.codecademy.com/learn/learn-the-command-line, then find a drush tutorial online, you'll be much less frustrated by Drupal - and CiviCRM! For instance, to disable multiple modules at once, you can type: `drush dis civicrm views mymodule myothermodule`.
> 3 votes

# Answer
I can't answer the specific question of if/when there will be an easier GUI-based upgrade process, but two possibilities to alleviate the current pain:

1. If you are using Drupal and have ssh access, then 'drush cvup' from the command line is easier.
2. Consider a Civi hosting provider that does updates for you.
> 2 votes

---
Tags: upgrade
---


# Question
Title: Sending a CiviContribute form that's not coming from a standard donation page
I'm contemplating building my own donation page completely, to have full control over the look and feel. The page should send a donation form to the civicrm server that includes the same form fields as the standard donation page does.

Could someone tell me if this approach is viable? Or am I bound to run into problems at some point?

I am especially interested if the form must include some special codes (in hidden form fields) that I would have to generate myself when creating the custom donation page.

# Answer
There IS a viable approach to this, but I don't think it's quite what you're imagining. Sending the form fields to CiviCRM isn't going to load the CiviContributionPage session object, where much of the data is stored.

Approaches you could take include:

* Use template overrides to change the template. It sounds like you've explored this approach.
* Build the form using Webform-CiviCRM integration, which gives you much greater control over the look and feel. This requires Drupal.
* Modify the existing template's HTML after it's rendered using hook\_civicrm\_alterContent.
* If none of these will satisfy, instead of submitting all the same form elements, instead use the Contribution API to submit your values.

Check out the Simple Donate extension as an example of folks who took the last approach. They're using AngularJS, so the other options weren't on the table for them.
> 2 votes

---
Tags: civicontribute, contribution-page
---


title: Update contact's field to empty value

text:
# Question
Title: Update contact's field to empty value
I have updated some contacts and during import there was a mixup in some fields, i.e. an individual's "Website" field was filled with the value of an Organisation's website.

I want to set the value of "Website" field for this individual to empty. I tried updating the contact with both *Update* and *Fill* options, leaving the "Website" field empty, but this didn't work.

What is the best way to do this?

# Answer
> 1 votes
I would probably create a profile with the website, and then use the 'update multiple contacts' to clear the website a hundred at a time (which is the maximum of contacts you can update with one profile action).

First you need to create a profile, and read up on profiles in the User Guide if you are not familiar with them. Next you search for your contacts, and select a maximum of 100 at a time, and select the 'update multiple contacts' from the action list. You then select the profile and use the 'copy' functionality to set the website to empty. I have not tried this, but this is what I would try to do if updating SQL is not an option.

If that does not work you will probably either clean them in the database OR delete the contacts and re-import (if that is an option).

---
Tags: import, upgrade
---


# Question
Title: CiviEvent - capturing billing information, interaction (or not) with contacts
I may be missing something obvious, but what is the best way to capture billing information for an event registration, including for a registration of multiple people?

What I mean is, in addition to providing a credit card option, we allow optionally providing billing name, address, fax, and email.

Currently we are using a profile for the additional billing information (billing name, address, fax, and email), which gets attached to registrant #1. This caused a problem at first - an email address supplied for billing would overwrite the email address on registrant #1. "Solved" by replacing the email field in the billing profile with a new text field that is just for the profile (but unfortunately is not an email field, so is not validated for email).

Is there a better way, to collect this information and have it attached to the event registration itself, not to one of the contacts?

# Answer
When you say registration, do you mean "of membership"?

If it's just registration of being part of your organisation, perhaps attach it to an activity of type "Registration" on the contact.

However, your message concerned me. In general CiviCRM isn't used for credit card information - there are a lot of laws surrounding how that information is stored. Tangentially, you should also read: https://en.wikipedia.org/wiki/Payment\_Card\_Industry\_Data\_Security\_Standard

In general we would advocate using a dedicated payment processor extension and only storing transaction Ids in Civi.
> 1 votes

# Answer
I would suggest making the Contact 1 an organization profile and then the billing info attached to that profile with a contact name. Then additional profiles could be individuals that would collect whatever info for them.
> -1 votes

---
Tags: civievent
---