# Question
Title: Long List of CiviDiscount Codes Needs Management
How do you manage a long list (100+) of CiviDiscount codes?

We hold an annual conference and make about 70 codes per conference - so the list adds up.

Can I remove old discount codes without affecting contribution records? seems to be possible, although deleting them seems to be not the best practice?

Ideas:

How difficult would it be to implement a quick filter at the top that toggles the view to show active and inactive (or both) codes?

Or, what about a quick filter for 'Event' the codes are attached to? (or something like that?)

Alternatively - could a Drupal view handle this? Thanks!

# Answer
> 0 votes
You can disable the codes and then sort by what is still active. I also recommend coming up with a naming convention that makes it easier to sort.

You could also set up an automatic discount for certain memberships per certain events, which would cut down on the need for so many codes.

---
Tags: cividiscount
---


# Question
Title: Some tokens not work with CiviRules 2.1 and E-mail API 1.17.2?
I'm using WordPress 4.9.8, CiviCRM to 5.4.0, CiviRules 2.1 and E-mail API 1.17.2. I've created a Rule that send email to contact when added to a group. I've used some token here https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#available-tokens

But only token {domain.email} and {domain.name} can show. Other tokes is empty. Is it bug?

# Answer
> 2 votes
This might be caused by this issue: https://github.com/CiviCooP/org.civicoop.emailapi/issues/10. A fix is in progress....

---
Tags: wordpress, email, civirules
---


# Question
Title: CiviEvent multiple participant registration does not save all field values to contact
I've come across a weird problem while trying out the CiviEvent participant registration that I would like to share with you and hear your thoughts.

Here is the scenario:

So, I created an event in CiviCRM and turned on the online registration option. Under the **Registration** tab, I enabled '**Register multiple participants**' checkbox leaving the '**same email address?**' checkbox unchecked. Basically, I'm allowing a participant to register one or more participants each having a different email.

I would like to save the first name, last name, and email. I do this by defining a profile and adding it into CiviEvent event registration form. Below is a screenshot of that:

The profile exposing these fields is called "Event Registration Personal Information" and is defined like this:

The problem:

When a participant registers himself and/or another participant, the contact is successfully created within CiviCRM. All fields exposed from the profile are filled with the corresponding data **except** for the email address. Within each contact, the email address field is therefore empty. I tried switching the email type from "Billing" to "Primary", but sadly still received the same result.

Since I use WordPress, I wanted to test the profile and see if that's the problem by adding it as a standalone form using the CiviCRM WordPress shortcode. Upon submitting the form, the contact has been created successfully and all data is saved including the email. This means that the problem does not come from the profile itself, but from the CiviEvent module.

This leads to my question: Am I using the CiviEvent module incorrectly or did I miss some option? Did any of you encounter the same issue?

I am using CiviCRM version 4.7.31

**Edit:** For some reason, when disabling the '**Register multiple participants**', the problem still persist.

# Answer
> 1 votes
I think I have found the solution to my problem. I'll post this here in case someone ever stumbles on the same problem.

When configuring the profile that you would like to use for the event registration form, be sure to **not** set the e-mail type (category) to "Billing". If set, the email will not be saved to the contact (no idea why).

All other e-mail categories seem to work fine (e.g. "Primary" or in my case "Main").

---
Tags: wordpress, civievent, profile, forms, online-registration
---


title: civiDiscount 3.5 and civiCRM 5.4.0

text:
# Question
Title: civiDiscount 3.5 and civiCRM 5.4.0
After upgrading to civiCRM 5.4.0, I cannot access latest version of civiDiscount via the civiCRM menu.

I see the option under Administer and Contributions, but when I click civiDiscount, I am returned to the civi Dashboard, instead of seeing the civiCRM interface.

There's no error logged by civiCRM.

I'm also running Joomla 3.8.11

# Answer
Can you try to clean CiviCRM cache and do a menu rebuild? You can do this by navigating to CiviCRM \>\> Administer \>\> System Settings \>\> Cleanup Caches and Update paths. Once you on the page click on Cleanup cache button.

HTH

Pradeep
> 5 votes

---
Tags: cividiscount
---


# Question
Title: Extracting email address for the who database?
How do you extract email addresses from CiviCRM to go into an excel file?

Thanks,

# Answer
Do you mean to export all the contact's email address from CiviCRM into csv file? If so you can do Find Contacts and export the result into csv format.

1. Navigate CiviCRM \>\> Search \>\> Find Contacts
2. Select list of contacts to export and from action dropdown select 'Export Contacts' options.
3. On export screen select 'Select fields for export' and proceed
4. On 'Select fields to export' page from the first dropdown select Individual and then Email and Primary from the drop drown besides it.
5. Click on export button.

HTH

Pradeep
> 5 votes

---
Tags: contacts, export
---


# Question
Title: update pending contributions transaction date wrong
When doing a search for pending contributions and then do a batch update to completed the received date is changed to today's date. In the past version 4 this would stay as the original received date. This is causing us problems as the received date shouldn't change.

We are using CiviCRM 5.3.1 on Drupal 7

Thanks

Gareth

# Answer
If you are using Batch update using profile than including `Receive date` in your profile will actually solve your issue. There has been change in code to handle contribution fields correctly now.

The workflow does make sense when changing contribution to completed the receive date is updated to now(). The system assumes that money has come in now unless you specify the exact date.

So when you include Receive date in your profile it will be pre populated with old values and hence it won't update to now().

HTH

Pradeep
> 2 votes

---
Tags: contributions, pending
---


# Question
Title: Automatic updates of timeline activity dates
I am finding that timelines in civicase assign dates for activities based on when the case is opened, which means timeline dates are rarely accurate to when they should occur.

Let's assume that "Open Case" is the first activity, "Course Start Date" is the next one, and all later activities are offset from "Course Start Date". Is there a way for the dates associated with all later activities to be adjusted when "Course Start Date" is modified after opening the new case?

# Answer
> 3 votes
The default timeline that is specified in the Case Types configuration allows you to specify the reference activity (i.e. which activity should provide the reference point for any time offset) and the amount of the offset (i.e. how many days before/after) for any given activity that is going to be in the default timeline. So, in your example, you want 'Course Start Date' to be the reference for all subsequent activities.

Having said that, when you create the case, I think that all the offset calculations are done at that point in time, so even if you then subsequently set a date for the 'Course Start Date' activity, I don't think subsequent activity dates will automagically adjust as we might like them to.

# Answer
> 2 votes
Define a secondary timeline called e.g. post-course, which has your post-course tasks. Then when you know the course date, add that timeline using Add Timeline on the manage case screen.

You may also want to consider sequences, which don't have set offsets, but get created in order when the previous task completes, although it may not quite be what you're looking for. https://docs.civicrm.org/user/en/4.6/case-management/set-up/

# Answer
> 0 votes
*when you create the case, I think that all the offset calculations are done at that point in time, so even if you then subsequently set a date for the 'Course Start Date' activity, I don't think subsequent activity dates will automagically adjust as we might like them to.*

Has this been fixed yet in CiviCase? This is a huge problem for my set-up, and I was looking for an answer and am very disappointed this is the reality. If there is an update on how to make this happen, TIA!

---
Tags: civicase
---


# Question
Title: will ssl certificate on main domain work on subdomain
docs say that CiviCRM does not support shared SSL and "SSL must be installed on your domain not one at a higher level"

What about subdomains?

I have WP installed at site.com and WP with CiviCRM installed at civi.site.com

Do I need to be able to install SSL on civi.site.com or will it work from site.com?

# Answer
> 2 votes
There is nothing specific about civi on your question, it is possible to use a wildchar certificate (\*.site.com) or one that works for several subdomains.

If you want a simple and free certificate and that isn't offered by your hosting company, I recommend you "let's encrypt".

---
Tags: ssl
---


# Question
Title: Settings Definition (How to Use On_Change?)
Settings definitions allows for a field "on\_change". Can anyone explain how to use this? I would like to have it execute a function that I have defined in my extension when my quickform is saved.

THanks!

Documentation Referenced: https://docs.civicrm.org/dev/en/latest/framework/setting/#settings-definition

# Answer
> 3 votes
`on_change` is executed when setting value is changed. You can either set it

```
 'on_change' => [
   ['CLASS_NAME', 'functionName'],
 ],

```

Else

```
'on_change' => [
  'CLASS_NAME::functionName',
],

```

A good example would be https://github.com/civicrm/civicrm-core/blob/master/settings/Localization.setting.php#L145

HTH

Pradeep

---
Tags: extension, settings, quickform
---


# Question
Title: How can I import a list of contacts from MailChimp to the database all at once?
I am looking to import a list of 185 contacts from MailChimp to our database and wanted to know how I can do this in one go. As far as I know I have to export the list from Mail Chimp and then edit the fields in an excel document, but how to I make sure the fields will match with those in CiviCRM? Does anyone have or know where there is a template of what needs to be on the spreadsheet? Are there any guides to how to layout the columns to refer to the fields I want to mark in Civi, also can I stop it importing duplicate contacts? Thank you! Grace

# Answer
There is a mailchimp extension which you could install in CiviCRM and which then connects to your mailchimp and imports the contacts from mailchimp into CiviCRM.
> 1 votes

# Answer
I think if you are doing a one off transfer of what is a relatively small set of contacts then an export from MailChimp and then import to CiviCRM is easiest option. Depends on what fields you have in MailChimp (is it more than name and email?) I'd just export everything from MailChimp and then you can set which fields you want to import and where to map them in the CiviCRM contact import. If you need to do any adjustment, then I find Excel the easiest place to do this.
> 1 votes

# Answer
You can use MAILCHIMP CIVICRM INTEGRATION extension to import contacts to civicrm based on mailchimp as wells as to mailchimp based on civicrm.
> 0 votes

# Answer
To just answer the simple version of the question - you can use the Import Wizard at Contacts \> Import Contacts which is also at this path civicrm/import/contact?reset=1
> 0 votes

---
Tags: import
---


# Question
Title: Can we integrate forms on wordpress using CiviCRM?
I just wanted to ask what plugins or any ways to integrate forms in wordpress that can integrate using CiviCRM?

# Answer
You can use Contact form 7 and CiviCRM extension to integrate forms in wordpress. It enables sending data from a Contact Form to CiviCRM if you enter the data in the Contact Form in the correct way.

More details of using this can be found here.

HTH

Pradeep
> 0 votes

# Answer
I'd recommend using Caldera Forms CiviCRM which has great integration with WordPress via the superb Caldera Forms plugin. Check out the tutorial by Tadpole Collective to get yourself going with Caldera Forms CiviCRM.
> 4 votes

