# Question
Title: How to set permissions on an angular page
I have developed a basic angular page and forms which stores data in the database. However the data stored are settings and should only be accesible when a user has a permission for Administer CiviCRM.

How do I that? I don't have a Menu.xml where I would usually do that but I do have routing options in the angular controller.

# Answer
I found a solution for this. The developer docs (https://docs.civicrm.org/dev/en/latest/framework/angular/loader/) mention how you could create your own angular page, which is a regular civicrm page but at a different url.

Because it is a regular page I could set permissions for that just as I was used to do. See https://docs.civicrm.org/dev/en/latest/framework/routing/#access\_arguments for how to do that.
> 2 votes

---
Tags: permissions, angular
---


title: How do I set up a group mailing list

text:
# Question
Title: How do I set up a group mailing list
I want to send a new event listing to all our members who have ticked a requesting information from us. At the moment when I choose the new mailing list option it's just a blank screen

# Answer
> 1 votes
The steps for creating a Mailing List are

* create a Group of contacts (from a Search or other method)
* set that Group to be used as a Mailing List

It is unclear what you mean by 'choose a new mailing list option'. It may help if you add some screenshots after (re)reading https://docs.civicrm.org/user/en/latest/organising-your-data/groups-and-tags/#group-settings-and-functionality to ensure we are all on the same page about what you are trying to do. Thanks

# Answer
> 1 votes
This also sound something is broken in your civicrm installation. What happens when you click on Mailing in the menu? Could you then start a new mailing?

Did you try to clear the civicrm caches? by going to https://your-site.com/civicrm/clearcache?reset=1

---
Tags: civicontribute
---


title: Deadlocks in Rebuild Smart Group Cache

text:
# Question
Title: Deadlocks in Rebuild Smart Group Cache
Sorry in advance for my lack of familiarity with civi, I'm not the most experienced member of the team.

We seem to be running into a problem with the Rebuild Smart Group Cache job where the cpu will completely max out every time it is run. I looked deeper into the issue in the log and have gotten the following output:

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]
    [type] => DB_Error
    [user_info] =>
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="
    DELETE  g
      FROM  civicrm_group_contact_cache g
      WHERE  g.group_id = 120  [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]"]
)

```

It has also happened on the query

```
       [user_info] => INSERT IGNORE INTO civicrm_group_contact_cache (contact_id, group_id)
        SELECT DISTINCT id, group_id FROM civicrm_temp_group_contact_cache910
       [nativecode=1213 ** Deadlock found when trying to get lock; try restarting transaction]

```

Is this at all related to https://civicrm.org/blog/eileen/478-group-contact-cache-deadlocks-improvement ? And would it be alleviated by changing the caching setting mentioned in the blog post?

# Answer
That pretty much sums it up. We have fixed similar problems by changing the Smart Group cache timeout via civicrm/admin/setting/search?reset=1, alongside setting a limit to the Scheduled Job so that only X groups would be considered for each job run.

In another situation we did the following (pasted from our ticket system).

> * set cache clearing to deterministic drush cvapi setting.create smart\_group\_cache\_refresh\_mode=deterministic
> * created a scheduled job to run always job.group\_cache\_flush
>
> Outcome was clearing the civicrm\_group\_contact\_cache after the 5 minute time we allow caches to be valid.
>
> This should resolve deadlocks that occur during cache clearing. It will not resolve deadlocks that may occur during cache rebuilding

Hopefully those give you some ideas of ways to progress
> 1 votes

# Answer
I have helped out a client with similair deadlock problems and most of the time it turned out that the confifuration of a particilair smart group was causing this.

But finding out which group is causing it is the pain. Sometimes the query causing the deadlock indicates group id. So my suggestion would be try to have a look at group with id 910.
> 0 votes

---
Tags: smartgroups
---


title: GDPR and CiviCRM 4.7.30

text:
# Question
Title: GDPR and CiviCRM 4.7.30
On our web site, the GDPR extension does not figure on the list of installable extensions. Does it mean GDPR (the latest 2.5) is not stable for 4.7.30, or some other reason?

Does it harm to install 2.5 manually?

Drupal 7.58

# Answer
> 1 votes
Version 2.5 (now 2.6) is the Latest Release is therefore available to install via a zip or a git clone method.

I expect it is just a factor that there are other steps to be done to make it the auto download version from the civicrm UI

# Answer
> 2 votes
It does not harm to install extensions manually. Actually that is the way I am using the most.

The auto install requires that an extension developer has submitted his/her extension through a review process and for most extensions developer (like me) that is too much of a hassle and also puts me in the maintainer and supplier role.

---
Tags: drupal, extension, gdpr
---


# Question
Title: Splitting Contributions between Accounts
From time to time, we have contributions that come in which need to be credited to two accounts. How do I split a contribution?

# Answer
1. You could create two contributions, as @ErikH mentioned in a comment.
2. You could create a price set with two fields configured for the two accounts. Then create a contribution using the price set and have two line items, one for each account.

FYI, we expect with a month or so to have a new version of the Line Item Edit extension which will allow you to easily add an additional line item without first defining a priceset. That will allow you to split the contribution between accounts more easily. See https://github.com/JMAConsulting/biz.jmaconsulting.lineitemedit/wiki
> 1 votes

# Answer
CiviCRM doesn't allows splitting of contributions out of the box. However if you are a developer or if you have access to developer resources you could probably develop an extension which does what you need.
> 0 votes

---
Tags: contributions
---


# Question
Title: Why do Activities entered via a webform *not* marked as Completed get entered into Civi as completed?
We're on Civi 4.6.17 and Drupal 7.

I've created a webform with a 'script' for callers with multiple Activities. Activity 1 is to record the results of a phone call asking for an in-person meeting (call is Completed, Left Message, etc) with the 'target' contact. Activity 2 is to record the date, time, subject, status of a successful request for an in-person meeting made on the phone call. Activity 3 is to create a reminder to the caller to send a reminder of the in-person meeting to the 'target' contact by postal mail, e-mail or text messsage.

When callers can (or cannot) reach the target on the phone, then Activity 1 date, time, subject, status is recorded. If the target cannot be reached, the call ends of course. However, even though a date, time, status are not recorded for Activity 2 and Activity 3, both activities are entered as completed in the caller's Activity record, and an e-mail gets sent to the caller (who is Assigned To: the activity)

I have a default subject for Activity 2 and Activity 3. I'll try removing the default subject text, leaving it blank, and see if that is the cause of Activity 2 and Activity 3 being recorded.

My desired outcome is simply for Activity 1 status to be saved and Activity 2 and Activity 3 to not be saved on form submittal if the caller does not talk with the 'target'.

I'm also getting this error message on form submittal which seems to be related: Notice: Undefined index: act in wf\_crm\_webform\_postprocess-\>processActivities() (line 1368 of /var/www/citizenactionny/my.citizenactionny.org/sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc).

# Answer
> 1 votes
If you use a webform condition (part of Drupal webform 4.x), with a question like 'Did you speak with the target?', you could hide the fields for Activities 2 and 3 if the caller enters 'No'. If the fields are hidden based on the condition, they will not process to CiviCRM.

# Answer
> 1 votes
Try exposing the "activity type" field as "user select". On the webform, change that field to a checkbox with just the one activity type as an available option. That allows the user to toggle activity creation on and off. Also for better UX set a conditional rule for the other activity fields to be shown/hidden based on that checkbox.

# Answer
> 0 votes
I am also getting "Notice: Undefined index: act in wf\_crm\_webform\_postprocess-\>processActivities()" but perhaps two years on it's moved to line 1411 (webform\_civicrm 7.x-4.20). The line relates to sending an email to the activity's assignee, specifically to sending attachments (none in my case). I worked around it with the "@" php error control operator, see snippet below.

---
Tags: webform-civicrm, activities
---


# Question
Title: Use case: management of planning / volunteers for a music festival
I'm taking care of the management of volunteers (about 800 people) for a 10-days music festival. I've been using drupal+civicrm for this for about 5 years now. There were some complaints that the way it works is not user friendly (but had to be implemented quickly). We've been looking to replace cicicrm by a commercial product but found out this product can't beat civicrm ;-)

So now I'm looking how I can improve the civicrm setup so everybody is happy! I hope to get some tips ...

I'll try to describe the way we are organised now and how I've set this up in civicrm.

At the festival there are about 50 different workplaces: bars, stage, backstage, toilets, foodstands, ... Each workplace has one or more responsibles. Volunteers can work on multiple workplaces. The workplace responsible must be able to manage the data of people working for him / her only. (So not of the other people) Currently this is setup using groups and giving access rights on groups. Disadvantage of this is that when a responsible adds a new volunteer but forgets to assign a group (or assigns the wrong group) he cannot acces the data anymore.

One of the most important parts is creating a planning of who will work in which place on a certain day and creating reports / lists. I've done this now using custom fields for the contacts and creating many reports using drupal views but this is a lot of manual work each year. I was wondering if using civievents would be more appropriate?

Ideally each volunteer would also be able to manage his/her own data (such as address, indicate when he/she's able to work, ...)

Any suggestions on the optimal way to implement this?

# Answer
I would recommend using the CiviVolunteer extension: https://civicrm.org/extensions/civivolunteer. We have one customer that uses this extension to manage the volunteerd planning for a big event.
> 1 votes

# Answer
Another approach (esp as you are on Drupal) would be to consider using permissioned relationships as your method of connecting entities together.

Eg John is Manager for Backstage (an Org type contact). Jenny and Joe are volunteers via a relationship to Backstage.

By using Fuzion's extension you can therefore give John permission to see Jenny and Joe.

If jenny also volunteers for Toilets, then Teddy the Toilet manager will also have access to her record.

All of this can easily be cooked up using webforms and views so most users don't even need to go 'in' to civicrm itself.

Get in touch if this approach sounds useful if you need more of a walk through. Good luck
> 0 votes

---
Tags: civievent, contacts, groups, civivolunteer
---


# Question
Title: Missing wordpress civivolunteer commendation table
We have wordpress 4.9.4 and civi volunteer 4.7.21-2.2.3

When someone makes a contribution or joins as a member, we get a missing table database error (from the error log): Table 'vahcrm.civicrm\_value\_volunteer\_commendation\_7' doesn't exist

This error occurs after the transaction goes through and civi tries to update the database and the user gets the error: Failed to update contribution in database

When we try to renew a membership, we get (from the error log): Table 'vahcrm.civicrm\_value\_civivolunteer\_5' doesn't exist

A little background....I'm a volunteer for a non-profit. The previous web/civi admin person moved everything to a new site, broke the site into a multi-site configuration without fully setting everything up, and then quit. I came to the civi problems having only heard the word civi before. I would appreciate ANY help I can get to figure this out.

How do I go about finding and fixing this problem?

# Answer
> 1 votes
What might help in such situations is to disable, uninstall the extension and then install it again in the hope it will create the missing fields and tables.

It is a good idea to make a backup before you disable the extension because there is a high risk of losing data.

# Answer
> 0 votes
If you are new to CiviCRM and facing a partially configured, broken multi-site configuration I'd recommend you find a Partner to help you. (Disclosure: I'm one of them - there are many others!).

You need someone to review your current configuration, understand what is broken/incomplete and then come up with a plan to fix it. That is beyond the scope of what can reasonably be achieved through SE.

---
Tags: wordpress, civicontribute, civivolunteer, multisite
---


title: Clickatell SMS Troublshooting

text:
# Question
Title: Clickatell SMS Troublshooting
I'm runnning the bitnami image on Google cloud (5.0.1), trying to get sms reminders working.

Provider Account is set up and tested, extension installed and configured, but when I send a test sms it is reported as delivered by Civi, but it's not, and nothing appears in the providers reporting either, so I assume there has been no actual communication with the gateway.

How can I troubleshoot this? Does the extension work with 5.1?

# Answer
Aha, nothing wrong with either extension, after some time I finally noticed the timezone mismatch with the server
> 2 votes

---
Tags: civisms
---


title: Cron breaks after upgrading PHP

text:
# Question
Title: Cron breaks after upgrading PHP
I'm running CiviCRM 4.5.5, Having recently upgraded to WordPress 4.9.5 and PHP 5.6 (mailing was flawless just prior to this). Latest scheduled mailing failed to initiate, and a URL method test of cron.php generated the following error:

Parse error: syntax error, unexpected 'clone' (T\_CLONE), expecting '(' in /.../wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(207) : eval()'d code on line 1

Is there any simple way to fix this? (After the time it took to set CiviCRM up several years ago, I'm reluctant to upgrade--I'm a volunteer, not a tech.)

# Answer
> 4 votes
As PHP develops, some code that used to work in older versions fails in newer versions. The CiviCRM code gets updated to accommodate those changes - but obviously if you don't upgrade you don't get those fixes.

Your fix is to downgrade the version of PHP, then upgrade CiviCRM, then upgrade PHP again. You can find a table of supported PHP vs CiviCRM versions in the Administration Guide

If you need help upgrading see Find an Expert (including me!)

# Answer
> 2 votes
Chris (OP) here. I opted to go with a fresh site, latest version install (PHP 7.1, WP 7.9.6, CiviCRM 5.1.2). Cron still not functioning, so I decided to go with Easycron rather than waste more days of my life. Thanks for your input though guys :)

# Answer
> 1 votes
The problem is a library included in CiviCRM doesn't work with your new PHP version.

I expect you may be able to successfully upgrade Civi without first downgrading PHP, so try that. If you get errors, then follow @Aidan's advice and downgrade PHP, upgrade CiviCRM, then upgrade PHP again.

Note that you can often install a second version of PHP on the same system and switch between them.

---
Tags: php, cron
---


# Question
Title: Smart Group Features Extension to Memberships, Events, Contributions, Activities,
I have a lot of Organisations, each having their own Administrator(s) who manage their own memberships, events, contributions, activities, ... (that I predefine for them)

I would like those Administrators to be able to make "Multiple Updates" to those (e.g. payments by checks) ; but I don't want them, for security reasons, to use the standard Search features to do that.

As far as I know (am I wrong ?), there is currently no possibility to predefine and store Searches, except for Contacts, via Smart Groups.

My idea would be : since we have the same search possibilities for members, participants, contributions, activities, ..., as for Contacts, it should not be too costly to develop the ability to extend the Smart Group features (including Multiple Update) to those.

What is the best way to have this ability developped (I am not personally a programmer) ?

---

**Edited May 25 to give an example :**

I have defined an Event with an associated Contribution Page.

People register on line (Webform) and pay either on line or by check.

When I receive the checks, I want to record them to manage the Event balance :

* I Search for Contributions, based on the Contribution Page + Pending Status :
* In the contacts List, I then select those who have sent their check and I select Action \> Update multiple Contributions :

* Then I select a Contribution Profile which contains Total Amount, Payment mode (check or cash), check #, status :

* I can then record all the checks that I have received

I would use the same process to update memberships custom fields (Search for memberships + Membership Profile, instead of Contribution) or for Event or Activities.

I can make those Searches because I am the general Administrator, but I don't want my organizations Administrators to have this permission : too dangerous and uneasy : this is why I ask for this Search storage (in the form of Groups), that I could predefine for them.

# Answer
> 1 votes
If you are using Drupal then I would consider building Views and Webforms to give you the flexibility you need without sending users deeply in to civicrm itself. If that sounds useful then get in touch for a more fleshed out explanation.

# Answer
> 0 votes
There are different ways to accomplish this. The first way is setup ACL's. ACL are used to define what a user (in your case Administrator) may see. That way you can allow them to only see a certain group of contacts.

When you are using ACL's the search and reporting works as expected and will only show the contacts the user is allowed to see. You can then still use the batch and profile editting options.

# Answer
> 0 votes
If you need permission based access so A can access other contacts related to B then the Permissioned Relationships module by Fuzion might be worth looking at

---
Tags: civievent, civimember, contributions, activities, smartgroups
---


title: GDPR extension Captcha

text:
# Question
Title: GDPR extension Captcha
It appears that Google Captcha does not seem to work with the GDPR extension.

I have a fully working setup using profiles as normal on site - which can be seen here

https://peoples-press.com/index.php?option=com\_civicrm&task=civicrm/profile/create&gid=57

However, on this form,

https://peoples-press.com/index.php?option=com\_civicrm&task=civicrm/gdpr/comms-prefs/update

I have captcha activated but it does not show on form. If I click Save then it alerts me to complete Captcha despite it not being possible. Form works fine if I deactivate Captcha.

Joomla 3.8.7 and Civicrm 5.1

# Answer
Quick update, we're releasing a new version which has the ability to include captcha. It will be available from tommorrow (v2.6).
> 1 votes

---
Tags: gdpr
---


# Question
Title: https://civicrm.org/extensions/areas causing error
Upon installing the extension and then changing the settings so that 'Collapse this set on initial display' and 'Collapse this set in Advanced Search' are marked with yes, the follow warning of "Custom group 'Areas' already exists in Database' appears. How do I fix this error? We're using Civi 5.0.0

# Answer
This sounds like a civicrm bug. I have tried locally and have the same error.

I found a work around: you can give the custom group a different title (the title Areas is also used for another group which is reserved).

I have created a bug report: https://lab.civicrm.org/dev/core/issues/141
> 1 votes

---
Tags: extension
---


# Question
Title: How do I configure Webform and CiviCRM for event registration including optional donation
When setting up an Event Registration plus optional donation using Drupal's webform/Civi integration module, is it better to set the Contribution Page to Donation or Event Fee?

# Answer
I understand what you’re trying to do.

Try set it to Donation. That will make your Contribution level financial type = Donation - but looking at the lineItems within that you should see two lineItems: 1) Financial Type associated with the CiviCRM Event Page for the Event monies and 2) the Financial type Donation for the extras;

That’s how it works for Memberships and top-up optional Donations (for sure - doing that on a number of projects). The Financial Type for the Member $ is what is defined in the Membership Type Config settings.

If this does not work like that for Event registrations - I think it should (it should pull the Financial Type from the Event config); One should be able to have one Contribution with three lineItems - each with a different financial type:

* Member Dues
* Donation
* Event Fees

The first two in combo are working for sure. I’ve not yet tried other combinations.

Keep me posted on what you find.
> 1 votes

# Answer
As Jon mentioned you are referring to the financial type of the contribution. A financial type is a way to categorise contributions. Default CiviCRM comes with Donation,Event Fee, Contribution, Campaign contribution. But you are free to define your own financial types.

Which financial types you need depends on the context in which you are using CiviCRM. I know organisations where the Event Fee is good enough but I also know organisations where they make a difference between several events and also want those differences being reflected in their financial reporting.

So to answer the question, I cannot decide for your which one is better for you.
> 0 votes

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


# Question
Title: Where should I convert the birth_date string to a Date object?
My angular module resolve object:

```
        resolve: {
      myContact: function(crmApi) {
         return crmApi('Contact', 'getsingle', {
             //id: 'user_contact_id',
             id: 43,
          return: ['first_name', 'last_name', 'middle_name', 'birth_date', 'gender_id']
        });
      }
    }

