# Question
Title: Can donors store their card details on dashboard?
I would like to give access to our donors to the contact dashboard and also let them donate from that page to different campaign or events signup, so they would not have to enter their details over and over again.

I was also thinking, what if it would be possible to give option to store their credit card details like modern checkout does, for them to avoid entering them every time?

What are possibilities of achieving this? What can go wrong along the way? Thanks

# Answer
> 3 votes
It is possible to achieve this with a modern token based payment processor like the iATS Payments extension which we wrote the code for. One example of such card-on-file feature already exist:

A process button in the recurring series screen -\> this lets admins charge a one time amount to a card-on-file. This could be for e.g. a catch up transaction, an additional year end donation (phone bank calls donor and gets ok to use the card on file) or for a purchase at a silent auction (where to speed up checkout credit cards or bank accounts (ACH EFT or e-cheque) were processed and tokenized ahead of the event).

So a use my card on file does not yet exist for a donor to select as a payment method - it’s definitively possible to put that together.

---
Tags: civievent, civicontribute, iats, payment, user-dashboard
---


title: API contact custom field

text:
# Question
Title: API contact custom field
I successfully used civicrm to create a contact but I want to send a custom field value through api to be saved on the created contact but can't find a way to do can you advise, when I search in support -\> developer -\> api explorer only found "CustomField" but can't use it to set custom field value on a specific contact.

# Answer
good to hear you had some success! I would expect the api explorer to show you the custom fields for contact? You can use the custom fields with the api if you know the id of the custom field. So for custom field with id 5 the parameter for the API would be:

```
 custom_5 => <your value>

```

So an example would be:

```
$result = civicrm_api3('Contact', 'create', [
  'custom_11' => "blablabla",
])

```

;
> 1 votes

---
Tags: contacts, custom-fields
---


# Question
Title: What can be done to ensure Stripe and CiviCRM are ready for SCA in Sept 2019
There is a comment at https://lab.civicrm.org/dev/financial/issues/41#note\_14585 saying an MIH will be needed to ensure Stripe+CiviCRM is ready for this.

In Stripe Dashboard is shows

assuming via API was right option you get

and assuming i opted for right choice the next screen shows

and if i add recurring i get

# Answer
> 2 votes
There is a Stripe Make it Happen campaign here.

> * Upgrade to Stripe Elements which simplifies PCI compliance for end-users and allows us to take advantage of the latest developments with Stripe - https://stripe.com/gb/payments/elements
> * Support for SCA Payments - required in Europe for ALL credit card payments from September 2019. To be implemented by migrating to the "PaymentIntents" API: https://stripe.com/docs/payments/payment-intents
> * Support for processing refunds from within CiviCRM.
> * Support additional payment methods payment methods (eg. SEPA, iDEAL, Google Pay) - once we have switched to Stripe Elements we can implement these easily. If you wish to fund a particular payment method just let us know when you offer funding.

---
Tags: stripe
---


# Question
Title: How do I find individuals that are participants in multiple (two) events?
I want to see who is registered for both of two events. How can I do that as a search or a report?

# Answer
> 1 votes
Advanced Search, Participant Search And reports only allows you to select 'One of' the selected option i.e it does "Event 1 OR Event 2" on the selected events.

But I guess you want "Event 1 AND Event 2", if so you can use CiviCRM \>\> Search \>\> Search Builder to do AND between conditions. See below attached image

Cheers

Pradeep

# Answer
> 2 votes
You could do it in multiple steps:

* search for Event 1 participants then create a group
* use advanced search, enter the new group in the group box, and in the events section select Event 2 participants

You could create both of those as smart groups if you want to check progress as registrations come in.

But hopefully someone has a more streamlined method!

---
Tags: civievent, search, participants
---


# Question
Title: Does webform civicrm update contribution_recur_id when creating recurring contribution and membership?
I am looking more closely at the data structure and it appears that when the form is submitted we get an unlinked recurring contribution series and membership. Is this by design or user error in configuration?

the details - the civicrm\_membership table field 'contribution\_recur\_id' does not seem to have the recurring ID updated from the recurring profile the webform created

Is this how people are gaining the functionality? https://github.com/adixon/ca.civicrm.contributionrecur

Drupal 7 / up to date webform\_civicrm and civi

# Answer
Yes, it does, but only when you select 0 for installments (ongoing commitment) otherwise it seems to not link the recurring properly.
> 0 votes

---
Tags: webform-civicrm, recurring-contributions
---


