# Question
Title: Schedule Reminder executed but no email sent out
I had a scheduled email reminder, which will trigger reminder email when it is 2 week(s) before Membership End Date. Repetition is enabled, to repeat every 1 hour until 1 day after Membership End Date.

"Send email" option is checked, with email subject and content.

When I execute this schedule reminder, it runs and below message is shown in job log:

```
Summary
Finished execution of Send Scheduled Reminders with result: Success (1)
Details

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Send Scheduled Reminders with result: Success (1)

```

No email is triggered for my test account, which will expire in 3 days.

However, other scheduled job (mail\_report) is able to send out email.

I'm not sure what's wrong. Any idea to figure this out?

I'm using CiviCRM 4.4.6 in drupal 7.

# Answer
A contact is added to the list of scheduled reminder recipients when they first meets the criteria you have specified and the reminders will be re-sent to that list on your repetition schedule.

If you ran your scheduled reminder for the first time when your membership end date is in 3 days then it won't be on the reminders email list. Only memberships with end dates 2 weeks in advance will be added to the list.

You can confirm this is the case by adjusting the end date for your test record to 15 days away then wait for 1 day to see if the reminder is sent.

Also, although you haven't asked about this, are you sure you want to send 24 reminder emails to your members each day for 15 consecutive days? That is what will happen with the settings you describe (assuming your cron runs at least hourly). It seems like a perfect way to annoy your members and get blacklisted for spamming.

I also suggest you upgrade to 4.4.16 as there have been bug fixes and security updates since 4.4.6 .
> 3 votes

---
Tags: drupal, scheduled-reminders
---


# Question
Title: Return-Path vs. unsubscribe and X-CiviMail-Bounce
Is there any reason that Civi would set unsubscribe and X-CiviMail-Bounce properly, but set return-path to reply-to instead? See the (modified) headers below.

We changed mail servers not too long ago, and since then our bounces are suddenly going to our reply-to address rather than our bounce address. Host says this is being done by the client (ie civi), rather than the mailserver, but the timing is odd since it worked fine prior to change in mail server.

I don't think we made other configuration changes that would account for this.

Any help in debugging this would be much appreciated.

Civi 4.2.6 Drupal 7.16 (yes we are planning to upgrade)

---

**Headers**

---

```
Delivered-To: [someaddress@somewhere.com]
Received: by [mailserverip] with SMTP id xxxx;
        Thu, 18 Jun 2015 06:29:50 -0700 (PDT)
X-Received: by [receiving server] with SMTP id yyyyy;
        Thu, 18 Jun 2015 06:29:50 -0700 (PDT)
**Return-Path: <info@ourorganization.org>**
Received: from [ourmailserver] ([our mail server ip])
        by [receivingmailserver] with ESMTPS id [receiving mail servicer id]
        for[someaddress@somewhere.com]
        (version=TLSv1.2 cipher=xxxxx bits=128/128);
        Thu, 18 Jun 2015 06:29:50 -0700 (PDT)
Received-SPF: pass (xxxxx) client-ip=xx.xx.xx.xxx;
Authentication-Results: xxx;
       spf=pass (xxxxxxxxxxxx) smtp.mail=xxx
Received: from [xx.xxx.xx.xxx] (helo=[ourwebserver])
    by [ourmailserver] with esmtpa (Exim 4.72)
    (envelope-from <info@ourorganization.org>)
    id 1Z5Zt7-0003cp-JQ
    for info@ourorganization.org; Thu, 18 Jun 2015 13:29:49 +0000
Message-Id: <E1Z5Zt7-0003cp-JQ@mailserver>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_abd6aac4c1ae6db13534624f06413403"
Reply-To: "US" <info@ourorganization.org>
From: "NY-BEST" <info@ourorganization.org>
Subject: Next Week! Conference
**List-Unsubscribe: <mailto:ourbounce+u.2505.397854.8d11b042631c3439@ourserver.com>**
To: Admin User <info@ny-best.org>
Precedence: bulk
**X-CiviMail-Bounce: ourbounce+u.2505.397854.8d11b042631c3439@ourserver.com**
Date: Thu, 18 Jun 2015 09:30:08 -0400

```

# Answer
> 1 votes
Turns out it was a problem with exim, which was apparently changing the headers civi was sending.

After working with our host they were able to adjust exim.conf to make it work. Here's what they did which may or may not be completely correct, and may or may not solve others' problems, but it' a start

At the very top of exim.conf add

local\_from\_check=false untrusted\_set\_sender = true local\_sender\_retain = true

Here's the reference: http://www.exim.org/exim-html-current/doc/html/spec\_html/ch-main\_configuration.html

"If local\_from\_check is set false, the From: header check is disabled, and no Sender: header is ever added. If, in addition, you want to retain Sender: header lines supplied by untrusted users, you must also set local\_sender\_retain to be true.

These options affect only the header lines in the message. The envelope sender is still forced to be the login id at the qualify domain unless untrusted\_set\_sender permits the user to supply an envelope sender."

# Answer
> 0 votes
The header looks ok, it's probably your mail server that rewrites it. Can you try to switch to mail() instead of smtp or the other way around into your mail config on civicrm?

---
Tags: civimail, configuration
---


title: Can not access CiviCRM

text:
# Question
Title: Can not access CiviCRM
I cannot access CiviCRNM on Drupal. I get

Sorry but we are not able to provide this at the moment. Could not find user name for payment processor

Return to home page.

I am using drupal 7 and civiCRM 4.6.3. I had made some changes to the set event as payable when creating an earlier event and used dummy credentials for paypal pro. I now do not know how to undo the changes or gain access to CiviCRM. Thanx in advance.

# Answer
> 2 votes
I simply commented out the line requiring the payment processor and it worked. I then deleted the payment processor I had created earlier.Finally. I uncommented the line I had previously commented out.

# Answer
> 3 votes
You can't access civicrm backoffice?

Try http://yoursite.org/civicrm/admin and disable the payment processor from there.

# Answer
> 2 votes
If you can not access http://yoursite.org/civicrm/admin/paymentProcessor?reset=1 disable the processor via db by setting the `is_active` field to `0` inside table `civicrm_payment_processor`.

---
Tags: payment-processor
---


# Question
Title: How do I find civicrm field names for import?
I want to import memberships, but civi isn't finding the membership type. How do I find out the field names (such as membership\_type) for each membership? This problem has cropped up for other imports. For example, I'd like to be able to import relationships.

Is there a tool that I need outside of civi? Is there someplace in civi where I can find this type of information?

Thanks.

# Answer
> 3 votes
When importing memberships the type needs to match name of the type from the first column on the membership page (Administer =\> CiviMember =\> Membership Types). So if you've defined a membership type of "Gold Member" then when importing, you need to put Gold Member in the column for membership type in the CVS.

Importing relationships is a bit trickier. You can only import one type of relationship with each cvs file.

Have you looked at the on line book on importing. It gives some good examples and tips on importing.

http://gitbook.civicrm.org/common-workflows/importing-data-into-civicrm.html

# Answer
> 2 votes
If you upload any csv to the Import Memberships wizard and then click through to the second screen, on the right you will see a drop down that will show you the list of fields that the Import can accept. That will include fields such as External ID, Email etc one of which will be required to match to the contact, as well as Membership Type, Membership Status, Membership Since, Membership Start Date.

If you have made custom Membership fields, then they should be shown in the drop down too.

Relationships can be imported via the Import Contacts wizard, but as Paul says, only a single Relationship Type at once. These live right at the bottom of the selector, ie after World Region etc. You choose the 'relationship type' that is to be created, then select the field that you have for the related contact you are making, eg Organisation Name if you are adding the Employer as part of importing the Employees. HTH

---
Tags: civimember, import, relationships
---


title: Simplenews vs civiMail

text:
# Question
Title: Simplenews vs civiMail
I'm considering using Drupal's simplenews module for sending (most of) my email newsletters, rather than civiMail. Are there any disadvantages to doing this?

The background is:

* Drupal 8 and civi 4.7 (when I go live later this year)
* Mandrill to power the actual email sending
* All newsletters will contain a single news item, not a collection of multiple items
* I want email to be sent when the news is available, not weekly or monthly
* I want my news creators to be able to have the simplicity of just creating an article and giving it a tag, without having to worry about enews complexities.
* I want my news items to appear prominently on the website
* I want various other bits of content to automatically appear in the email (coming events etc).

Given this, it seems to me that what I'm doing is basically automating the emailing of a Drupal content item (rather than creating a bespoke newsletter), and so it's better to use simplenews for this.

The only disadvantages I can see are:

1. if I want to show, edit or automate the subscriptions in Civi, I'll have to create groups and use Drupal Rules to sync the civi groups to the simplenews subscription preferences.
2. If I want civi and simplenews to update each other with knowledge about changed email addresses etc., I may have to use Rules for that also.
3. I probably won't be able to personalise emails with tokens based on civi information about the contact. (which I don't mind)

Are there any other disadvantages to using a simplenews & Mandrill setup in this way? Any reasons to prefer civiMail? Do I seem to be thinking about this right?