# Answer
As pradeep mentioned there is the Contact Form 7 wordpress plugin this plugin sends the form submission to a CiviCRM API. You can use the Form Processor extension to create and API end point to handle the form submission.

I have written a blog post on how to handle form submissions with the form processor and will include a word press example.

Below a screenshot of the Wordpress contact form configuration.
> 0 votes

---
Tags: wordpress, forms
---


# Question
Title: How to update a sequence email created by CiviCRM?
I'm using WordPress 4.9.8, CiviCRM to 5.4.0, CiviRules 2.1 and E-mail API 1.17.2

I've created a sequence email by CiviRules by steps:

**Step 1**: After user added to a group G, send email 1

**Step 2**: After 5' until user added to the group G, send email 2

**Step 3**: After 10' until user added to the group G, send email 3

If I've created this sequence from start, sequence email sended ok. But if I want to update this sequence by and step like this:

**Step 4**: After 200' until user added to the group G, send email 4

This sequence created about 15' until user added to the group G, but after 200', no email send to user.

I've tried tick or untick "Don't recheck condition upon processing of delayed action" but nothing happens.

What can I do to make a sequence email and this sequence can update with CiviCRM?

---

**Update 08/08/2018** This is conditions of my CiviRule, I have 4 Rule like that picture, the difference are the number of delay minute and the template mail.

The rule of this picture is created after my user added to group "Thông tin hữu ích". The minutes my user add to this group \< 200 minutes but my user can not received email send in the rule delayed 200 minutes

# Answer
> 1 votes
I have a working CiviRule just like the one you are describing (I think) which works fine. I have not created 4 different rules but added different actions to the same rule. There is a blog post on this here: https://civicrm.org/blog/erikhommel/using-civirules-for-a-petition-journey-at-amnesty-international-vlaanderen

I have included a screenshot of my conditions. Can you see any differences which would explain your problem? I think you need both the group checks, The one (group is) acts on the parameter from the contact add to group, the other one checks if the contact is still in the group when sending mails (to allow the opt out if the contact no longer wants to receive mail).

I also think you'd be better off by adding all 4 actions to this rule rather than have 4 rules.

I will test with the delay of 200 minutes and see if there is a problem there.

---
Tags: wordpress, email, civirules
---


title: User can add themselves to any group

text:
# Question
Title: User can add themselves to any group
There are a couple of posts, listed below, already on this topic - but I'd like to follow up:

**SUMMARY**

I can create an ACL role and limit access to a custom field group - which is *seemingly* wonderful. Data that should not be visible to everyone is not.