# Question
Title: Can inherited members receive scheduled reminders?
In the scenario that organizations that have memberships, and then people are associated with the organization by relationship (and inherit that membership), it would be good to be able to send a scheduled renewal notice to the people that currently have the relationship with the organization. (Let's call that relationship "Representative is / Representative of"). The organization itself may not have a valid email address, and even if they do, it is probably not the right one that renewal notices should go to. The people who are currently "Representative of" the organization may change over the years while the organizational membership remains constant.

I have been trying to set up such a flow (as follows):

* Organization has membership
* Individuals have a relationship with the organization that inherits the membership
* A smart group filters these people (e.g. an active relationship, let's say) and this group is used in the scheduled reminders to limit reminders only to the appropriate people.
* Cron jobs are being fired (and the "Send Scheduled Reminders" cron job in particular is being fired).

However, no reminders appear to be going out.

In researching, I found this PR and am trying to decipher if this relates.

> **After**
>
> A scheduled reminder is only excluded if
>
> * The membership triggering the reminder is inherited, and
> * The contact lacks relationship-based permission to edit the membership owner contact

Does this mean our entire scenario is unsupported? (ie. inherited memberships cannot receive Scheduled Reminders)?

There is also some description related to whether or not the relationship is permissioned for editing. In our scenario we would not choose to set this permissioning, but if that would solve this issue we might change our mind. I did a quick test and was not successful yet in getting a reminder to go out even with permissioning.

# Answer
Confirm that they have ALL of following conditions met:

* current employee relationship that is also permissioned
* inherited membership
> 1 votes

---
Tags: civimember, scheduled-reminders
---


# Question
Title: Using profile for people to submit activities
How can I create a data entry profile that creates an activity?

Example: We train peer leaders, who then meet with mentees. We'd like them to submit their meeting information (e.g. duration, # of attendees, brief description) as an activity (e.g. type = 'peer leader meetings with mentees') that would be associated with the peer leader contact.

Similarly, we'd like to have activity types 'gave informational talk', 'served on a panel', 'participated in outreach event', etc.

The reason I'm asking about doing it as a profile is that we wouldn't want them to be able to view contact participation history, etc.- just to complete and submit the activity.

Or is there a different method you'd recommend to do this? Thanks!

# Answer
> 1 votes
If you are using Drupal then you can use webform and webform civicrm module. This modules allows to create front end forms using Civi fields and also provide ability to perform actions when form is submitted like creating activity, relationships, contribution etc.

For wordpress you can use caldera and civicrm caldera plugins which is similar to drupal webform.

Thanks

Pradeep

---
Tags: profile, activities, permissions
---


title: Webform contribution page not loading

text:
# Question
Title: Webform contribution page not loading
I set up a webform with a contribution page. The contribution page has a title, currency, payment processor, contribution amount (£100) and tests fine.

On the webform, it shows as 0.00 and is not loading at all.

Do contribution pages on webforms have to be linked to a membership payment or an event registration?

I'm sure I'm missing something obvious.....

# Answer
You’ll need to check off Contribution Amount in your config (on the Webform). Then (in your webform components screen) you can:

* drag it to where you want to move it to on your form
* set it to a specific amount and hide it
* use conditionals to set it to a specific amount
* with some additional config you can also pass it into the form as a parameter

Webform CiviCRM only takes the config portion (payment processors, thank you and receipting, financial type) bits from CiviCRM Contribution form.
> 1 votes

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


# Question
Title: Listing events that only belong to a group
I have CiviCRM 5.12 on drupal 7. I want to create a drupal view containing the next events that are printed if only the contact belongs to an authorized group. That is, when I create an event, I link it to a group with a custom field and in the view, I want to filter the events and keep those reserved for the group containing the contact corresponding to the user drupal. Please can you help me ?

# Answer
> 1 votes
I think you can filter the views using CONTEXTUAL FILTERS. Add group custom field in CONTEXTUAL FILTERS set default value to use below php code

```
    civicrm_initialize();
    try {
      $result = civicrm_api3('Contact', 'getsingle', [
        'return' => ["groups"],
        'id' => "user_contact_id",
      ]);
      return $result['group'];
    }
    catch (Exception $e) {
      return 0;
    }

```

Cheers

Pradeep

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


# Question
Title: Does iATS payment requires SEPA Direct debit for ACH to work?
We are in the UK and would like to process direct debit from Civicrm. I found iATS payment processor can process ACH/DD. Just wondering is processing UK DD a built in feature of iATS payment? Does it require any other plugins to work? Thanks

# Answer
> 1 votes
We did build UK Direct Debit \[with the mandate - the entire workflow\] into the iATS Payments Extension but it wasn't used much and we have not actively supported it recently. And SEPA works well and is widely adopted by lots of European CiviCRM Clients. One does not need to be exclusive -\> you can processing CC with iATS Payments and use SEPA for DD for the time being.

---
Tags: payment-processor, iats
---


title: Membership renewal as same type

text:
# Question
Title: Membership renewal as same type
How can we ensure members renew as the same membership type? At initial sign-up, they can choose their type but after that, renewals should be as the same type - they should not be able to renew as a different type.

One option is to create separate contribution pages for each membership type, then have a join page that links to each of those. And then setup scheduled reminders for each type with links to the contribution page for renewal. With 13 membership types, that's a lot of setup.

So we're looker for a smarter way to do that. Any ideas or useful extensions? Drupal system so webforms are an option.

# Answer
> 3 votes
With Drupal webforms I am pretty sure you can set the Membership Type to be locked so renewing folk won't be able to change from the one that loads - will only work if they are logged in or using a checksum.

# Answer
> 1 votes
The key bits are:

```
function membershipcards_civicrm_buildForm_CRM_Contribute_Form_Contribution_Main(&$form) {

  $currentMemberships = array_keys($form ->_currentMemberships);
  // Assuming there is only 1 current Membership - display it (first result):
  $currentMembershipID = $currentMemberships[0];
  // price_43 -> is element 24 (_label = Membership)
  // price_42 -> is element 25 (_label = Additional Contribution)
  $elementId_membership = $form->_elementIndex['price_43'];
  $elementId_latefees = $form->_elementIndex['price_42'];

  foreach ($form->_elements[$elementId_membership]->_elements as $key => $oneMembership) {
    if ($oneMembership->_attributes['membership-type'] != $currentMembershipID) {
      unset($form->_elements[$elementId_membership]->_elements[$key]);
    }
  }
...

```

---
Tags: civimember, contribution-page
---


# Question
Title: Password Reset emails being marked as spam
Hi hope everyone is well.

We have come across a bit on an issue when requesting the password reset emails to go out. The emails come from my own email address as I am the only admin, but our O365 mail filter is classing these as spam.

I would presume that this is because the mail server (Office 365) thinks that Civi is spoofing my email address.

Has anybody else come across this and if so, was there any way around this.

Thanks, Terry

# Answer
> 0 votes
A couple of questions

* What CMS are you using?
* How do you have your outbound email set up?
* Are other emails getting marked as spam?
* When you view source of the email, are there any headers inserted by the receiving mail server that let you know why it was marked as spam?

Password reset emails are typically sent by the CMS, not CiviCRM and you will need to make appropriate changes there. Both Drupal (smtp) and WordPress (WP Mail SMTP) have SMTP plugins/modules that allow you to use a 3rd party SMTP server to send email.

---
Tags: email, mailserver
---


# Question
Title: Incorrect Resource URL error when they're correct
Since the upgrade to CiviCRM 5.13.4, I have noticed a lot of websites receiving the 'Incorrect Resource URLs' even though they are correct and most of them are just the default settings.

I checked, double checked and even tripled check a good portion of these websites and deduced that they definitely have the correct URLs and everything else on the websites work as expected.

There are no other errors in any of the logs or the console and it seems this issue applies to others as well as me.

I am using Civi on Drupal 7 with PHP 7.1.

# Answer
We deduced that this error message comes from the timeout being too small in the public function fileExists($url, $timeout = 0.50) in civicrm-core/CRM/Utils/Check/Component.php.

The timeout is not long enough for all sites which is why the message pops up despite the settings being correct.

This can be resolved by either hacking the source code and increasing the timeout to something bigger, for example 1.0 or turning off the check.

You can see the gitlab issue here for more information regarding this: https://lab.civicrm.org/dev/core/issues/1035

I believe that the Civi team are working on a fix for this as well to avoid having to hack the source code.
> 2 votes

---
Tags: drupal, resource-urls
---


# Question
Title: Permission denied in Civi\Core\AssetBuilder->build()
I just upgraded CiviCRM on a test version of my Drupal 7.54 site from 4.7.15 to 4.7.23 and get the following (edited) error when going to system status in CiviCRM.

> Warning: mkdir(): Permission denied in Civi\Core\AssetBuilder-\>build() (line 167 of sites/all/modules/contrib/civicrm/Civi/Core/AssetBuilder.php). Warning: file\_put\_contents(sites/default/files/civicrm/persist/contribute/dyn/angular-modules.eef75e30334ca152b0d58bf58d4xxxxx.js): failed to open stream: No such file or directory in Civi\Core\AssetBuilder-\>build() (line 171 of sites/all/modules/contrib/civicrm/Civi/Core/AssetBuilder.php)

I made sure that I deleted templates\_c and made it and all CiviCRM files writeable to the server.

# Answer
> 2 votes
This suggests a file permission issue on the relevant folder - which is `sites/default/files/civicrm/persist/contribute/dyn/`.

First, ensure the parent folders exist - both `sites/default/files/civicrm/persist/contribute/dyn/` and `sites/default/files/civicrm/persist/contribute/`. If both exist, check the permission AND owner of the `dyn` folder. Is the owner the same user as the webserver user? Likewise, if `dyn` doesn't exist do the same for `contribute`. If you're not sure how to check owner/permissions, or how to interpret them, please either a) hop on https://chat.civicrm.org, or b) update the question with your operating system (including the distribution, if Linux) and webserver software (most likely Apache or nginx).

# Answer
> 0 votes
I had a similar issue in WordPress. I believe the issue is caused because the upgrade script requires resource files to be in their expected place from the old version. So, if you've created a new install and are just migrating a database, then the error may be triggered.

The resource locations have changed between database versions, so the update script fails if it can't find the old resource files.

I fixed this by copying the old resource files to the expected location (as they are listed in the error - in my case this was `plugins/files/civicrm`).

For reference, I was updating the CiviCRM database from 4.7.9 to 5.13.5 on Wordpress 5.11. Once the files are available, the update should run (In my case, I needed to retrigger the update with http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1)

---
Tags: drupal, permissions
---


# Question
Title: Contribution Report - Grouped by Custom Field
I am looking to be able to build a report that essentially has aggregate donations grouped by a custom field. For example - every donor is asked: How did you hear about us (Referral Source), which is answered via a contribution custom field set of options. Essentially we want to create a report that says:

Referral Source - Number of Donations - Total Donations - Average Donations

Is there a report that can let me do that - is there an extension that provides such a capability?

# Answer
I was able to do this via a contribution summary report - unfortunately that does not allow for sorting.
> 0 votes

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


# Question
Title: How should a CiviCRM site that uses remote profiles be protected?
When remote profiles are enabled for a CiviCRM site, it says the following:

> Warning: External profile support (aka "HTML Snippet" support) is enabled in system settings. This setting may be prone to abuse. If you must retain it, consider HTTP throttling or other protections.

A page on civicrm.org says the following about "HTML Snippets" (remote profiles):

> if your system has used the "HTML Snippet" technique, then you should evaluate measures such as:
>
> * Configure HTTP firewalling to prevent POSTs to CiviCRM from unrecognized referrers
> * Replace the "HTML Snippet" with a custom integration that uses a more secure data-flow based on APIv3 and REST.

Using the API for some of our related sites isn't a great option considering how easy it is to add a form to other domains.

What is HTTP firewalling? Does that require scanning referrers of POST requests, and ensuring that the originate from the CiviCRM instance or trusted sites? Is it possible to do this with a CiviCRM extension? Does such an extension already exist?

Thanks for your help. : )

# Answer
There are a couple of other methods that would be worth checking
> 1 votes

---
Tags: profile, forms, security
---


# Question
Title: Is there a way to open the honoree section by default?
I would like to have the honoree section on a civicontribute page default to being open, instead of having the user find and click on the honoree title in order to see the fields. They could still close it if they don't want to use it. Is there a way to do that?

# Answer
That will require a small bit of code -\> javascript (to check that box on load of the form).
> 0 votes

---
Tags: civicontribute, honoree
---


title: Translation issue

text:
# Question
Title: Translation issue
I've many strings that are not translated in the back end even though they are and for years. Like this one :

or mix with french like this:

They often come with the same syntax that seems correct:

> {ts escape="sql" skip="true"}Membership Details{/ts}

How should I improve?

You can see this in the Membership dashboard, for example:

# Answer
> 3 votes
The string displayed in the title of dashboard dashlets is part of the report instance configuration. If you go to the report's configuration, you should be able to change it from there.

If you are using multi-lingual, there is a known limitation on the roadmap that this field is not multi-lingual in the database schema. It could be, but it's not the case right now.

# Answer
> 0 votes
Thanks bgm, this solved half of my need. This value can be changed in title.

I still want to have membership status translated (New, Pending, Current,...) even though they are in CiviMember.

---
Tags: translation
---


# Question
Title: is there a quick way to export the complete data from my database?
I am new to civicrm, just got a job with an organisation where this is the pre-existing database. I think the data in there is in a mess and I would like to export all data to excel / csv if possible so I can check through it. Is there any way of doing this quickly? Thanks

# Answer
> 3 votes
The short answer is "Yes" but it's not as useful as you might think.

First - consider a contact with 10 donations, 5 events attended, 3 memberships, etc. If you exported this all in one table, it would be hundreds of columns, with data flattened to the point of uselessness. On the other hand, if you export contacts in one table, donations in another, etc., it's quite hard to make good sense of what you're looking at since it lacks context.

My recommendation is to search for all contacts (going to **Search menu \>\> Find Contacts** and press **Search** without specifying any criteria). Then from search results, select the **All Contacts** radio button, and **Export Contacts** from the *Search Actions* drop-down. Export **All Primary Fields**.

This is a) still information overload, b) doesn't contain quite a lot of database information, but will serve as a helpful starting place to familiarize yourself.

---
Tags: export
---


# Question
Title: "DB error: already exists" when creating a Drupal user who already exists as a Contact in CiviCRM
I'm running CiviCRM 4.7.10 and Drupal 7.50.

I have had a Civi database for a while, but am now wanting to give people front end accounts in order to use some features there.

My problem is that when a user, who is already a contact in Civi, tries to create a Drupal account, they get the rather unceremonious "DB error: already exists".

I'm confused because I keep reading that Civi is set up to automatically merge new users with existing contacts on matching emails (or whatever criteria is set in the Unsupervised deduping settings for Individuals - mine is using email only at the moment).

I would love to understand how this is supposed to work and how to fix it when it doesn't.

Thanks, Lewis