```

Which I am trying to bind to

```
            <input type="date"
          crm-ui-id="tournamentForm.birth_date"
          name="birth_date"
          ng-model="myContact.birth_date"
          placeholder="yyyy-MM-dd"
          min="1930-01-01"
          max="2029-12-31"
          />

```

Results in this error from angular:

```
Error: [ngModel:datefmt] Expected `1972-05-11` to be a date

```

Where should I (what's the best practice for) convert the string to a Date object?

# Answer
> 3 votes
Angular example using the same options with data model binding:

https://docs.civicrm.org/dev/en/latest/framework/ui/#date-picker

---
Tags: api
---


# Question
Title: is there a way to share an event post to facebook or mailchimp?
I understand there is a way to share an event post directly to our fb page or mailchimp content. is that done through civicrm?

thank you.

# Answer
> 1 votes
In CiviCRM you can create events and manage (registered) participants at an event. CiviCRM also provides an online registration form for events.

You can use the link to the public information page and the online registration form in a mail send from mailchimp or in a message on facebook. As far as I know there is no automatic way of doing this.

If you want more information also take a look at the user guide of CiviCRM: https://docs.civicrm.org/user/en/latest/events/what-is-civievent/

---
Tags: wordpress, civievent
---


# Question
Title: Manual contribution, add contact that is not found
While adding a contribution manually, the first step is to find a contact. If the contact is not found, I remember being able to select 'new contact' from the bottom of the autocomplete list. As at 4.7.25 is it possible to add a contact from the contribution page or do we need to move to 'new individual' if the contact is not found while taking payments?

# Answer
It does show up the link to create contact when no match is found.

From your shared image it looks like the user has limited permission to create contact/access CiviCRM profile or also check if 'New Individual' Profile is enabled under Reserved profiles.
> 4 votes

# Answer
"is it possible to add a contact from the contribution page"

Yes, when you visit the Contribution page select the 'want to do this as a different person' eg from http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1 or just bookmark the link http://dmaster.demo.civicrm.org/civicrm/contribute/transact?cid=0&reset=1&id=1

the important bit is the cid=0

Then you can fill out the Contribution Page as anonymous and use that approach to create the Contact.

If this isn't a useful Answer then I really haven't understood your question.
> 0 votes

---
Tags: contributions
---


title: Civicrm Entity & Drupal 8

text:
# Question
Title: Civicrm Entity & Drupal 8
I have begun working on structuring a franchise type educational site and we are going with CiviCRM and Drupal. However, we wanted to go with drupal 8 since we are starting fresh with a complete overhaul.

The reason I am writing, is I came across the civicrm Entity module, and from descriptions looks very promising to connect the needs of civi and our Drupal aspects of the project. I wanted to ask though, how far along is that 8.x version? And is it ok to use?.... we are having some issue currently....

I did install the dev module that is up on https://www.drupal.org/project/civicrm\_entity , however, I think something isn’t working as while I can place a civi field in a content type as entity reference, and I can add content and the reference loads in the form and can be selected, once saved however, all it shows is a “restricted access” text with (id) in the field, and when viewing published version that content item that field/reference does not show.

Also, I do not see the CiviCRM Entity types under the Drupal STRUCTURE admin area, but from some of the screen shots in blog documentation I saw this should be there for management options too….

We currently have all other modules and civi working with drupal 8, and this is our last critical piece of the puzzle. Unfortunately, while I am comfortable working with drupal, I do not have a code background so couldn’t dig into this.

Is there more to activating this module than doing through main drupal admin panel, or maybe it should have been done via composer? Any insight anyone can provide would be MUCH appreciated on helping me getting civi Entity going & connected!

# Answer
> 4 votes
There is still work to be done to get this firing fully - and you many need to reach out to some of the Partners to help get things working sufficiently for your scenario. There are a number that have done a bunch of work in this area.

There are some other Drupal tools that aren't fully firing with civicrm, ones that we use in pretty much every development as they are so helpful in bending the laws of the civi universe - eg Webform\_civicrm and Views integration.

There has been a recent push on the webform side of things, and the plan for Views is to step fully in to tieing it in with Civicrm\_entity.

You may find you want to join both https://chat.civicrm.org/civicrm/channels/civicrm-entity and https://chat.civicrm.org/civicrm/channels/drupal which is where most of the active discussions are taking place.

---
Tags: civicrm-entity, drupal-8
---


title: Bounce Handling with Amazon SES/SNS

text:
# Question
Title: Bounce Handling with Amazon SES/SNS
I have a setup with CiviCRM and Amazon SES, everything is working fine.

A Problem arises with the bounce handling. Amazon can either do that internally via Amazon SNS, or just forward the mails to your domain for common handling (Catchall or VERP).

I wanted to use the SNS mechanism, and amazon sends the mail correctly to the specified address, but the email isn't a typical bounce mail, but instead the original headers are JSON encoded like this:

```
{   "notificationType": "Bounce",   "bounce": {
    "bounceType": "Permanent",
    "bounceSubType": "General",
    "bouncedRecipients": [{
      "emailAddress": "bounce@simulator.amazonses.com",
      "action": "failed",
      "status": "5.1.1",
      "diagnosticCode": "smtp; 550 5.1.1 user unknown"
    }],
    "timestamp": "2017-11-20T11:05:06.477Z",
    "feedbackId": "0102015fd91a6479-ae22395c-1f7d-4423-a9e5-e0715bffc731-000000",
    "remoteMtaIp": "1.2.3.4",
    "reportingMTA": "dsn; a4-8.smtp-out.eu-west-1.amazonses.com"   },   "mail": {
    "timestamp": "2017-11-20T11:05:04.000Z",
    "source": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com",
    "sourceArn": "ARN_INTERNAL:identity/example.com",
    "sourceIp": "1.2.3.4",
    "sendingAccountId": "__ID__",
    "messageId": "0102015fd91a5ca3-93c245fe-e333-46ae-8fed-96160d20cfab-000000",
    "destination": ["bounce@simulator.amazonses.com"],
    "headersTruncated": false,
    "headers": [{
      "name": "Received",
      "value": "from crm.example.com (mx02.example.com [1.2.3.4]) by email-smtp.amazonaws.com with SMTP (SimpleEmailService-2638500019) id MbY8b9mKuaex7LdPcwd8 for bounce@simulator.amazonses.com; Mon, 20 Nov 2017 11:05:04 +0000 (UTC)"
    }, {
      "name": "MIME-Version",
      "value": "1.0"
    }, {
      "name": "Content-Type",
      "value": "multipart/alternative; boundary=\"=_99c8dccfc484a99b0f6101141a34c4ae\""
    }, {
      "name": "Reply-To",
      "value": "\"Example Company\" <info@example.com>"
    }, {
      "name": "Return-Path",
      "value": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com"
    }, {
      "name": "From",
      "value": "\"Example Company\" <info@example.com>"
    }, {
      "name": "Subject",
      "value": "Bounce Test – Monday 4"
    }, {
      "name": "List-Unsubscribe",
      "value": "<mailto:bounce.crm+u.83.52.2a7c92a4101dd5fd@example.com>"
    }, {
      "name": "job_id",
      "value": "83"
    }, {
      "name": "To",
      "value": "Tom TestUser <bounce@simulator.amazonses.com>"
    }, {
      "name": "Precedence",
      "value": "bulk"
    }, {
      "name": "X-CiviMail-Bounce",
      "value": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com"
    }, {
      "name": "Date",
      "value": "Mon, 20 Nov 2017 12:05:04 +0100"
    }],
    "commonHeaders": {
      "returnPath": "bounce.crm+b.83.52.2a7c92a4101dd5fd@example.com",
      "from": ["Example Company <info@example.com>"],
      "replyTo": ["Example Company <info@example.com>"],
      "date": "Mon, 20 Nov 2017 12:05:04 +0100",
      "to": ["Tom TestUser <bounce@simulator.amazonses.com>"],
      "subject": "Bounce Test – Monday 4"
    }   } }