BUUUT any user (with the ability to edit a contact) can add users to an ACL group. I feel it renders ACL roles/restrictions pointless. (We have users who need to be able to edit a contact, to adjust contact information and such but shouldn't be privy to all the custom data in the system.)

How do I prevent a user from adding contacts to ACL groups?

Permissions, ACL and Groups

**QUESTION** Does anyone have feedback on the Group Protect extension? It looks very promising but the notes indicate it's a work in progress from early 2016. Or is anyone taking a different avenue to prevent users from adding themselves to ACL groups?

# Answer
As you have noted, the big problem with the ACL group system is the lack of control around adding to groups. I've used the Group Protect extension previously and it does the job.
> 2 votes

# Answer
The ability to add groups to a contact depends on the visibility of groups for the user. The cms permissions "view all contacts" and "edit all contacts" grant visibility to all groups in the system.

You need to remove the cms permissions "view all contacts" and "edit all contacts" for this role and add an acl for each civicrm group that the contact should be able to view or edit. This way you can set permissions to edit/view contacts and restrict the visibility of groups.
> 1 votes

# Answer
We have found that limiting users in this way works well for access purposes, however, we have also found that users limited to groups in this way can create a contact that has no group. If they don't add a group, then they loose the ability to see or edit the contact they tried to add. Often, they then add the contact again. (and sometimes again).

Also, when adding a contact through Cases-\>New Case-\>New Organisation, it is not possible to add a group on that 'easy-add' screen.

It then takes an admin to login and add the group that the user forgot to add.

We can see no way of making the selection of a group compulsory (or a default) when a user adds a contact on the Contacts--\>New Organisation screen.

We have treated this as a 'user coaching opportunity', emphasising that if they don't choose the right group, it's going to take extra time to get the data in, as they'll have to contact an admin to get the group added. At least all our users now know what to do if they forget to put a contact in the right group.

We also insist that a user creates an organisation before adding a case, so that the organisation is in the correct group.

Just thought I should mention these small issues we have found, and their work-rounds to hopefully save someone else the pain of working it out. Hope it helps.
> 1 votes

---
Tags: groups, acl
---


# Question
Title: Reusing scheduled & sent emails - screen goes blank
Very new at Civi, so please be patient!

Every time we try to reuse an existing email in "scheduled & sent" the screen goes blank. Any ideas?

Have tried different emails, users, browsers, computers and same result. We have Civicrm 5.3.1, Joombla Version 3.8.11 stable, Joomla Platform 13.1.0, php 7.1.20, Apache, mysql.

Many thanks

# Answer
The problem was somewhere between multi-lingual and logging - `log_civicrm_group` was missing the column `title_en_GB`. Switching logging off and on again refreshed the log table schema and resolved the blank screen problem.
> 3 votes

---
Tags: civimail
---


title: Use API3 or API4?

text:
# Question
Title: Use API3 or API4?
What is the recommended version of API to use at this point in time? I am about to do a major rewrite of an extension to manage small groups and I want to future proof it.

Are there any advantages/disadvantages to using API4?

Thanks!

# Answer
> 4 votes
Coleman sent the following to the dev list 3 weeks ago. The line I have emphasised below seems particularly relevant to your question.

> As you probably know, CiviCRM api v4 has been quietly being developed over in an extension. The nice thing about being in an extension is that we can commit code without going through the core PR process and iterate rapidly, but the downside is that it doesn't get as much attention or visibility.
>
> But that's about to change. I intend for CiviCRM 5.5 to ship with the Api4 extension bundled in the tarball. At first it will be disabled by default, but at some point that too will change.
>
> It has a test suite that is being run on a nightly basis here: https://test.civicrm.org/view/All/job/CiviCRM-Ext-Matrix/ (soon I want api4 tests running with every core PR).
>
> I've now developed my first extension using api4, and I'm happy enough with it to start recommending that other developers give it a try. **IMO if you are starting off writing a new extension and want to ensure longevity for that project, api4 is a good choice (even though we currently have no plans to deprecate api3, someday it may happen).**
>
> So I suggest you download the api4 extension and play around with the new, angular-based api explorer to have a look at what it can do (the explorer is not 100% feature-complete but it's still fun to play with). Enjoy :)

Advantages: intended to be lots!
Disadvantages: it's new.

# Answer
> 3 votes
As long as the Developer Guide (https://docs.civicrm.org/dev/en/latest/api/) only mentions API3 I would recommned using that one.

---
Tags: api
---


# Question
Title: CiviCRM not recognizing csv file when uploading
CiviCRM is suddenly not recognizing upload file as a csv file. It's now giving an error message that csv file not recognized. What is the problem and how can I overcome it?

# Answer
I'd look at the size of the csv, how big is it. The number of records in the csv, if it is very big I'd break it up. Look for extra blank lines that should not be there, i.e. clean it up. Then what kind of csv are you using, open and save again as csv. I've had these kind of issues, hopefully this helps, good luck!
> 1 votes

# Answer
encoding matters, civicrm only accepts UTF-8, better change them on a notepad before importing

Open *yourrfile*.csv in Notepad\> Save As .csv (change encoding to UTF-8)
> 1 votes

# Answer
I often find that saving a csv, then editing it and resaving it will cause problems on upload. hence the workaround is to copy all the data and paste in to a new csv and save and upload. Any help?
> 0 votes

---
Tags: import
---


# Question
Title: How do I add in a new Activity Type for CiviCampaign?
How do I add in a new Activity Type for CiviCampaign?

I can see how to do this via CiviCRM » Administer CiviCRM » Option Groups » Activity Type Options for Contacts only.

Any help would be great!

# Answer
You cannot do that anymore through the user interface. In previous versions of CiviCRM you could define the activity for contacts and cases, or cases.

As Erik said, any activity could be linked to a campaign, there is no restriction on that. So there is no need to to define whether you want use an activity only in campaigns.
> 1 votes

---
Tags: civicampaign
---


title: Transfer contribution to other contact

text:
# Question
Title: Transfer contribution to other contact
Due to an error a bankaccount (iban) was connected to a wrong contact, so several contributions must be transferred to the right contact. What is the procedure for this action?

# Answer
> 8 votes
There is extension 'Move Contribution' available for moving contribution from one contact to another. Once you have installed the extension transfer can be done through the contact's contribution tab or through a Find Contributions search result action.

HTH

Pradeep

# Answer
> 6 votes
To move a Contribution from one Contact to another only requires a very small edit in your database.

If you have access to phpMyAdmin -\> go to the `civicrm_contribution` table and in the `contact_id` column replace the incorrect contact\_id with the correct one. If for example we want to move contribution with id=3 from `contact_id = 10` to `contact_id = 750` -\> double click in that table cell and replace 10 with 750.

If you have access to mysql: change the `contact_id` for contribution with id=3:

```
UPDATE civicrm_contribution SET contact_id = 750 WHERE id = 3;

```

---
Tags: contributions
---


title: Changing position of pre-form help text

text:
# Question
Title: Changing position of pre-form help text
I'm customising the CSS on my profile page - I've learned a lot doing this! I've got it almost how I want it. The last thing I'd like to change is the position of the pre-form help text on some custom fields - they currently float above the text box and label, and I would like them to appear immediately below the field label, to the left of the text box. I've googled and searched StackExchange and not found an answer - any ideas?

Thanks, Andrew

# Answer
Moving html can be done using javascript. You can embed javascript code to move the pre help field just below the label or text field. Here are the references for it https://docs.civicrm.org/dev/en/latest/framework/resources/

https://docs.civicrm.org/dev/en/latest/framework/region/
> 2 votes

---
Tags: profile
---


title: error on upgrade to 5.3

text:
# Question
Title: error on upgrade to 5.3
upon upgrade from 4.7.31 to 5.3 the site could not load any civi pages, it would give a generic error message.

in the log I see:

Civi\Payment\Exception\PaymentProcessorException: CRM\_Core\_Payment\_PayPalImpl: Payment processor type is not defined! in CRM\_Core\_Payment\_PayPalImpl-\>\__construct() (line 73 of /var/www/xxxxxx/sites/all/modules/civicrm/CRM/Core/Payment/PayPalImpl.php).

but this site does not use paypal, it uses authorizenet so I have no idea why this is causing a fatal error

my temp workaround was to just comment out line 73 of PayPalImpl.php but I'll need to verify that payments still work. Anyone else have a similar issue with 5.3?

# Answer
> 1 votes
I posted this to gitlab here https://lab.civicrm.org/dev/core/issues/250 and the issue turned out to be related to odd records in my database.

this query, from Elieen exposed the bad row

```
SELECT p.id, p.name, p.class_name, p.is_active, pt.id, pt.class_name, pt.name
FROM civicrm_payment_processor p
LEFT JOIN civicrm_payment_processor_type pt ON pt.id = p.payment_processor_type_id
+----+--------------------+----------------------+-----------+------+----------------------+---------+
| id | name               | class_name           | is_active | id   | class_name           | name    |
+----+--------------------+----------------------+-----------+------+----------------------+---------+
|  1 | Dummy Processor    | Payment_PayPalImpl   |         1 |   10 | Payment_Dummy        | Dummy   |
|  2 | Dummy Processor    | Payment_Dummy        |         1 |   10 | Payment_Dummy        | Dummy   |

```

so I updated the row in civicrm\_payment\_processor to change Payment\_PayPalImpl to Payment\_Dummy and everything works without the modification to civi code.

# Answer
> 0 votes
I have had the same message after updating from 5.2.1 to 5.3.2. I have 2 sites, neither have any contributions configured, either thru paypal or anyone else. Both sites were upgraded. The other is working fine but this one cannot get into civi from drupal entry.

Civi\Payment\Exception\PaymentProcessorException: CRM\_Core\_Payment\_PayPalImpl: Payment processor type is not defined! in CRM\_Core\_Payment\_PayPalImpl-\>\__construct() (line 73 of /mysite/public\_html/drupal/sites/all/modules/civicrm/CRM/Core/Payment/PayPalImpl.php).

I took the advice of editing out line 73 and all is good.

---
Tags: upgrade, payment-processor
---


title: Additional Fonts for TCPDF

text:
# Question
Title: Additional Fonts for TCPDF
How do I add additional Fonts to CiviCRM, especially where wkhtmltopdf and dompdf aren't used?

This is the case when name Badges for an event are printed, and the font isn't capable of of special chars in names.

There is some information already here - but I had to puzzle and try and error a lot, so I decided to write question and answer a bit more conclusively here.

# Answer
Fonts for TCPDF are generated, and are located in civicrm/vendor/tecnickcom/tcpdf/fonts/ in a format like this:

```
-rw-r--r-- 1 www-data www-data 1,9K Aug  9 14:44 robotoi.ctg.z
-rw-r--r-- 1 www-data www-data 8,6K Aug  9 14:44 robotoi.php
-rw-r--r-- 1 www-data www-data  78K Aug  9 14:44 robotoi.z

```

To generate the fonts, a static method from the library addTTFfont is called, and saved to the previously mentioned folder.

```
$roboto_italic             = TCPDF_FONTS::addTTFfont('/var/www/boell_testing/public/sites/default/files/civicrm/persist/fonts/roboto/roboto/Roboto-Italic.ttf', 'TrueTypeUnicode', '', 32);

```

After this call, the fonts should be available. The civicrm has to be told that there are additional fonts, which is done via a global settings array:

```
global $civicrm_setting;
$civicrm_setting['CiviCRM Preferences']['additional_fonts'][$roboto_italic] = "Roboto Italique";

```

In civicrm/CRM/Utils/PDF/Label.php --\> public function getFontNames() the fonts are added to the menu and are available in the drop down menus for, in this case name Badges. But every other PDF generator using TCPDF should have the fonts as well.
> 3 votes

---
Tags: pdf
---


title: Moving from Drupal to Wordpress

text:
# Question
Title: Moving from Drupal to Wordpress
I am moving my organization's website over from Drupal 7 to Wordpress, and along with that I need to connect our existing CiviCRM install with the new Wordpress install. I just have a few concerns before I start anything:

Can I just install CiviCRM for WP and hook it up to the existing database? Is there a special procedure that I will need to go through to connect our existing database with WP? Is there any risk to the data moving over this way?

Thanks!

# Answer
Migrating from Drupal/Civi to Wordpress/Civi is relatively painless. You'll need to truncate your `civicrm_uf_match` database table, which links Civi records to CMS users, and repopulate it - **Administer menu \> Users and Settings \> Sync Users to Contacts** works well if you want ALL your Wordpress users to be linked up.

That said, there are numerous gotchas to watch out for - I've started compiling a list here.
UPDATE: I've merged this with documentation on wiki.civicrm.org. Please check Moving from Drupal to Wordpress.

Since StackExchange prefers direct text to links, here's what I've got so far:

* PayPal IPNs needed changing. You can only change future IPNs in Paypal; you may also need to set up a 307 redirect from the old URL.
* URLs linking to contribution pages etc. in mailing templates, scheduled reminders etc. need to be changed.
* Images in mailing templates and scheduled reminders must get a new absolute URL (or a redirect).
> 10 votes

# Answer
I migrated a client's installation from Drupal 5 and CiviCRM 1.9. Although the original post is almost three years old at this point, it might still be useful to reply for the benefit of future searchers.

Migrating to WordPress is not simply a matter of installing CiviCRM for WordPress and hooking up the legacy Drupal database. There are several components to be aware of before you proceed:

1. Many Drupal installations include other content aside from the CiviCRM database. If this is the case with your site, you should migrate your standard Drupal content first. I have general Drupal to WordPress migration guide for anyone who needs to do this.
2. Most migration procedures have a way of exporting Drupal users over to the WordPress installation. While you can migrate the users in the form of usernames and other metadata, your existing users will very likely still have to reset their accounts. This is because WordPress uses a different password hashing method to Drupal. Further, different Drupal versions use different hashing methods. Other replies mention experiencing problems with users and I suspect this might have something to do with it.
3. Finally, there's CiviCRM itself. Jon G's Switching CMS platforms guide was useful here. We had a lot of fiddling around to correct the resource URLs and menus.

We sort of got things working well enough but the user reset issue was a deal-breaker for the client. In the end, she decided to switch to a completely different CRM platform which had a different set of migration issues!
> 1 votes

# Answer
You can migrate easily from Drupal 7 to WordPress with the tool FG Drupal to WordPress. https://www.fredericgilles.net/fg-drupal-to-wordpress/ But about the CiviCRM data, I don't know if it will still be compatible when you move from Drupal to WordPress.
> 0 votes

# Answer
I would say that generally people almost always switch to Drupal, not away to WordPress. It would be hard to imagine a reason to go the other way... Drupal offers more features and flexibility and more useful integration into CiviCRM. Make sure this is really what you want to do for the long haul before putting in all the effort to switch.
> -4 votes

---
Tags: drupal, wordpress
---


# Question
Title: How to fetch Profile gid from hook_civicrm_post included in a Contribution Page?
I am using profile object inside

```
function hook_civicrm_post($op, $objectName, $objectId, &$objectRef){

}

```

How can I fetch the Profile gid from the above variables? or is there any way to implement it ?
I want to create a household on submission of a Profile A using custom fields and similarly create an Organization on submission of a Profile B using custom fields.
So I need a Profile ID which will distinguish between Profile A and Profile B using gid.

The $objectRef variable has the following structure for Profile

```
Array
    (
        [qfKey] => f6a85f995860db13425c24378f05c98d_9488
        [entryURL] => https://example.com/example-registration/?page=CiviCRM&q=civicrm/contribute/transact&
        [email-Primary] => check@gmail.com
        [first_name] => check
        [last_name] => gmail
        [phone-Primary-1] =>
        [street_address-Primary] => abc
        [supplemental_address_1-Primary] => a
        [city-Primary] => cci
        [postal_code-Primary] => 30200
        [country-Primary] => 1013
        [state_province-Primary] => 1640
        [1] => 1
        [2] =>
        [3] =>
        [4] =>
        [custom_16] => Array
            (
                [1] => 1
                [2] =>
                [3] =>
                [4] =>
            )

        [custom_17] =>
        [5] =>
        [custom_1] => Array
            (
                [1] => 1
                [2] =>
                [3] =>
                [4] =>
                [5] =>
            )

        [custom_18] =>
        [custom_19] => Partner check
        [payment_processor_id] => 0
        [priceSetId] => 8
        [price_12] => 40
        [selectProduct] =>
        [cms_create_account] => 1
        [cms_name] => familycheck
        [cms_pass] => test
        [cms_confirm_pass] => test
        [MAX_FILE_SIZE] => 20971520
        [ip_address] => 192.51.248.26
        [amount] => 65
        [amount_level] =>
        [selectMembership] => 2
        [tax_amount] =>
        [currencyID] => AUD
        [is_pay_later] => 1
        [invoiceID] => 0c6d15e48854236861cdc16a4a8222e9
        [is_quick_config] => 1
        [email-5] => check@gmail.com
        [description] => Online Contribution: Family Registration
        [accountingCode] =>
        [addressee] => 1
        [email_greeting] => 1
        [postal_greeting] => 1
        [updateBlankLocInfo] =>
    )

```

# Answer
You can use profiles directly to create an Household. When you add a field to a profile you have first select the entity, which could be contact, Individual, subtype of Individual, Household, Organization and others.

So there is no need to program this.
> 1 votes

---
Tags: profile, hooks
---


# Question
Title: LoadForm Popup - Uncaught TypeError: Cannot read property 'split' of undefined
In all of my custom extensions, when I use the loadForm function to load a form (generated with Civix) as a popup, I get the following error:

```
Uncaught TypeError: Cannot read property 'split' of undefined
at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:167:34)
at $.(anonymous function).(anonymous function).isOriginalUrl (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:144:25)
at HTMLDivElement.<anonymous> (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:256:40)
at Function.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:370:19)
at jQuery.fn.init.each (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:137:17)
at jQuery.fn.init.$.fn.(anonymous function) [as crmSnippet] (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery-ui/jquery-ui.js?pd7a7l:236:10)
at HTMLDivElement.<anonymous> (http://dev.civicrmdev/sites/all/modules/civicrm/js/crm.ajax.js?pd7a7l:441:34)
at HTMLDivElement.dispatch (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5226:27)
at HTMLDivElement.elemData.handle (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:4878:28)
at Object.trigger (http://dev.civicrmdev/sites/all/modules/civicrm/bower_components/jquery/dist/jquery.js?pd7a7l:5130:12)

```

Apparently Civi replaces the default buttons with some other buttons. This error breaks that process. I noticed this when trying to use the Shoreditch theme (my buttons disappeared).

I'm unsure how to approach debugging this. Any ideas on what would cause this with my forms loaded in popups? The standalone page loads just fine with the buttons.

# Answer
> 1 votes
I just figured it out.

When using the loadForm function you have to include at least 1 parameter in the URL. If you do not include a parameter then you will get the error.

**Is this a bug?**

---
Tags: extension, quickform
---


# Question
Title: CiviCRM Entity display shows email addresses - should only show display name
I have a content type in Drupal ('Event') that uses an entity reference autocomplete field to search the name of the submitting organization. The entity reference field only displays contacts that meet a filter criteria, as set in the entity reference view.

When the content type with the entity reference field was originally set up, it functioned as expected. About a month ago I noticed the display was suddenly showing the submitting organizations' email address in addition to just their name. The problem is specifically in the display of the event after it has been created (the way the name appears in the autocomplete widget is fine).

The display was originally: "**Event facilitator:** Random Organization Name"

Now, it appears like this, with the addition of their email address: "**Event facilitator:** Random Organization Name `<random@organization.com>`"

I'd rather not have their email addresses be displayed.

Thinking that it might have had something to do with an update, we downgraded CiviCRM Entity back to version 7.x-2.0-beta11, but the problem persists.

Has anybody experienced this issue? Any help or insight is greatly appreciated.

Using CiviCRM 5.3.1.

# Answer
> 1 votes
This was considered a feature by some folks, other folks maybe not.

You need a small custom module to change this... It should implement hook\_entity\_info\_alter(&$entity\_info)

https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook\_entity\_info\_alter/7.x

you would need this code:

```
function YOURMODULE_entity_info_alter(&$entity_info) {
  unset($entity_info['civicrm_contact']['label callback']);
}

```

Install your module, clear caches.

That will make CiviCRM Entity default the contact entity label to just the display\_name, which in your case would be the organization name.

# Answer
> 4 votes
Congratulations, you're the winner of jackrabbithanna's Friday open source evening random issue choice award!

I've added a configuration option to CiviCRM Entity to be able choose a few options for what the civicrm contact entity label should be.

You'll find a fieldset 'Options' at the configuration page: 'admin/structure/civicrm-entity/settings'

There's a field, "Contact Entity Label"...The default option is "Legacy", which will follow the logic for formatting of the contact entity label that existed previously to this update. Users who upgrade and don't choose an option will have it behave as it did before.

You can also choose, "Display Name only", "Display Name + email", "Display Name + phone", or "Display Name + IM"..

It's available in the 7.x-2.x-dev version right now, will be in version 2.2

Or apply the code updates in this pull request: https://github.com/eileenmcnaughton/civicrm\_entity/pull/165/files

---
Tags: civicrm-entity
---


title: Issue with MySQL support

text:
# Question
Title: Issue with MySQL support
Attempting to install CiviCRM 4.6.38 in Wordpress 4.9.8, PHP 7.2.5, MariaDB 10.3.8, Nginx 1.14.0, Amazon Linux 2. Getting "MySQL support not included in PHP". PHPinfo shows mysqli and mysqlnd enabled.

# Answer
> 1 votes
CiviCRM 4.6 is not compatible with PHP7.2 - you'll either need to upgrade CiviCRM, or downgrade PHP. (CiviCRM 4.6 is quite an old release to install in 2018.)

CiviCRM runs this check when installing (here's the same check in 4.6).

If the server's PHP does not have the appropriate function (`mysqli_connect()` in recent CiviCRM, compatible with your PHP7.2, and `mysql_connect()` in CiviCRM 4.6 - suitable for older PHP releases only as it was deprecated in PHP5.5 and removed in PHP7.0), then the installer will bail out saying that you "lack MySQL support in your PHP".

If you want to use CiviCRM 4.6, you'll need to run it with an older version of PHP.

I recommend **using a current and supported version of both CiviCRM and PHP** instead.

---
Tags: php, mysql
---


# Question
Title: How to send Amazon SES bounce notifcation emails to civiCRM bounce processing email address?
I'm trying to follow the helpful guide here on setting up Amazon SES

https://www.compucorp.co.uk/node/1740

All working well apart from bounce handling. Amazon SES by default seems to send bounce notifications back to the sending email address.

How to send from members@site.com and get bounce notifcations to bounce@site.com using Amazon SES?

# Answer
> 1 votes
I've figured it out now. I'd not understood that bounce processing works only with bulk emails and not with 'transactional' emails. All works fine if you know this!

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


# Question
Title: Custom filed that will auto calculate a position number based on date
We manage a wait list for membership so I would like to know if there is a way to calculate a number for a custom filed that would be based on if a member is a subtype and then the date in another custom filed. So that we would have a position number every time we entered a contact to the subtype waitlist. and would recalculate all the numbers after a contact was removed from the waitlist subtype

# Answer
Sorry - there is no membership wait list concept in CiviCRM. To achieve what you describe here will require custom code -\> a CiviCRM extension.
> 1 votes

# Answer
Ditto to KarinG. A way around this is to build some sort of report with all the contacts/members. Then sort the report with last created or last modified date. You won't be able to get a position #, but you at least have the order of the waitlist.
> 1 votes

---
Tags: custom-fields
---


# Question
Title: Civicrm webform to edit membership custom fields
I am trying to create a webform using the Webform Civicrm Integration module. The form would allow users to edit custom fields associated with existing memberships. Our members are required to attend an orientation sometime after signing up for their initial membership. I would like to create a form that would allow users to enter the date of a Member's orientation session, which is a custom field associated with Memberships. I can't figure out how to do this for an existing, already previously created membership. Is this possible with Civicrm Webform?

If not, would it be possible using a membership directory profile instead (haven't been able to figure out a way to include the Orientation date custom field for a profile either, since it would involve combining Contact and Membership fields).

Any suggestions?

I am using Civicrm 4.7.29 in Drupal 7, with Webform CiviCRM Integration 4.21.

# Answer
Absolutely possible with Webform CiviCRM! A few thoughts:

* upgrade to CiviCRM 5.3.1 or above (a security update)
* by giving members logins or by using the checksum token you can make it such that their all ready exisiting in the database details (Name, Address, Membership Type) are displayed to them - you decide if you want them to be able to update those
* of course in addition to filling out the blank Custom fields on the Membership;
* look to enable the custom fields on your Membership in the CiviCRM tab for your webform -\> Membership section (on the left) -\> at the bottom of it. Here is an example: that Checkbox ALM is a CiviCRM custom field on the entity Membership in this example. Look here to expose your custom date fields to your Webform.
> 1 votes

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


# Question
Title: CiviCRM Slow Bulk Emails to Sparkpost via Rest
Hopefully someone can help.. First the particulars:

CiviCRM 5.1.2 / Wordpress
Sparkpost Extension: 1.1
Mailer Batch: 0
Mailer throttle: 0
Mailer job: 1000
Mailer Cron: 8

It appears that when sending out bulk emails, Civi is generating them one at a time (we turned off Smarty), which is impacting email performance.

**How was I able to determine this ?**
\- Doing "tail -f" on the civi log, I saw a copy of every email being recorded, one at a time.
\- A constant stream of activity on the database, with queries (civicrm\_relationship) and recording of the email activity in the database. When the mails were finished, the database activity ceased.
\- And the clincher... a continuous stream of sockets being opened and timing out. Running "netstat -an" and grep-ing the ip, I saw a few hundred connections to the same ip (though we are only running a batch of 8), and only the ports changing. The connections would time out, and new ports would come in..this was a pattern observed throughout the life of the email process.

Can someone please confirm that this is the expected behavior of Civi and if so, is there a way to batch emails. Also, is there a way to keep connections open ?

# Answer
> 1 votes
How many emails are you trying to send? mailer cron=8 is really if you want to send a lot (I would not consider putting something else than 1 if less than 100k emails sent).

As for the job size at 1000. you are on the lower side, and would probably put at least an order of magnitude higher.

With more "normal" settings, you should get a better behaviour.

This being said: 1) yes, sending a mailing means a lot of traffic around your db, it's normal, nothing to worry about, it's big queries to record which emails have been sent

2) yes, each email is sent a separate email, here again, it's normal and works as intended

What is less normal is the number of connections. If you use smtp, it will create one connection and push all the emails of the batch in this connection. Obvioulsy the more cron jobs running you have, the more connection, hence my recommendation to lower it to 1 to see how it goes

I'm not familiar with the sparkpost extension, it might use a http rest api, and depending how it's designed, make more requests, you should check the code or look directly with the authors of the extension.

---
Tags: email, sparkpost
---


title: Drupal Views Multiple Field CiviCRM

text:
# Question
Title: Drupal Views Multiple Field CiviCRM
I collect data in case activities, and I'm currently trying to build a Drupal Views of this data. I'm running into a problem with multiple fields. For example: "What colors do you prefer?" The results are showing up like:

Red, Blue, Green Green, Blue

Is there a way to present each line as a color? My end goal is to create a pivot table to show a count of each color. I have a lot of multiple field questions that have this problem right now. The only solution I can think of is to create a PHP code to output a if statement == "RED" line by line.

# Answer
> 2 votes
Check out Charts, Google Charts module - if not for this purpose you'll be using it for some other data displays soon!

Below is a screenshot of a View - Page of Format: Chart -\> aggregating by Grant Type over a certain time period \[PS - the Table is an attachment -\> Format: table\]. For your use case try Aggregate by your custom field containing the Colors.

# Answer
> 1 votes
I would suggest indeed that you use a php field in your views and a field per option and filter the options out.

The multi value custom fields store their value with a special character as a separator.

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


title: Using CiviCRM for Library Management

text:
# Question
Title: Using CiviCRM for Library Management
Is there a CiviCRM extension for managing a book and video library - or some other library management system which integrates with CiviCRM so it can see the membership status out of CiviCRM (only current members are allowed to borrow from the library). Thanks in advance for your answers.

# Answer
> 1 votes
if you are using Drupal - and you aren't needing to use clever "enter the book number and have all the details pulled in from external software" when adding a new item to your library, then i could see a relatively easy path of making each item a node, using unlimited group of fields to track 'out date, in date, person'- and use civicrm entity 'contact reference field' to track which civi contact has the item

and do the rest with views and webforms

there is also https://www.drupal.org/project/library but it may be as much effort as building from scratch imo

# Answer
> 0 votes
There is no specific Library extension that I am aware off, nor is there an integration with KOHA AFAIK.

I think you would either have to develop an integration that allows koha to check if someone is a member in CiviCRM (which would be relatively straightforward with the API) or develop an extension that adds the required functionality to CiviCRM.

---
Tags: civimember, extension
---


title: Can we print an invoice without GST?

text:
# Question
Title: Can we print an invoice without GST?
We have a client who wants to bill an Australian Member with Ireland HQ, therefore they need to provide an invoice without GST as head office is paying. Is there any way we can tick or untick GST when creating a payment? Thanks.

Drupal 7.59 CiviCRM 4.7.38.

# Answer
Sales Tax (like GST) is per Financial Type so if you need to make an invoice without GST you need to make the Contribution of a Financial Type that has no GST associated with it.

Have a look here for details on how to set up different sales tax rates for the same membership type:

How to apply different Sales Tax rates to the same Membership Type - Back Office
> 4 votes

---
Tags: contributions, invoice
---


# Question
Title: How to have form not require billing address if zero fee in priceset is selected in Event?
Using CiviEvent, I have an event with a priceset that includes various prices, but also a zero fee option. The billing block information should not be required if zero fee is selected, but I can't get it to work.

I am open to ideas for workarounds. I am not able to upgrade the CiviCRM version at this point.

On the web event registration form, before clicking continue:

* If a non-zero fee is selected, the billing block correctly appears and shows as required to fill in if Paypal not selected.
* If the zero fee is selected, the billing block correctly does not appear.

BUT

When the user clicks the continue button after selecting the zero-fee option, an Error message comes up about fields in the billing bock being required. This is despite the billing block not being shown to the user (correctly as there should not be shown when zero fee).

For the first-time click, it also includes billing firstname/lastname, which I would expect to be taken from the Individual firstname/lastname that were filled in

If I click the continue a second time, it no longer mentions billing firstname/lastname, but it still shows some billing block fields as being required.

Billing First Name is a required field. Billing Last Name is a required field. Street Address is a required field. City is a required field. State/Province is a required field. Postal Code is a required field. Country is a required field.

The second time:

Street Address is a required field. City is a required field. State/Province is a required field. Postal Code is a required field. Country is a required field.

I have version 4.6 so it might the bug below, but I am not sure. Zero fee for a paid event

thanks, Michele

# Answer
> 0 votes
It was definitely the known bug. I upgraded to 4.6.38 and no longer have the problem.

# Answer
> 2 votes
Sounds like https://issues.civicrm.org/jira/browse/CRM-16929. You might need to apply the 3 patch that were submitted to this issue -

The first two are pretty longer patch so not sure if they will be applied directly. Recommendation is to upgrade CiviCRM to the latest version.

# Answer
> 0 votes
One way to do it is to write `hook_civicrm_buildForm` and use form id as a trigger in if condition and use jQuery to remove/disable billing section when specific option is selected.

---
Tags: civievent, forms, price-sets
---


# Question
Title: Remove User Login from Event registration
I am creating an event for my organization and its showing the enter a username as require. I want to remove this as this is a public event and it complecate things for people. I went and found where to go to allow anonymous user to register and did the anonymous role change on the dupral access but still Im getting the username thing.

# Answer
You will need to turn off the setting for profile that you have used in Event registration.

HTH

Pradeep
> 3 votes

---
Tags: civievent
---


# Question
Title: How to set the CMS language as the preferred language of the contact?
There is a way to force the language of a contact created via webform: How to set a constant value for a field in webform (eg the prefered language)?

but I'd like to do it automatically, eg if I see the form as /fr/form it will set the preferred Civi language to fr, if the visitor is on /de/form it will be in german

Is this possible with webform civicrm?

# Answer
This is only a partial answer - but the PHP `$_SERVER` global variable contain the requested language code (e.g. `en_US`) (See here). `civicrm_option_value` stores the "Languages" option group, which provides a mapping from the language code to the language option value ID.

It seems like you could parse the requested language (`en` and `en-US` must be mapped to `en_US`), add an API call to `OptionValue.get` to get the correct ID value, and set the default value for preferred language.

Note that this is slightly different from what you're requesting - a French-speaking user on an English-localised web browser will get English, not French - but the concept should be applicable.
> 1 votes

# Answer
I think the best option is to add some jquery -\> that reads the URL - parses it - and then writes to the appropriate field on the webform based on whether it finds /de/ , /fr/ or /en/
> 1 votes

---
Tags: webform-civicrm, localisation
---


# Question
Title: Is it possible to not have a default country?
I'm working on a Civi implementation for a client who deals with contacts around the world. It makes no real sense for them to have a default country, yet it looks like I have no option but to set one. Is there a way to not have a default country for address records?

# Answer
CiviCRM allows you to over-ride the settings through php. You can over-ride default value for Contact Country.

Add the below snippet in your sites civicrm.settings.php file

```
global $civicrm_setting;
$civicrm_setting['Localization Preferences']['defaultContactCountry'] = '';

```

Ref: Override CiviCRM Settings

HTH

Pradeep
> 5 votes

---
Tags: addresses, default-settings
---


# Question
Title: DB error missing field in contribution reports after upgrade to 5.4.0 (Drupal)
After upgrade to 5.4.0 (from 4.7) I'm seeing fatal DB errors ("no such field") when refreshing Contribution Detail & Summary reports. Debug log shows:

> $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle ) \[code\] =\> -19 \[message\] =\> DB Error: no such field \[mode\] =\> 16 \[debug\_info\] =\> SELECT ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name, ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id, ifnull(civicrm\_contribution\_contribution\_id, '') as civicrm\_contribution\_contribution\_id, ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contribution\_currency, '') as civicrm\_contribution\_currency, ifnull(civicrm\_contribution\_receive\_date, '') as civicrm\_contribution\_receive\_date, ifnull(civicrm\_contribution\_total\_amount, '') as civicrm\_contribution\_total\_amount, ifnull(civicrm\_contribution\_fee\_amount, '') as civicrm\_contribution\_fee\_amount, ifnull(civicrm\_contribution\_net\_amount, '') as civicrm\_contribution\_net\_amount, ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as civicrm\_contribution\_contribution\_or\_soft, ifnull(civicrm\_contribution\_campaign\_id, '') as civicrm\_contribution\_campaign\_id, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_25, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_26, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_27 , sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct from civireport\_contribution\_detail\_temp3 group by civicrm\_contribution\_financial\_type\_id, civicrm\_contribution\_payment\_instrument\_id \[nativecode=1054 \** Unknown column 'civicrm\_contribution\_total\_amount' in 'field list'\] \[type\] =\> DB\_Error \[user\_info\] =\> SELECT ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name, ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id, ifnull(civicrm\_contribution\_contribution\_id, '') as civicrm\_contribution\_contribution\_id, ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contribution\_currency, '') as civicrm\_contribution\_currency, ifnull(civicrm\_contribution\_receive\_date, '') as civicrm\_contribution\_receive\_date, ifnull(civicrm\_contribution\_total\_amount, '') as civicrm\_contribution\_total\_amount, ifnull(civicrm\_contribution\_fee\_amount, '') as civicrm\_contribution\_fee\_amount, ifnull(civicrm\_contribution\_net\_amount, '') as civicrm\_contribution\_net\_amount, ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as civicrm\_contribution\_contribution\_or\_soft, ifnull(civicrm\_contribution\_campaign\_id, '') as civicrm\_contribution\_campaign\_id, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_25, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_26, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_27 , sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct from civireport\_contribution\_detail\_temp3 group by civicrm\_contribution\_financial\_type\_id, civicrm\_contribution\_payment\_instrument\_id \[nativecode=1054 \** Unknown column 'civicrm\_contribution\_total\_amount' in 'field list'\] \[to\_string\] =\> \[db\_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM\_Core\_Error::handle prefix="" info="SELECT ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contact\_sort\_name, '') as civicrm\_contact\_sort\_name, ifnull(civicrm\_contact\_id, '') as civicrm\_contact\_id, ifnull(civicrm\_contribution\_contribution\_id, '') as civicrm\_contribution\_contribution\_id, ifnull(civicrm\_contribution\_financial\_type\_id, '') as civicrm\_contribution\_financial\_type\_id, ifnull(civicrm\_contribution\_payment\_instrument\_id, '') as civicrm\_contribution\_payment\_instrument\_id, ifnull(civicrm\_contribution\_currency, '') as civicrm\_contribution\_currency, ifnull(civicrm\_contribution\_receive\_date, '') as civicrm\_contribution\_receive\_date, ifnull(civicrm\_contribution\_total\_amount, '') as civicrm\_contribution\_total\_amount, ifnull(civicrm\_contribution\_fee\_amount, '') as civicrm\_contribution\_fee\_amount, ifnull(civicrm\_contribution\_net\_amount, '') as civicrm\_contribution\_net\_amount, ifnull(civicrm\_contribution\_contribution\_or\_soft, '') as civicrm\_contribution\_contribution\_or\_soft, ifnull(civicrm\_contribution\_campaign\_id, '') as civicrm\_contribution\_campaign\_id, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_25, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_25, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_26, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_26, ifnull(civicrm\_value\_gift\_aid\_declaration\_custom\_27, '') as civicrm\_value\_gift\_aid\_declaration\_custom\_27 , sum(civicrm\_contribution\_total\_amount) as sumcontribs, count(\*) as ct from civireport\_contribution\_detail\_temp3 group by civicrm\_contribution\_financial\_type\_id, civicrm\_contribution\_payment\_instrument\_id \[nativecode=1054 \** Unknown column 'civicrm\_contribution\_total\_amount' in 'field list'\]"\] )