# Answer
> 1 votes
How are you trying to create these Drupal user accounts? We have used `User Import module` : https://www.drupal.org/project/user\_import \- for this and it works great. It's really neat in that you can export a Group of Contacts from your CiviCRM -\> batch CSV upload them into Drupal using user\_import module + create AccountNames (e.g. FirstNameLastName format) and/or dispatch links to everyone as you create their accounts.

For details please see here: https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact

# Answer
> 1 votes
Already exists could be in one of two places: Creating the civi contact or creating the uf record.

I suspect it's the latter, but play with the api to confirm. Also, turn on stack trace (debug settings), retry, and post the full output here.

# Answer
> 0 votes
This question is a few years old now, but I faced the same problem today when creating a new user account in Drupal. We're running CiviCRM 5.x and Drupal 7.x.

I got around the issue by firstly deleting the offending user account in Drupal and then going to the contact record in CiviCRM of the person that I was trying to create a user account for. In the contact record, click on the 'Actions' button and then select 'Create User Record'. Fill out the necessary fields and create the user account. Everything then worked beautifully.

---
Tags: drupal, user, integration, duplicate-contacts
---


# Question
Title: Preventing duplicate entries from online profile form
We currently have an online profile form in place where new charity members complete their details - This then creates a new charity group on Civi.

We are having instances where new members are entering their details multiple times, which then creates multiple instances of the same group on Civi.

Is there a away to stop multiple groups being created, such as making Civi / The form check for duplicate entries that are already present on the system. Such as check if the email address is already in use for example?

Many thanks for your help

# Answer
You should have an unsupervised dedupe rule setup for individuals. This is used to check if a contact is already in the dB when they complete a form as an anonymous (not logged in) user. The default unsupervised rule is to match email. You can create a new one that looks at other fields. It is important that all the fields used in your unsupervised rule are in the profile used.

Also, you may want to look at the advanced settings in your profile setup. There are options there with what to do with duplicate contacts.

There is some more info about the dedupe rule types here: https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/#understanding-dedupe-rules-supervised-unsupervised-and-general

Hope this helps.
> 2 votes

---
Tags: profile, duplicate-contacts
---


# Question
Title: Is there a way to expose a CiviReport on a Wordpress page?
Reports are not one of the component options available when using a shortcode in wordpress. What is the recommended way to expose a civireport on a wordpress page?

# Answer
If you run your report and copy all the info after wp-admin/admin.php and paste that after your page URL it will drop the report in. The data you from the report url begins with a "?" and looks similar to this.

```
?page=CiviCRM&q=civicrm%2Freport%2Finstance%2F50&reset=1&force=1

```

So you URL to show the report on the WordPress page will look like this.

```
https://<<site URL>>/<<page slug>>/?page=CiviCRM&q=civicrm%2Freport%2Finstance%2F50&reset=1&force=1

```

Keep in mind you may need to adjust permissions depending on what user roles should be able to view this page.

Hope this helps.
> 2 votes

---
Tags: wordpress, civireport
---


# Question
Title: Use single profile on checkout from cart
I'm trying to use the cart checkout to simplify checkouts for parents registering their children in multiple classes over the summer. Many sign up for 8 classes, and when they get to checkout, they have to enter all their information for all 8 classes. Does anyone have experience altering the checkout to check if the same profile is being used on the multiple events to just use one?

Edit: Alternatively, is there a way to assign a profile to the overall cart checkout, so the profiles used for the individual events could be shortened?

# Answer
Just so you know, there's two extensions currently under development for CiviCRM, and specifically that integrate with CiviCRM's Event Cart feature, that might meet some of your needs. They're under active development, and you can check them out on CiviCRM's GitLab.

boxoffice: Provides a lighter workflow for the CiviCRM Event Cart. Designed for a ticket box office (ex: where you do not need the names of other participants).

eventpack: Provides a way to bundle events together (at a discounted price) in the CiviCRM Event Cart (and the Boxoffice extension).
> 2 votes

---
Tags: civievent
---


title: How to cope with CiviEvent user choices

text:
# Question
Title: How to cope with CiviEvent user choices
I've set up a paid-for event with online registration which uses a price set where a user can choose how many tickets they want in each of the available types and optionally add a donation (by entering multiples of £1).

It seems that a user can enter fractions and negative values in any field. And they can also not select anything but can continue.

I've done a temporary fix to test for fractions and negative values in a custom extension by adding some JavaScript in templates/CRM/Price/Form/Calculate.tpl and some extra validation code in CRM/Event/Form/Registration.php

Is there a better/recommended way of doing this? This would seem like a common requirement.

PS The CiviEvent Cart Checkout looks useful but is described as being in an Alpha state. Anyone using it successfully? https://wiki.civicrm.org/confluence/display/CRMDOC/CiviEvent+Cart+Checkout

Thanks in advance.

# Answer
> 1 votes
If you're on Drupal - I recommend you use Webform CiviCRM module - https://www.drupal.org/project/webform\_civicrm \- It will let you built a cart (multiple Events, fee-options, discount codes, etc) and leverage all native Drupal Webform options (like Conditionals) to build your fees without requiring any code.