```

Civi cannot handle this type of message (to the best of my knowledge) and it is then moved to the ignored folder. I'm pretty sure I am not the first one to have this problem, but I couldn't find any solutions to this. Maybe someone has written a parser for those type of messages already?

Help/Suggestions are welcome!

# Answer
> 3 votes
I've created an extension to handle bounces through Amazon SNS notifications, see civicrm-ses.

It exposes a webhook to process SNS notifications and map and create bounces when appropriate.

Hope you find it useful.

**PS**: although the extension is in `alpha` stage, I've been using it in production for a month (~60,000 emails processed), test in a dev environment first if you like :)

---
Tags: email, bounce, amazon-ses
---


title: List of mailings with public view

text:
# Question
Title: List of mailings with public view
I can't seem to find any info on this so don't know if it exists! I would like to create a page that provides a list of all recent mailings from civiMail but with just their public view behind the link. Is there something like that? Running CiviCRM 4.7.29 and Wordpress 4.9.5.

Thanks Norm

# Answer
So I solved this problem by using the Wordpress plugin called Postie. I added the email account associated with the plugin to the group I send the emails too, and voila, it now lists them out in their full html glory.

This was pretty easy to set up and most people should be able to do it.

Norm
> 5 votes

# Answer
List of mailings are not directly available for anonymous or authentic user with limited permission. However you can have it available in one of the 2 ways

1. Using Public Mailing Archive extension(You will need to tweak code to work as per your requirements for example this extension list Mailings using Mailing subject, change the variable in tpl file to use Mailing name)
2. Create copy of Mailing Summary report and give access to Anonymous user. (I would create an extension that will add a special permission and use hook to alter the link of Mailing Name to use mailing view link).

HTH

Pradeep
> 7 votes

---
Tags: civimail
---


# Question
Title: Setting up rule to link CiviCRM contact (created when webform is submitted) with Drupal 7 account
I have configured the rules same as in Setting up rule to link CiviCRM contact with Drupal 7 account it creates a drupal user if contact is created or updated in CiviCRM. But it doesn't get fired if the contact is created in CIviCRM through webform submission. It ends up with an error-"Cannot create user, email: invalid!!".Any help would be really appreciated.Thanks in advance!

# Answer
> 2 votes
You may need to add your rule here. The one by Christia is specifically about "updating a contact record in the CiviCRM" not about creating.

The only way we have made rules work for creation from webform is to add eg a Tag to the contact and then run the trigger off that. You need civicrm\_entity.

This is cross-posted from the Drupal SE. Here is an example Rule you may be able to glean things from. It also auto logs in the contact.

```
{ "rules_self_create_user_account_and_login" : {
    "LABEL" : "Create User Account",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "civicrm", "rules" ],
    "ON" : { "civicrm_entity_tag_create" : [] },
    "IF" : [
      { "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ] } },
      { "data_is" : {
          "data" : [ "civicrm-entity-tag:entity-table" ],
          "value" : "civicrm_contact"
        }
      },
      { "data_is" : { "data" : [ "civicrm-entity-tag:tag-id" ], "value" : "525" } }
    ],
    "DO" : [
      { "civicrm_entity_action_create_user" : {
          "USING" : {
            "civicrm_contact" : [ "civicrm-entity-tag:entity-id-contact" ],
            "is_active" : "1",
            "notify" : "1",
            "signin" : "1",
            "username_format" : "email"
          },
          "PROVIDE" : { "civicrm_user" : { "civicrm_user" : "Created Drupal User" } }
        }
      },
      { "redirect" : { "url" : "civicrm\/user?reset=1" } }
    ]
  }
}

```

You need to Add a new Tag - note the ID of that tag - change the exported Rule to the Tag you created for this purpose. Then also alter your webform so it adds that Tag automatically to the contact upon form submission

# Answer
> 1 votes
Here's an example Rule for Creating a user after a Webform CiviCRM submission; For the Event we're creating a helper Membership (we're really just Registering people to ride their bikes in an Event) - but the Membership gives us a nice Event to trigger on;

Using CiviMember to automatically create a Drupal user

---
Tags: contacts, webform-civicrm, drupal-rules
---


# Question
Title: Import Contacts creating dupes despite dedupe rules
We are currently updating a member database with returning and new students/contacts. In the past we have been able to import lists updating the returning students, but now new duplicate records are being created for each of our returning students. I have tried importing using several dedupe rules (including ones that worked in prior years) and also selecting update and skip, but still get duplicates.

What am I missing? Since last year, I have udpated WordPress, CiviCRM and PHP, but I don't know if that could cause this sort of problem. Any suggestions are welcome.

CiviCRM 4.7.31 Wordpress 4.9.6 PHP 7.1

# Answer
> 2 votes
Easiest way is just to use the Contact ID if it is in your file.

Are you importing to the same location type? It does not dedupe a given data point if importing on a different location type.

I've noticed that you must set your desired dedupe rule to be unsupervised. Selecting a rule that is not marked unsupervised hasn't worked lately and is probably a bug.

I believe this is related Import Contacts with dedupe rules

---
Tags: import, duplicate-contacts
---


# Question
Title: How should I copy a site from production to staging?
I think the procedures on migrating a site at https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location are out of date. They certainly don't reflect how we at JMA migrate sites from production to staging in 2016. For example, we don't create a fresh install of CiviCRM, and instead pull the source code from git and copy the dbs. We also use various techniques to prevent staging, dev and local test sites from sending out emails, which are not included the recipe.

So: what is a good recipe for migrating a production site to a staging instance?

# Answer
> 13 votes
Many of the steps documented on the "Migrating a site" wiki page are handled automatically now. Here's my recipe, which is far from perfect, but is much closer.

* Copy the entire filesystem to the staging server. Git works well for this, but when it's not an option, we'll use SFTP or create a tarball.
* Dump the database using `mysqldump`, either directly or using `drush civicrm-sql-dump` or `wp-cli cv sql-dump`. Copy the db dump to the staging server. We don't use git for this because of the database size; we either use `drush sql-sync` or copy it manually.
* Assuming a manual database dump copy, we need to remove the trigger definers - unless the MySQL username is identical on both production and staging. I use `sed -i -e 's:/\*\!50017.*\*/::g'`.
* Load the database into MySQL on the staging server.

Assuming this is not the first time we set up the server, we're done! On first time setup, there are a few other things we need to do:

* Replace all the usernames, passwords, paths, etc. in `settings.php`, `civicrm.settings.php`, and/or `wp-config.php` with the values appropriate to the staging server. If using git, these files are ignored in git, only local copies exist.
* There are a number of values we override in `civicrm.settings.php` on the staging server to use the appropriate paths. Here's what I put in mine, directly below the `<?php` marker:

.

```
global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['allowPermDeleteFinancial'] = 1;
$civicrm_setting['Directory Preferences']['customTemplateDir'] = '/home/jon/local/example/wp-content/civicrm/templates';
$civicrm_setting['Directory Preferences']['customPHPPathDir'] = '/home/jon/local/example/wp-content/civicrm';
$civicrm_setting['Directory Preferences']['extensionsDir'] = '/home/jon/local/example/wp-content/civicrm/extensions';
$civicrm_setting['URL Preferences']['extensionsURL'] = 'http://example.local/civicrm/extensions/';
$civicrm_setting['URL Preferences']['imageUploadURL'] = 'http://example.local/wp-content/plugins/files/civicrm/persist/contribute/';
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://example.local/wp-content/plugins/civicrm/civicrm';