Key issue seems to be that civicrm\_contribution\_total\_amount is not included in temp table civireport\_contribution\_detail\_temp3

Checked on a 5.0 demo site listed on civicrm.org (https://drupal.demo.civicrmfr.org/civicrm/report/list?compid=2&reset=1 \- the only one running 5.x) and get the same error.

Any help gratefully received...

# Answer
> 1 votes
For some reason i am getting different no such field error i.e for contact.birth\_date. I have locked the issue for this error at https://lab.civicrm.org/dev/core/issues/325 and submitted PR at https://github.com/civicrm/civicrm-core/pull/12660 .

I also logged issue for your bug at https://lab.civicrm.org/dev/core/issues/326 which happens when we enable Section header under sorting tab.

To fix this temporary until Core team have PR for it, i would suggest you to turn off section header.

HTH

Pradeep

---
Tags: error, contributions, database, reports, 5.0
---


# Question
Title: wrong currency on contribution pages - how to correct?
I have set default currency to GBP, created memberships with GBP amounts, and set GBP as the currency within my contribution page.

But membership fee displays in USD on the contribution page and when sending payees to paypal (my only payment processor) attempts to charge of a USD amount.

What am I doing wrong please?

thank you:)

# Answer
> 1 votes
Try re-saving the contribution pages so that the new default currency is updated. You can cross check the currency used for contribution page using api explorer, it might be helpful to track the error.