thanks for your thoughts,

Jonathan

# Answer
It's technically possible to use either CiviMail or Simplenews, but the real questions in my opinion, are:

1. What else are you using CiviCRM for? Donations, memberships, etc?
2. If you're using Civi for lots of things, wouldn't it be nice to run reports on Donations vs. Mailings and keep your data in a single place: CiviCRM?
> 1 votes

---
Tags: drupal, email
---


# Question
Title: How do I show in a Contribution report (if I can) the other particpants payment sttaus if they were paid for by another attendee
My finance person wants a contribution report that doesn't just show the contributions for the initial person signing up, but lists individuals that were paid for as additional attendees signed up for and paid for as well. Is that possible?

# Answer
I expect the data you want lives in pricesets, so perhaps this extension will expose it: https://civicrm.org/extensions/extended-reports
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Itemized Annual Statement of Contributions
I can create a letter template containing the appropriate tokens from the Summary Fields but the only available token would be a Sum reflecting the entire year's donations. Is it possible to produce an end of the year statement that would reflect an itemized list of each individual contribution (including the final sum).

# Answer
Assuming you are using version 4.4 or higher the answer is yes.

In brief the steps are:

1. Use a Find Contributions search to identify the relevant contributions from last financial/fiscal year.
2. From the actions list select **Thank-you letters for Contributions**
3. Choose to **Group Contributions by** Contact.

More details, including layout of letters, can be found in the **Thank-you letters** section of the our user and admin guide for version 4.6. ( Functionality has been available since 4.4, but not documented until 4.6.)
> 3 votes

---
Tags: contributions
---


title: Import exisiting Membership data

text:
# Question
Title: Import exisiting Membership data
I run a large non profit association that provides free legal advice and advocacy for older tenants. Our current database has two roles. One is a global role so that Head office can look at all members and the other is that each branch can log in and look at its members in that branch.

My question is does CiviCRM allow me to essentially have the same type of setup that we have now. That is can i have groups(branches) that i can restrict log in to only that data, and then those of us at hq can log in and veiw all the branch data. We currently have 17 branchs and can import all data by csv?

# Answer
> 2 votes
You can control access to contacts via a number of routes. It might help narrow down the options if you clarify what you consider to be a 'member' ie are they someone who 'pays' a membership fee to cover a specific period, or something vaguer?

One way we have provided the multi-level control that you could use is by treating CiviCRM Relationships (eg between the Branch and the Member) as the control mechanism.

So an 'Officer' who has a relationship to a Branch, can see the Members who have a relationship to the same Branch, but no other contacts.

If the Branch has a relationship to a State level organisation, which then in turn has a relationship to a Federal level (for example) then the permissioning flows up (or down), ie an Officer at the Federal level sees 'all', an Officer at the State level sees all members of all the Branches in that State.

You can read more about this Extension we made for this usage here https://civicrm.org/extensions/relationship-permissions-acls

Otherwise there are built in ACLs that can work off Groups and other CiviCRM features which you can read about here -http://book.civicrm.org/user/current/initial-set-up/permissions-and-access-control/

It may take some thinking through but I would expect CiviCRM can replicate your requirements. HTH

---
Tags: civimember
---


title: Relationships are shown twice

text:
# Question
Title: Relationships are shown twice
I am using CiviCRM 4.5.5 with Drupal 7.

When I go to add a relationship the custom relationships show up twice.

Please help.

Thanks, Josh

# Answer
> 5 votes
As per the code the select list loads all relationship types of corresponding Contact's contact Type. So for instance \[Employee of (Individual type), Employer of (Organization Type)\] Relationship Type(RT), if you are going to add relationship for Individual Contact A then on you will only see 'Employee of' (not 'Employer of') RT.

In your case "other projector contributor' and 'other project contributor is' are both related to same contact type thats why you are able to see both on select list.

# Answer
> 4 votes
If you are talking about fact that there is both "other projector contributor' and 'other project contributor is'? then that is expected. it is showing you both ends of the relationship - same as it would with parent-child.

---
Tags: relationships
---


# Question
Title: Can TinyMCE 4.2.1 be installed under CiviCRM 4.1.5?
I have been attempting to install TinyMCE 4.2.1 as the default Drupal editor but have run into problems. I have posted separately on the TinyMCE forum about this. I am just wondering if anyone has installed it as a separate wysiwyg editor CiviCRM?

We are on 4.1.5

# Answer
> 1 votes
CiviCRM 4.1 is not maintained and highly insecure. Unless you have manually backported *every* security patch on this list plus the relevant ones on this list then you are strongly recommended to upgrade to a supported version. Recent versions, incidentally, ship with TinyMCE.

---
Tags: wysiwyg, tinymce
---


# Question
Title: Drupal not loading Civi's CSS and jQuery
Drupal 7 is not loading Civi 4.4's resources: CSS & jQuery. Clearing Drupal cache solves the problem, for a few hours, then it happens again. I've tried the following:

1. custom theme? nope, it's happening in Seven or Garland
2. resource URLs in CiviCRM are correct
3. disabled and re-enabled Civi as a module, no permanent solution.
4. disabled other modules like jQuery Update or Admin Menu
5. Turning off Drupal cache, CSS and jQuery aggregation. It has no effect, even though clearing Drupal's cache solves the problem.

Note it's not a conflict between js, the Civi resources *simply aren't loading*.

This started happening after an upgrade from 4.2 to 4.4. Any ideas for help?