```

In Wordpress, we also need to add a few overrides to `wp-config.php`. Some of these may be overkill but: `define('WP_HOME','http://example.local');
define('WP_SITEURL','http://example.local');
define('RELOCATE',true);` Finally, if this is a multi-site Wordpress, we need to do a search and replace of the database for the URL. We do this with `wp-cli search-replace https://oldsite.com https://newsite.com` but this tool also does the trick.

# Answer
> 1 votes
Thanks to Jon G and alec for this answer that mostly works for me.

Just a detail on the sed expression that was not working out of the box for me, I use:

```
sed -e 's:/\*\!50017[^*]*\*/::g' <DUMP_ORIG> > <NEW_DUMP>

```

The `/*!50017 ...*/` is in the middle of a long line that define other stuff related to triggers that I want to keep. This modified regex ensure that I remove **only** this `/*!50017 ... */` and not the whole comment.

# Answer
> 0 votes
Steps to migrate site having CiviCRM from prod to staging:

1. Take SQL dump of your CMS database and if civicrm is using a different database than CMS (which in most cases people does that), take sqldump of civicrm database too
2. Copy codebase over to staging server
3. Create a new database for your CMS and civicrm (if civicrm on prod was using different DB than of CMS) on staging server
4. Load both databases with dumps you took in #1
5. Update CMS DB config file (drupal = settings.php || Wordpress = wp-config.php) to match correct database credentials
6. Update civicrm\_settings.php file to match correct database credentials
7. Update civicrm\_settings.php file for correct CIVICRM\_UF\_BASEURL and civicrm\_root variables

---
Tags: migration
---


# Question
Title: Unable to Upgrade from CiviCRM 4.6.16 to 4.7 (Wordpress)
When attempting to upgrade from CiviCRM 4.6.16 to any of the 4.7 releases, I receive the following error message:

Error: Migrate "on behalf of" information to module\_data

Debug info says: "Unknown column 'for\_organization' in 'field\_list'

This is the first time I've encountered any issues during the upgrade process. I have been using CiviCRM since version 4.4.

Screenshot is below. Thank you for your help! Darron

# Answer
Problem is old field was lost in the upgrade. Try updating this file:

CRM/Upgrade/Incremental/php/FourSeven.php

with code at this GIT pull request.

This post here explains it in more detail.
> 1 votes

---
Tags: wordpress, upgrade, 4.7
---


# Question
Title: Which Drupal permissions does a user need in order to see and change their relatives (contacts with permissioned relationships) in webform?
I have a webform which users use to register themselves and their family members for events. If users have a login, it automatically populates their family members, who are contacts with permissioned relationships to the user, and all they have to do is select which events they are registering for this time.

Recently, most of my users are not having their families pre-populate, even though they do have family members, properly relationshiped and permissioned in the system. It works perfectly for anyone with admin privileges, but in this case I want most users to only see their spouses and children.

**Which permissions do I need to give them?**

I'm using Drupal 7.43, CiviCRM 4.6.18, Webform 7.x-4.12, and Webform Civicrm Integration 7.x-4.15+27-dev

Below are my current settings:

EDIT: I have now read this documentation, which makes me wonder whether my question should be about the CiviCRM ACL permissions instead, but I don't see how to do that either. https://docs.civicrm.org/user/en/4.6/initial-set-up/permissions-and-access-control/

# Answer
> 2 votes
You're looking for the Relationship Permissions as ACL extension.

# Answer
> -1 votes
Try setting CiviCRM: access Contact Dashboard for authenticated users.

---
Tags: drupal, webform-civicrm, permissions, acl, user-account
---


# Question
Title: Transactional Email Compatible with CiviCRM (Not Sendgrid)
We started having trouble with mass mailings at the start of 2018. CiviCRM's tracking did not yield helpful information: mailing reports state 100% of emails were delivered, and I knew this to be inaccurate.

I set up Sendgrid, and for first four months had excellent delivery rates. In May, 14% of our emails were blocked. After a lot of conversations with Sendgrid support, it turns out this is because others on our shared IP have spammy practices.

the price to solve this is to have a dedicated IP at $80/month. This is steep for us, like other many CiviCRM users, we are a very small nonprofit. (also, I resent being extorted. We chose a plan because of how many emails we send; had I been informed that we would receive poor service at that price, I would have made a different choice.)

But looking around, I do not see other email platforms that are as easily compatible with CiviCRM. SendinBlue, for instance, has plugins for CMSs, but not CRMs.

Does anyone have a good experience with a transactional email service? Or suggestions on how to see more accurate tracking from CiviCRM?

# Answer
> 1 votes
I've had a good experience using SparkPost and MailJet for both transactional and CiviMail use.

SparkPost extension: https://civicrm.org/extensions/sparkpost-civicrm-integration

MailJet extension: https://github.com/compucorp/uk.co.compucorp.civicrm.mailjet Though note, this is old code for version 4.4 and needed a change to get it working in a 4.6 install where I used it. Off the top of my head a core Mailing file was overwritten by the extension but it doesn't need to be to work in 4.6.

# Answer
> 0 votes
I want to add that from my perspective if you find a good service but integration with CiviCRM is lacking you have two options:

1. You either start making this integration yourself, or pay someone to make it for you. You then share what you have made
2. Or you stick with the options which are working for the moment. Which @oskylark has helped you with.

---
Tags: mailing
---


# Question
Title: Email-to-activity processing – can't create subfolders of the inbox
When setting up a Civi site for a client, I turned on email-to-activity processing. When you do this, Civi tries to set up two folders ('CiviMail/ignored' and 'CiviMail/processed') as subfolders of the inbox folder. However, the mail server doesn't support this, and puts them in a different place in the folder hierarchy (on the same level as the inbox).

I've patched this for now but it doesn't seem like a good long-term solution. Has any one else run into this? Any ideas on how I might deal with it in a longer-term way? Seems like something that would be good to make configurable.

(The relevant code in Civi is in CRM/Mailing/MailStore/Imap.php)

# Answer
> 2 votes
You can aslo create an issue on https://lab.civicrm.org/dev/core/issues and then send a Pull Request on GitHub.

# Answer
> 1 votes
When you say "doesn't support this", it sounds like it isn't returning an error(?), so it might be that the hierarchy separator isn't being determined correctly. Also I've seen some imap servers are case sensitive or just picky, so INBOX might be treated differently from Inbox when you specify the prefix.

Which imap server brand is it? Besides playing a bit with the Source settings on the Mail Account page where you set it up, try to confirm what the separator is (can put some debug code in the same place you've linked to see what it's returning from getHierarchyDelimiter()).

---
Tags: email
---


# Question
Title: Mailchimp Extension - not recognising API key
I've installed mailchimp on a site (drupal 7.59, civi 4.6.33)

I have Created an API key in Mailchimp Copy/pasted API key to mailchimp settings in CiviCRM

And on clicking save/test get the following message

Could not use the Mailchimp API - API Key required. You will see this message If you have not yet configured your Mailchimp acccount.

Anyone else had this issue? Which blindingly obvious step have I missed out?

# Answer
> 1 votes
Looked on the github issues column and found this

https://github.com/veda-consulting/uk.co.vedaconsulting.mailchimp/issues/300

Latest version of mailchimp extension (2.0.1) not necessarily compatible with civi 4.6

---
Tags: mailchimp
---


# Question
Title: Minimum permission set to enable Manage Contribution Pages?
What is the minimum set of permissions that I need to grant to a user to allow him to access 'Manage Contribution Pages'? The only permission that seems to grant access to this page is 'administer CiviCRM', but that then enables administration of essentially the entire application.

Thank you.

# Answer
Administer CiviCRM includes administering Contribution pages. You can create a role for administering the CRM (such as editor) and then actually restrict menu items to that same role so that they don't have easy access to everything else. However, it would be pretty hard to make a contribution page without being able to access nearly all the other settings.

Managing the contribution pages is a higher function.
> 2 votes

# Answer
In order to create/edit contribution pages you will need to give `CiviCRM: access CiviCRM` permission but that will also give them ability to control almost all of the backend. In order to give them ability to record backend contributions (with edit contributions) and view all contributions (for visible contacts), you can give them `CiviContribute: access CiviContribute` permission.
> 0 votes

---
Tags: permissions
---


# Question
Title: The action Remove contact from group not working in Civirules
I'm using CiviCRM 4.7.23 version.Using civirules, For the trigger-"Contact of any type is restored" , Action -"Remove contact from group" .If any contact is restored from trash, it should be removed from the group.This is not working for me. The contact is not removed from the group. Any help?

# Answer
> 1 votes
Updating the latest version of CiviRules will fix this. This bug has been fixed two weeks ago.

---
Tags: civirules
---


# Question
Title: Am i able to do a search for duplicates in the database?
If I am looking to clean up my database can I do a mass search for duplicates? save the file and at a later date work on merging?

# Answer
Yes - go to **Contacts menu » Find and Merge Duplicate Contacts**. There is dedupe documentation available.

The tricky question is, "What represents a duplicate contact?". For some organizations, two contacts with the same record might be a duplicate; for others, that's not enough to determine if it's a duplicate.

So while the Using rules and merging duplicate contacts manually section of the documentation might be all you need (e.g. if you can use the built-in "match on emails only" rule), you may need to read the rest to tell CiviCRM what constitutes a duplicate for your organization.
> 7 votes

# Answer
There is also the Extended Contact Matcher extension which could be used to match duplicates. This extension is more enhanced than the default dedupe functionality.
> 1 votes

---
Tags: duplicate-contacts
---