HTH

Pradeep

---
Tags: civicontribute, currency
---


title: Secure storage for file attachments

text:
# Question
Title: Secure storage for file attachments
We want to add some file fields to individual contacts for PDF documents. Is there a way to store these files so that they can be accessed by a Civicrm user with appropriate permissions but not reachable on the web site otherwise - including by a search bot or similar agent that may ignore a robots.txt instruction? I realize this question may go beyond Civicrm configuration to web server security in general but hoping someone can point me in the right direction. My civicrm is running on WordPress on Ubuntu. Thanks.

# Answer
> 2 votes
There is a special permission for accessing user file uploads in CiviCRM. You can turn this off for Anonymous user and I believe your files won't be accessible for Anonymous users.

---
Tags: security, attachments
---


# Question
Title: How to setup cron trigger in CiviRules extension
How can i set the trigger event to be a daily cron on memberships?

Goal is to check all memberships that has status pending for more than 40 days, if yes then change status to expired. I understand it would be a custom condition and action.

# Answer
> 2 votes
You can set the Membership status rule to end date as 40 days for pending status. But i am not confident that pending memberships are actually processed by 'Update Membership statuses' cron job.

# Answer
> 2 votes
You can develop your own cron trigger. There is no tutorial for that but take a look at the daily group membership cron trigger.