If your CiviCRM is not attached to Drupal - then your options are to either help fund improvements \[contact the Core Team - they have a paid Issue queue https://civicrm.org/paid-issue-queue \] or get on Mattermost chat.civicrm.org - to see if you can team up with developers/other orgs that are interested in improving the native CiviCRM Cart Checkout.

# Answer
> 0 votes
I'm not 100% sure of precisely what your organization's needs are, but since you mentioned CiviCRM Event Cart, so you know, there's two extensions currently under development that integrate with CiviCRM's Event Cart feature that might meet some of your needs. They're under active development, and you can check them out on CiviCRM's GitLab.

boxoffice: Provides a lighter workflow for the CiviCRM Event Cart. Designed for a ticket box office (ex: where you do not need the names of other participants).

eventpack: Provides a way to bundle events together (at a discounted price) in the CiviCRM Event Cart (and the Boxoffice extension).

---
Tags: civievent, civicontribute
---


# Question
Title: iATS Charge to Card on File attributed to merged/deleted record
What happened: 1: Went to recurring series. Clicked "Process" on Card on File 2: Put in the amount, left defaults 3: Charge went to iATS and posted successfully. 4. The charge linked to a formerly merged/deleted record of the same name as the record it was supposed to be processed on, unlinked to the recurring contribution.

What could have caused this?

# Answer
> 1 votes
Found it! The contact\_id in civicrm\_iats\_customer\_codes was linked to the wrong contact. Previously the records were merged and one was soft-deleted, so in our import process that was confused. Should be a simple fix!

# Answer
> 1 votes
This tells me there are issues with the way in which you have migrated your recurring series from PayPal to iATS Payments and into CiviCRM.

---
Tags: iats
---


# Question
Title: (version 5.13/5.14) Search Builder syntax error when "Groups" "is empty"
in the latest versions of CiviCRM (5.13.4 and 5.14) we can no longer search for contacts that are not included in any group through the search builder!

First (at least until version 5.12) with this search:

we obtained "all contacts that did not belong to any group", while now we give a a **SINTAX ERROR**.

How to solve?

# Answer
> 4 votes
This is a recent bug introduced by the fix to a different search issue, issue #726.

A permanent fix will need to be found that doesn't break either scenario. However, to resolve your immediate issue, you can open file `CRM/Contact/BAO/Query.php` and delete line 3037.

I've reported this issue as #1048.

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


# Question
Title: At signup, auto assign organization:contact relationship based on email domain being the same
Is there a way for this: When a new contact is created (through drupal or backend), auto assign a relationship to an organization if one exists with the same email domain as the contact's email domain.

Makes sense right? If I'm newly on-boarded to my company, I'd like to just register on the site and it all be set up and working. Most of our members inherit their membership through their Employer and we'd like to manually have this done since this is starting to be an administrative burden.

# Answer
> 5 votes
Thanks everyone! I solved it totally with CiviRules extension. I just used a combination of the built-in API explorer & the extension's documentation to figure out how to create my own Condition & Action.

The condition checks if that domain exists for an Organization. I set it to work ONLY if it finds 1 (just to make it work simply for now) and the contact is an Individual (no Org to Org relationships). If true, the Action then creates the relationship.

To make this work, when we set up an Org.. we make a dummy email their primary/main email and put it on hold so no communications go out to it.. like this: dummy@domain.com

I'll share the big stuff. I'm not a coder, so if someone finds a better way to do this.. let me know.

https://docs.civicrm.org/civirules/en/latest/

```
    Condition:

  public function isConditionValid(CRM_Civirules_TriggerData_TriggerData $triggerData) {
    /** $this->logCondition('my con log message', $triggerData, \PSR\Log\LogLevel::INFO); */
    $contactId = $triggerData->getContactId();
    $contactTypeParams = array('return' => "contact_type",'id' => $contactId);
    $contactType = civicrm_api3('Contact', 'Getvalue', $contactTypeParams);
    $contactEmailParams = array('return' => "email",'id' => $contactId);
    $contactEmail = civicrm_api3('Contact', 'getvalue', $contactEmailParams);
    $contactEmailDomain = substr(strrchr($contactEmail, "@"), 1);
    $orgEmailDomainCountParams = array('email' => ['LIKE' => "%" . $contactEmailDomain],'contact_type' => "Organization");
    $orgEmailDomainCount = civicrm_api3('Contact', 'getcount', $orgEmailDomainCountParams);
    if ($orgEmailDomainCount = 1 && $contactType = "Individual"){
        return TRUE;
    } else {
    return FALSE;
    }

    Action:

  public function processAction(CRM_Civirules_TriggerData_TriggerData $triggerData) {
     /** $this->logAction('my act log message', $triggerData, \PSR\Log\LogLevel::INFO);  */
    $contactId = $triggerData->getContactId();
    $contactEmailParams = array('return' => "email",'id' => $contactId);
    $contactEmail = civicrm_api3('Contact', 'getvalue', $contactEmailParams);
    $contactEmailDomain = explode('@', $contactEmail)[1];
    $orgContactIdParams = array('return' => "id",'email' => ['LIKE' => "%" . $contactEmailDomain],'contact_type' => "Organization");
    $orgContactId = civicrm_api3('Contact', 'getvalue', $orgContactIdParams);
    civicrm_api3('Relationship', 'create', ['contact_id_a' => $contactId,'contact_id_b' => $orgContactId,'relationship_type_id' => 5,'is_active' => 1,'is_permission_a_b' => 2,]);
    civicrm_api3('Contact', 'create', ['id' => $contactId,'employer_id' => $orgContactId,]);
  }

```

# Answer
> 1 votes
you could write an extension, or module that uses the civicrm\_post hook; when a new contact is created, look at the email; do an api call to see if that domain exists in one of your valid contacts; if so, create the relationship between the two cids.

It might be easier with the civicrm\_entity module and its hooks instead of the post hook. Might even be able to do it entirely with civirules extension, civicrm\_entity and rules modules.

---
Tags: drupal, civimember, relationships
---


title: CiviEvent - Payment Options missing

text:
# Question
Title: CiviEvent - Payment Options missing
Same issue in civi 4.7.3 and 4.7.8, on joomla 3.5.1. Payment Options shows up in Registration (Test Drive) and Registration (Live) but does not show up in front end, in the live site. I have another site using civi 4.6 and I have no problems there. Should show Paypal and Pay Later.

# Answer
Ann,

Forgive me if the question seems obvious but this sounds like what I had initially reported as a bug on JIRA in https://issues.civicrm.org/jira/browse/CRM-17214 but it turned out to be a slight change in behavior between versions.

Hope this helps!
> 1 votes

# Answer
There is a fix (work around). It is only needed for users on Joomla. And that is the java fix- Go to System Settings / Resource URLS. Change the path for CiviCRM Resource URL to be /administrator/components/com\_civicrm/civicrm/
> 1 votes

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


title: Form development

text:
# Question
Title: Form development
We are looking to create internship applications for our organization this summer. We don't want to use google forms and are wondering if there is something we can create using civicrm?

Wahaj Khan

# Answer
Wahaj Khan welcome to SE CiviCRM. If you are using

**Drupal**

You can use webform and webform CiviCRM module to create front end forms.

**Wordpress** You can use Caldera and Caldera CiviCRM plugins to create front end forms.

Above modules provide lots of option to control the actions from UI like making a field required based on a selection of a field, Online payments, sending emails etc

Cheers

Pradeep
> 3 votes

# Answer
CiviGrant is designed to support applications for scholarships.

It supports the eligibility test part of an internship process. Possibly the value of the grant is zero which is the second role of CiviGrant and which you may not need. If CiviGrant is overkill for your purpose then stick to webform.
> 0 votes

---
Tags: webform-civicrm
---


title: Where is the API key?

text:
# Question
Title: Where is the API key?
We want to connect CiviCRM with our payment processor (Twingle). We need to find the API key, the site key and the URL of the CiviCRM instance, but we can't seem to find them.

Where can we find them?

# Answer
> 8 votes
You can find the site key information you need in the System Administrator Guide: https://docs.civicrm.org/sysadmin/en/latest/setup/site-key/

The API key is in the database and needs to be set up for a contact that has access. You can install the API Key extension which will enable the API Key in the contact summary if you have admin rights: https://civicrm.org/extensions/api-key

The URL of the CiviCRM instance will be in your civicrm.settings.php. You can check it in the UI if you navigate to Administer\>System Settings\>Directories and click on the question mark in the green bit on the top of the screen. You will see a window in the right hand corner of the screen and the civicrm.root will be the URL for your CiviCRM instance.

Hope this helps!

---
Tags: api
---


title: Load sample data after installation

text:
# Question
Title: Load sample data after installation
I forgot to tick the box to install the sample data. Is there a way to do it after installation? I tried loading civicrm\_sample.mysql but that didn't seem to load everything.

# Answer
If it's a new install it might be simplest to just drop/recreate the database, remove the civicrm.settings.php file, and run the installer again.

The file with the sample data is sql/civicrm\_generated.mysql, but it overlaps with sql/civicrm\_data.mysql. You either use one or the other. If you just import the `generated` file now you'd get conflicts/duplicates for things like phone types etc.
> 1 votes

---
Tags: contacts
---


title: Delete old civi event locations

text:
# Question
Title: Delete old civi event locations
I want to condense the list of event locations to ones actually in use, and quickly update the contact details to reflect changes in our team. I only have access through the UI and was hoping to find a list, as you can for event types and templates, but am not having much luck. I'm using 5.13.4.

Looking through past questions I'm not the only one having issues, so would be good to know any fixes or if this is being addressed in the next upgrade!

# Answer
> 1 votes
This seems to cover it: Edit 'existing locations' for events

"If you are wanting to do a one-off cleanup of obsolete addresses than as a UI work around you could edit the old events that contain those obsolete locations and set the first address line to DO NOT USE or NO LONGER IN USE or similar"

---
Tags: civievent, addresses, location
---


# Question
Title: Is there a way to produce automated welcome emails for individuals who sign up to receive our newsletter?
I want to figure out if we can create automated email sequences in CiviCRM. So, for example, if someone signs up for our newsletter, they get an email immediately that has some of our "best of" information, for example, and then 1 week later, they get another email that has some information about the impacts we're having in the community, but it's all automated through CiviCRM. We have two automated buttons that appear whenever anyone is added to our database or signs up to volunteer or to attend an event. The buttons ask if the individual would like to receive our newsletter and the second button asks if they would like to be sent volunteer opportunities. We'd like to be able to craft an email that will be generated and sent to everyone who selects 'yes' on these two options.

# Answer
As @ericG suggested the CiviRules extension can do this. You can find the CiviRules extension here: https://civicrm.org/extensions/civirules and documentation on the extension is here: https://docs.civicrm.org/civirules/en/latest/.

If you want to send an email you will also need the Email API extension: https://civicrm.org/extensions/e-mail-api
> 4 votes

# Answer
In addition to the above suggestion, you could use Scheduled Reminders (https://docs.civicrm.org/user/en/latest/email/scheduled-reminders/)

Scheduled reminders have access to date fields. If you added two date fields to your contact - Joined Newsletter and Wants Volunteer Opportunities - your scheduled reminders could send emails based on time periods based on those dates. Your front end form would need to make the choice "Yes" update a date field - not sure how hard that would be. The benefit of using scheduled reminders might also be integration with the email templates CiviCRM stores with a WYSIWYG editor.

In addition to using date fields from the contact entity, you could consider using custom activity types fueled by a Webform CiviCRM (joined newsletter, wants to volunteer) to kick off the scheduled reminders, which might be useful for reports and tracking joins/removals.

Lastly, you could also check out the pathway of integrating with an email marketing tool like Mailchimp which also has scheduled email/auto-responder features. There is a nifty Civi extension to handle that (https://github.com/veda-consulting/uk.co.vedaconsulting.mailchimp/) but it would be considered an intermediate/advanced implementation to pull off without problems.

Hope this has helped!
> 3 votes

# Answer
You might also be interested in checking out this extension: https://github.com/artfulrobot/chasse/tree/master

Which might help with keeping track of where people are on your onboarding process.
> 3 votes

---
Tags: email
---


# Question
Title: Migrating Drupal to wordpress redirect existing links
After migrating from Drupal to wordpress links to event info pages for example no longer work - as these have been shared already is there a way to redirect these?

# Answer
You can keep the URLs you're currently using - as long as you're using a recent version of CiviCRM - simply by adding this to your `wp-config.php` file:

```
define( 'CIVICRM_CLEANURL', 1 );

```

This will create URLs in the same format as Drupal ones, i.e.

```
https://domain.com/civicrm/event/info?reset=1&id=3

```

This does assume that you are using the default base page named "CiviCRM" with the slug `civicrm`. If this page doesn't exist, then create it and add the slug to the setting in the CiviCRM "CMS Database Integration" admin page. You may also need to visit the WordPress "Permalinks" page to refresh your rewrite rules so that Clean URLs work as expected.
> 5 votes

# Answer
Using nginx it's possible to catch these links and redirect:

In the relevant server block add a location match on /civicrm/event/info

then redirect this to https://$server\_name/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&$args

So it will look like this:

```
location /civicrm/event/info {
  return 301 https://$server_name/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&$args;
}

```

By comparing other urls you can catch contribution pages and others as well.
> 3 votes

---
Tags: wordpress, nginx
---


title: Smart Group for Soft Credit Name

text:
# Question
Title: Smart Group for Soft Credit Name
Is there a way to create a smart group that contains contacts that have made a contribution with a specific soft credit name? I see that I can run a Soft Credit Report and add contacts to a group but I would like to make that group dynamic. We're using Civi 4.7.17. Thanks.

# Answer
> 2 votes
Jon G - Megaphone Tech has written an extension Soft Credit Custom Fields which, amongst other things, adds a "Soft Creditee's Name" field to the Advanced Search. This should be used to create the smart group.

**Edited**: *SearchKit into the scene*

Note that with SearchKit it's possible to create the smart group without the help of the extension:

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Fundraisers_P2P",
          "label": "Fundraisers P2P",
          "api_entity": "Contact",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "sort_name",
              "contact_type:label",
              "contact_sub_type:label",
              "GROUP_CONCAT(DISTINCT Contact_ContributionSoft_contact_id_01.soft_credit_type_id:label) AS GROUP_CONCAT_Contact_ContributionSoft_contact_id_01_soft_credit_type_id_label"
            ],
            "orderBy": [],
            "where": [
              [
                "Contact_ContributionSoft_contact_id_01.soft_credit_type_id:name",
                "=",
                "pcp"
              ]
            ],
            "groupBy": [
              "id"
            ],
            "join": [
              [
                "ContributionSoft AS Contact_ContributionSoft_contact_id_01",
                "INNER",
                [
                  "id",
                  "=",
                  "Contact_ContributionSoft_contact_id_01.contact_id"
                ]
              ]
            ],
            "having": []
          }
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

# Answer
> 1 votes
I believe advanced search will be able to do this for you. (Main menu, Search and then Advanced Search)

Below the basic search fields you should find a collapsed section for Contributions. Expand it and you'll see a pull down for Contributions or Soft Credits. When you select one of the soft credit options, you'll get an additional option to select soft credit type. After you've pressed search, you can create a smart group in the normal manor (click on All XXX records, select New Smart Group from the Actions pull down, give it a name, etc.).

---
Tags: search, smartgroups
---


title: How to change case dashboard column

text:
# Question
Title: How to change case dashboard column
We need to remove subject from case dashboard. we don't know where to change whether in report or in drupal. can any one please help on this.

# Answer
> 1 votes
In sites/all/modules/civicrm/templates/CRM/Case/Page/DashboardSelector.tpl remove the line that starts with:

`<th data-data="subject"`

Also there is a similar line in sites/all/modules/civicrm/templates/CRM/Case/Form/ActivityTab.tpl

---
Tags: civicase
---


# Question
Title: Multiple Payment Processing account in Civicrm
Good day all,

A company needs to setup Social Giving using Civicrm.

Is it possible to allow multiple non-profits enable their respective Payment Processing in single Civicrm installation/instance? e.g. PayPal Standard/Pro or iATS, Stripe?

Thank you kindly!

# Answer
> 2 votes
You can add as many payment processors as you'd like and tie those to unique contribution pages: https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/#setup-and-configuration.

However, the real question is reporting requirements. What are they? Are these non-profits all under a parent non-profit? If not, then they should have their own installation of Civi so they can easily get their financial reporting right. The likelihood of incorrect reporting is high if you tried to shoehorn multiple orgs in one Civi.

If they are related, you could create a campaign for each organization and track the finances separately. Or use financial accounts: https://docs.civicrm.org/user/en/latest/contributions/key-concepts-and-configurations/#financial-accounts.

---
Tags: payment-processor
---


title: Webform CiviCRM or CiviCRM Entity?

text:
# Question
Title: Webform CiviCRM or CiviCRM Entity?
Until now whenever I've needed to enable site visitors to enter or update data in Civi on Drupal sites I've used webforms and the excellent Webform CiviCRM integration module. By and large it does the trick. However on a couple of sites I'm currently working on I need to enable suitably authorised users to create some content - I'll call it a project profile - that will contain a mixture of Civi data (org name, related individual contact name/s, website, etc.) and what would sensibly be Drupal field data (a couple of URLs, some images, a logo, maybe a link to a Youtube video, some descriptive text, etc.). I've read all the stuff I can find about the CiviCRM Entity module and it sounds like the right fit for my needs.

If the content creator would only ever create one project profile then a webform based approach seems optimal, but I can see that users may want to create multiple project profiles, and have the ability to edit them, which for me seems to indicate that CiviCRM Entity is the way to go.

So I've started to play with it, and now I'm less certain. I've created a new Drupal content type (project profile), and want to include an organisation name that will be stored in CiviCRM. Using this post as a guide to how to go about it I've got the field to work pretty much as I need it, but this seems like a lot of work to get just one field in my content type to do what I want. Repeating this for each field that I want to be included that contains data from Civi entities will take some time, and I'm unclear as to how the disparate bits of data will be linked together - if the author enters an organisation name in one field and an email address in another does the module understand that the email address belongs to the organisation record?

Which all makes me wonder that maybe I'm going about it the wrong way.

Should I instead be adding Drupal fields to the CiviCRM Contact entity and using the CiviCRM Entity Reference module to bring in data from other CiviCRM entities (phone number, email address, etc.)? Or is that approach essentially the same?

I'm concerned about investing a huge amount of time going down the CiviCRM Entity route only to find that it's not the best approach for my use case, but I'm not even clear about what the key questions are that might help me make a good decision.

This looks like a really powerful approach, but it also feels like I'm highly likely to not get the result that I want, and spend a lot of time getting there.

Any advice, links to good guides, videos etc., most welcome.

# Answer
CiviCRM Entity is the way to go if you want content creators to reference create CiviCRM data on nodes or other Drupal entity types...The downside is, assembly on some not so well documented features required. We have used it to allow users to add/edit contacts with emails etc..well as you know, I wrote that article.

There is this article too which tries to explain the CiviCRM Entity Reference field: https://skvare.com/blog/using-civicrm-entity-reference-field-submodule-inline-entity-form

If you place a CiviCRM Entity Reference field on the Contact entity, and target Emails, then it will save the email and connect it to the contact as you would expect them to be. CiviCRM Entity Reference field is a "remote" reference field, in that it doesn't save data in any Drupal field tables, but accesses the Civi data directly.

You shouldn't have to setup your forms and any CiviCRM Entity Reference fields but once, and then you can use the same config with Entityreference fields on your node type over and over.

One big disadvantage to the D7 version, is that you cannot have multiple "form modes" in D7 .. that is multiple configurations of which fields appear on edit forms.....So if you want one entityreference field inline entity form for an organization contact, and another for an individual contact, you can run into problems, because you want the organization name for the org contact, and maybe first / last name for the individual contact.

You can use hook\_form\_alter or css to hide fields when needed though too. You would configure your contact edit form to have all the properties/fields you may need, and then hide them as necessary for the different reference fields. That will require some development and special knowledge.

CiviCRM Entity is a very powerful tool, but does require some learning and elbow grease, and sometimes code, to make very custom setups.

As to which tool to use when, that depends on the use case IMO. I'd be happy to chat about it sometime on CiviCRM mattermost, chat.civicrm.org, civicrm entity channel, just ping jackrabbithanna. We use Webform CiviCRM alot too.
> 2 votes

---
Tags: webform-civicrm, civicrm-entity
---


# Question
Title: URLs in CiviMail give a 404 not found error
CiviCRM 5.14.0.

This is a new installation with WordPress. I sent a test mail. I checked out the unsubscribe link, which resolves to this

That turns out to not be a valid link. I have a feeling there must be a setting somewhere for that.

# Answer
> 2 votes
I added Options -Indexes to the Apache configuration file which changed the behavior of the link. The URL is controlled by a page in WordPress, which is creates a permalink.

---
Tags: civimail
---


# Question
Title: PHP warning "Warning: Declaration of CRM_Mailchimp_Permission" logged when open a CiviReport
Drupal 7.67 Civi 5.13.4

I get a PHP warning in my Drupal logs every time I open a report in Civi. The complete warning is Warning: Declaration of CRM\_Mailchimp\_Permission::check($permissions) should be compatible with CRM\_Core\_Permission::check($permissions, $contactId = NULL) in require\_once() (line 218 of ...modules/civicrm/CRM/Core/ClassLoader.php).

I do not get any php errors with Inspect Console on the report pages.

I looked at the permissions and I have all MailChimp related items checked for my role.

I looked in the CiviCRM View Log and I do not see anything there related to Mailchimp. There is however this log repeatedly. Not sure if it is related. warning\] Deprecated Path: There is a setting (generate\_schema\_and\_data) not correctly defined. You may see unpredictability due to this. CRM\_Core\_Setting::setItems