# Question
Title: Anonymous users can't View details of a Contact in a public directory Listing
Currently on CiviCRM 5.1.2 / WordPress 4.9.6 in my dev site and on my Live site on CiviCRM 5.0.2 / WordPress 4.9.6. The reason for the CiviCRM difference was it was my last attempt to see the cause of a behavior I'm seeing:

**Problem:** *Anonymous users are not able to View the details of a contact that is in our public directory listing.*
**Scenarios:**

* *When an anonymous user clicks 'View' they are redirected to the home page.*
* *For ANY logged in user it will show the details of the contact selected.*

**Expectation:** We are wanting even anonymous users to be able to see the details of the directory.

---

**Things that have been checked:**

1. I have looked for any errors during the timeframe in the Log files located in:

> wp-content/uploads/civicrm/ConfigAndLog

and

> ../wp-content/error.log

2. Checked the permission of the Profile that is being used for the directory Listing and detail View.

* ***Used For*** option has ***Standalone Form or Directory*** and ***Search Views*** checked
    * The group, ***Hub Directory of Organizations***, is selected as the Limit listing group.
    * ***No account creation option***, ***Issue warning and do not save selected***, ***No Proximity*** search and ***Enable mapping for this profile*** is selected
    * All fields are set to either ***Expose Publicly*** or ***Expose Publicly and for Listings***
    * As one test I had all fields set to ***View Only*** to no avail
3. Changed the permission on the limit listing group, ***Hub Directory of Organizations***, and its parent group from ***User and User Admin Only*** to ***Expose Publicly*** to see if it made a difference. No avail.
4. Checked WordPress / CiviCRM permission access to make sure the following were checked: ***Access\_all\_custom\_data***, ***access\_contact\_reference\_fields***, ***access\_uploaded\_files***, ***profile\_listings***, ***profile\_listings\_and\_forms*** and ***profile\_view***. At one point I tried ***view\_all\_contacts***, but to no avail.
5. Disabled any new extensions and the one that wrote for special formatting of my directory to see if it was affecting the permissions or access. Did not fix.

What else should I check for? A combination of things to be checked together?

# Answer
It is not possible to expose contacts to anonymous users.

The only place where this is possible is with registered participants for an event because you could create a public participant listing.

The other way to expose data to anonymous users to use a module from your CMS. In Drupal you could use the views module, and in Wordpress you can show a profile list on a wordpress page.
> 3 votes

---
Tags: wordpress, profile, permissions, directory
---


# Question
Title: CiviCRM installation page is blank on Wordpress
I am trying to install CiviCRM in Wordpress.

The upload and activation of the plugin worked fine.

Issue is now using this URL `/wp-admin/options-general.php?page=civicrm-install` to complete the installation is failing.

All I am getting is a blank screen. I've checked the Safari console via "inspect element" and there are no error messages.

# Answer
Did you follow the instructions from the administrator manual? https://docs.civicrm.org/sysadmin/en/latest/install/wordpress
> 1 votes

---
Tags: wordpress, installation
---


# Question
Title: Large Text Fields Not Writing in Database
We've discovered what seems to be a bug creating large text fields from CiviCRM Custom Fields. I hope I'm able to explain this well enough.

Relevant environment information: \- Drupal 7.59 \- CiviCRM 5.1.0 and then 5.1.2 \- PHP 5.5.9 (not recommended but supported) \- Webform and Webform CiviCRM modules for Drupal enabled

And the steps we took: 1. Create custom fields of type text associated with a contact. Give it a very large database size, something like 6000. I haven't confirmed exactly at what point is too large, but 6000 definitely was.

2. Create a webform on the Drupal side with CiviCRM processing enabled. Make contact 1 for CiviCRM processing able to show the large field and also accepting existing contacts. Edit the webform field for the existing contact so it is a dropdown select (just for easier testing).
3. Fill out the form once to create a contact, filling in that field.
4. Go back to the form and select the existing contact to be the one you created. The field does not auto-populate.
5. Alternate way to test this is to go to the form with the parameter ?cid=\[id\] added to the URL, which will show errors on the screen about the field not existing.

==== After investigation, we discovered that the root of the problem seemed to be that the field was not being created in the database table for the custom value. For example, if the custom field group was called constituent and it was the 3rd custom group, the table I believe would be civicrm\_value\_constituent\_3. Each custom field of that field group normally gets a column in this table, but if the large text size is too big, it doesn't create the column and it doesn't give any warnings either. Manually creating the columns into the table fixed the problem, reinforcing that conclusion.

It does still add to the civicrm\_custom\_field table, so no problem there. It's just the values table.

# Answer
> 2 votes
Did you create a large text field or a memo field? And if so did you inspect the logs?

If it is a text field. I assume that mysql has a limit on the column size so probably it is failing because of that error.

---
Tags: drupal, custom-fields, webform-civicrm
---


# Question
Title: How to add email while trying to create a Household contact using civicrm api v3?
I want to add email address to create a contact of type Household , how I can achieve it as while checking in API explorer I don't see it.

```
$result = civicrm_api3('Contact', 'create', [
  'contact_type' => "Household",
  'household_name' => "Test",
  'email' => 'abc@gmail.com
]];

```

I was trying to convert civicrm API v2 to civicrm API v3. In civicrm API v2, I saw this, so I thought we may have some way to add email directly in API v3 (also not sure if api v2 below is correct)

```
$householdParams = array(
                    'household_name' => $familyName,
                    'contact_type'   => 'Household',
                    'email'          => $form_state['storage']['contactInfoValues']['emailAddress']
                    );
$householdContact =&civicrm_contact_add($householdParams);

```

# Answer
You will have to use the Email API with the contact\_id of the just created contact. You can do this in a chained API call if you want to.
> 5 votes

---
Tags: api, households
---


# Question
Title: Can not enable Contact Distance Search under CiviCRM modules
I have installed CiviCRM 4.7 and CMS is Drupal 7.56 CiviCRM Contact Distance Search is showing disabled in the modules list. Why is it disabled? how to enable it?

# Answer
CiviCRM Contact Distance Search requires views module and since your system is missing required modules you won't be able to enable it. Once you install Views module you will need to configure it with civicrm so that drupal can access data from civicrm.

Thanks

Pradeep
> 11 votes

# Answer
CiviCRM Contact Distance Search is a Drupal module, Advance Search is a core CiviCRM search functionality. The two are not linked what so ever. CiviCRM Contact Distance Search module allows you to set up a Drupal view so that users on your website can search for particular contacts that are in your CiviCRM database by using a postcode and distance. I have recently updated the module to allow a map and use your location More info can be found here - https://civicrm.org/blog/anil/drupal-views-civicrm-contact-distance-search-with-a-map
> 0 votes

---
Tags: search, installation
---


# Question
Title: Cannot set sort order of custom fields in profile
I created a custom group and populated with custom fields. When I preview all fields in group, it is in the correct order.

When I use the custom group in a profile, the profile reverses the order.

I've tried changing weights to order, but I can't seem to make it work.

Any thoughts?

# Answer
> 5 votes
The weight of the custom fields only controls the order in which they appear on the back end. The profile sets its own order. You can set the order from **Administer menu » Customize Data and Screens » Profiles**, then clicking the **Fields** link next to the profile you want to edit and using the "Order" buttons (see screenshot).

---
Tags: custom-fields, profile, joomla
---


# Question
Title: How can I make tags in tagsets visible to users who want to tag contacts
When I have a group of tags in a tagset, I notice that when I'm trying to add tags to a contact I can't see the list of tags (as I would if it was a standard CiviCRM multi-select field).

Instead all I have is the option of keying characters in and seeing possible matches. I guess that approach is OK if all my users know the tags well, but for a new user who doesn't know the tags it's a bit daft, and I'll end up having to produce a cheat sheet with all the tags on it.

Is there a reason why these tagset fields are different from conventional multi-select fields? Is there a simple way to change them so that the tags do appear in a drop-down as well as responding to keyed characters?

I'm working with CiviCRM 4.7.24 and Wordpress 4.8.2, and I see the same behaviour regardless of whether I add tags from the contact summary screen or by editing the contact record.

# Answer
By design, tagsets are an auto complete drop down. However, there is one thing we could do to improve the usability: make the list open immediately and show the complete list of tags. I don't really see a downside to that change so I'll make a PR and see if anyone objects.

https://github.com/civicrm/civicrm-core/pull/12248

UPDATE: The feature has been accepted and will be released with CiviCRM 5.3.0.
> 3 votes

# Answer
Not an answer - but a follow up, I wanted to include an image. I checked out the demo and was wondering if I missed what you referred to originally. On the tags tab, I see the attached. Where the list is checkable list. Is this not what you are seeing, perhaps I misunderstood.
> 1 votes

---
Tags: tags
---


# Question
Title: Stop Webforms loading memberships in the messages section for 'existing contacts'?
We have a Webform that creates a single membership. We've set it to use the 'existing contact' which very helpfully pre-fills the webform with the existing user's details - or with the details corresponding to the contact's checksum from a CiviMail. This is all brilliant so far!

However, when the page loads it also shows all the contact's existing memberships. And it shows them in the page's system 'messages' block.

In our use case we don't want to see existing memberships. And even if we did we'd want to see them in a webform component that we can control the behaviour of. When they appear in the system messages block it looks like an extra communication to the user and is rather confusing.

So, is it possible to prevent them from loading at all? Or at least have them load as a component of the webform rather than displaying in the messages block?

We are on Drupal 7.58, Civi 5.0.0

# Answer
> 2 votes
You could add a simple css hack to your webform which sets system messages on the front page of the form to `display: none`. That's not a perfect solution because it will hide *all* of them, but it's something.

# Answer
> 0 votes
There is no way from preventing this message unless you are a developer and write your own drupal module which hides this message.

---
Tags: civimember, webform-civicrm
---


# Question
Title: webform-civicrm error when creating CiviCRM custom data group
When creating (or saving) a custom data group or (field)set the following error pops up:

Notice: Undefined offset: 0 in webform\_civicrm\_civicrm\_postSave\_civicrm\_custom\_group() (line 436 of /home/unidosnow/www/www/sites/all/modules/webform\_civicrm/webform\_civicrm.module)

The code throwing this:

```
/**
 * Implements hook_civicrm_postSave_tableName().
 *
 * Handles adding/editing a custom group.
 *
 * @param CRM_Core_DAO_CustomGroup $dao
 */
function webform_civicrm_civicrm_postSave_civicrm_custom_group($dao) {
  module_load_include('inc', 'webform', 'includes/webform.components');

  // get all fieldsets with custom group ID
  $customGroupId = $dao->id;
  $dbResource = db_query("SELECT * FROM {webform_component} WHERE type ='fieldset' "
          . "AND form_key LIKE '%cg{$customGroupId}_fieldset'");
  $fieldsets = $dbResource->fetchAll(PDO::FETCH_ASSOC);

  // check if dao fields have been fetched
  if (!$dao->title) {
    $dao->find(TRUE);
  }

  // run only if the title of the custom group has changed in civicrm
  -->>  if ($fieldsets[0]['name'] != $dao->title) {  <<-- Exception here
    foreach ($fieldsets as $field_info) {
      $component = array();
      $component['name'] = $dao->title;
      $component['type'] = $field_info['type'];
      $component['form_key'] = $field_info['form_key'];
      $component['weight'] = $field_info['weight'];
      $component['nid'] = $field_info['nid'];
      $component['cid'] = $field_info['cid'];
      $component['pid'] = $field_info['pid'];
      webform_component_update($component);
    }
  }
}

```