But as Pradeep suggested also take a look at the membership status rules and enable the update membership status cron.

---
Tags: civimember, civirules
---


title: Batch update Primary Address

text:
# Question
Title: Batch update Primary Address
I made the mistake of importing work addresses before home addresses. How can I update home addresses to all be primary?

# Answer
The only option i feel is running a query that will switch the primary address from work to home for a set of contacts in a group.

1. Add imported address contact in a group X.
2. Update is\_primary to NULL for all address for contacts in a group X.
3. Update is\_primary to TRUE for home address for contacts in a group X.

HTH

Pradeep
> 1 votes

---
Tags: addresses
---


# Question
Title: Get Custom CiviCRM Data by ContactID This is not a duplicate
This is option group 110 in civicrm\_option\_value

I am trying to create a custom query for reporting that pulls the actual Custom Data LABELS ('Green Light','Red Light', etc)vs the custom data VALUES (1,2,3 etc) per the CIVI Terminology in Admin.

The following SQL:

SELECT civicrm\_contact.id, civicrm\_contact.display\_name, civicrm\_value\_custom\__safe\_sport\_co\_9.usoc\_sports\_safe\_complete\_9, civicrm\_value\_custom\__safe\_sport\_co\_9.background\_check\_7, civicrm\_value\_custom\__safe\_sport\_co\_9.red\_light\_override\_71, civicrm\_value\_custom\__safe\_sport\_co\_9.override\_expiration\_72, civicrm\_value\_custom\__safe\_sport\_co\_9.background\_check\_status\_73 FROM civicrm\_contact INNER JOIN civicrm\_value\_custom\__safe\_sport\_co\_9 ON civicrm\_value\_custom\__safe\_sport\_co\_9.entity\_id = civicrm\_contact.id WHERE civicrm\_contact.id = 1000

1000,Billy Jenkins,2/27/2018,3/16/2018,0,NULL,1

I actually WANT

1000,Billy Jenkins,2/27/2018,3/16/2018,0,NULL,Green Light

This is micro version of what I actually need which is many more custom data columns but its the same situation, I can't simply join the civicrm\_option\_value.value field because there are dozens of values of '1' I'm not sure how to segment the 110 group only to pull what I need.

What should I do?

# Answer
> 1 votes
I'll try to answer specifically for this question but this effectively is a duplicate of MySQL Query to return all custom values because it's the exact same technique.

First, look in civicrm\_custom\_field in the "name" column for the Background Check Status field. I'm going to assume it says "Background\_Check\_Status" there. If not you'll need to change it below to match.

```
SELECT civicrm_contact.id,
civicrm_contact.display_name,
civicrm_value_custom__safe_sport_co_9.usoc_sports_safe_complete_9,
civicrm_value_custom__safe_sport_co_9.background_check_7,
civicrm_value_custom__safe_sport_co_9.red_light_override_71,
civicrm_value_custom__safe_sport_co_9.override_expiration_72,
ov1.label AS 'Background Check Status'
FROM
civicrm_contact
INNER JOIN civicrm_value_custom__safe_sport_co_9 ON civicrm_value_custom__safe_sport_co_9.entity_id = civicrm_contact.id
LEFT JOIN civicrm_custom_field cf1 ON cf1.name = 'Background_Check_Status'
LEFT JOIN civicrm_option_group og1 ON cf1.option_group_id = og1.id
LEFT JOIN civicrm_option_value ov1 ON (ov1.option_group_id = og1.id AND ov1.value = civicrm_value_custom__safe_sport_co_9.background_check_status_73)
WHERE civicrm_contact.id = 1000

```

Since you already knew the option\_group\_id, you could use that like so, but I find the name is easier on the eyes.

```
SELECT civicrm_contact.id,
civicrm_contact.display_name,
civicrm_value_custom__safe_sport_co_9.usoc_sports_safe_complete_9,
civicrm_value_custom__safe_sport_co_9.background_check_7,
civicrm_value_custom__safe_sport_co_9.red_light_override_71,
civicrm_value_custom__safe_sport_co_9.override_expiration_72,
ov1.label AS 'Background Check Status'
FROM
civicrm_contact
INNER JOIN civicrm_value_custom__safe_sport_co_9 ON civicrm_value_custom__safe_sport_co_9.entity_id = civicrm_contact.id
LEFT JOIN civicrm_option_value ov1 ON (ov1.option_group_id = 110 AND ov1.value = civicrm_value_custom__safe_sport_co_9.background_check_status_73)
WHERE civicrm_contact.id = 1000

```

# Answer
> 0 votes
You can use `public function alterDisplay(&$rows)` function of civicrm reports, and add new column, and use civicrm API to populate those columns for custom fields.

Example code:

```
public function alterDisplay(&$rows) {

  foreach ($rows as $rowNum => $row) {

    $this->_columnHeaders['XYZ_custom_info'] = array(
      'title' => 'XYZ custom info',
      'type' => CRM_Utils_Type::T_STRING
    );

    try{
      //Getting spouse name
      $field_info = civicrm_api3('Contact', 'get', (
        'return' => "custom_field_id",
        'id' => "",
      ));

      $rows[$rowNum]['XYZ_custom_info'] = $field_info;
    }
    catch(Exception $e) {
      echo 'Message: ' .$e->getMessage();
    }
  }
}

```

# Answer
> 0 votes
Another way to do this type of reporting in general is to write a cron script that uses the api and periodically writes out the values to another table that has a schema of your choosing, then have Crystal Reports pull data from that table. The data wouldn't be 100% realtime because there'd be a delay between until the next run of your script, but reporting doesn't always need to be realtime.

---
Tags: custom-fields
---


title: Settings - Outbound Mail are not saved

text:
# Question
Title: Settings - Outbound Mail are not saved
please help, I have a Joomla 3.6.5 and CiviCRM 4.7.14 I just migrated from the dev site to the live site, and now when I check the Outbound Mail settings in CiviCRM, they are empty. Everytime I fill them out and press save, once I reaload the settings page, they are empty again.

Please, where is this info stored?

Thank you

# Answer
> 1 votes
The typical troubleshooting steps here would be to check for errors in the CiviCRM log as well as to check for JavaScript errors in your web browser's console.

# Answer
> 0 votes
If you have access to the database using phpMyAdmin, the email information is in the civicrm part of the database tables with the table name "civicrm\_email". The default email is probably the first mentioned with the ID of 1.

Have you entered the default email address in Administer\>Communications\>Organization Address and contact info, as well as set them up in Adminster\>Communications\>From email addresses?

In the latter,dont forget to:

1. mark the relevant default email address.
2. Include double-quotes (") around the name and angle-brackets (\< \>) around the email address.

# Answer
> 0 votes
The settings for the outbound mailer are stored in the `civicrm_setting` database table. Use the following SQL statement to retrieve them:

```
select * from civicrm_setting
where name='mailing_backend'

```

The result field `value` all the settings in (I suppose) Drupal database storage format. Does it have SMTP server details? For example:

```
s:10:"smtpServer";s:34:"email-smtp.eu-west-1.amazonaws.com"

```

# Answer
> 0 votes
This looks like a caching problem. I recently had the same issue.

# Answer
> 0 votes
If runInNonProductionEnvironment=TRUE, then the mailing settings are coming from 'mailing\_backend\_store' in stead of 'mailing\_backend' in the table civicrm\_setting. You need to modify it manually in the table.

---
Tags: joomla, email, database, settings
---


title: How to import time with date

text:
# Question
Title: How to import time with date
Importing the date works correctly, but the time shown is always 12:00 am even though the import field is, for example 02/07/2018 11:31 am. I tried various formats like the previously mentioned 02/07/2018 11:31 am or 03/04/2018 14:22.

How can I import the time and the date into a CiviCRM date field. I am importing the dates into a custom date field.

# Answer
I don't think that this is currently possible. The time part will we stripped in `CRM_Utils_Date::convertToDefaultDate()` called here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/Import/Parser/Contact.php#L1909

You could have an extension read an imported text field with a date string and set the proper datetime value for the custom field via the hook `hook_civicrm_custom` in an extension. But adding the functionality to core would most likely make more sense.
> 3 votes

---
Tags: import, timestamp
---


# Question
Title: My custom fields are not visible on Contact's Activity Log
I try to show (first for the admin user) all changes for a contact. That works on Contact's Activity Log page. I can see the date and time of modifying my custom fields, but the old and the new values are not shown. In the databases log table for the custom field are the changes logged.

How can I fix this?

Thank you.

# Answer
Have you enabled detailed logging (this is disabled by default)?

If no, you can enable this from the Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.) menu option -

/civicrm/admin/setting/misc?reset=1

This feature records a full history of all changes made.

Please note the below before this feature is enabled -

Detailed logging (aka "logging") allows you to maintain a full history of all changes made to everything in CiviCRM. It's a powerful feature which is turned off be default — because it's a bit overkill for most organizations, and it comes with some downsides too.