Any ideas what might case this?

# Answer
There is already a fix submitted for this warning but haven't got merged. But i believe the fix should fix the problem. Can you try after applying patch from here?

Cheers

Pradeep
> 2 votes

---
Tags: civireport
---


# Question
Title: Drupal AJAX HTTP Request terminated Abnormally after file upload
I am getting the following error (as shown) when trying to upload a file to a normal content type. This started happening after migration of the Drupal site to a new server and more than one site hosting on this server seems to be having this problem. Not quite sure what the cause could be at this point.

# Answer
Issue was resolved by modifying mod\_security configuration
> 2 votes

---
Tags: drupal
---


# Question
Title: Error when registering for an event - DB Error no such table
Hello I am getting the following error when trying to register for an event. Not sure what is happening or which table is missing. I am running CiviCRM 5.2.13 on CentOS Linux/Plesk 17. Any Help would be greatly appreciated.

```
backTrace

#0 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Error.php(190): CRM_Core_Error::backtrace()
#1 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such table", -18, 16, (Array:2), "SELECT type FROM .node n where status = 1 GROUP BY type [nativecode=1146 ** T...")
#3 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-18, 16, (Array:2), "SELECT type FROM .node n where status = 1 GROUP BY type [nativecode=1146 ** T...")
#4 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), "SELECT type FROM .node n where status = 1 GROUP BY type [nativecode=1146 ** T...", "DB_Error", TRUE)
#5 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-18, NULL, NULL, "SELECT type FROM .node n where status = 1 GROUP BY type [nativecode=1146 ** T...", "1146 ** Table 'jtaweb_crm.node' doesn't exist")
#7 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT type FROM .node n where status = 1 GROUP BY type")
#9 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/DataObject.php(2415): DB_common->query("SELECT type FROM .node n where status = 1 GROUP BY type")
#10 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("SELECT type FROM .node n where status = 1 GROUP BY type")
#11 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("SELECT type FROM .node n where status = 1 GROUP BY type")
#12 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/DAO.php(1413): CRM_Core_DAO->query("SELECT type FROM .node n where status = 1 GROUP BY type", TRUE)
#13 /data/www/vhosts/<website url>/httpdocs/sites/default/files/civicrm/ext/com.pogstone.contenttokens/contenttokens.php(492): CRM_Core_DAO::executeQuery("SELECT type FROM .node n where status = 1 GROUP BY type", (Array:0))
#14 /data/www/vhosts/<website url>/httpdocs/sites/default/files/civicrm/ext/com.pogstone.contenttokens/contenttokens.php(9): contenttokens_getContentTypesInUse()
#15 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Utils/Hook.php(270): contenttokens_civicrm_tokens((Array:5))
#16 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(84): CRM_Utils_Hook->runHooks((Array:242), "civicrm_tokens", 1, (Array:5), NULL, NULL, NULL, NULL, NULL)
#17 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(86): CRM_Utils_Hook_DrupalBase->invokeViaUF(1, (Array:5), NULL, NULL, NULL, NULL, NULL, "civicrm_tokens")
#18 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_tokens", Object(Civi\Core\CiviEventDispatcher))
#19 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:1), "hook_civicrm_tokens", Object(Civi\Core\Event\GenericHookEvent))
#20 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(47): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("hook_civicrm_tokens", Object(Civi\Core\Event\GenericHookEvent))
#21 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Utils/Hook.php(164): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_tokens", Object(Civi\Core\Event\GenericHookEvent))
#22 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Utils/Hook.php(751): CRM_Utils_Hook->invoke((Array:1), (Array:5), NULL, NULL, NULL, NULL, NULL, "civicrm_tokens")
#23 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Individual.php(208): CRM_Utils_Hook::tokens((Array:5))
#24 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(168): CRM_Contact_BAO_Individual::format((Array:36), Object(CRM_Contact_DAO_Contact))
#25 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(308): CRM_Contact_BAO_Contact::add((Array:36))
#26 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(2011): CRM_Contact_BAO_Contact::create((Array:36))
#27 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(1190): CRM_Contact_BAO_Contact::createProfileContact((Array:42), (Array:18), "2", (Array:0), NULL, "Individual", TRUE)
#28 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(523): CRM_Event_Form_Registration_Confirm::updateContactFields("2", (Array:42), (Array:18), Object(CRM_Event_Form_Registration_Confirm))
#29 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Form.php(489): CRM_Event_Form_Registration_Confirm->postProcess()
#30 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#31 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Event_Form_Registration_Confirm), "next", "Next")
#32 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Event_Form_Registration_Confirm), "next")
#33 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Registration_Confirm), "next")
#34 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#35 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Core_Controller->run((Array:3), NULL)
#36 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#37 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#38 /data/www/vhosts/<website url>/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:3))
#39 /data/www/vhosts/<website url>/httpdocs/includes/menu.inc(527): civicrm_invoke("event", "register")
#40 /data/www/vhosts/<website url>/httpdocs/index.php(21): menu_execute_active_handler()
#41 {main}

```

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to member your administrator or service provider with more details about what action you were performing when this occurred. DB Error: no such table Return to home page.