The custom set creates successfully, haven't yet tried to use it in a webform. Before the 4/25 update I had created custom data sets without this error. Don't have record of the versions I was using at the time, the current versions that show the problem are CiviCRM 4.7.29, Drupal Core 7.59, webform-civicrm 4.20, and webform 4.17.

# Answer
> 2 votes
This was not a bug that caused any loss of functionality, just a php notice which has since been fixed via this patch: https://github.com/colemanw/webform\_civicrm/pull/139

---
Tags: webform-civicrm
---


title: Search by radius to postal code or zip

text:
# Question
Title: Search by radius to postal code or zip
I tend to do a lot of roster pages on Drupal + CiviCRM sites (Drupal Views, exposing CiviCRM contact record fields). One of the search filters I'd like to try would be to allow visitors to enter a postal/zip code and then have results from contacts that are located in a radius to the postal code. I know CiviCRM has some ability to geocode contact addresses. Is there any way we can harness the goecoding into a postal/zip filter for this type of search?

# Answer
> 1 votes
As luck would have it, I was over at the Drupal project review queue and found exactly what I was looking for. It's currently on its path to being approved (hopefully soon) and currently it only supports UK postal codes but this is what I expect will be the answer (it's a sandbox project at this time):

CiviCRM contact distance search https://www.drupal.org/sandbox/vakeesan26/2498395

# Answer
> 2 votes
I have recently updated the module to allow a map and use your location. More info can be found here - https://civicrm.org/blog/anil/drupal-views-civicrm-contact-distance-search-with-a-map

# Answer
> 1 votes
You would need to do some custom work to get this exposed to a public page I suspect, but CiviCRM already provides radius search, based on Zip Code.

First you need to turn on geocoding which will go get the latitude/longitudes for all the contacts you have (based on their zip code). Go here to set up: civicrm/admin/setting/mapping (note you have to allow civi the time to fully geocode your contacts as well.)

Then in Advanced Search, you can search a zip code, and say you would like to search a specific radius around that zip. (Note if geocoding is not turned on, the option to specify a radius is not displayed.)

Using Drupal Views, assuming you are geocoding,you may be able to create a view based on a radius using that stored lat/long (though that may be prohibitive CPU wise). Depends on how many contacts you need to filter. (Probably need to use a PHP filter in the view to calc the distance on each contact to determine inclusion.)

(Google for the algorithm to calc distances on lat/long)

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


# Question
Title: Not able to choose "unsubscribe group" for a mailing?
According to the user guide, if I select contacts by search and then start a CiviMail mailing to them I should be offered the "Unsubscribe group" option, as shown in this helpful screenshot posted on another question.

I can't get this to appear for the life of me. I'm on 4.7.27 under Wordpress. All I get is "Hidden Group 1234" in the Recipients field. Has this behaviour changed?

The reason for the question is that I want to do various searches to segment people but maintain a single unsubscribe group that would apply to any of my searches.

**EDIT** This might be a "please help me fix my CiviCRM install" question instead of a "how's it supposed to work" question.

On at least two of my installs (one Wordpress, one Drupal7) I don't see the Unsubscribe group option. Huh?

Reproduce: Search all contacts » Select some contacts » Mail by CiviMail.

Expect to see Unsubscribe Group option, but do not.

I agree with @petednz that this works on the 4.7/Drupal7 (actually 5.0.0 at time fo writing) demo site.

# Answer
> 1 votes
This was a bug that was fixed in 4.7.28 commit ref

Doh!

# Answer
> 2 votes
What you describe is exactly what I observe at dmaster.demo.civicrm.org.

Steps

Run Search and select some contacts.

Choose Email/Send via CiviMail

On the next screen I see the Unsub Group

---
Tags: civimail, 4.7, unsubscribe
---


title: Email blast mailing through CiviCRM

text:
# Question
Title: Email blast mailing through CiviCRM
How can I send an e-blast email mail to groups from different states after pulling a report in CSV FORMAT from CiviCRM

# Answer
The easiest way would be to create groups in Civi based on which state they are in then send the email out of Civi mail. Use the advanced search to find the contacts, select the ones you want included in the group, then select Group - Add contacts. Select Create new group, name it and select mailing list from the group type and save.

In the mailings drop down, select new mailing, format however you want and select which group you want it to go to. That way you can track opens and which links have been opened by each person. You can also include attachments to this email.
> 2 votes

---
Tags: email
---


title: Zero fee for a paid event

text:
# Question
Title: Zero fee for a paid event
I host a donation-based event, and allow people to register online using a PayPal Payment Processor.

I want to have different options for donations, but also none at all (zero amount).

I tried to use Regular Fees with one of them set to zero, I tried Price Sets, I tried CiviDiscount. But all have the same problem - once the amount to pay is zero, the 'Pay' button of PayPal disappears, and instead there is no button to register free from charge.

I also tried to name the 'Pay Later' label as '€0', but then the user still has to choose one of the normal fees, and then choose the '€0' payment processor rather than the PayPal one, which is very confusing.

How can I do that choosing the zero fee will simply allow to continue and register without paying anything?

# Answer
If you make a price set, create a price field and make the field not required, you should be good to go. The person simply wont choose a price option and registration will continue as normal. You should also be able to add a no cost (value 0) fee and registration will also continue as normal.

Can you explain more about your setup? CMS, CiviCRM version, what you mean by 'Pay' button of PayPal disappears.
> 2 votes

# Answer
If you are on a version of civi pre 4.7.x then were some related bugs eg https://issues.civicrm.org/jira/browse/CRM-16929. Knowing what version of civi you are on helps folk answer you more helpfully but that ticket does clearly suggest that a $0 in the Price Set options should work fine.
> 1 votes

# Answer
Just hit this issue myself and after a bit of testing I think I've worked out that there is an issue with the "Paypal-express" payment processor.

Image below has paypal-express set as processor

With payment methods set to test or "paypal standard" the continue button is there, but if the "paypal-express" payment processor is selected the contine button disappears for zero dollar payments.

Image below with paypal-standard set.
> 0 votes

---
Tags: civievent
---


# Question
Title: Bee email composer integration (alternative to Mosaico)
Has anyone had experience with using Bee with Civi? I see that Nicolas Ganivet, the co-founder and CTO of Cividesk, was looking into it back in 2016.

In my opinion, Bee has significant advantages over Mosaico. I realize Mosaico is open-source and free, but its capabilities and user interface seem to be lacking compared to Bee.

Any input is appreciated!

# Answer
> 2 votes
The mosiaco extension integrates the mosaico editor for mass e-mail editing in CiviCRM. However it is not an e-mail service.

I dont know of anyone in the community who have been looking into it, however there is a question on Stack Exchange about integrating a bee template into CiviCRM: CiviMail/Cron Fails using BeeFree template

---
Tags: extension, email, mosaico
---


# Question
Title: Simple way to prevent one user seeing one contact
My user would like a particular case worker to be prevented from accessing one specific client. At present we're not using ACLs but I implemented one scheme that I could get to work on my test system but not on their system - I have almost given up trying to figure out why. I created a smart group with all clients except the excluded one, and a group with the case worker who could see only this group. Can anyone suggest another way this can be achieved?

# Answer
You could do that with hook\_civicrm\_aclWhereClause:

* remove 'view all contacts', 'edit all contacts' for the case worker
* create an extension implementing `hook_civicrm_aclWhereClause` eg:

`function everyoneexcept_civicrm_aclWhereClause($type, &$tables, $whereTables, &$contactID, &$where) {
 if ($contactID == 'your_case_worker_id') {
 $where .= ($where ? ' AND ' : '') . " contact_a.id != 'your_case_worker_relative_id'";
 }
 }`

For a one-off case, just hardcode the contact id's for your case worker and their relative.

Caveat - not extensively tested!
> 3 votes

---
Tags: drupal, acl, 5.1.0
---


# Question
Title: How do I prevent a user from adding contacts to ACL groups?
I have successfully set up CiviCRM ACLs so that only contacts within the group "NYC Team" have access to certain events.