# Answer
Check what caching you have set up in Drupal. My suspicion is that aggressive caching somewhere is taking a snapshot of the head on a non-Civi page (since that's most of your site) and presuming that it's the universal header.

You might try disabling all caching and see whether it continues to break an hour or two after you clear your caches. Alternatively, look through any cache modules or services you've got and think whether it might cause this.
> 2 votes

# Answer
Civi's core resources (styles and scripts) are added at runtime so you probably won't gain anything by disabling/enabling the civicrm module in Drupal. But since you are able to reproduce the problem somewhat reliably, I'd suggest you put a debug/logging statement in a couple places in the file civicrm.module. Namely:

* In the function `civicrm_html_head()` to ensure it's being called.
* In the function `civicrm_initialize()` \- look for the line where it says `drupal_add_html_head($header);`. That's the key bit so you definitely want to make sure that function is getting called.
> 1 votes

---
Tags: drupal
---


# Question
Title: Are log tables updated during an upgrade?
If a CiviCRM upgrade amends the structure of existing tables, do you know if the same changes are applied to the equivalent logging tables?

I've noticed in the column `civicrm_line_item.label` NULL is allowed, but in `log_civicrm_line_item.label` it's not. So when I create Contribution prices without labels, I get a constraint violation from the logging trigger during payment.

Wanted to check if it's safe to amend the logging table structure to match, or if there was a reason for the difference.

# Answer
> 1 votes
It should change the structure on the log tables, but with the caveat that the log table system isn't at the same level of support and usage as the rest of CiviCRM. The beta label hasn't come off it for years, so I wouldn't be surprised to see a bug like that.

If you're using logging, I assume you're already prepared for trouble when you upgrade, and if you are capable of changing the field structure now, I assume you'll be able to fix things later. Consequently, go ahead and make the change, but note it somewhere. If an upgrade fails, you'll know one potential reason.

# Answer
> 2 votes
See Are the logging tables upgraded:

> yes. you disable logging during upgrade (the upgrade changes are not logged)
>
> when u reenable logging, it checks for schema differences and makes the needed changes to the logging table

Since version 4.3, logging should be automatically disabled and re-enabled during upgrades: see Upgrade should disable logging and triggers.

This suggests the possibility that if logging remained enabled during an upgrade prior to 4.3.0, the structure of logging tables may not have been updated at that point.

It also suggests that disabling and re-enabling logging ought to bring the logging schema up to date.

---
Tags: upgrade, database
---


# Question
Title: Is there a way to bulk create (and connect) drupal users from CiviCRM Organizations?
With Drupal and CiviCRM it is rather straight forward to bulk create Drupal users from CiviCRM individuals and connect them at the same time:

1. Export the individuals from CiviCRM
2. Import them into Drupal using the module User Import

It works really nice: Drupal accounts are created and at the same time connected with the CivicRM contacts. And the Drupal module gives you a lot of nice options such as sending out an email with a one-time login or defining user names.

If you try the same approach with CiviCRM organizations, it will create Drupal User records but wont connect them with the according CiviCRM contacts.

I made sure that the matching/dedupe rules should not be a problem (email only) and disabled CiviCRM profiles (the default name and address profile contains individual only fields) - but no success.

Any ideas on how to bulk create organizations? Preferably using Drupal user import or anything that is doable via the UI and/or not too complex?

# Answer
> 3 votes
That is indeed how the Drupal / CiviCRM user integration works: Users = Individuals.

We stick to this way of working so we're not restricting ourselves to having to maintain a customisation like this which would be business critical if it stopped working after an upgrade.

Having accounts linked to an individual is also good, as it shows **who** in the organisation did something, like apply for membership.

It also means things like event registrations work as expected as a person will be attending those.

Using webforms, you can easily expose information about a person and their related contacts so they can update their details as well as their organisation's at any time. Keeping contact 1 as the logged in user makes this easy.

There is also this blog from Whitefuse Media which explains a similar situation and how they handled it (see the section: Drupal Users Synced to CiviCRM Organisations)

http://www.whitefusemedia.com/blog/civicrm-development-case-study

# Answer
> 1 votes
You can use the approach outlined here which uses Drupal Rules to create the User and send them a 'you have an account' email etc. The Rule can be triggered off a Civi Tag, ie you find your Orgs, you Tag them with a tag such as 'create drupal account' and Rules does the rest.

https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and

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


# Question
Title: Civi Database erased when upgrading from 4.6.3 to 4.6.4
I tried to upgrade from Civi version 4.6.3 to 4.6.4 but ended up having my crm database erased and filled with an empty civi database. I have tried to import my backup sql file in phpMyAdmin and get the following error.

```
--
-- Dumping data for table `civicrm_acl`
--

INSERT INTO `civicrm_acl` (`id`, `name`, `deny`, `entity_table`, `entity_id`, `operation`, `object_table`, `object_id`, `acl_table`, `acl_id`, `is_active`) VALUES
(1, 'Edit All Contacts', 0, 'civicrm_acl_role', 1, 'Edit', 'civicrm_saved_search', 0, NULL, NULL, 1),
(2, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access CiviMail subscribe/unsubscribe pages', NULL, NULL, NULL, 1),
(3, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access all custom data', NULL, NULL, NULL, 1),
(4, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online contributions', NULL, NULL, NULL, 1),
(5, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online pledges', NULL, NULL, NULL, 1),
(6, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'profile listings and forms', NULL, NULL, NULL, 1),
(7, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'view event info', NULL, NULL, NULL, 1),
(8, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'register for events', NULL, NULL, NU[...]
MySQL said: Documentation

#1062 - Duplicate entry '1' for key 'PRIMARY'

```

# Answer
> 5 votes
Two issues. 1. Database is getting reset when you upgrade 2. you cannot restore from backup.

Answer to #1 is this: Make sure you are following the upgrade procedure on this page: http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades

Answer to #2 is this, before restoring from backup, follow this procedure.

a. ensure that the backup is intact, examine in a text editor, or import the backup into an entirely new database (not the civicrm database) called "justtesting" or whatever

b. drop the civicrm database. this resets the schema of the database entirely, as new tables and columns are added during partial/failed upgrades, and must be removed.

c. recreate the civicrm database with the same name as it had before

d. import the mysql backup dump file into the newly re-created civicrm database.

---
Tags: upgrade, mysql
---


# Question
Title: How do I Add Contacts to Group from an Activity Report?
There is a choice in Activity Reports to Add Contacts to Group, on the top right - so I created a new Group and chose that Group, but there is not a button to click to complete the add. It's not automatic. I'm on Civi 4.6.3.

# Answer
click on the Preview Report button and you will get the 'Add contacts to group' action. Just tested it on the demo site running CiviCRM 4.6.4 using Safari and Chrome browsers http://d46.demo.civicrm.org/civicrm/report/instance/3
> 1 votes

# Answer
You should start by upgrading to the latest version (4.6.5). Most probably it was a bug that was fixed for 4.6.4. (You can confirm this before upgrading by looking at at the bugs fixed in 4.6.4).
> 0 votes

---
Tags: activities, civireport, groups
---


# Question
Title: Unable to drop mydashlets on my Dashboard
Can't drop my dashlet in the civicrm dashoard. I can drag it out but it wont drop anywhere.

Here is an image of me dragging it but the dashboard isn't opening up to drop it.

# Answer
I fixed it by pasting the file where it was looking for it. However, it is disconcerting that it is looking for the file in the wrong place.
> 1 votes

# Answer
Your dashboard configuration page doesn't look right - you can compare it to the demo site to see what I mean: http://d46.demo.civicrm.org/civicrm/dashboard

It seems like you have some CSS (or possibly JavaScript) that's overriding the standard CSS. You may want to open the developer console and look for `div id="existing-dashlets-col-0"` \- see screenshot.
> 0 votes

---
Tags: dashboard
---


# Question
Title: You are using Stripe.js in live mode over an insecure connection
Testing out Stripe with Civicrm 4.6.2, the plugin installed from Civicrm Stripe payment processor, when confirming the input test data of a Contribution Campaign with an enabled thank you page, stripe.js replies with:

```
You are using Stripe.js in live mode over an insecure connection.
This is considered unsafe. Please conduct live requests only on sites
served over https.

```

Now the Stripe dashboard is set to test, yet even after caching and reloading the page this message is shown.

Possibly for this reason when submitting a payment with a test card there is no confirmation, the page just renders again with the blank payment details input form. Nothing is shown on the Stripe dashboard. What could the problem be?

**UPDATE:**

After setting the Link to Test-Drive, the process works in the dashboard admin. On the live site after submitting the transaction with the details, the page still renders again with blank cc input form. In the console there are two errors which I think might be the reason for the error:

```
TypeError: cont is undefined civicrm:1460
ReferenceError: Shadowbox is not defined civicrm:1509

```

Shadowbox JS is installed as a plugin and set to active. Any ideas?

# Answer
Not only must the stripe dashboard be "test" but CiviCRM's contribution page must be rendered in "test drive" mode as well. Is that the case?
> 1 votes

---
Tags: payment-processor, 4.6.2, stripe
---


# Question
Title: Membership renewal start date doesn't update?
This behaviour has been observed on a live CiviCRM 4.5.8 site as well as the current demo site which is 4.6.6

When renewing a membership offline, the start date doesn't update to reflect the current membership term. An example (using UK date formats)

Membership type term = 1 year Membership Since Date = 01/07/2011 Membership Start Date = 01/07/2014 Membership End Date = 30/06/2015

So as of today, the member is in "Grace".

When you click "Renew" the membership start date doesn't update to reflect the new membership term, only the end date does. So the new dates are

Membership type term = 1 year Membership Since Date = 01/07/2011 Membership Start Date = 01/07/2014 Membership End Date = 30/06/2016

which would suggest this person has 2 year membership and doesn't reflect that they renewed this year, making membership dashboard data incorrect.

Is this expected behaviour or a possible bug?

Heather O.

# Answer
If you check on yoursite/civicrm/admin/member/membershipStatus?reset=1 and for the status "Grace" there is a **Yes** in the column headed "Member" then this is expected behaviour.

CiviCRM does not have a "renewal start date". The "start date" is the date the latest continuous period of membership started on. For any member with a status that has a "Yes" in that "Member" column a renewal will extend the end date of the current membership and not change the start date.

If you want anybody who renews after their membership end date to get a new start date then you either need to edit the **Grace** status and untick the box **Current Membership?**, or disable the **Grace** status entirely if it is not needed for your business rules and just have a membership status of **Current** followed by the membership status **Ended**.

You can read more about **Membership status rules** in the **Defining memberships** chapter of our User and Admin Guide
> 5 votes

# Answer
That sounds like the behaviour described in Test Plan - Membership Renewal:

> **Renew A CURRENT Membership**
>
> "Current" membership means that the calculated membership\_status has is\_current\_member = TRUE. For this case we are basically extending the End Date for the existing membership record and inserting a membership log record. Processing is the same for Rolling and Fixed membership periods.
>
> ```
> Update the existing membership record
>     Join Date and Start Date are NOT modified...
>
> ```
> 3 votes

# Answer
In my experience different organisations will interpret this in different ways.

Some expect the membership record to represent the entire length of time the contact has been a member and this is CiviCRM's default behaviour. In your case the contact is in their second year of of membership and this is represented by the data.

Some expect the membership start and end date to represent the current membership period. This isn't the default way that CiviCRM works but you could achieve it by creating a second membership record for the contact, letting the first one expire. You would then have a membership record per year of membership. Its not the way we would normally recommend setting up memberships but have come across installations where its being used in that way. Therefore these organisations would probably view this as a bug or undesired behaviour!

As others have said, the behaviour your seeing is as expected.
> 2 votes

# Answer
The benefit of the start date NOT changing upon timeline renewal is that it is easy to spot "continuous" members. This is because members that have never expired since they first became a member will have an identical "member since" and "start date". Those that have expired, and come back, will have different "member since" and "start date"s.
> 1 votes

---
Tags: civimember
---


# Question
Title: Attach invoice to event registration emails even if transaction is not taxed
Is it possible to attach invoices to confirmation emails for event registrations, if the payment transaction is not taxed?

From what I've observed, currently, invoices are only attached when a transaction has non-zero tax amount.

# Answer
> 1 votes
This sounds like the following bug:

Event or contribution payment invoices are not being attached in confirmation emails, when the tax amount is 0 or evaluates to false.

Fixed in 4.6.5 .

# Answer
> 0 votes
From what I can tell in the docs, this is "tax invoice" functionality. It is not a system for generic invoicing. I think tax invoices are a country-specific feature, perhaps related to VAT.

# Answer
> 0 votes
You can modify the System Workflow Messages (civicrm/admin/messageTemplates?reset=1) so that if the transaction is Pay Later, it will replace the word Receipt with the word Invoice

ie

{if $is\_pay\_later}{ts}Tax Invoice{/ts}{else}{ts}Tax Receipt{/ts}{/if}

Hope that helps

---
Tags: civievent, contributions, taxes
---


title: Import Fails After Reporting Success

text:
# Question
Title: Import Fails After Reporting Success
I am trying to import 200 activities to contacts and the import shows that all records are imported but if I go to the contact and look at their activities it is not shown.

Any help is appreciated.

Thanks, Steve

# Answer
I had about 25 fields I was skipping in the import map. I deleted these fields and it worked like a charm.
> 2 votes

# Answer
Please upload a screenshot of your field mapping, your unsupervised dedupe rule setting and a sample data of the CSV you are working with.
> 1 votes

---
Tags: activities, import
---


title: Can financial accounts be imported?

text:
# Question
Title: Can financial accounts be imported?
I have close to 100 financial accounts from Quickbooks that I need to get in CiviCRM. I'd like to avoid entering these by hand. Is there any way I could import these?

# Answer
There are likely more tables involved that just that table so I would not go directly into the database. There is an api for creating financial accounts so you could try using the csvimporter extension to import them. I believe it is available as a downloadable extension from your manage extensions page.

I would suggest just importing one and then looking to make sure it looks correct before doing more. Not that there are at least 3 entities involved - financial types, financial accounts & the one that links them.

Financial accounts have the cost code information and financial types are what the user selects. Each Financial type should have a number of related financial accounts for different purposes (income, expense etc) - so just look to make sure they look the same through the UI before you go for 100 imports
> 6 votes

---
Tags: civicontribute, import
---


# Question
Title: Why Are My Event Reminders Not Being Sent?
I should have received an event reminder I had scheduled to go out today, but didn't.

I have confirmed that the email was saved under the "schedule reminders" tab of the event.

I did notice that it didn't appear on the scheduled mailings here - /civicrm/mailing/browse/scheduled (but I'm still new to civi so not sure if they're supposed to show there or not).

I don't think I have configured everything for bulk mailing properly yet, but some emails do go out (like registration or membership confirmations).

Drupal 7.38 civiCRM 4.4.15

# Answer
Is your Scheduled Jobs for Send Scheduled Reminders enabled at civicrm/admin/job?reset=1 ? If so, does the View Log Job have any info? /civicrm/admin/joblog?jid=8&reset=1.

If not, and if you want to confirm if your cron is running, then enable a Scheduled Job and then check back later, when it should have run, and see what the Scheduled Job shows as the last time it ran. If it hasn't run then you probably need to check your cron set up http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs
> 5 votes

---
Tags: drupal, scheduled-reminders
---


# Question
Title: Restricting users in the same group to view/edit ONLY their own contact details
Restricting users in the same group to ONLY edit their own contact details.

I do not want to create separate group for each contact and then put the restriction. I have many contacts in one group and would like to restrict users from updating each others' details.

Thank you in advance.

# Answer
> 2 votes
Unless you have other reasons for doing so, you do not need to give a user access to the back of CiviCRM to edit their own contact details.

In Drupal you can do this by setting any profile with the relevant fields to be **Used For** "View/Edit Drupal User Account". This profile will then appear on the Drupal account information page when that user is logged in and they can edit their own details.

There is similar functionality for Joomla! and Wordpress, but I can see that the User and Admin guide is somewhat Drupal-centric in this regard and does not specify the equivalent **Used For** option for those. It looks like it **may** be "User account" and that the profile labelled "Name and Address" always has that option selected and is the only profile that can have that option selected in both Joomla! and WordPress.

Alternatively it could be that in Joomla! and WordPress any Contact profile can be exposed through the front-facing web pages to allow logged-in users to edit their own information if you follow the instructions in the Integrating with Joomla! or Integrating with WordPress sections of our User and Administrator Guide.

(I, too, am somewhat Drupal-centric.)

# Answer
> 1 votes
I am not sure of the relevance of the group in the question. But you can allow anyone to edit their profile by exposing the profile in edit mode.

In the profile listing. click More \> Use Profile Create Mode.

Then change the "create" to "edit" in the link and let the users have that link.

# Answer
> 0 votes
Thank you for your response JoAnne and Devejenx.

I had read through all the documents available online as suggested by JoAnne. I even went to try the profile restriction available but with no luck.

I am part of a non-profitable religious organization. We have had numerous issues maintaining user/membership data of the members', and hence decided to give out control to the individuals. With this we can even leverage the other useful tools in CiviCRM like CiviEvent, CiviContribute etc.

We have our site built on Wordpress-CiviCRM.

Will try the hook suggestion and update.

---
Tags: wordpress, permissions, acl, user
---


title: Adding Spouses to Civi Contacts

text:
# Question
Title: Adding Spouses to Civi Contacts
I have about 5000 records of my org. To be a "member" of our org we measure that by "household" so therefore there could be two or more people in the household.(we provide free legal advocacy to these people).

We have a unique identifier being a member number. Each member number could have say two people under that one number, being a married couple.

I have used the import contacts feature in Civi to import "individuals" because if I import them as "households" there dosnt seem to be a name field for the household show up after import. ie it shows the address and city etc but "name" is blank and it dosnt assist our org by not having a member name to identify the household.

So i added individuals. My frustration at this program is that despite spending multitudes of time reading the documentation, i cant import the spouse name into the program that creates a relationship.

Is there any way to get assistance on this issue. Happy to share the csv of our database if it assists in comprehending our data.

# Answer
There are a couple of ways to do this, but here is the one that I prefer.

1. Decide how you'll name households. CiviCRM household names are arbitrary, so you can so something like "Jane and John Smith" or "Smith Household". Use a spreadsheet function to populate that field in your spreadsheet.
2. Import the households as households. Include your membership number as External Identifier. Include your new Household Name field.
3. Create a unique identifier for your individuals as a new field. Use a spreadsheet function to append "A" to the member number on the first spouse and "B" to the member number on the second. The result would be that you have member number 1234 and individual number 1234A on the one spouse and member 1234 and individual 1234B on the other. On the second spouse, add another field with the individual number of the first spouse.
4. Import your individuals with numbers ending in A. Include the member number, and import the field as "Household of - External Identifier". Include the new -A number you created as External Identifier.
5. Import the "B" spouses as individuals. Include the member number to create the household relationship and the -B number as the External Identifier. Finally, include the corresponding -A number as "Spouse of - External Identifier".

The result should be households that have relationships with the individuals and individuals with relationships to each other.
> 5 votes

---
Tags: contacts, import
---


# Question
Title: Multi-value fields in profiles - how to?
When I add a multi-value custom fields to a profile, Civi only allows visitors to enter the fields once - as a simple fields.

How to configure custom fields and profile to get form with multi-field table described in "Multi-value fields in profiles" section on http://book.civicrm.org/user/current/organising-your-data/profiles/

This table with 'new record' in form is also described there http://wiki.civicrm.org/confluence/display/CRM/Multiple-record+Custom+Data+Sets+in+Profiles

# Answer
I don't think you can add multiple values in multi-value field in create mode (out of the box) at the moment.

You could have the user fill in one value and have them add more later. If you don't want the user to have to login you could send them a checksum token.
> 3 votes

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


title: Listing events in wordpress

text:
# Question
Title: Listing events in wordpress
So I would like to use the CiviCRM events in wordpress, in a page listing multiple events, using the shortcodes. If I create a page in wordpress with the following:

```
[civicrm component="event" id="584" action="info" mode="live"]

```

It is fine, it will display the single event. However, if i was to add another event into the page, it doesn't display. Ideally I would like to use this shortcode inside of Advanced Custom Fields. The reason for doing this is we need to display only certain events for a page which members are logged in to view.

```
<?php

if( have_rows('events') ): ?>

    <ul>
        <?php while( have_rows('events') ): the_row(); ?>
            <li><?php var_dump(get_sub_field('event')); ?></li>
        <?php endwhile; ?>
    </ul>
<?php endif; ?>

```

The vardump above literally returns null. Any ideas how I can do this. I am aware of the civievent wiget but that lists all events that are upcoming.

Just to clarify this is for civicrm 4.5.4. Cheers.

# Answer
> 5 votes
This was an issue prior to 4.6--you couldn't have more than one instance of CiviCRM content on a screen. Christian Wach did a lot of work to change this for 4.6--that's why he was asking what version you're on.

In short, if you're not on 4.6, upgrade. If you are, you may have found a bug.

# Answer
> 1 votes
If you use the WP plugin Ajax event calendar you can put your events into categories, and use a shortcode to list all events of a given category on a page or post..

---
Tags: civievent, wordpress
---


# Question
Title: "Membership can not be used as a Result Column for profile searches" - why not?
What can be done to make Membership - Membership Status in particular - a Result Column for profile searches? I want to be able to show Status in a Search View.

# Answer
Can't you go to Advanced Search & select the memberships you want - you can select which statuses you want, too - the results show status and date of membership if you select to **Display Results As** Membership - unless I don't understand your question.

Note: For v4.5 and below, **Display Results As** is in the top right of the Basic Criteria frame in an Advanced Search.

In 4.6 **Display Results As** is in the "Search Settings" grouping at the bottom of the Basic Criteria frame in an Advanced Search.
> 2 votes

# Answer
With regard to finding people who have aren't members, if you can't do this via a view I think you will need a smart group of people in your Group who have a membership and then use the include/exclude custom search (or perhaps Search Builder) to find people in the Group but not in the smart group.
> 1 votes

# Answer
Joe - I think a View is probably a good approach for you to take. If you do so, pls consider attaching it here so others can try it out.
> 1 votes

---
Tags: civimember, profile, search, user, ui
---


# Question
Title: Is it correct that saving an address with only Country should fail to save data?
On Demo if you go to this record http://d46.demo.civicrm.org/civicrm/contact/view?reset=1&cid=202 and 'add address' or 'Edit' and save the Home Address with just Country (currently set to Default Country = Australia), nothing gets saved, no debug message either.

I tested on demo after witnessing what I thought was a problem with a Profile on a Contribution page, but the issue seems to be actually with the 'save contact' task.

# Answer
> 3 votes
if you have a default country and that you save an address with only that country, it assumes it's not that the user chose this country, but just that the default was left selected.

So it's normal behaviour, but might not be what you want indeed.

---
Tags: contacts
---


# Question
Title: Files in the data directory (Upload | Custom)should not be downloadable. (Nginx)
I am running a drupal site on nginx and I have a civicrm set-up on this site. Whenever I login and goto civicrm dashboard, I am getting this warnings. I have tried searching solution for this, not able to fix it.

```
Files in the data directory (/home/drupal7/sites/example.org/files/civicrm/custom/) should not be downloadable.

Read more about this warning

Files in the data directory (/home/drupal7/sites/example.org/files/civicrm/upload/) should not be downloadable.

Read more about this warning

```

I have tried this on my nginx configuration file.

```
    root /home/drupal7;

    location ~ /sites/example.org/files/civicrm/(custom|upload) {
        deny all;
        return 404;
    }

```

# Answer
Your proposed solution in your nginx config looks about right; here's a tested & working example:

```
location ~* ^/sites/(.*)/files/civicrm/(ConfigAndLog|templates_c|upload|custom) {
    deny all;
}

```

Here are some things you could check.

1. Have you reloaded nginx since making the config change?
2. Pick a file in files/civicrm/custom/ and try to access it in a browser.

* If you can, the nginx config needs fixing.
    * If you can't, the warning is spurious; it would be good to investigate why. Check your nginx access logs for the test requests that Civi makes to check access.
3. Is another `location` block in your nginx config taking precedence over this one? You can check this by temporarily enabling debug-level logging for the relevant virtual host, e.g.

error\_log /path/to/log debug;

(Note that nginx needs to have been built with --with-debug .) This will produce very verbose logging, so only enable it briefly while testing: enable debug, access a file under files/civicrm/custom/ , disable debug, then look through your error log for the request. From this, you should be able to see which `location` block matched the request.

You should also deny access to ConfigAndLog/ and templates\_c/ as in the config above.

See checkUploadsAreNotAccessible.
> 3 votes

---
Tags: drupal, security, nginx
---


# Question
Title: How should I move a custom field to a different custom fieldset?
Sometimes one needs to rejig which fieldset contains one or more fields after data has been entered in them. For example, you create a new contact subtype and you want to move some but not all of the custom fields in an existing custom fieldset to a custom fieldset for the new contact subtype. You might need to do this when consolidating fieldsets, or just so the fields appear under a more appropriate title when you have several fieldsets for the same objects.

What's the best way to move a custom contact field and its data to a different fieldset?

# Answer
Mostly you will want to move fields between customs fields sets used for the same entity (ie from one custom field set used for participants to another custom field set used for participants.)

This can be done easily through the UI as follows:

1. Go to **Administer \> Customize Data and Screens \> Custom Fields**
2. If it doesn't already exist create the new field set.
3. Return to **Administer \> Customize Data and Screens \> Custom Fields** and select **View and Edit Custom Fields** for the field set containing the field you want to move.
4. On the far right of the row containing the field you want to move click on **More \> Move**.
5. Select the the new field set.

However, if you want to move a field from a field set used for **Individuals** to a field set used for **Contacts** or vice versa you will get an error message "The destination group extends a different entity type."

In that situation or similar involving a single branch of contact subtypes:

1. Back up your database.
2. Using phpMyAdmin or otherwise, in **civicrm\_custom\_group** find the field set with the most restricted contact type and edit the **Extends** field to match the value in the field set with the least restricted contact type. (eg change "Individual" to "Contact".)
3. In the UI move the field as described above.
4. Using phpMyAdmin or otherwise change the **Extends** value you altered in 2. back to it's original value.

NOTE: 1. I haven't tried moving fields between a field set used for Organizations and one used for Individuals.
> 10 votes

# Answer
Before doing either of the following approaches, make sure to backup your database.

Both methods assume you have created the new custom fieldset group in the browser before beginning.

**Export and Import**

The first method is done through the browser, and the instructions are a high-level summary of what needs to be done.

1. Create a new second field in the other custom fieldset. You'll need to use a different name when creating the second field that was used when creating the first field. (After you have created the second field, you can change its name back to what was used for the first field.) If the field has option values, make sure to use the same set of options.
2. Export data from the first field including the contact id,
3. Import data into the second field.
4. Review the data to make sure everything looks right.
5. Delete the first field.

**Change the field location in the schema (Expert SQL skills required)**

This method can be used to avoid long exports and imports, as well as inadvertent errors in configuring fields the same through the browser.

Make sure to take your site offline while modifying the schema as below.

In this approach, we create new field(s) in the table holding the data for the new fieldset, copy the data over, move the fields from the old to the new group, review the data, then delete the old field(s). As an example, we're going to move fields from an Applicant custom fieldset to a new Student fieldset.

1. Find the custom field ID and the custom fieldset group ID in one of two ways.

1. In a browser, navigate to Administer \> Custom Data and Screens \> Custom Fields, then beside the relevant fieldset click View and Edit Custom Fields, then beside the relevant field, hover over Edit field and observe the url your browser displays (or open a new tab for that url). In the url, you'll see gid=xx and id=yy, where xx is the fieldset group id and yy is the field id.
    2. In MySQL either on a command line, via phpMyAdmin, or some similar tool, list the custom fieldset groups with:

    mysql\> SELECT id, name, title, extends FROM civicrm\_custom\_group;

    Note the fieldset group id numbers of the old and new groups you want, say gg1 and gg2. Then run:

    mysql\> SELECT id, name, label FROM civicrm\_custom\_field WHERE custom\_group\_id=gg1;

    Note the field id number you want, say ff.
2. There is a table for each custom fieldset named civicrm\_value\_GGG\_gg, where gg is the group id, and GGG is its civicrm\_custom\_group.name. I find it is easiest to get the table name by copying it into my clipboard from the list of tables in the database. From the mysql command line:

mysql\> SHOW TABLES;
3. Display the definition of the table so we can copy one or more field definitions into the new table, for example:

mysql\> SHOW CREATE TABLE civicrm\_value\_applicants\_11;

| civicrm\_value\_applicants\_11 | CREATE TABLE `civicrm_value_applicants_11` (

`id` int(10) unsigned NOT NULL AUTO\_INCREMENT COMMENT 'Default MySQL primary key',

`entity_id` int(10) unsigned NOT NULL COMMENT 'Table that this extends',

`student_number_18` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`application_stage_19` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`academic_program_20` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`start_term_21` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`residency_22` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`application_type_23` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`academic_level_24` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`rtw__25` tinyint(4) DEFAULT NULL,

`applicant_type_52` double DEFAULT NULL,

PRIMARY KEY (`id`),

UNIQUE KEY `unique_entity_id` (`entity_id`),

KEY `INDEX_application_stage_19` (`application_stage_19`),

CONSTRAINT `FK_civicrm_value_applicants_11_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE

) ENGINE=InnoDB AUTO\_INCREMENT=3337 DEFAULT CHARSET=utf8 COLLATE=utf8\_unicode\_ci |

4. Here's the table we are copying fields into:

mysql\> show create table civicrm\_value\_students\_37;

| civicrm\_value\_students\_37 | CREATE TABLE `civicrm_value_students_37` (

`id` int(10) unsigned NOT NULL AUTO\_INCREMENT COMMENT 'Default MySQL primary key',

`entity_id` int(10) unsigned NOT NULL COMMENT 'Table that this extends',

PRIMARY KEY (`id`),

UNIQUE KEY `unique_entity_id` (`entity_id`),

CONSTRAINT `FK_civicrm_value_students_37_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8\_unicode\_ci |

5. Using relevant field definitions from the first table, run the following query:

mysql\> ALTER TABLE civicrm\_value\_students\_37

ADD COLUMN (

`student_number_18` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`academic_program_20` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`start_term_21` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`residency_22` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`academic_level_24` varchar(255) COLLATE utf8\_unicode\_ci DEFAULT NULL,

`rtw__25` tinyint(4) DEFAULT NULL

);

6. Copy the data over. If the fieldset receiving the data exists for some or all of the relevant records, then you will need to run an update query along the following lines

mysql\> UPDATE civicrm\_value\_students\_37 s

INNER JOIN civicrm\_value\_applicants\_11 a

ON s.entity\_id=a.entity\_id

SET

s.student\_number\_18=a.student\_number\_18,

s.academic\_program\_20=a.academic\_program\_20,

s.start\_term\_21=a.start\_term\_21,

s.residency\_22=a.residency\_22,

s.academic\_level\_24=a.academic\_level\_24,

s.rtw\__25=a.rtw\__25;

7. Insert the data if appropriate. If some or all of the records in the old fieldset do not exist in the new fieldset, you'll need to run an insert query along the following lines:

mysql\> INSERT INTO civicrm\_value\_students\_37 (entity\_id, student\_number\_18, academic\_program\_20, start\_term\_21, residency\_22, academic\_level\_24, rtw\__25)

SELECT a.entity\_id, a.student\_number\_18, a.academic\_program\_20, a.start\_term\_21, a.residency\_22, a.academic\_level\_24, a.rtw\__25

FROM civicrm\_value\_applicants\_11 a

LEFT JOIN civicrm\_value\_students\_37 s

ON a.entity\_id=s.entity\_id

WHERE s.entity\_id IS NULL;

NB: FYI the LEFT JOIN ... WHERE ... IS NULL selects records that exist in the old table but not the new one.

8. This step is the first action that changes what appears through the browser. Update the fieldset group that these fields are in:

mysql\> UPDATE civicrm\_custom\_field SET custom\_group\_id=11 WHERE id IN (18, 20, 21, 22, 24, 25);

9. After checking the data in the browser, remove cruft from the first database table:

mysql\> ALTER TABLE civicrm\_value\_applicants\_11

DROP COLUMN student\_number\_18,

DROP COLUMN academic\_program\_20,

DROP COLUMN start\_term\_21,

DROP COLUMN residency\_22,

DROP COLUMN academic\_level\_24,

DROP COLUMN rtw\__25;
> 2 votes

---
Tags: custom-fields
---


# Question
Title: DB error: already exists on contribute page
I'm on civi 4.6.2, with Drupal 7

I have a contribution page which is a contribution on behalf of an organisation, and also creates a user account for the website. I'm getting the error below on submit. Some searching suggests truncating the civicrm\_uf\_match table - but if I do that will the link between all the Drupal accounts on my site and their CiviCRM profiles be broken?

Thank you!

Robin

Sorry but we are not able to provide this at the moment. DB Error: already exists Error Details Database Error Code: Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI\_uf\_name\_domain\_id', 1062 Additional Details: Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -5
[message] => DB Error: already exists
[mode] => 16
[debug_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id']
[type] => DB_Error
[user_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id']
[to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id']"]

```

) Return to home page.

# Answer
> 2 votes
It means you a trying to create a new account with an email that is already in use for another account.

Some CMS (drupal at least!?) don't allow two separate accounts with the same email, hence the (rather not too explicit) error message.

The simple solution is either to change the existing account so it uses another email address or create the new account with an email that isn't used already.

The not so simple but would be awesome for your karma solution is to contribute a patch to display an "end user friendly" error message and the option to put another email in the form if its invalid

X+

# Answer
> 1 votes
There is a previously created entry in the table with rfenwick@googlemail.com\**-1\** as the uf\_name, which is normally the same as the Drupal account email. Could you check using phpMyAdmin or mysql from the command line for other entries in this field:

```
SELECT * FROM civicrm_uf_match WHERE uf_name like '%-1';

```

In some other parts of CiviCRM one sometimes sees '-1' added to a machine name field that needs to be unique if the key being inserted is the same as an existing entry. Perhaps there is a bug in here somewhere doing the same (surprising since this functionality is so well used).

Could you delete any entries with -1, then try again with a new email. You might want to review at Contact \> Find and Merge Duplicate Contacts, that the Unsupervised rule for Individual contacts is reasonable and will catch any problems with the contacts that will be created using your Contribution form.

# Answer
> 0 votes
This issue is recently fixed in civicrm later version 4.6.3 and here's the fix https://github.com/civicrm/civicrm-core/pull/5645/files

---
Tags: civicontribute
---


# Question
Title: Automatically send unpaid contribution reminder
I would like to send an email on the 10th of each month to "pay later" donors from the past month who did not pay their amount due.

How should I do this?

# Answer
Take a look at Scheduled reminders rather than CiviMail.
> 3 votes

---
Tags: civicontribute
---


# Question
Title: Test CiviMail gives Error in call to Mailing_send_test : mail() returned failure
I am able to send group emails from a search (less than 50), am able to send a test email from the Administer / System Settings / Outbound Email, but when I try to do a CiviMail test, I get Error in call to Mailing\_send\_test : mail() returned failure.

What should I look for?

I'm running CiviCRM 4.6.4 with Drupal 7.3.8 and here's the contents of the ConfigAndLog file after trying to send mail with the Debug and Backtrace on

```
    Jul 09 08:29:28  [info] $backTrace = #0 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Core/Error.php(894): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(PEAR_Error))
#2 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("mail() returned failure", NULL, 16, (Array:2), NULL)
#4 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/packages/Mail/mail.php(175): PEAR->raiseError("mail() returned failure")
#5 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Mailing/BAO/MailingJob.php(707): Mail_mail->send("\"Mr. Matt Burkhardt\" <mlb@imparisystems.com>", (Array:11), "--=_fd576d140be170d71ee812779cea380f\nContent-Transfer-Encoding: 8bit\nConten...", "26")
#6 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Mailing/BAO/MailingJob.php(611): CRM_Mailing_BAO_MailingJob->deliverGroup((Array:1), Object(CRM_Mailing_BAO_Mailing), Object(Mail_mail), "", (Array:0))
#7 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Mailing/BAO/MailingJob.php(198): CRM_Mailing_BAO_MailingJob->deliver(Object(Mail_mail), (Array:12))
#8 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/api/v3/Mailing.php(643): CRM_Mailing_BAO_MailingJob::runJobs((Array:12))
#9 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_mailing_send_test((Array:10))
#10 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#11 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("mailing", "send_test", (Array:10), NULL)
#12 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Subscriber/ChainSubscriber.php(195): civicrm_api("mailing", "send_test", (Array:10))
#13 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Subscriber/ChainSubscriber.php(72): Civi\API\Subscriber\ChainSubscriber->callNestedApi((Array:34), (Array:5), "create", "Mailing", 3)
#14 [internal function](): Civi\API\Subscriber\ChainSubscriber->onApiRespond(Object(Civi\API\Event\RespondEvent))
#15 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func((Array:2), Object(Civi\API\Event\RespondEvent))
#16 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:4), "api.respond", Object(Civi\API\Event\RespondEvent))
#17 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Kernel.php(221): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("api.respond", Object(Civi\API\Event\RespondEvent))
#18 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/Civi/API/Kernel.php(98): Civi\API\Kernel->respond(Object(Civi\API\Provider\MagicFunctionProvider), (Array:9), (Array:5))
#19 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Mailing", "create", (Array:34), NULL)
#20 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Utils/REST.php(404): civicrm_api("Mailing", "create", (Array:34))
#21 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Utils/REST.php(640): CRM_Utils_REST::process((Array:3), (Array:32))
#22 [internal function](): CRM_Utils_REST::ajax()
#23 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
#24 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:12))
#25 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#26 /home6/frederk3/public_html/lcfcadmin/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
#27 [internal function](): civicrm_invoke("ajax", "rest")
#28 /home6/frederk3/public_html/lcfcadmin/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
#29 /home6/frederk3/public_html/lcfcadmin/index.php(21): menu_execute_active_handler()
#30 {main}

```

# Answer
> 1 votes
It is likely a problem of configuration of your server. If you have a cheap hosting, they might have disabled the mail() function. If it's your own server, you need to install a mail server for instance postfix.

A workaround might be to try using smtp instead of mail, with localhost as the mail server. if this doesn't work, you might want to try the sendmail option.

Might be worthwhile checking with your host provider, see if they impose restrictions on mailing from php. If they do and don't want to change their policy, your only option might be to move to a less restrictive host

# Answer
> 0 votes
I have the same problem. I create a mailing, I use "send test mail" and I get this error : Error in call to Mailing\_send\_test : mail() returned failure

Any idea ? Regards, HashKey

---
Tags: civimail
---


# Question
Title: What went wrong with events search? "Counted" link gives error... How to fix it?
I am on civicrm 4.6.5. From a Event Dashboard when I select the "Counted" link to see the list of participants, "DB Error: syntax error" appears on the screen. And from civicrm log I get the following message. So far it was working perfectly fine. I am not sure what went wrong!!! Can anyone help please?

```
Jul 21 12:30:53  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]
    [type] => DB_Error
    [user_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 15 AND civicrm_participant.status_id 0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:]]3[[:>:]]|[[:<:]]4[[:>:]]'  AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND  civicrm_participant.role_id REGEXP '[[:<:]]1[[:>:]]|[[:<:]]2[[:>:]]|[[:<:' at line 3]"]
)

Jul 21 12:30:53  [info] $backTrace = #0 /srv/www/sites/all/modules/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /srv/www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /srv/www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#4 /srv/www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#5 /srv/www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", "DB_Error", TRUE)
#6 /srv/www/sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
#7 /srv/www/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /srv/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#9 /srv/www/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#10 /srv/www/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#11 /srv/www/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#12 /srv/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1221): CRM_Core_DAO->query("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...", TRUE)
#13 /srv/www/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(4609): CRM_Core_DAO::singleValueQuery("SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contac...")
#14 /srv/www/sites/all/modules/civicrm/CRM/Event/Selector/Search.php(288): CRM_Contact_BAO_Query->searchQuery(0, 0, NULL, TRUE, FALSE, FALSE, FALSE, FALSE, NULL)
#15 /srv/www/sites/all/modules/civicrm/CRM/Core/Selector/Controller.php(233): CRM_Event_Selector_Search->getTotalCount(4, NULL)
#16 /srv/www/sites/all/modules/civicrm/CRM/Event/Form/Search.php(336): CRM_Core_Selector_Controller->__construct(Object(CRM_Event_Selector_Search), NULL, NULL, 4, Object(CRM_Event_Form_Search), 1, NULL)
#17 /srv/www/sites/all/modules/civicrm/CRM/Event/Form/Search.php(124): CRM_Event_Form_Search->postProcess()
#18 /srv/www/sites/all/modules/civicrm/CRM/Core/Form.php(455): CRM_Event_Form_Search->preProcess()
#19 /srv/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(94): CRM_Core_Form->buildForm()
#20 /srv/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Event_Form_Search), "display")
#21 /srv/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Search), "display")
#22 /srv/www/sites/all/modules/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("display")
#23 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#24 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#25 /srv/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#26 /srv/www/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
#27 [internal function](): civicrm_invoke("event", "search")
#28 /srv/www/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
#29 /srv/www/index.php(21): menu_execute_active_handler()
#30 {main}

```

# Answer
This is a bug that was introduced in 4.6.5. My guess is 4.6.6 will be out pretty quickly as a result!

Check here if you want to jump in & patch your install

https://issues.civicrm.org/jira/browse/CRM-16858
> 2 votes

---
Tags: civievent, search, search-results
---


# Question
Title: Selecting Participants report from Manage Events results in: "DB Error: syntax error Return to home page." after update
Worked fine with Drupal 7.37 core and CiviCRM 4.6.2.

Updated site to 7.38 core and Civi 4.6.5, then get an error for all of my events when trying to display Participants from "Manage Events" page.

Error trace shows the following:

```
Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND civicrm_participant.is_test = 0 ) AND (contact_a.is_deleted = 0)' at line 3, 1064
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 57 AND civicrm_participant.status_id 0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)' at line 3]
    [type] => DB_Error
    [user_info] => SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 57 AND civicrm_participant.status_id 0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count( DISTINCT  civicrm_participant.id )  FROM civicrm_contact contact_a LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
                                                        contact_a.id = civicrm_note.entity_id )  LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id  INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id  LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id )  LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id )  LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
                               AND option_group_participant_role.id = participant_role.option_group_id )  LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id)  WHERE  ( civicrm_event.id = 57 AND civicrm_participant.status_id 0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 AND civicrm_participant.is_test = 0 )  AND (contact_a.is_deleted = 0)' at line 3]"]
)