# Answer
Looking at the backtrace it looks like its a bug in Fancy Tokens extension. There is a new release for this extension. Try after upgrading the extension to 5.1 if you can still replicate the bug.

Cheers

Pradeep
> 2 votes

---
Tags: civievent
---


# Question
Title: Cannot Find Solution For “Membership status cannot be calculated for <dates>” Renewal Error!
I have read the related thread and tried many iterations to find a solution for the error

> The membership cannot be saved because the status cannot be calculated for start\_date: 20190701 end\_date 20200630 join\_date 20190701 as at 2019-06-18 07:16:08

I know a lot has been written on this but none of it is working to solve my problem. I apologize if I am missing something simple. I am running 5.13.14 in Drupal 7 using PHP 7.2.

I am trying to import members with a contact ID, start date, and membership type ID. I have tried using an end date as well but that does not help.

Here are my membership rules.

**New**

**Current**

**Grace**

Any help in figuring out what is wrong here is greatly appreciated!

Thanks, Josh

# Answer
The error message shows future start and join dates. Civi is attempting to the determine the status as of the time of import, but none of the default status rules cover that scenario hence the error message. 'New' only applies from the 'member since' / 'join date' so is not applicable.

One option is to change your join dates to be the current time so that the memberships show as 'New'. Your memberships would then be regarded as 'current' despite being before the membership start date.

Alternatively, you could create a 'future' status with start event of 'start date' with eg a '-1 month' adjustment, and an end date of 'start date'. That should let you import the membership which will be inactive until the start date is reached. (Not tested extensively but seems to work on a quick test.)
> 2 votes

---
Tags: civimember
---


# Question
Title: Schedule reminder test not working - execute now for job not working
So I have set up a scedule reminder and made sure it is only dirrected to my email. When I go into sceduled jobs and execute the send\_reminder job, it doesn't work. I worked twice yesterday to a collegues email but hasn't work since to either mine or theirs. Is there any way to fix this? Or any reason it wouldn't work? Is there another way to send out emails to custemer a certain length of time after a specific date?

thanks

# Answer
As far as I recall scheduled job execution wont send the reminder if its not due, what are the settings for your reminder?
> 0 votes

---
Tags: scheduled-reminders, scheduled-job
---


title: Cannot install iATS extension

text:
# Question
Title: Cannot install iATS extension
What am I doing wrong? Keep receiving an error message whenever I try to install iATS extension. Can anyone suggest please? Thanks

```
https://pastebin.com/4BkQErA8

```

Backtrace:

```
>      [info] $backTrace = #0 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Error.php(952):
> CRM_Core_Error::backtrace("backTrace", TRUE)
> #1 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922):
> CRM_Core_Error::exceptionHandler(Object(DB_Error))
> #2 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB.php(985):
> PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2),
> "CREATE TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT
> NULL AU...")
> #3 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575):
> DB_Error->__construct(-5, 16, (Array:2), "CREATE TABLE
> `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...")
> #4 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223):
> PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "CREATE
> TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL
> AU...", "DB_Error", TRUE)
> #5 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1907):
> PEAR->__call("raiseError", (Array:7))
> #6 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(933):
> DB_common->raiseError(-5, NULL, NULL, "CREATE TABLE
> `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...",
> "1050 ** Table 'civicrm_iats_customer_codes' already exists")
> #7 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(403):
> DB_mysqli->mysqliRaiseError()
> #8 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1216):
> DB_mysqli->simpleQuery("CREATE TABLE `civicrm_iats_customer_codes` (\n
> `id` int unsigned NOT NULL AU...")
> #9 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(366):
> DB_common->query("CREATE TABLE `civicrm_iats_customer_codes` (\n  `id`
> int unsigned NOT NULL AU...")
> #10 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(326):
> CRM_Utils_File::runSqlQuery("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
> "-- install sql for iATS Services extension, create a table to hold
> custom cod...", NULL, TRUE)
> #11 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(119):
> CRM_Utils_File::sourceSQLFile("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
> "/home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments...")
> #12 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader.php(28):
> CRM_iATS_Upgrader_Base->executeSqlFile("sql/install.sql")
> #13 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(264):
> CRM_iATS_Upgrader->install()
> #14 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.civix.php(50):
> CRM_iATS_Upgrader_Base->onInstall()
> #15 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.php(48): _iats_civix_civicrm_install()
> #16 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(76):
> iats_civicrm_install()
> #17 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(48):
> CRM_Extension_Manager_Module->callHook(Object(CRM_Extension_Info),
> "install")
> #18 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager.php(237):
> CRM_Extension_Manager_Module->onPreInstall(Object(CRM_Extension_Info))
> #19 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/v3/Extension.php(58):
> CRM_Extension_Manager->install((Array:1))
> #20 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101):
> civicrm_api3_extension_install((Array:2))
> #21 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(168):
> Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
> #22 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(99):
> Civi\API\Kernel->runRequest((Array:9))
> #23 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/api.php(43):
> Civi\API\Kernel->runSafe("Extension", "install", (Array:2))
> #24 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Form/Extensions.php(189):
> civicrm_api3("Extension", "install", (Array:2))
> #25 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Form.php(490):
> CRM_Admin_Form_Extensions->postProcess()
> #26 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160):
> CRM_Core_Form->mainProcess()
> #27 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions),
> "next", "Next")
> #28 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203):
> CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions),
> "next")
> #29 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103):
> HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions),
> "next")
> #30 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Controller.php(349):
> HTML_QuickForm_Page->handle("next")
> #31 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(411):
> CRM_Core_Controller->run()
> #32 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(156):
> CRM_Core_Page_Basic->edit(1, NULL)
> #33 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Page/Extensions.php(121):
> CRM_Core_Page_Basic->run()
> #34 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(311):
> CRM_Admin_Page_Extensions->run((Array:3), NULL)
> #35 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(85):
> CRM_Core_Invoke::runItem((Array:16))
> #36 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(52):
> CRM_Core_Invoke::_invoke((Array:3))
> #37 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/drupal/civicrm.module(444):
> CRM_Core_Invoke::invoke((Array:3))
> #38 /home/webadmin/public_html/cmm-uat/includes/menu.inc(527): civicrm_invoke("admin", "extensions")
> #39 /home/webadmin/public_html/cmm-uat/index.php(21): menu_execute_active_handler()

```

# Answer
> 6 votes
Looks like you had already installed the extension on your instance (and removed it without properly uninstalling it\*). The table 'civicrm\_iats\_customer\_codes' already exists in your database. You can delete the table from if it doesn't have any data in it or change the sql statement in extension code to use 'CREATE IF NOT EXISTS'

HTH

Pradeep

KarinG: \*if you properly uninstall the iATS Extension - the uninstall process will copy your civicrm\_iats\_customer\_codes to a backup table for safe keeping before deleting that table;

---
Tags: error, iats
---


# Question
Title: Fuzion tokens for membership start and end date
I want to use Fuzion tokens in an attachment letter (an insurance certificate) and I need to show up start and end date for this certificate.

It's easy for name and everything related to contact or custom fields but I don't find for the start and end dates.

Is it something like `{contact.membership_start_date}` & `{contact.membership_end_date}`?

Will these customs fields work? Is there a way to find them (documentation, ...)?

**EDIT : 18/06/2019**

I tried the Fuzion tokens found with Jon's help but unfortunately the {membership.*_*} fields didn't work in my document. Others worked well. I thought at first, it didn't work out because the test user used had no contribution date, but actually even with one I can't get the token working.

Has anybody already succeeded in using those fields ?

# Answer
> 0 votes
So, after searching round and round, I finally found a simple extension: civitoken which permits to use many tokens and solved my question.

Actually Jon G already showed the way: https://civicrm.stackexchange.com/a/294/6991

Thanks for your help.

# Answer
> 4 votes
The issue is that a contact can have multiple memberships, so you can't use membership tokens unless you display your search results as memberships.

In Advanced Search, do your search again, but change **Display Results As** from *Contacts* to **Memberships**. If your contacts only have one membership each, this is all you need to do; if they can have multiple memberships, you probably need to filter by date, membership type, or status to get the correct ones.

From the search action selector, you'll now have the option **Print/merge document for membership**. When you select that, the list of tokens will include membership start and end dates.

UPDATE: I've posted a video here demonstrating what I believe is the answer to the question: https://www.youtube.com/watch?v=5D2aLoW9ovU&feature=youtu.be

---
Tags: civimember, tokens
---


title: Limit contributions

text:
# Question
Title: Limit contributions
We are selling exhibit booths on our website using an online form. We are almost sold out and don't want someone to pay by credit card only to be rejected. Is there a way to keep the form active only until the last booth is sold?

I've looked under all these elements of our setup: Campaign Manage Contribution Pages Manage Price Sets Edit Price Fields

With thanks, Erin

# Answer
You would want to use the maximum participants field under an event price set. You can do this on each price item, so for your case you can have the cost to have an outreach booth and set how many spaces are available.

It sounds like you are just using a contribution page and there is no way to limit line items there. At least you will know for next time.
> 3 votes

---
Tags: contributions
---


# Question
Title: How to setup a camping event with 2 part payment option?
Here are the conditions I need to meet

* Registration Cap: 15 people
* Deposit Fee: £10, a non-refundable deposit of £10 per person is due at time of registration, to reserve your space.

Payment Options (Either pay in full amount or interest-free installment option)

* First installment £45 (After which we’ll book your tickets – non-refundable)
* Final installment £55 (Other charges - non-refundable)
* Or they can pay the full £100 (excluding deposit) in one go
* Participants need to upload their photo while registering

My question is - How can I set up a fixed deposit amount & 2 part pricing option with a Maximum number of participants? If I set up Max no of participants and some people pays in 2 installments then the number would be maxed out before actually 15 people would be registered. Also, How can I give the option to upload a document that can be accessed easily? Thanks

EDIT: I have seen the other question at Is there a way to allow partial payments for events?

But Last answer received on this was in 2017 and I am wondering if there’s any better solution for this Kind Of issues by now!! The answers provided was not a straightforward solution because there’s no automated system and requires a lot more administrative workaround. I need a simple solution just like a event registration or a online contribution page. Just wondering, is it possible to create an extension that can take care of that? If it’s achievable via extension, how that can be done?

Multiple part payments can be achieved by selecting “Multiple registration for same email”. But issues is, how to restrict registration to only 15 contacts rather than 15 participants?

If they paid partially, how to send them an automated email for payment reminder?

# Answer
We have a client that runs a child after school care STEM program. Monies are due at the time of registration (one month eg in May) and then monthly (starting in Sep) for additional 9mo;

We use webfom civicrm (of course! ) with iATS payments to:

1) sign up for the Event and detemine the participant fee (conditionals factors are age, number of days, time-slots). 2) collect all contact info (parents, emergency contacts, contacts allowed to pick up the child) etc 3) use the recurring series feature in the webform civicrm -\> CiviCRM -\> Contributions tab -\> to enable that and to expose instalments on the webform 4) so parents can choose to pay now (all up front) or select the monthly option - this automatically creates a monthly recurring contribution with first charge now. 5) an administrator changes the next scheduled date for the recurring series to Sep 01 (so second instalment will be in Sep) 6) if you have a lot of recurring series then you can use views and civicrm entity and views bulk operations to contruct a view in which you can update multiple next scheduled dates in bulk.
> 1 votes