What I am trying to figure out is how to prevent low-level users from adding themselves (or other contacts) to the CiviCRM group "NYC Team". (If a low level user can add themselves (or others) to the group "NYC Team" (and other Access Control type groups), it renders the ACLs to be ineffective.

# Answer
> 9 votes
With situations like that I simply just disable the group. The ACL still works, but users don't have access to add anyone to the group.

If you need to add someone else to the group, just enable, add and disable again.

Heather.

# Answer
> 3 votes
There is a useful little CiviCoop extension called group-protect to mark a group as protected. You can use this to protect your ACL groups and assign a permission to those who should edit them.

# Answer
> 2 votes
I think you'd need to use hooks to hide the ACL groups from the dropdowns. There's a forum post here that links to a module that does this - looks like it could be adapted into an extension to hide the groups from everyone but admins. It's a few years old, mind.

# Answer
> 2 votes
Set the view permission for the group so that users you don't want adding themselves or others to it can't see it.

# Answer
> 0 votes
CiviCRM has an option for groups in the group settings to make the group "Reserved". You can use this setting along with the CMS permission "CiviCRM: administer reserved groups" to limit who can edit a group.

For more information, here are some good docs: http://book.civicrm.org/user/current/organising-your-data/groups-and-tags/

Another way to control who can create groups is using hook\_civicrm\_buildForm and warning/redirecting the user to another page if they don't have certain permissions. See code snippet below.

```
function memberperms_civicrm_buildForm( $formName, &$form ) {
    if (strpos($formName, "AddToGroup")
        and
        !CRM_Core_Permission::check('edit all contacts')
    ) {

        // Display Error Message
        CRM_Core_Session::setStatus("Sorry, the group feature is not currently supported for members", "Permission Denied", "error");

        // Redirect to civicrm home
        drupal_goto("civicrm");
    }
}

```

---
Tags: groups, security, acl
---


# Question
Title: How is 'contact modified' defined as on CiviCRM reports?
I'm looking to run a report that only shows contacts who we've engaged with (registered for an event, joined our database, updated their details) in the past 12 months. Would the 'contact modified field deliver this report? Thanks all!

# Answer
Yes! The Contact modified date filter will work to filter contact that are modified in past 12 months
> 3 votes

# Answer
Is this for GDPR purposes? If so, you might find the GDPR extension useful. Among other things, it lets you specify which activities you want to include/exclude when determining whether there has been contact with individuals.
> 1 votes

---
Tags: custom-reports
---


# Question
Title: How to connect your household address to its members in civicrm api v3?
```
$result = civicrm_api3('Address', 'create', array(
  'sequential' => 1,
  'contact_id' => $householdContact['id'],
  'location_type_id' => "Home",
  'is_primary' => 1,
  'street_address' => $form_state['storage']['contactInfoValues']['address1'],
  'supplemental_address_1' => $form_state['storage']['contactInfoValues']['address2'],
  'city' => $form_state['storage']['contactInfoValues']['city'],
  'state_province_id' =>  $form_state['storage']['contactInfoValues']['state'],
  'country_id' => "US",
));

$master_address_id = $result['id'];

 $result = civicrm_api3('Address', 'create', array(
          'sequential' => 1,
          'contact_id' => $primaryContact['id'],
          'master_id'  => $master_address_id,
          'location_type_id' => "Home",
        ));

```

I need to attach the household address with primary contact address . How can i achieve I tried by implementing above ,but it did not work?

# Answer
You need to provide same set of values to create address for members of the household with additional parameter master\_id as Address foreign key id of household contact.

```
$addressParams = [
  'sequential' => 1,
  'contact_id' => $householdContact['id'],
  'location_type_id' => "Home",
  'is_primary' => 1,
  'street_address' => $form_state['storage']['contactInfoValues']['address1'],
  'supplemental_address_1' => $form_state['storage']['contactInfoValues']['address2'],
  'city' => $form_state['storage']['contactInfoValues']['city'],
  'state_province_id' =>  $form_state['storage']['contactInfoValues']['state'],
  'country_id' => "US",
];
$result = civicrm_api3('Address', 'create', $addressParams);

$addressParams['master_id'] = $result['id'];
$addressParams['contact_id'] = $primaryContact['id'];
$result = civicrm_api3('Address', 'create', $addressParams);

```

HTH

Pradeep
> 3 votes

# Answer
You are currently supposed to add the address details to the address that is sharing the data from another address.

You can see an example here: https://github.com/civicrm/civicrm-core/blob/865168d5d056d071d23d0273189051241c5261e5/tests/phpunit/CRM/Core/BAO/AddressTest.php#L446

Your version should already create a linked address, but does not copy over the data.

It seems only import and API suffer from this issue. The GUI actually does copy over the values. This seems like a usefull feature request.
> 1 votes

---
Tags: api, addresses, households
---


title: How do I create an email template?

text:
# Question
Title: How do I create an email template?
I currently send a 'thank you for renewing' email out on an individual basis. I know there is a function for designing a template so I don't need to copy and paste text from Word, but I can't find the option. I would be grateful if someone could point me in the right direction.

Many thanks!

# Answer
You can find them by going to **Mailings \> Message Templates** OR **Administer \> Communications \> Message Templates** in the menu.

Here is the documentation: https://docs.civicrm.org/user/en/latest/email/message-templates/
> 4 votes

---
Tags: civimail
---


# Question
Title: what kind of sanitization needs to be done when doing civicrm_api3('Contact', 'create') inside custom drupal modules?
How does creating contacts via civicrm\_api3() fit into these areas https://docs.civicrm.org/dev/en/latest/security/#strategy https://docs.civicrm.org/dev/en/latest/security/inputs ?

If I'm using this inside custom drupal modules, is it safe to simply:

```
function mycustom_webform_submission_insert($node, $submission) {
  if ($node->nid == 123) {
    civicrm_api3('Contact', 'create', array(
      'sequential' => 1,
      'contact_type' => 'Organization',
      'contact_sub_type' => 'Sub Type Name',
      'organization_name' => $submission->data[48][0],
      // I've done nothing to that $submission data, it's only been processed by whatever Drupal/Webform module do.
      // Is that a security risk?
    ));
  }
}

```

# Answer
> 2 votes
The Drupal Webform module sanitises form inputs.

The Webform CiviCRM Integration module uses the underlying webform submission functions to sanitise data.

**However** the accepted answer on this question makes a very valid point.

> It's a common misconception that user input can be filtered. PHP even has a \>(now deprecated) "feature", called magic-quotes, that builds on this idea. It's nonsense. Forget about filtering (Or cleaning, or whatever people call it). What you should do, to avoid problems, is quite simple: whenever you embed a string within foreign code, you must escape it, according to the rules of that language.

*Both modules mentioned above are covered by the Drupal security advisory policy.*

---
Tags: drupal, api, security
---


# Question
Title: Price set is required but “-none-” option remains
As the title says, we have a price set - its required, but the none option remains. This is being used for a membership sign up contribution page. Sorry I did not clarify earlier.

Civi 5.1, wordpress 4.9

Update: we ended up creating a new price set, making the options required, and a new contribution page and it all worked out.

# Answer
> 0 votes
One way to avoid such behavior is to write `hook_civicrm_buildForm` and use contribution page id as a trigger in if condition and use jQuery to remove 'None' option from dropdown/radio.

---
Tags: civimember
---


# Question
Title: Get the ID for the default organization through API
Is there any way to get the "default organization" contact id through the API?

# Answer
> 4 votes
The default organization contact id is stored in civicrm\_domain table. You can use domain api to retrieve the contact id i.e

```
  $result = civicrm_api3('Domain', 'getvalue', array(
      'sequential' => 1,
      'return' => "contact_id",
      'id' => 1,
    ));

```

HTH

Pradeep

---
Tags: api, organization
---


title: Styling buttons on CiviCRM public forms

text:
# Question
Title: Styling buttons on CiviCRM public forms
I'm looking to improve the look of buttons on CiviCRM public forms. I am using a bootstrap sub-theme. Are the button classes documented anywhere? Any suggestions for addressing this?

Using Drupal 7 & CiviCRM 5.x

# Answer
> 1 votes
If you're using Drupal + CiviCRM you should check out the "Shoreditch" theme for CiviCRM which changes the CiviCRM UI to use bootstrap based styling.

**Note:** *Shoreditch is in Alpha state and undergoing active development, we are using this in production and aside from a few minor issues it's working very well.*

If you're not using Drupal you would want to look at overriding the CSS in your CMS/site theme. You can get the button classes etc using the "Web Inspector" in any major web browser - these are not directly documented at present.

---
Tags: drupal, button, 5.0
---


# Question
Title: How can I clear all contacts (as if they never existed) without touching any CiviCRM settings?
After having put a lot of time into customizing a CiviCRM installation, I want a way to replicate the configuration / customization / installed-extensions, but start from scratch on the contacts (so that newly added contacts -- after the admin contact and organization -- have contact-ids of 3,4,5,...). Deleting all contacts via the UI doesn't seem to "reset" the next-contact ID counter.

Perhaps one way this could be possible is if there were a means by which all configuration / extensions could be backed up and restored, independent of the data in the system (e.g. contacts, memberships, contributions, etc.). Is this possible somehow? Or is there another way to achieve my goal of "starting over" with non-configuration data?

# Answer
> 4 votes
I would suggest to perform deletion of contact from UI and then reseting the auto increment value through mysql command. Truncating database might loose contact that are not suppose to be deleted like logged in contact id or Default organization contact id or they might be possible to have orphan data for contacts if we directly truncate the table. Here is what i would do

1. Find Contact
2. Select All contact
3. From Action list i will select 'Delete Contact permanently'

Shell in for mysql or in phymyadmin through web and run `ALTER TABLE civicrm_contact AUTO_INCREMENT = 1`

> Note: Backup database before deleting contacts.

HTH

Pradeep

---
Tags: backups
---


# Question
Title: Is it mandatory to link Membership to Contributions in CiviCRM
We have a whole bunch of contribution records to import into CiviCRM from our legacy database. The membership records already exist in CiviCRM. I can't find a way to link the new contribution records (to be imported) to the existing membership records. Is there a membership record no. that I could extract and use it to link the contribution record (to be imported) to the membership record.

If that is not an option, can I just import the contribution records without linking them to the membership records? The only downside I can see is I wouldn't be able to see the related contributions while I am on the membership screen. But they will all be visible in the Contributions screen.

I'd appreciate the community's thoughts on this. Thanks,

Raja Mukherjee

# Answer
> 1 votes
For the second part, yes - you can import the contributions `Contributions > Import Contributions` without linking to memberships which will then show under the Contributions tab.

Contributions are linked to memberships with MembershipPayment so when you have the membership id and contribution id you can link them with:

```
$result = civicrm_api3('MembershipPayment', 'create', array(
  'membership_id' => X,
  'contribution_id' => Y,
));

```

The challenge here is to get the right membership and contribution id's to pair up. You could tackle this in various ways including:

1) if you don't mind a bit of coding, write your own import script to create the Contribution, find the relevant Membership then create the MembershipPayment.