```

Looks like ( civicrm\_event.id = 57 AND civicrm\_participant.status\_id 0 AND civicrm\_participant.is\_test = 0 ) is malformed and should be ( civicrm\_event.id = 57 AND civicrm\_participant.status\_id = 0 AND civicrm\_participant.is\_test = 0 ), but I don't know the cause.

# Answer
> 1 votes
This is a new bug in 4.6.5 :-(

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

I would expect 4.6.6 to be out fairly quickly to remedy it - or you can apply patches from the list.

---
Tags: civievent, sql
---


title: Send an Email from CiviCase

text:
# Question
Title: Send an Email from CiviCase
is there a way I could add the "Send an Email" activity to the CiviCase timeline? I was hoping to file an activity in the timeline so that x number of days from the Open Date, the user can "Send an Email" via an email template.

# Answer
Yes and no. You can add a plain reminder to send an email to the timeline, but to send the actual email they'd need to expand the roles section and click the mail icon.

Or they can send a regular email from their mail program and use the email processor feature, which will autofile inbound emails on the case if the subject has the right code in it. See http://book.civicrm.org/user/current/case-management/setup/ down where it says "filing emails on cases".
> 1 votes

---
Tags: email, civicase
---


# Question
Title: Event custom fields not carried over to repeat events
When we set up a recurring event, data in custom event fields isn't carried over to the repeated events. Similarly, if a recurring event is edited and we tell it to overwrite all the occurrences, only the edited event will retain the custom data.

(This is in v4.6.4, but I'm able to duplicate this in the online demo)

# Answer
This sure seems like an oversight on CiviCRM's part. Good call for testing on the demo to rule out some weird problem on your site.

At this point, the bug needs to be reported and fixed. Go to issues.civicrm.org and create an issue. That way it can be triaged and assigned to the best person to fix it.

Unfortunately, until a fix comes out, you'll have to manually select the new recurring events in the custom data settings.
> 2 votes

---
Tags: civievent, custom-fields
---


# Question
Title: Problems with Search Builder: Trying to find records with empty Country field
I know I have contacts with no Country - this was something we came across recently when a colleague tried to use the proximity search and known contacts didn't appear. I've used Batch update to update a fair few I knew about, but when I use the Search Builder now to check for Contacts \> Country \> Primary \> 'Is empty' or '≠' 'United Kingdom' and it comes back with nothing. But scrolling through the records, I can see there are still some records with no Country?

Am I not using the Search Builder properly or is there a bug? I'm using v4.4.13

# Answer
> 1 votes
Try changing the search condition of the Search Builder ignore is\_primary flag

look for: contact -\> country -\> home -\> is not null (also change the address type) contact -\> contact type = Individual

by this way you can select all the record with country field null also you can use batch update

---
Tags: search, search-results, search-builder
---


# Question
Title: Change Joomla User Group After Registration
I created custom profiles and have registration forms for these profiles. What I want to do is to assign people after registration to a specific Joomla user group.

For example:

1. If a visitor register on **A** profile, I want to assign him/her to Joomla's **A** user group.
2. If a visitor register on **B** profile I want to assign him/her to Joomla's **B** user group.

Is this possible? Thanks.

# Answer
Yes, you can do it by way of CiviCRM groups. Two parts:

1. Create a CiviCRM group for each profile. Go into the advanced settings for each profile and select the corresponding group to have all contacts filling the profile automatically added to the group.
2. Install the CiviCRM Group Sync extension in Joomla. Configure it to sync up the appropriate CiviCRM groups to Joomla.

An added benefit is that you'll be able to filter by the groups within CiviCRM.
> 2 votes

---
Tags: joomla
---


# Question
Title: Why I am getting a "?" in a PDF letters beside images?
I have a PDF letter (thankyou for donations) that I've created in a new implementation of civi for our organization. I've struggled with formatting it to look nice when converted to PDF, and everything is great, except that in the final PDF there is a question mark beside the image of our exec dir's signature. Like so...

If I save the HTML to a file and open in my browser (Chrome, on Mac), I get "â€‹" in the place where the "?" shows up in a PDF, suggesting a character encoding issue. The browser shows "Western (Windows-1256)" encoding, and if I change it to UTF-8, the html renders correctly. However, that doesn't solve the problem in civi. Everywhere that I know to check in my system is using UTF-8.

I've tried different image formats (PNG, JPG), and I've even seen this happen in another of my civi message templates with different image.

Strangely, our logo image in the same letter/template does not have this problem, though in a couple of my rounds of editing, the mysterious ? showed up there as well.

EDITED: Here's the HTML. (And, yes, I know inline CSS is frowned upon, but I'm not sure how to change that in the context of a Message Template. Also the internal CSS block doesn't convert through dompdf, but that would be for another thread...)

```
<style type="text/css">div.name {
margin-bottom: 7px;
font-family: 'Trebuchet MS';
font-size: 11px;
vertical-align: baseline;
</style>
<table>
    <tbody>
        <tr>
            <td style="padding: 0px; width=120px">
            <p><img src="/media/civicrm/persist/contribute/images/logo-707x1032.png" width="100px" /><br />
            <span style="font-size: 11px; line-height: 1; font-family: 'Times New Roman';"><i>Creating global partnerships that<br />
            combat extreme poverty and<br />
            nurture sustainable community</i></span></p>
            </td>
            <td rowspan="2" width="20px"> </td>
            <td rowspan="2">
            <p>{contact.today_date}</p>

            <p> </p>

            <p>{contact.display_name}<br />
            {contact.street_address}<br />
            {contact.city}, {contact.state_province} {contact.postal_code}</p>

            <p><span style="line-height: 1.6em;">{contact.postal_greeting},</span></p>

            <p>Thank you for your gift of {contribution.total_amount} ({contribution.receive_date}) for ----. Your support is truly important in our work of bringing communities together.</p>

            <p>Sincerely,<br />
            <img src="/media/civicrm/persist/contribute/images/Leslie%20signature.png" width="250" /> <br />
            <span style="line-height: 1.6em;">xxxxxxxx</span><br />
            <span style="line-height: 1.6em;">Executive Director</span></p>
            </td>
        </tr>
        <tr>
            <td style="padding: 0px;">
            <div class="name">xxxxxxxx<br />
            Executive Director</div>

            <div class="name">staff here</p>

            <p style="margin-bottom:1em;"><span style="font-size: 11px; font-family: 'Trebuchet MS'; font-weight: bold; vertical-align: baseline;">Board of Directors:</span></p>

            <p><span style="font-size: 11px; font-family: 'Trebuchet MS'; vertical-align: baseline;">board here</span></p>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="3" style="padding: 0px;">
            <p style="margin-top:1em"><span style="font-size: 11px; font-family: 'Times New Roman'; text-align: center;"><b>xxxxxx is a 501c3 organization. No goods or services were exchanged for this donation. Please save this letter for your taxes.</b><br />
            <span>address</span></p>
            </td>
        </tr>
    </tbody>
</table>

```

# Answer
CiviTeacher is right, there is extraneous character, totally unrelated to the image. I am able to consistently recreate the problem in this way:

1. In WYSIWYG mode (CKEditor)
2. Type "text 1", Enter
3. Type "text 2", shift-enter
4. Move insertion point to the beginning of "text 2", and backspace so that you have "text 1text 2" on one line.
5. Shift-enter to separate "text 1" and "text 2" onto two lines
6. Move insertion point to the end of "text 2" and shift-enter

This results in the following html code (source mode):

```
<p>text 1<br />
<span style="line-height: 1.6em;">text 2<br />
</span></p>

<p> </p>

```

The hidden character is just to the left of the code. It doesn’t show up in either wysiwyg or source views. It remains hidden when copied to other text editors (like an email client, this message board - just copy the above code -, or TextWrangler).

Seems like a bug in... CKEditor? Where does this get reported?
> 5 votes

# Answer
When I have encountered this previously, I have found that it (oddly) enough is caused by extra space in the template code itself - have you tried, for example, removing all the spaces at the beginning of the line where your reference is located? The spacing is wonderful for easily reading the code, of course, but it causes issues like this in my experience.

Lesley
> 6 votes

# Answer
Please try removing the space (coded %20) from the filename of the image, either by renaming it on the server or reuploading it.
> 3 votes

---
Tags: civimail, pdf
---


title: Add membership details to summary tab

text:
# Question
Title: Add membership details to summary tab
I would like to pull through some of the membership details into the summary tab (don't ask... clients...!)

What is the easiest way to do this, as when you are on the summary tab, none of the membership info is assigned to smarty.

This is civicrm 4.5.4

Cheers.

# Answer
> 3 votes
Create a new extension and use hook\_civicrm\_summary which should be of more use and you can add value at any place

Please refer to the following link for more reference http://wiki.civicrm.org/confluence/display/CRMDOC43/hook\_civicrm\_summary

# Answer
> 1 votes
Alternative if you're just displaying data is to attach some extra smarty code to the end of the summary template using *templatename*.extra.tpl:

https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates

You can grab the data from the API in this file using smarty api commands. Then use jQuery to insert it into the summary tab where appropriate.

# Answer
> 1 votes
I sort of did just this. Because there is a lot of white space next to the name, we display the membership info after the name.

Because some of our contacts have multiple memberships and we care about the start and end on some of them, I created a view on membership to concatenate the info we wanted to show.

So it shows something like John Smith - Gold '16, Alumni class of '05.

The code for the hook is straight forward. (I can't say the same for the sql for the view):

```
 function ccas_hooks_civicrm_contact_get_displayname(&$displayname, $contactId, $objContact) {

 $sql = "select affiliations
         from ccas_affil_alum
         where contact_id = $contactId";

 $affiliations = CRM_Core_DAO::singleValueQuery($sql);

 $displayname = $displayname . ' - '.$affiliations;

```

}

---
Tags: civimember
---


title: Find Contributions Search 503 error

text:
# Question
Title: Find Contributions Search 503 error
I'm getting a 503 error when I use the contributions search:

.../wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontribute%2Fsearch&reset=1

I've checked the following:

* Wordpress page called civicrm is present
* permalinks are set to post name
* under civi's wordpress integration settings, civicrm is set as the wordpress base page.

Thanks for your help.

# Answer
> 1 votes
The web host was running an older php version on their development server. Updating to a newer version (they said 5+) solved the problem.

---
Tags: contributions, search
---


# Question
Title: Can we disable resource-intensive logging queries triggered by inline edit?
On the contact summary page in CiviCRM 4.6.4 with advanced logging enabled, after doing an inline edit of address or phone, an AJAX query is triggered for a logging report URL:

/civicrm/report/instance/87?reset=1&force=1&section=2&altered\_contact\_id\_op=eq&altered\_contact\_id\_value=59625&cid=59625&qfKey=blah&crmPID=2&snippet=json

Report instance 87 is a reserved instance of Contact Logging Report (Summary) with report\_id logging/contact/summary .

This is a problem on a site with a large number of log entries: in this case, 4.8 million in log\_civicrm\_activity\_contact. The logging queries take many minutes to complete. So a simple inline edit triggers heavyweight queries that slow down the database.

I'm guessing this is done in order to update the count on the Change Log tab heading. In Civi 4.4, if advanced logging is enabled then the Change Log tab heading does not show a count. This is preferable. Was the count added as a result of a feature request? Can it be disabled?

# Answer
> 3 votes
I think this would be a relatively simple fix. I'd suggest you file an issue for this and, ideally, provide a patch...

...actually in fiddling around with this I just wrote a patch that fixes it. Try this:

#6283 Don't force-refresh the changelog tab to avoid performance overhead

---
Tags: logs, performance
---


# Question
Title: Can i print or save a pdf of all activities
I need to print or save as a pdf all activities for any of our contacts on civi. This would be used to report to meetings etc on work we have done with individuals who use our support services. at the moment, i am printing each individual activity, which is laborious and time consuming! is there any way i can generate a report that lists all activities?

thank you

# Answer
if there isn't an easy solution in CiviCRM, and if you are on Drupal, then I would recommend doing it with the Views module and the Print module which lets you generate PDFs from Views. Happy to provide more detail if that route is useful for you.
> 1 votes

# Answer
Two options:

1. The Constituent Detail Report was made for this kind of purpose. Search for the contact you are meeting with, and it will show their relationships, contributions, activities, and more. However, if you keep notes in the Detail field on your activities, this won't be very helpful as it doesn't display.
2. You can use the Activities report to display all of the client's activities. Again, just filter to the appropriate contact, and you can even filter your activity type. Though not a real "contact" report, you'll find this under Reports \> Contact Reports.
> 0 votes

---
Tags: civireport, activities
---


# Question
Title: What payment processors will be supported in core for 4.7?
For a new client install, we need to pick a supported payment processor. Many questions about payment processors support appear in this forum, in the civicrm forums and elsewhere. The Wiki lists many and there are several extensions, with various levels of support and capabilities.

There is a general extension to support omnipay but that does not support the latest (4.6.5) version and has not had much traction. Also, 4.7 will substantially refactor payment processing.

I would normally turn to paypal as that is in core and likely dominant, but the wiki notes say it is migrating to payflow and recurring payments require an additional fee, so I'm skeptical that this may pose risk in future versions.

Would appreciate suggestions on how to select a payment processor that will be well supported.

# Answer
> 5 votes
Omnipay should work with the latest version - but is only relevant if a processor you wish to use is currently offered through it.

If you want recurring in the US you should probably consider IATS Paypal Authorize.net

in that order.

IATS is most actively developed & IATS has been investing in Civi development itself & the other 2 have the most traction - although Authorize.net has some real technical gaps - ie. they don't retry IPNS.

If you do go with IATS you should use their customer referral programme as your customer will save $100 that way. IATS will also either give you $100 or donate it to CiviCRM if you (like us) prefer not that in order to maintain neutrality http://home.iatspayments.com/civicrm-referral

---
Tags: payment-processor, recurring-contributions
---