# Answer
I am not sure if I understood this correctly. Instead adding participant count limit to price field i would use Event setting to define maximum participant count.

I would create two required price field option of type radio

1. Fix Deposit
2. Event ticket fee

Define max count to 15 in events Info and Settings.

To support partial payment on Event fee you can try the Registration Deposit extension developed by LCD Services that provides ability to define deposits on each price field options. However the extensions README says that ATM it only supports for Authorize.net and PayPal Standard.

HTH

Pradeep
> 1 votes

---
Tags: civievent, payment, upload
---


# Question
Title: How to get CiviCRM Views to work in Drupal 8 with separate CiviCRM database
When setting up a Drupal 8 with separate CiviCRM database, the Drupal views cannot read the CiviCRM database:

> SQLSTATE\[42S02\]: Base table or view not found: 1146 Table 'xxx.civicrm\_contact' doesn't exist: SELECT civicrm\_contact.id AS id, civicrm\_contact.organization\_name AS civicrm\_contact\_organization\_name FROM {civicrm\_contact} civicrm\_contact LIMIT 11 OFFSET 0; Array ( )

Checking the civicrm\_views module I suppose there are some changes needed in the civicrm\_views\_views\_data() function to connect to the right database for the CiviCRM data.

I also tried to create a view based on entities from the CiviCRM Entity module, but have the same error there.

Anybody got this working or has some hints how to do it?

# Answer
> 9 votes
I had the same problem today, so I looked in the source code.

In `civicrm.install` there's a function called `_civicrm_get_db_config`. It's looking in the `$databases` array for an element with a key `civicrm`. So I added this to `settings.php`:

```
$databases['civicrm']['default'] = array (
  'database' => 'civi_db_name',
  'username' => 'mysqluser',
  'password' => 'redacted',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

```

I then had to clear all caches before it worked, but work it does.