2) if you prefer GUI, import your contributions via the UI, export the contributions and memberships (to get the id's), do some spreadsheet manipulation to produce a csv of contribution and membership ids, then use the API CSV Importer extension to import these as MembershipPayments

# Answer
> 0 votes
If you do want to add the Contribution to a Membership then it would be worth looking at Fuzion's API CSV Import GUI extension

---
Tags: civicontribute, civimember
---


title: Civicrm local db error

text:
# Question
Title: Civicrm local db error
**My Specs**

I migrated a production Drupal 7/Civicrm 7.x-4.7.9 site to my local machine. For my stack, I am running MAMP and PHP 5.6.32, the production server is on PHP 5.6.33

I downloaded all files, and databases (there are two, one for Civicrm and one for Drupal 7).

Took a while, but got it set up and running and changed all urls in the DB. no issues so far.

but now when I got to ...site\civicrm (yes for some reason the local is running on two back slashes in stead of one -- if this is an issue, otherwise it's secondary to the below unless related...)

**And here is what I need help with:**

I get this error:

Sorry but we are not able to provide this at the moment. 'civicrm/showevents': Could not find access\_callback in path tree, Could not find page\_arguments in path tree, Could not find is\_ssl in path tree

---

Things I've done so far: Cleared all cache

Any thoughts?

**Thanks in Advance!!!**

# Answer
The path `civicrm/showevents` does not seem to be a part of core. I think you have an extension enabled on your site which is creating a problem.

* Disable or uninstall `Event Calendar(com.osseed.eventcalendar)` from Extension page `civicrm/admin/extensions?reset=1`.
* If you can't access the extension page, try disabling this using `cv` command OR directly modifying `civicrm_extension` table in your database. Set `is_active` value to `0`.

```
$ cv ext:disable com.osseed.eventcalendar

```
* Clear cache OR rebuild the menu using `civicrm/menu/rebuild?reset=1`.
> 1 votes

---
Tags: error, database
---


# Question
Title: Is 4.7.x end-of-life? Why does my site say that 4.7 has reached the end-of-life?
The CiviCRM Status Screen is reporting for any version that is 4.7.x that it is End of Life.

What does this mean? Is there something wrong with version 4.7? Do I need to panic?

# Answer
> 5 votes
There is a helpful explanation. The numbering system changed, this is detailed here

5.0.0 is the next version after 4.7.31 and is not a major update.

In The Q&A section there is an answer to this question which explains why the limitations of the update messaging system in 4.7 led to the decision to use the End of Life message in this instance:

> The in-app messaging in 4.7.x was hard-coded several years ago. For a site running the last 4.7.31, we can only display one of two messages -- either that 4.7.31 is up-to-date or that it 4.7 is end-of-life. Neither message is accurate or desireable -- the truth is that 4.7.x was renamed to 5.x.
>
> We've updated the notification system so that future messages can be more nuanced/accurate, but for sites currently 4.7 we've had to take an awkward approach. For April and May, we used the understated message; but in June, we switched to the overstated message.

# Answer
> -1 votes
There is no need to panic. That 4.7 is end of life means that no updates are released. It is usually good to have an update strategy (update with each release, update once a year, never update).

---
Tags: upgrade, 4.7, core, 5.0
---


# Question
Title: Missing column 'frontend_title' in ''civicrm_uf_field_de_DE" after upgrading to 5.1.2
I have an empty status page and the errors attached below in the Drupal 7 watchdog after upgrading to 5.1.2. Also, the columns in civicrm\_uf\_field\_de\_DE don't match columns in civicrm\_uf\_field (not sure if they should, though).

> $Fatal Error Details = array(3) { \["message"\]=\> string(23) "DB Error: no such field" \["code"\]=\> NULL \["exception"\]=\> object(CiviCRM\_API3\_Exception)#433 (8) { \["extraParams":"CiviCRM\_API3\_Exception":private\]=\> array(6) { \["error\_code"\]=\> string(13) "no such field" \["sql"\]=\> string(1055) "SELECT a.id as `id`, a.is\_active as `is_active`, a.group\_type as `group_type`, a.title as `title`, a.frontend\_title as `frontend_title`, a.description as `description`, a.help\_pre as `help_pre`, a.help\_post as `help_post`, a.limit\_listings\_group\_id as `limit_listings_group_id`, a.post\_URL as `post_URL`, a.add\_to\_group\_id as `add_to_group_id`, a.add\_captcha as `add_captcha`, a.is\_map as `is_map`, a.is\_edit\_link as `is_edit_link`, a.is\_uf\_link as `is_uf_link`, a.is\_update\_dupe as `is_update_dupe`, a.cancel\_URL as `cancel_URL`, a.is\_cms\_user as `is_cms_user`, a.notify as `notify`, a.is\_reserved as `is_reserved`, a.name as `name`, a.created\_id as `created_id`, a.created\_date as `created_date`, a.is\_proximity\_search as `is_proximity_search`, a.cancel\_button\_text as `cancel_button_text`, a.submit\_button\_text as `submit_button_text` FROM civicrm\_uf\_group\_de\_DE a WHERE (a.name IN ("new\_individual", "new\_organization", "new\_household")) AND (a.is\_active = "1") LIMIT 25 OFFSET 0 \[nativecode=1054 \** Unknown column 'a.frontend\_title' in 'field list'\]" \["tip"\]=\> string(62) "add debug=1 to your API call to have more info about the error" \["is\_error"\]=\> int(1) \["error\_message"\]=\> string(23) "DB Error: no such field" \["debug\_information"\]=\> string(1055) "SELECT a.id as `id`, a.is\_active as `is_active`, a.group\_type as `group_type`, a.title as `title`, a.frontend\_title as `frontend_title`, a.description as `description`, a.help\_pre as `help_pre`, a.help\_post as `help_post`, a.limit\_listings\_group\_id as `limit_listings_group_id`, a.post\_URL as `post_URL`, a.add\_to\_group\_id as `add_to_group_id`, a.add\_captcha as `add_captcha`, a.is\_map as `is_map`, a.is\_edit\_link as `is_edit_link`, a.is\_uf\_link as `is_uf_link`, a.is\_update\_dupe as `is_update_dupe`, a.cancel\_URL as `cancel_URL`, a.is\_cms\_user as `is_cms_user`, a.notify as `notify`, a.is\_reserved as `is_reserved`, a.name as `name`, a.created\_id as `created_id`, a.created\_date as `created_date`, a.is\_proximity\_search as `is_proximity_search`, a.cancel\_button\_text as `cancel_button_text`, a.submit\_button\_text as `submit_button_text` FROM civicrm\_uf\_group\_de\_DE a WHERE (a.name IN ("new\_individual", "new\_organization", "new\_household")) AND (a.is\_active = "1") LIMIT 25 OFFSET 0 \[nativecode=1054 \** Unknown column 'a.frontend\_title' in 'field list'\]" } \["message":protected\]=\> string(23) "DB Error: no such field" \["string":"Exception":private\]=\> string(0) "" \["code":protected\]=\> int(0) \["file":protected\]=\> string(57) "/var/www/example.com/app/sites/all/modules/civicrm/api/api.php" \["line":protected\]=\> int(45) \["trace":"Exception":private\]=\> array(10) { \[0\]=\> array(4) { \["file"\]=\> string(70) "/var/www/example.com/app/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php" \["line"\]=\> int(3342) \["function"\]=\> string(12) "civicrm\_api3" \["args"\]=\> array(3) { \[0\]=\> &string(8) "uf\_group" \[1\]=\> &string(3) "get" \[2\]=\> &array(2) { \["name"\]=\> array(1) { \["IN"\]=\> array(3) { \[0\]=\> string(14) "new\_individual" \[1\]=\> string(16) "new\_organization" \[2\]=\> string(13) "new\_household" } } \["is\_active"\]=\> int(1) } } } \[1\]=\> array(6) { \["file"\]=\> string(68) "/var/www/example.com/app/sites/all/modules/civicrm/CRM/Core/Resources.php" \["line"\]=\> int(689) \["function"\]=\> string(14) "getCreateLinks" \["class"\]=\> string(20) "CRM\_Core\_BAO\_UFGroup" \["type"\]=\> string(2) "::" \["args"\]=\> array(0) { } } \[2\]=\> array(4) { \["function"\]=\> string(20) "outputLocalizationJS" \["class"\]=\> string(18) "CRM\_Core\_Resources" \["type"\]=\> string(2) "::" \["args"\]=\> array(0) { } } \[3\]=\> array(4) { \["file"\]=\> string(65) "/var/www/example.com/app/sites/all/modules/civicrm/CRM/Core/Invoke.php" \["line"\]=\> int(275) \["function"\]=\> string(14) "call\_user\_func" \["args"\]=\> array(1) { \[0\]=\> &array(2) { \[0\]=\> string(18) "CRM\_Core\_Resources" \[1\]=\> string(20) "outputLocalizationJS" } } } \[4\]=\> array(6) { \["file"\]=\> string(65) "/var/www/example.com/app/sites/all/modules/civicrm/CRM/Core/Invoke.php" \["line"\]=\> int(84) \["function"\]=\> string(7) "runItem" \["class"\]=\> string(15) "CRM\_Core\_Invoke" \["type"\]=\> string(2) "::" \["args"\]=\> array(1) { \[0\]=\> &array(12) { \["id"\]=\> string(2) "61" \["domain\_id"\]=\> string(1) "1" \["path"\]=\> string(20) "civicrm/ajax/l10n-js" \["access\_callback"\]=\> string(1) "1" \["access\_arguments"\]=\> array(2) { \[0\]=\> array(1) { \[0\]=\> string(14) "access CiviCRM" } \[1\]=\> string(3) "and" } \["page\_callback"\]=\> array(2) { \[0\]=\> string(18) "CRM\_Core\_Resources" \[1\]=\> string(20) "outputLocalizationJS" } \["breadcrumb"\]=\> array(1) { \[0\]=\> array(2) { \["title"\]=\> string(7) "CiviCRM" \["url"\]=\> string(19) "/en/civicrm?reset=1" } } \["is\_ssl"\]=\> string(1) "0" \["weight"\]=\> string(1) "1" \["type"\]=\> string(1) "1" \["page\_type"\]=\> string(1) "0" \["page\_arguments"\]=\> bool(false) } } } \[5\]=\> array(6) { \["file"\]=\> string(65) "/var/www/example.com/app/sites/all/modules/civicrm/CRM/Core/Invoke.php" \["line"\]=\> int(52) \["function"\]=\> string(7) "\_invoke" \["class"\]=\> string(15) "CRM\_Core\_Invoke" \["type"\]=\> string(2) "::" \["args"\]=\> array(1) { \[0\]=\> &array(4) { \[0\]=\> string(7) "civicrm" \[1\]=\> string(4) "ajax" \[2\]=\> string(7) "l10n-js" \[3\]=\> string(5) "de\_DE" } } } \[6\]=\> array(6) { \["file"\]=\> string(67) "/var/www/example.com/app/sites/all/modules/civicrm/drupal/civicrm.module" \["line"\]=\> int(445) \["function"\]=\> string(6) "invoke" \["class"\]=\> string(15) "CRM\_Core\_Invoke" \["type"\]=\> string(2) "::" \["args"\]=\> array(1) { \[0\]=\> &array(4) { \[0\]=\> string(7) "civicrm" \[1\]=\> string(4) "ajax" \[2\]=\> string(7) "l10n-js" \[3\]=\> string(5) "de\_DE" } } } \[7\]=\> array(2) { \["function"\]=\> string(14) "civicrm\_invoke" \["args"\]=\> array(3) { \[0\]=\> &string(4) "ajax" \[1\]=\> &string(7) "l10n-js" \[2\]=\> &string(5) "de\_DE" } } \[8\]=\> array(4) { \["file"\]=\> string(37) "/var/www/example.com/app/includes/menu.inc" \["line"\]=\> int(527) \["function"\]=\> string(20) "call\_user\_func\_array" \["args"\]=\> array(2) { \[0\]=\> &string(14) "civicrm\_invoke" \[1\]=\> &array(3) { \[0\]=\> string(4) "ajax" \[1\]=\> string(7) "l10n-js" \[2\]=\> string(5) "de\_DE" } } } \[9\]=\> array(4) { \["file"\]=\> string(29) "/var/www/example.com/app/index.php" \["line"\]=\> int(21) \["function"\]=\> string(27) "menu\_execute\_active\_handler" \["args"\]=\> array(0) { } } } \["previous":"Exception":private\]=\> NULL } }

# Answer
Hopefully this seems more like upgrade issue for multi-lingual setup. The views are not created properly for the new field thats being added to civicrm\_uf\_group. The sql looks fine, But YES the columns for views should match exactly same as table however the label for multi-lingual column may vary.

To fix this i would suggest you to create column in the view or might have re-run code to rebuild Multi-lingual schema(`CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales, NULL, TRUE);`)

HTH

Pradeep

Commands (https://gist.github.com/mlutfy/647e6325a09079e4f08f273af64900d9):

# Drupal 7

drush php-eval 'civicrm\_initialize(); CRM\_Core\_I18n\_Schema::rebuildMultilingualSchema(\["en\_US","fr\_CA"\], NULL);'

# Drupal 8

drush php-eval '\Drupal::service('civicrm')-\>initialize(); CRM\_Core\_I18n\_Schema::rebuildMultilingualSchema(\["en\_US","fr\_CA"\], NULL);'

# Drush

drush cvapi System.rebuildmultilingualschema
> 2 votes

---
Tags: missing
---