Full details can be found HERE
> 0 votes

# Answer
Does the user has the permission to view the report `Contact Logging Report (Summary)`?
> 0 votes

---
Tags: contacts, logging
---


# Question
Title: Export contributions - missing Field Mapping dropdown
I was able to reproduce on CIVICRM DEMO site: https://demo.circle-interactive.co.uk Steps to reproduce:

1. Find contributions
2. Select contributions
3. Select action 'Export contributions'
4. Select option 'Select fields for export'

A dropdown should display to let use select fields for mapping but in civicrm version 5 that div id '#map' do not have any content.

# Answer
> 3 votes
It does work. If you don't have mapping saved then it won't display the list. I tested on https://demo.circle-interactive.co.uk/ after saving the mapping. Second time i visited the page i could see mapping field. Make sure you have mappings saved for contribution export.

---
Tags: civicontribute, contributions, field-mapping
---


title: CiviCRM Contribution Page Theme

text:
# Question
Title: CiviCRM Contribution Page Theme
I was wondering if anyone had suggests on great themes that I could purchase or are free for the public facing CiviCRM contribution pages? We would like to to be very responsive (Mobile friendly) and maybe incorporate Bootstrap.

Any ideas or suggestions are helpful. Thanks

# Answer
There is a drupal theme Civi Bartik Public: https://github.com/CiviCooP/civi\_bartik\_public

You can configure the colors in the drupal admin. Unfortunately I dont have screenshot.
> 1 votes

# Answer
Since contribution pages are front end drupal pages you can use bootstrap theme since its very responsive or amnesty have customized drupal theme compatible for CiviCRM
> 0 votes

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


title: Contribution Widget

text:
# Question
Title: Contribution Widget
I can't figure out why the Widget on my contribution page only shows "-- placeholder --" although about and button text are filled out...?

# Answer
> 2 votes
Looks like your server is not configured to execute php file using url https://www.unitedwaymcca.org/sites/unitedwaymcca.org/modules/civicrm//extern/widget.php?cpageId=40&widgetId=10&format=3

I can see 403 Forbidden nginx error in browser console. This URL is responsible to build the widget.

You may find more reasons for this error in servers access or error logs.

---
Tags: civicontribute, widget
---


# Question
Title: CiviCRM 5.4.0 Install "You do not have permission to access this page"
I am stuck on this step:

> Then go to Settings \> CiviCRM Installer: http://example.org/wp-admin/options-general.php?page=civicrm-install
>
> ```
> In version 4.7 and above you will see a link on the wp-admin page to the Installer screen
>
> ```

There is not link on the wp-admin page like it says and if I manually use http://example.org/wp-admin/options-general.php?page=civicrm-install with my domain it gives me a "You do not have permission to access this page" error.

I basically cannot access the installer at all.

# Answer
> -1 votes
Sometimes even i face similar problem when i try to install CiviCRM. But i make it work by commenting the line that throws this error.

You can find quick solution here.

---
Tags: installation, 5.0
---