# Answer
> 1 votes
You can use the data processor extension (https://lab.civicrm.org/extensions/dataprocessor) for that. The data processor is an extension for CiviCRM which gets data from CiviCRM and exposes this to the API (it is possible to add your own outputs, e.g, csv file, page etc..)

At the Drupal side you need the CiviMRF Core Module (https://github.com/CiviMRF/cmrf\_core). The CiviMRF is capable of connecting to an external civicrm and with cmrf\_views you can setup views to retrieve data from the CiviCRM API.

With the data processor you can create your own custom API's (or views).

All this is still work in progress but functional working. I hope to write a blog post on how the data processor works with Drupal views in the near future.

This will also work when CiviCRM is installed in the same Drupal environment. The CMRF core module provides a 'local' connection.

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


# Question
Title: How can I generate a CiviMail delivery & Click-thru report
I need to email a report to a person of a particular mass email that was sent from CiviMail. The person doesn’t have access to CiviCRM. How can I generate a CiviMail detailed delivery & Click-thru report from CiviReport and email using scheduled job? Thanks

# Answer
> 3 votes
I guess you can use Mailing Summary report with filter as start and end date and configure it to send email via schedule job.

---
Tags: civimail, civireport
---


# Question
Title: Is it possible to Pre-Fill Form Fields Using URL Parameters?
I would like to pre-fill this field in the picture and I have tried with following URL, but it doesnt seem to work! Anyone has clue if this is possible with civicrm links? Thanks

```
https://example.com/civicrm/mailing/browse/scheduled?reset=1&scheduled=true?mailing_name=SOMENAME

```

# Answer
> 3 votes
Most pages don't support this out of the box because securing inputs is tricky. CiviReports supports this, and search pages are starting to support this (it works for a handful of fields and more are coming) but for now, if you want to do this, you should probably write a bit of jQuery to parse the url argument and fill the field in.

EDIT: See this Github issue which tracks the status of documenting the fields that are supported by passing parameters in the URL.

---
Tags: urls, prefilled
---


title: How to change a sites URL

text:
# Question
Title: How to change a sites URL
**CiviCRM 5.14.0**

I've read several explanations of how to change a sites URL but I am not having luck. I have made the changes in my apache2 sites-available conf file and restarted apache2. I have also changed the base in civicrm.settings.php. Now the new URL just goes to the Apache default page.

Some things I have read say I have to clear the CiviCRM cache but I can't do that if I cannot access the site.

Any suggestions?

# Answer
This is basically a system admin question rather CiviCRM specific. I personally don't have very good experience in doing this but when there is URL changes

1. Make sure your new domain is pointing to correct server IP
2. Update the url in apache or nginx conf.
3. Update .htaccess file in your site directory if its using any base url.
4. Update the base url in wp-settings.php or drupal's settings.php file.
5. Update the base url in civicrm.settings.php file
6. Clear drupal and civicrm cache
7. If using wordpress you may need to update in database

Query:

```
UPDATE wp_options SET option_value = 'http://new_domain.org' WHERE option_name IN ('siteurl', 'home');

```

Cheers

Pradeep
> 2 votes

---
Tags: installation
---


title: CiviMobile App error when editing phone

text:
# Question
Title: CiviMobile App error when editing phone
CiviMobile app on Android errors when trying to add or edit a phone number.

clicking save returns error "Please enter phone number"

App occasionally crashes when trying to add a phone number. Other fields edit and save as expected.

CiviCRM 5.14 on Drupal 7.67 extensions: CiviMobileAPI (com.agiliway.civimobileapi) version 3.1 CiviMobile (com.webaccessglobal.module.civimobile) version 2.0

Android App

Anyone else having this issue? Thanks

# Answer
Mine is still in testing, but yes, also seeing API errors on mobile app start. CiviCRM 5.14.1, Drupal 7.67. There has been a new 3.1.1 release of CiviMobileAPI since your post you may want to try? I'm still seeing an error on app start with it.

Not sure about your CiviMobile, the app on play is com.agiliway.civimobile? Otherwise I don't think this: https://civicrm.org/extensions/civimobile/version-20 is required, or at least, it's an old dev and not related to the current API?
> 2 votes

---
Tags: mobile, civimobile
---


title: How to install the missing countries

text:
# Question
Title: How to install the missing countries
When adding a new contact, I want to insert the address including the country. However, in the drop-down menu, only a few countries are listed. How can I add missing countries to the drop-down menu at the address field?

# Answer
From the CiviCRM menu -

Administer \> Localization \> Languages, Currency, Location.

Select required countries from the 'Available Countries' option.

CiviCRM help on this option -

*Which countries are available in the Country selection field when adding or editing contact addresses. Profile and Custom 'Country' fields also use this setting. To include ALL countries, leave the right-hand box empty.*
> 4 votes

---
Tags: custom-fields
---


title: Delay automated email like receipts

text:
# Question
Title: Delay automated email like receipts
Is there a way I can delay when a automated E-Mail is sent. For Example - I would like the receipt email when one submits a contribution to be delayed by a few hours. Thank you

# Answer
Check out this extension by CiviCoop: CiviRules. You can do exactly that -\> delayed Actions: https://civicrm.org/extensions/civirules
> 3 votes

---
Tags: civicontribute, civimail, receipts
---


# Question
Title: How to increase the autocomplete search results in webform
How to change the module code to increase the autocomplete search results in webform. we have two contact one is enquirer and another is organisation its result 12 on autocomplete.

# Answer
It looks like line 669 here: https://git.drupalcode.org/project/webform\_civicrm/blob/7.x-4.x/includes/contact\_component.inc#L669

You can try changing the 12 to something else. It might work to replace it with `Civi::settings()->get('search_autocomplete_count')` and then it should use the value under Administer -\> Customize Data and Screens -\> Search Preferences -\> Autocomplete Results. I haven't tested that.
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: Why are duplicate activities being created?
I have a client who has noticed that some activities that they create are being duplicated. I can see solid evidence of exact duplicates - apart from the id in the activity record. In the activity table the 2 ids are consecutive, in the activity\_contact table they are almost consecutive. The contents of the activity records are exactly the same - the created\_date and modified\_date are the same time to the second. The client creates a lot of activities - there are about 220K activity rows and they do have quite a few users working simultaneously updating Civi. This seems like a bug to me - any suggestions as to what else the problem might be? This installation is running 5.13.5 with Drupal 7.67

# Answer
> 4 votes
Not sure if it's the same problem but it could be the submitOnce problem which has a temporary fix in 5.14.1 and a fuller fix pending but is an easy change you can make:

See https://github.com/civicrm/civicrm-core/pull/14545/files

i.e. remove the "submitOnce" line.

Briefly the popup version of activities conflicts with the extra javascript that submitOnce adds. The problem was reproduced on firefox - just create an activity using the popup version of e.g. a meeting, from the contact's record.

---
Tags: activity
---


# Question
Title: Manage Groups shows no groups after server move
We moved our CiviCRM install to a new server a couple of weeks ago. Everything seemed to go smoothly, but we've now noticed that the Manage Groups page is empty:

Clues that I've got so far:

* This happens both with new users, and users that were moved over from the old server.
* I can create a new group without errors, but obviously it doesn't show up afterwards.
* Group counts show up on the contacts page tab, but no roups are shown there either.
* We followed the move process outlined at https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/.

Hopefully somebody out there's got some clues, because I'm coming up empty right now... Thanks in advance for the additional brain cells!

CiviCRM 5.11.0, Wordpress 5.2.1

# Answer
Points to Aidan -- I had flushed out the caches, but hadn't cleared out the `templates_c` folder. Once I did that I discovered a permissions problem on the `templates_c/en_US` folder. With that fixed everything is working again!
> 2 votes

---
Tags: groups
---


title: How to use PDF API in production?

text:
# Question
Title: How to use PDF API in production?
(This post is following a previous question I asked and is related to ErikH's answer: https://civicrm.stackexchange.com/a/31142/6991)

Context: I want to send per email an attached amended certificate (document ID #73). I tried the API explorer v3 and for one test user (id #54) it worked fine. Why an attached .pdf? Because it's an insurance certificate and it's important for each one of the 4000 members to have it personalized, that they can't modify it because of a legal issue and that they can print it easily. Once the membership is manually approved (it will always stay this way, again for legal issues), I want the team of volunteers to have the simple option to send it.

I have 2 questions that are related to each other. I read the documentation but as far as I am not so familiar to code, I don't know exactly what to do.

Question #1: is it possible to include some code in an existing template with general purpose within Civicrm? and which code? (and of course how?...)

PHP?

```
    $result = civicrm_api3('Pdf', 'create', [
  'contact_id' => 54,
  'template_id' => 73,
]);

```

or JavaScript

```
    CRM.api3('Pdf', 'create', {
  "contact_id": 54,
  "template_id": 73
}).then(function(result) {
  // do something with result
}, function(error) {
  // oops
});

```

Question #2: for this action, the API needs a contact ID and it's obvious it makes no sense to set it this way. Is there awy to use some fuzion fields instead like the civitoken {user.id}? I tried this way and the API explorer returns an error message. Is it possible or not? Thanks for any help.

# Answer
Do I gather correctly you want to do this in many cases? The easiest option would then be to use the CiviRules extension to send the PDF so you do not have to code.

You could then set up something like *if a membership of a certain type is added, send the PDF*. That would make more sense to me then trying to add it to a template? I do not think that route will take you anywhere.

You can find more information about the CiviRules extension here: https://docs.civicrm.org/civirules/en/latest/

If CiviRules can not help you you would probably have to write an extension but you need to explain more about what is required exactly at what time for me to be able to help you with that.
> 4 votes

# Answer
Based on Erik's help, this is how I've dealt with my need:

* When a new membership is manually checked and validated (for some legal issue), the team in charge of this task adds the member to a previously created dynamic group (sub group to membership called "validated membership")
* using CiviRules, the new "validated" member automatically receives an email with a personnalized body AND a .pdf as attachment generated from a template.

# this is the civirule:

> * Linked Condition(s): Contact (not) in Group(s) In one of selected groups ("validated membership")
> * Linked Action(s): Send PDF to e-mail address (printer or mailbox) "" with template "XXX" , template for e-mail body "YYY"
> * No Delay
> 3 votes

---
Tags: api, pdf
---


# Question
Title: Where is 'Payment Method' stored in the database for a Contribution "Payment Details"?
Simple question! What table is this in, where do I find it? Latest Civi/Drupal

This is on a contribution detail page. I updated the payment\_instrument\_id in civicrm\_contribute but it does not change it here.

# Answer
> 4 votes
The payment method of a contribution table is stored on the `civicrm_financial_trxn` table. Payments and Contributions are related through `civicrm_entity_financial_trxn` table.

Some discussions about similar issues have recently taken place on financial issue board. Please consider whether you can make a contribution on any of them or if you need to report a new one.

---
Tags: civicontribute, database
---


# Question
Title: Prevent automatic login after registration
When people register on my wordpress website using a civicrm profile, they get logged in automatically. As I first need an Administrator to approve the user, I would like users not to be logged in after registration is complete.

Is there a parameter I have missed or would I need to use a filter or whatever ?

# Answer
You're running into the effects of this code which automatically logs the user in. Unfortunately there's no way to override this code at the moment - except to override the class file itself by putting an edited copy in your custom PHP folder like this and remove those lines.

A couple of alternative approaches are to:
> 3 votes

# Answer
Thanks a lot guys. You got me on the right way and I looked for a wordpress solution instead of a civi one. I just added the following bits of code to my function.php file (in the child theme) to get disconnected and immediately redirected to a specific page (otherwise I was getting a civicrm error telling me I had no access to the page it was redirecting me to) :

```
/**
 * WordPress function to prevent autologin
 */
function user_autologout(){
            wp_logout();
        }
add_action('user_register','user_autologout');

/**
 * WordPress function for redirecting users on logout. If user comes from registration page, they are directed to a page telling them that their membership request is pending.
 */

function auto_redirect_after_logout(){
    if (strpos($_SERVER['HTTP_REFERER'], 'inscription') !== false){
    wp_redirect( home_url().'/pending_registration/' );
    exit();
    }
    else{
    wp_redirect( home_url() );
    exit();
    }
}
add_action('wp_logout','auto_redirect_after_logout');

```
> 3 votes

# Answer
CiviCRM relies on CMS(i.e WP) settings when creating users. By default WP doesn't provide any such settings so you may need to install some plugin which needs admin approval for newly created user. Probably something like User Approve plugin.
> 2 votes

---
Tags: wordpress, registration, logging
---


# Question
Title: How to identify and report on donor anniversaries?
We'd like to acknowledge donors who have given continuously for (say) 5 years. Let's say 'continuous' means at least one donation in a year. How could these contacts be identified and reported? I've looked at all the contribution reports, including the Powerbase report extension, and thought about smart groups but I can't see a way of detecting these. There is the 'Recurring contributions' report but that doesn't do it as these donations may not necessarily be defined as recurring contributions. We're using Drupal so could use Drupal Views, but I'm not sure that would be able to do it.

# Answer
I'm unaware of a way to do this with out-of-the-box features in CiviCRM. However we recently did this for a client by extending the Summary Fields extension, defining a Summary Field that calculates Yes/No based on whether the contact has at least one completed contributions of a certain Financial Type in each of the 5 most recent years. Sounds almost exactly like what you describe.

So my answer here would be "yes, totally possible by extending Summary Fields".
> 2 votes

---
Tags: civireport, contributions
---