# Question
Title: Undefined index: params in CRM_Event_BAO_Event::buildCustomProfile() - CiviEvent
I just came across this error (that I'd just like to clean up) after cancelling my PayPal transaction and returning to my site:

Undefined index: params in CRM\_Event\_BAO\_Event::buildCustomProfile()

Are there any fixes for this issue?

Thanks! Matt

# Answer
I also came across this notice, I've submitted a pull request: https://github.com/civicrm/civicrm-core/pull/12678
> 2 votes

---
Tags: civievent, civicontribute, error
---


title: Mass deletion of bad addresses

text:
# Question
Title: Mass deletion of bad addresses
I have several hundred individual records that have bad mailing address and have tagged them in CiviCRM. How can I delete these from the system in bulk? I have tried Civi's upload process by leaving the address blank and using the overwrite duplicate setting, hoping this would blank out their address, but that has no effect.

Thank you.

# Answer
> 5 votes
If you completly want to delete the addresses, you could also delete them from the database with a query like `DELETE FROM civicrm_address WHERE location_type_id = xx AND contact_id IN (SELECT entity_id FROM civicrm_entity_tag WHERE entity_table = 'civicrm_contact' AND tag_id = yy)`

Where `xx` stands for the id of the location type you want to delete and `yy` is the id of the tag.

# Answer
> 3 votes
See the docs section on profiles and then using batch update from the search results actions dropdown, i.e. search for your tag and then choose batch update via profile, and choose a profile that has your address fields. https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#updating-multiple-records-at-the-same-time

It may have the same thing as import where it interprets blank as "no change". If so, you could try fooling it with a space character as the address.

---
Tags: addresses, tags, upload
---


title: Conditional logic in Thank You letters

text:
# Question
Title: Conditional logic in Thank You letters
I recently took over the donor thank you letter process at the organization I work for and saw that Civi has the ability to create thank you letters for donors.

The organization I work for has 5 separate funds that members can contribute to. We want to be able to be able to send an automated thank you letter to contributors that reflects all of their contributions.

Is there a way to add an "if...then" sort of logic to these letters?

For instance:

* Member One donates $10 to Fund A
* Member Two donates $10 each to Fund B, C, and D
* Member Three donates $10 each to Fund B and E

We want to be able to automate letters that would say:

* Dear Member One, thank you for contributing $10 to Fund A.
* Dear Member Two, thank you for contributing $10 to Fund B, $10 to Fund C, and $10 to Fund D.
* and so on

I see tokens that auto populate for name, date, and address, but not for our individual funds themselves. I also don't see a way of specifying most recent contribution -- only total all-time or total last year.

Are there tokens I can use that will automatically pull from a member's contributions? Something like:

> Dear {firstname}, Thanks for donating {Fund A donation amount} to {Fund A}.

Or is this functionality not possible on Civi?

Thanks!

# Answer
Civitoken extensions provides additional tokens for contact. It would be worth trying the extension.

There are also few others
> 4 votes

# Answer
Assuming that each contribution is separate, you can use the Thank you letters with grouped contribution functionality to do what you want. I find the formatting a little funky, but it works.
> 3 votes

# Answer
You can also use CiviRules to send out thank you letters. You could then trigger on contribution added and then set the conditions (such as amount between xx and yy, and status is completed, and financial type is z, etc).

Use the Send e-mail action (provided by the email api extension) for sending the actual thank you e-mail.

You have to create a message template for each type of thank you letter, and a civirule for each type of thank you.
> 1 votes

---
Tags: civicontribute, civimail, contributions
---


# Question
Title: Multiple Types of Contributions using CiviContributions Drupal Integration
I am trying to use one webform to collect multiple types of contributions from one contact. Specifically, we are trying to collect a sponsorship and in-kind donation for one event from one contact type on the same webform. While I don't need to access two different contribution pages, I do want the webforms to population two different contribution records one for the monetary sponsorship, and another with the value of the in-kind donation. Does anyone know how to set this up?

Thanks, Neena

# Answer
> 2 votes
Create a Price Set with multiple fields and set the contribution type for each field. The use that price set on your page. It will show up as one contribution, but when you click on it and click view you'll see the 2 different contributions and the amount for each type. You can setup a report to view the info separately for each type if you want.

---
Tags: drupal, civicontribute, webform-civicrm
---


# Question
Title: MailChimp extension v2.0.1 won't install on CiviCRM 5.3.2
The latest stable release of the MailChimp extension for CiviCRM isn't installing on our Civi 5.3.2 via the Civi internal extension installer. Admin interface displays

> Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Error: unknown error

PHP error log shows no related errors. Also getting the following when coming back to the Civi admin interface after checking the log:

UDATE: On my fifth or sixth attempt to install, it finally worked. Didn't change anything prior to this. No idea why.

# Answer
> 1 votes
Crazy as it sounds, this is one case in which it may be advisable to repeat the same behavior and expect different results. There's no clear or obvious reason why the installer failed repeatedly, but on the fifth or sixth attempt, it finally worked. Memory glitch on the remote server? Hiccup in the CPU? Who knows. But if you encounter the same issue, try and try again, and hopefully you'll get the desired outcome sooner or later.

---
Tags: civimail, extension, mailchimp
---


# Question
Title: 'Create Linked Drupal User Account' problem - bug or user error?
I am trying to set up a rule to create a Drupal User when a Contact is created. The obvious approach is to fire on the event 'CiviCRM Contact has been created, check for the correct Contact subtype, and that a User does not already exist, and then use the action 'Create Linked Drupal User Account'.

This does not work on creating a Contact, giving an error message: Cannot create user, email: invalid!!

The Rules debug information in this case is:

`0 ms Reacting on event CiviCRM Contact has been created.
2.397 ms Evaluating conditions of rule Test Rule. [edit]
2.473 ms The condition civicrm_entity_contact_is_subtype evaluated to TRUE [edit]
6.878 ms The condition civicrm_entity_user_exists evaluated to FALSE [edit]
6.88 ms AND evaluated to TRUE.
 Rule Test Rule fires [edit]
 0 ms Rule Test Rule fires.
 0.041 ms Evaluating the action civicrm_entity_action_create_user. [edit]
 232.936 ms Rule Test Rule has fired.
239.83 ms Finished reacting on event CiviCRM Contact has been created.`

The only messages in the Drupal log are copies of the error message and the Rules debug log.

BUT if one then updates the same Contact, using the same webform and the same Rule with the Contact Updated event added, it works and the User is created. (This says a timing or sequencing problem to me, or a difference I haven't spotted in the syntax required in the two cases.)

What is going on?

The Rule export is:

`{ "rules_test_rule" : {
 "LABEL" : "Test Rule",
 "PLUGIN" : "reaction rule",
 "OWNER" : "rules",
 "REQUIRES" : [ "civicrm_entity", "civicrm" ],
 "ON" : { "civicrm_contact_create" : [], "civicrm_contact_edit" : [] },
 "IF" : [
 { "civicrm_entity_contact_is_subtype" : { "civicrm_contact" : [ "civicrm_contact" ],
 "contact_subtype" : "xxxx_Member"
 }
 },
 { "NOT civicrm_entity_user_exists" : { "civicrm_contact" : [ "civicrm_contact" ] } }
 ],
 "DO" : [
 { "civicrm_entity_action_create_user" : {
 "USING" : {
 "civicrm_contact" : [ "civicrm-contact" ],
 "is_active" : "1",
 "notify" : "0",
 "signin" : "1",
 "username_format" : "firstlast"
 },
 "PROVIDE" : { "civicrm_user" : { "username" : "Created Drupal User" } }
 }
 }
 ]
 }
}`

Configuration includes: CiviCRM 5.3.2 (including CiviCRM Rules Integration);
Drupal 7.59;
CiviCRM Entity 7.x-2.1;
Rules 7.x-2.11;
and dependencies.

(I have looked at the answers to various related questions and cannot get any joy. Those that are using the same approach don't seem be any help in getting mine working. Some suggest setting a Tag and then firing a rule off the Tag creation event - the CiviCRM Tag entity does not show up in the event selection list on my system, so I can't use that.

I have done something similar to the Tag suggestion using the Relationship created event, which does work (as far as I have tested it so far) but it's clearly a kludge (apologies) workaround. Should not the straightforward approach work?)

Thanks in advance, Tony

# Answer
> 1 votes
This could be caused that in CiviCRM an e-mail address is its own entity and created after the contact has been created.

Meaning that at the point the trigger contact created is fired there is no e-mail address in the database (yet). That one is added afterwards.

CiviCRM has functionality which is called profiles and which also create a user account. So maybe you can use a profile to create the contact and its related user account.

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


# Question
Title: CiviMember Sync with Wordpress usernames
1. How can I add a bulk operation to give certain individuals a membership on CiviCRM? for example, from a group
2. I want to sync those who are given memberships to give them a wordpress user accesss (already configured that). BUT when I sync them now, the username would the individual's prefix, first name, middle name, last name (ex. Mr-john-joe-smith), which is too long. **how can I make the format for the usernames?**
3. what would the default password be for the synced membership users afterwards?
4. CiviCRM syncs wordpress users to another individual that doesn't have to do anything with their name, email, phone number. How can I fix that before making the bulk operation.

# Answer
> How can I add a bulk operation to give certain individuals a membership on CiviCRM? for example, from a group

I'll defer to someone with deeper knowledge of CiviCRM internals on this one. It's a separate question, really, which you may want to post as such.

> I want to sync those who are given memberships to give them a wordpress user access (already configured that). BUT when I sync them now, the username would the individual's prefix, first name, middle name, last name (ex. Mr-john-joe-smith), which is too long. how can I make the format for the usernames?

Please refer to this thread on GitHub which provides a technique for you to define your own username format.

> what would the default password be for the synced membership users afterwards?

Newly-created WordPress users can set their own password by visiting the WordPress "Lost Password" screen.

> CiviCRM syncs wordpress users to another individual that doesn't have to do anything with their name, email, phone number. How can I fix that before making the bulk operation.

I think others have answered this elsewhere.
> 2 votes

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


# Question
Title: Error using Drush and Civi API when adding data to a custom field with multi-select data
I have been trying to create contacts data using Drush and the CiviAPI. I get an error when I try to add data to a multi-select field despite using exactly the same syntax that the API explorer gives me.

I have a custom field (machine name: custom\_10) that takes up to 5 options. As an example, If I use the API explorer to create the following output, I get this:

```
drush cvapi Contact.create contact_type="Individual" contact_sub_type="MySubType" custom_10=[1,2,3] first_name="John" last_name="Doe"

```

Executing this though the API explore works fine, but if I copy the drush line and execute it, the array data for custom\_10 causes an error:

```
Array
(
    [error_field] => custom_10
    [error_code] => 2001
    [entity] => Contact
    [action] => create
    [is_error] => 1
    [error_message] => '1,2,3' is not a valid option for field custom_10
)

```

executing a single option with custom\_10=1 will work fine. I have tried various different syntax but cannot get it to take. Has anyone else had this issue with the Drush approach for arrays in Custom fields?

I have no issues adding anything else Contact wise including chaining for additional emails. It is just fields that have arrays of data.

# Answer
I'm pretty sure you're running into the same problem I've documented on Gitlab as issue #298 \- basically, API Explorer doesn't return correct code when you need to pass in an array.
> 0 votes

---
Tags: api, drush
---


# Question
Title: How can we create memberships with two or more accumulated partial payments?
We'd like to let individuals pay membership fees incrementally, e.g. four quarterly occurring payments of 0.25M (where M is the total membership fee). It looks like the devs sought to do something like this previously in the Civi core, and there may have been partial payment function deployed in 4.7 -- see this thread and this thread too. But I'm not seeing anything in our live install of 5.4.0 (running on WP 4.9.8) that supports creation of new membership once user has made two or more contributions of which the sum meets or exceeds the membership fee.

Am I missing something? And if not, is there any appetite for an extension or core enhancement that would enable both tracking of partial membership payments and creation of membership (or renewal of membership) once the membership fee is paid in full?

# Answer
As of now, Partial payment is only possible through backend in CiviCRM. There is an open issue which extends it to be usable from live contribution page too. See https://github.com/civicrm/civicrm-core/pull/12319. To test/use this functionality, you need to perform the following steps -

* Apply this patch on your site.
* Create a pending/partially paid membership for a contact.
* Select `Default invoice payment page` from `civicrm/admin/setting/preferences/contribute?reset=1`.
* Navigate to user dashboard and you should be able to see a `pay now` link which points the user to complete this payment.
* The pending amount is prefilled on the contribution page and user is able to complete the payment using this live contribution page.

ToDo - On the last step, there needs to be a changeable amount field which user can use and pay the membership fee in different installments.
> 1 votes

---
Tags: civicontribute, civimember, partial-payments
---


# Question
Title: No cron runs have been recorded (CiviCRM 4.7.25 on Wordpress 4.8?)
I don't know how could I solve this problem. I have this problem from the beginning of installing. I read the other answers at this forum but they could;n solve my problem. would you please tell me how can I solve this error step by step?

# Answer
> 3 votes
From your second image, I see that you have not yet set up cron for CiviCRM. The first entry in your crontab executes the Wordpress job. A second entry is needed to execute the CiviCRM job.

Here are the instructions for doing so: https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#choosing-a-method

# Answer
> 0 votes
You've to put your wordpress admin username. and path is nothing but your website path. For instance if your site is in public\_html - have to include the public\_html path.

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


# Question
Title: Api doesn't update record vu creates new
I have a civicrm-application that gets updates trough an external rest-api call. But there's something odd happening.

Request:
```
api_key=76d9f1d3h4c87c2465a8a305b6fe&key=487e30c9219952143657f779&json={"first_name":"Sebastian","last_name":"Vyaene","birth_date":"01-01-1992","gender_id":2,"custom_5":"B380-A003-G164-W878","custom_6":null,"custom_7":null,"preferred_language":"nl_NL","phone":"0477745678","custom_8":{},"custom_18":[],"contact_type":"Individual","sequential":1,"custom_14":0,"id":420564,"custom_10":0,"api.Address.create":{"contact_id":"$value.id","street_address":" ","postal_code":"9000","city":null,"location_type_id":1,"id":396363},"api.Email.create":{"contact_id":"$value.id","email":"sebastian@marlon.be","id":426290},"api.Phone.create":{"contact_id":"$value.id","phone":"0477745678","id":101260},"api.Membership.create":{"contact_id":"$value.id","membership_type_id":1,"join_date":"2017-10-16","start_date":"2017-10-16","end_date":"2018-10-16","source":{},"custom_17":"B380-A003-G164-W878","id":362337}}&entity=Contact&action=create
</code></pre>

\`\`\` this is an create action, but there's already an id present, so there should be an update. But as you can see in the response, the id is ignored and another contact is created, what is not the behaviour we want.

<pre><code>Response:

```

{"is_error":0,"version":3,"count":1,"id":481202,"values":[{"id":"481202","contact_type":"Individual","contact_sub_type":"","do_not_email":"0","do_not_phone":"0","do_not_mail":"0","do_not_sms":"0","do_not_trade":"0","is_opt_out":"0","legal_identifier":"","external_identifier":"","sort_name":"Vyaene, Sebastian","display_name":"Sebastian Vyaene","nick_name":"","legal_name":"","image_URL":"","preferred_communication_method":"","preferred_language":"nl_NL","preferred_mail_format":"Both","hash":"0326647eddd86831d8e1454926e8a2c5","api_key":"","first_name":"Sebastian","middle_name":"","last_name":"Vyaene","prefix_id":"","suffix_id":"","formal_title":"","communication_style_id":"","email_greeting_id":"1","email_greeting_custom":"","email_greeting_display":"","postal_greeting_id":"1","postal_greeting_custom":"","postal_greeting_display":"","addressee_id":"1","addressee_custom":"","addressee_display":"","job_title":"","gender_id":"2","birth_date":"1992-01-01","is_deceased":"0","deceased_date":"","household_name":"","primary_contact_id":"","organization_name":"","sic_code":"","user_unique_id":"","created_date":"2018-08-20 10:04:48","modified_date":"2018-08-20 10:04:48","api.Address.create":{"is_error":0,"version":3,"count":1,"id":396363,"values":[{"id":"396363","contact_id":"481202","location_type_id":"1","is_primary":"1","is_billing":"0","street_address":" ","postal_code":"9000","manual_geo_code":"0"}]},"api.Email.create":{"is_error":0,"version":3,"count":1,"id":426290,"values":[{"id":"426290","contact_id":"481202","location_type_id":"","email":"sebastian@marlon.be","is_primary":"","is_billing":"","on_hold":"","is_bulkmail":"","hold_date":"","reset_date":"","signature_text":"","signature_html":""}]},"api.Phone.create":{"is_error":0,"version":3,"count":1,"id":101260,"values":[{"id":"101260","contact_id":"481202","location_type_id":"","is_primary":"","is_billing":"","mobile_provider_id":"","phone":"0477745678","phone_ext":"","phone_numeric":"","phone_type_id":""}]},"api.Membership.create":{"is_error":0,"version":3,"count":1,"id":362337,"values":[{"id":"362337","contact_id":"481202","membership_type_id":"1","join_date":"2017-10-16","start_date":"2017-10-16","end_date":"2018-10-16","source":"Array","status_id":"2","is_override":"","owner_membership_id":"","max_related":"","is_test":"0","is_pay_later":"0","contribution_recur_id":"","campaign_id":""}]}}]}

```

Request Id: 420564 Response Id: 481202

I've looked at the call for hours and i can't find the problem. Anyone else who can help?

I'm currently on 4.6.36 and drupal 7.59. But as a test i upgraded to 5.2.1 and the same problem occures.

# Answer
The snippet looks correct to me, Can you try using 'contact\_id' instead of 'id' as sometimes it did work for me. I am having hard time to recollect the scenario why i had to use 'contact\_id' over 'id'.

Cheers

Pradeep
> 1 votes

---
Tags: api, rest
---