title: Codebase error?

text:
# Question
Title: Codebase error?
Received Warning Message: New Codebase version detected. You might want to visit upgrade screen to upgrade the database.

When I click on the link it takes me to another error message:

```
An error has occurred.
0 <div id="crm-container" class="crm-container" lang="en" xml:lang="en">
<style type="text/css" media="screen">
@import url(/administrator/components/com_civicrm/civicrm/css/civicrm.css);
@import url(/administrator/components/com_civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css);
</style>
<div class="messages status no-popup">
<div class="icon red-icon ui-icon-alert"></div>
<span class="status-fatal">Sorry but we are not able to provide this at the moment.</span>
<div class="crm-section crm-error-message">CiviCRM 4.6.4 requires MySQL trigger privileges.</div>
<p><a href="https://powerengineering.org/administrator/" title="Main Menu">Return to home page.</a></p> </div> </div>
<script language="JavaScript">function toggle( element ) {
    var className = element.className;
    if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') {
        element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else {
        element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block';
    }
} </script></pre>

```

I contacted my host server and their reply was: "It seems to be an issue with the plugin itself."

Joomla ver: 3.4.1
CiviCRM ver: 4.6.4
mysql: 5.5.43
php: 5.4.39-1

# Answer
> 1 votes
As @Coleman already pointed out MySQL trigger privilege is a requirement for CiviCRM to run. So technically your host serveris correct, the message is from the plugin. But it is a **requirement** for CiviCRM to run, not an issue that needs to be fixed in the code.

Check this page https://docs.civicrm.org/sysadmin/en/latest/requirements/ for the technical requirements for CiviCRM to run, and you might want to point this out to your host server and check if they meet those requirements?

---
Tags: joomla
---


# Question
Title: Display a Block on a specific Civi contribution page using a url alias (How to)
Drupal 7.6 Civi 5.4.1 I would like to display a Block on a Civi contribution page but I would also like to have the page have a pretty url rather than the Civi civicrm/contribute/transact?reset=1&id=8 Here I found help to add the block as long as I have the native Civi url. Any ideas on how I can display the block with a url alias in place?

# Answer
> 1 votes
One option is to use the solution you linked to above and then set up a friendlier redirect that forwards them to the correct internal page URL. (So you could use something like example.org/donate and when they click on it the Redirect would send them to example.org/civicrm/contribute/transact?reset=1&id=8) The end result is still the default URL, but you could use the friendlier redirect in emails, campaign materials, etc.

Or, set up a webform (using Webform-CiviCRM) that takes payment/contribution. Then you can set up your own URL as usual (but can't use the default contribution form payment profiles, etc. -- you'd have to set the needed fields up in the webform).

---
Tags: drupal
---


# Question
Title: When to use CiviCampaign vs Financial Types/Accounts
I'm managing CiviCRM for an organization that has the following kinds of accounts in Quickbooks:

* General Fund: undesignated donations
* one account per staff member, for donations towards each staff members salary
* one account for each project/campaign, for donations towards a particular purpose
* accounts for sales of products

Initially, I captured each of these as a different campaign using CiviCampaign. These means we can do things like have a Campaign dropdown on a CiviContribute page, e.g. to donate to the general fund or particular project or to support a particular staff member. This means it's easy to get reports or filter searches based on how each campaign is doing.

However, now that we're working to fully integrate CiviCRM with Quickbooks, I'm running into a problem. CiviCRM accounting codes are contained under financial accounts, but don't offer the same functionality as CiviCampaign. For example, is it possible to have a dropdown to pick which fund a donation goes to on a donate page if the funds are captured as Financial Accounts instead of CiviCampaigns? It seems every Financial Account requires a Financial Type?

And it doesn't seem to be easy to add Financial Accounts as staff come and go, compared to captured these accounts as campaigns. It also seems awkward: the financial type is really donation for all of these contributions, but the donations just go to various funds/accounts/campaigns. Is there a way to capture this in multiple Financial Accounts without having to have multiple Financial Types?

My options seem to be:

* Use CiviCampaign, and figure out a way to modified the data before import to Quickbooks
* Use Financial Accounts / Financial Types, and figure out another way to get the functionality we want in CiviCRM and potentially deal with a proliferation of Financial Types (which just doesn't feel right)

I'm leaning towards the first option, because CiviCampaign seems to be the right tool. But for extensive use of CiviCRM and accounting integration, what is the best way to capture multiple destinations for donations? When should I use CiviCampaign and when should I use Financial Accounts?

# Answer
A few points:

1. The system creates a financial account automatically when you create a financial account, so there's not much extra effort. You will want to edit the financial account to put in the QuickBooks chart of account information.
2. The general advice regarding Chart of Accounts (in QuickBooks or similar software - it's actually an accounting best practice) is that you don't want to be removing them regularly. I'd suggest having a parent account for something like Donations - Staff Salaries, and then sub-accounts Donations - Staff Salaries - Joe, etc. While the subaccounts will remain, their amounts will be conveniently summarized in QuickBooks into the parent account. After creating the subaccounts as Financial Types in CiviCRM, edit associated the Financial Account that was automatically created, then make sure to configure the fields as appropriate for QuickBooks. I believe if you export your Chart of Accounts from QuickBooks (for many versions of QB Desktop File \> Utilities \> Export \> Lists of IIF files, select Chart of Accounts) then open it in a low-level text editor like Notepad you will be able to see the data you need to exactly match the account name and 'Account Type Code'. In particular, the subaccount will have a name with a colon in it separating the parent account name and this account's name. You need to enter that exactly correctly (cut and paste!) in order to have things work correctly when you import the .iif from CiviCRM into QB. Remember to backup QB before trying the import...it usually takes several finicky checks to get everything perfect and not creating duplicate accounts.
3. You can create a price set and associate different financial types with different select widget options pretty easily:

HTH
> 3 votes

---
Tags: civicontribute, civicampaign, accounting, financial-types, financial-accounts
---


# Question
Title: Sign up with a different membership type overwrites existing membership
I am working with an organisation that has several different types of membership. Members sometimes move from one membership type to another, but it is important that we keep track of which membership they had when.

Unfortunately, when a member signs up for a different type of membership using the online payment form CiviCRM overwrites the old membership so that it looks like it becomes the new membership type. We would like to keep the original membership record as it is and add a new membership for the new membership type.

Staff can do this in the backend by creating a new membership, but we want to be able to do this using the online sign up form.

We are using CiviCRM 4.6 on WordPress.

---

To illustrate my point, this is an example of what we would like:

Existing membership before sign up

* Membership 1
    + Type = Silver
    + Status = Current
    + Join Date = 1 April 2010
    + Start Date = 1 June 2014
    + End Date = 31 May 2019

After sign up

* Membership 1
    + Type = Silver
    + Status = Current
    + Join Date = 1 April 2010
    + Start Date = 1 June 2014
    + End Date = 31 May 2019
* Membership 2
    + Membership type = Gold
    + Status = New
    + Join Date = 8 November 2018
    + Start Date = 8 November 2018
    + End Date = 7 November 2019

What we actually end up with after sign up is:

* Membership 1
    + Type = Gold
    + Status = Current
    + Join Date = 1 April 2010
    + Start Date = 1 June 2014
    + End Date = 31 May 2020

i.e. the membership has been converted to 'Gold' and given an extra term

# Answer
On the contact record's Activities Tab, there is an Activity of the Type: "Change Membership Type". Could you use that to determine the past/present Membership types?

Also, if you set up different Membership Types with a different 'Membership Organization' selected, I believe the record can have simultaneous memberships. I do not recall if this creates additional problems down the line, however.
> 3 votes

---
Tags: civimember
---


title: Case Types page 'blank'

text:
# Question
Title: Case Types page 'blank'
When I go to Administer \> CiviCase \> Case Types, that page has no content on it and the breadcrumb link at the top just says 'CiviCRM'.

In the web console, I get this error when loading that page (I've removed the domain and added spaces to keep links from showing in the post):

GET h ttp :// \**.\******.org/go/wp-content/uploads/civicrm/persist/contribute/dyn/angular-modules.a136d84bc8cc935bcae2e81386c212ea.js net::ERR\_ABORTED 404

admin.php?page=CiviCRM&q=civicrm/a/:198

GET h ttp ://\**.\******.org/go/wp-content/uploads/civicrm/persist/contribute/dyn/angular-modules.a136d84bc8cc935bcae2e81386c212ea.js 404

VM6993 admin.php:199

Uncaught Error: \[$injector:modulerr\] h ttp ://errors.angularjs.org/1.5.11/$injector/modulerr?p0=crmApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.11%2F%24injector%2Fnomod%3Fp0%3DcrmApp%0A%20%20%20%20at%20http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A6%3A426%0A%20%20%20%20at%20http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A25%3A235%0A%20%20%20%20at%20b%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A24%3A282)%0A%20%20%20%20at%20http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A25%3A20%0A%20%20%20%20at%20http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A40%3A17%0A%20%20%20%20at%20q%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A7%3A371)%0A%20%20%20%20at%20g%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A39%3A382)%0A%20%20%20%20at%20fb%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A43%3A381)%0A%20%20%20%20at%20c%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A21%3A19)%0A%20%20%20%20at%20Gc%20(http%3A%2F%2Fgo.mediationla.org%2Fwp-content%2Fplugins%2Fcivicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.min.js%3Fr%3DQcNK7%3A21%3A332) at angular.js:38 at angular.js:4692 at q (angular.js:325) at g (angular.js:4653) at fb (angular.js:4575) at c (angular.js:1809) at Gc (angular.js:1830) at se (angular.js:1715) at HTMLDocument. (angular.js:32616) at i (jquery.min.js?r=QcNK7:2) (anonymous) @ angular.js:38 (anonymous) @ angular.js:4692 q @ angular.js:325 g @ angular.js:4653 fb @ angular.js:4575 c @ angular.js:1809 Gc @ angular.js:1830 se @ angular.js:1715 (anonymous) @ angular.js:32616 i @ jquery.min.js?r=QcNK7:2 fireWith @ jquery.min.js?r=QcNK7:2 ready @ jquery.min.js?r=QcNK7:2 K @ jquery.min.js?r=QcNK7:2

angular.js:38

# Answer
FIXED. I have CiviCRM installed on a subdomain. Using the advice in this answer: https://civicrm.stackexchange.com/a/21878/6594 I changed the URLs on the 'Resource URLs' page (Administer \> System Settings \> Resource URLs) from relative URLs with shortcode (ex. \[civicrm.files\]/persist/contribute/) to absolute URLs (ex. http://\***.\******.org/wp-content/uploads/civicrm/persist/contribute). That made all of the pages that were appearing blank work properly.
> 2 votes

---
Tags: wordpress, error, civicase
---


title: Cron not running

text:
# Question
Title: Cron not running
how can I fix this one? Thanks in Advanced\]

# Answer
> 1 votes
This is something you have to set up on your server. It's worth having a look here

https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/

---
Tags: cron
---


title: Activity - Send a Copy Email

text:
# Question
Title: Activity - Send a Copy Email
When filing an activity in CiviCase, there's the option "Send a Copy" to people listed in Case Roles. The email is sent correctly. However, when I "reply" to the email, the address of the sender is a default system email. Is there an option to have the "reply" email be the user that send the copy?

# Answer
> 2 votes
It used to be the logged in user but I guess some people didn't want that and it was changed in https://issues.civicrm.org/jira/browse/CRM-20308

So it now uses the order listed there:

1. The Reported by Contact's email address
2. System Default From Address
3. Default Organization Contact email address
4. Logged in user

Personally I think logged in user makes more sense, and you could have privacy and also antispam problems with the Reported By address if it's not the org's domain.

It looks like there was a setting added to allow the old behavior, but it's not clear how it's supposed to work. It looks like to prevent using the Reported By contact you would **uncheck** the setting "Allow Mail to be sent from logged in contact's email address" found at Administer-\>system settings-\>Outbound Email, except then it would always return the system/org-wide email address. https://github.com/civicrm/civicrm-core/commit/4c981f371a6602cdfcda525895e0d0c40e9294d9#diff-be8afcc653a18926aabd2b40be8469f9

If you want a quick hack, try changing line 1407 in CRM/Case/BAO/Case.php from:

```
$receiptFrom = self::getReceiptFrom($activityId);

```

to

`list($receiptUserName, $receiptUserEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
$receiptFrom = "$receiptUserName <$receiptUserEmail>";`

---
Tags: email, civicase, activities
---


title: Import Contacts from CSV

text:
# Question
Title: Import Contacts from CSV
I am attempting to import a csv file that is both regular comma delimited and I have also tried one saved as CSV UTF-8 (Comma delimited). Each time I go through the steps, I get through the match fields correctly. When I get to Step 3 Preview, I am told that my total number rows have errors and won't be imported:

# Answer
Without seeing some of the actual file that is being imported, it is hard to say for sure. But my guess is that birth date field is an actual date field? And if so, it needs to be formatted as a date and on the first import screen you have to tell Civi how it is imported.

The error file that you can click and download will give you more information, as it will tell you what field(s) are the problem.
> 2 votes

---
Tags: import, csv
---


# Question
Title: Report for number of events attended by each person
I would like a report that lists the number of events attended by (or registered by) each participant. This seems like something that a lot of organizations would find useful, yet I can't seem to find anything even close to this that I could customize into what I'm looking for. Am I missing something, or is there no such report in existence. If not, any suggestions. Thanks, Rick

# Answer
> 3 votes
I think you can get what you want with the "Event Participants Report" (under the Events \> Event Reports Menu). In the "Sorting" tab, just tick the box for "Section Header / Group By" against "Last Name, First Name". You use the "Filters" tab to restrict to a particular time period, set of events etc.

In general if I can't do something off the shelf in CiviCRM then I export a search result or report to Excel and manipulate it there. A lot easier than writing a new report. In this case I would have used the Subtotal function in Excel if I couldn't have done it within CiviCRM.

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


title: Unable to schedule ANY reminders

text:
# Question
Title: Unable to schedule ANY reminders
I am not able to schedule any reminders. This happens whens pretty much everywhere.. whether I'm trying to set this up for Events, or even generally in **CiviCRM \> Administrator \> Communications \> Schedule Reminders**

Anyone have any idea what is going on? This is the only error I get..

FYI: Powered by CiviCRM 5.6.0

> Error: Call to undefined method CRM\_Admin\_Form\_ScheduleReminders::setContext() in CRM\_Admin\_Form\_ScheduleReminders-\>buildQuickForm() (line 69 of .../sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php).

# Answer
I found the issue.. I tracked it down to the fact that I'm using custom templates to modify CiviCRM.

the **civicrm/CRM/Core/Form.php** file has been updated to a new version while my custom version I had in the Custom Template Directory was still using the older version.

I synced them up and everything is working fine now.
> 2 votes

---
Tags: scheduled-reminders
---


# Question
Title: Need to show profile on event for someone logged in
I am trying to set up an event registration form. The guests are asked to bring a food item to share, and the committee wants to know who is bringing what, so they want the user to enter a description of what they are bringing. From what I have read, I set up a profile with an added field. The problem I have is that when a person has logged in to Wordpress, the profile does not show up rather the page shows their name and asks if that is for whom they are registering. Is there a way for the added fields in a profile to always be displayed? Is there a better way for me to try to do this?

# Answer
If your profile includes some custom fields, check your permissions to ensure that those logged-in users have permissions to access the custom fields. (And if users don't have to log in to register, make sure anonymous users have that access too.)
> 1 votes

---
Tags: civievent
---


# Question
Title: Is it planned to use SPIP as a basis CMS for CIVICRM?
SPIP is a multilingual open-source CMS created in 2001, and a lot of non-profit use it as their website tool in France and other countries. Is it planned, or do you heard about some people willing to use civicrm together with SPIP ? Many thanks in advance, Cyril

# Answer
From what I can see, it seems that SPIP is a CMS and not a CRM. While there are no plans for native integration between CiviCRM and other CMSes beyond the four currently supported, many organizations still integrate CiviCRM with their existing CMS. Simple integration options include remote profile submissions using snippets. You can also use remoteform, which also works with contribution pages.

If you wanted a deeper integration, you could use CiviMRF, but that would take development work.
> 1 votes

---
Tags: api, developer
---


# Question
Title: Is there a way to have conditional fields like in Drupal 7?
I use CIVI 5.x and Drupal 7.

I would like to have conditional fields, that display is certain conditions are met, for example:

New Customer, IF group is business, show business address field, IF group is individual, show home address, etc..

Same behavior as Drupal conditional fields basically

# Answer
Webform with native conditionals fields works great. \[SOLVED\]
> 3 votes

# Answer
For a Civi-native solution, there's also the Profile Conditionals extension, but it's in a fairly early state. It's a bit tricky to configure, but works well once you do!
> 1 votes

---
Tags: fields
---


# Question
Title: Check for Matching Contacts no longer gives an option to merge
I'm not sure which version this behavior changed in. When we edit a contact, and change the information so it matches another contact and click on the Check for Matching Contacts button, we get a pop-up that says, "Similar Contact Found", but below, it no longer gives us an options to immediately merge those two contacts. It used to have this option, very easy for us to merge with. Instead, admins have to save, leave the screen, and go into the Contacts menu to try and find the duplicate contacts.

I have tried this on the sandbox, and it is missing there as well. See screenshot here: https://i.stack.imgur.com/gTZqz.jpg

Any way to get this back?

# Answer
It looks like the merge link was taken away in a recent update when the page was updated to use ajax for the matching lookup. For those who may be looking for a temporary work-around (until hopefully this comes back into the core product), using the URL info from @Demerit in the comments above, I looked for a way to add the Merge link back into the popup notification when a person clicks on the Find Matching Contacts button. This can be done by creating a custom Contact.tpl template and modifying one line in the "duplicates-msg-tpl" section.

The way I did it was to override just that template section, and then re-import the main Contact.tpl file (since I don't want to have to manage merging things every time that template changes). Not sure why, but I had to use the full path for that include call. Here is the example custom Contact.tpl file (you need to first define where your custom templates go and include that in the Civi Admin system settings). You may need to change the rgid to whatever rule id you use (it may not even be necessary to have that param in the URL at all, but I kept it there just in case). You may also want to switch your cid and oid values, depending on which contact you want to merge into the other. In this case, I'm assuming the one being edited should merge into the existing one that shows up on the list.

```
 {literal}
<script type="text/template" id="duplicates-msg-tpl">
  <em><%- info %></em>
  <ul class="matching-contacts-actions">
    <% _.forEach(contacts, function(contact) { %>
      <li>
        <a href="<%= CRM.url('civicrm/contact/view', {reset: 1, cid: contact.id}) %>"><%- contact.display_name %></a>{/literal}{if $contactId|intval > 0}{literal} (<a href="<%= CRM.url('civicrm/contact/merge', {reset: 1, oid: {/literal}{$contactId|intval}{literal}, cid: contact.id, action: 'update', rgid: 4}) %>">Merge</a>){/literal}{/if}{literal}
        <%- contact.email %>
      </li>
    <% }); %>
  </ul>
</script>
{/literal}
{include file="/var/www/civicrm/sites/all/modules/civicrm/templates/CRM/Contact/Form/Contact.tpl"}

```
> 1 votes

---
Tags: duplicate-contacts
---


# Question
Title: Is it OK to switch to PHP 7.2 now that Drupal 7.6.1 supports it?
Drual 7.61 was released a few days ago and I notice now "fully supports PHP 7.2". So, can we move to PHP 7.2 for CiviCRM where it runs with Drupal 7.61? I've updated a couple of my Civi sites to Drupal 7.6.1. and PHP 7.2 and all seems well, but when I look at stats.civicrm.org there seems very few sites running PHP 7.2 which makes me wonder why. So it is OK to move a Civi site to PHP 7.2?

# Answer
The latest versions of CiviCRM run fine with PHP 7.2. However, a) this has only been true a few months, b) Drupal 7 has only very recently become 7.2-compatible, c) most major Linux distributions don't ship with 7.2 by default. I'd say those three factors account for few sites running it.

Note that as of CiviCRM 5.8.0, known PHP 7.2 import issues have been fixed. CiviCRM 5.9.0 will handle the other known PHP 7.2 issue, which only occurs on certain types of reports.
> 8 votes

---
Tags: drupal, php7
---


# Question
Title: Problem with CiviCRM registering a new Wordpress user
I'm running WP 4.9.7 Multisites, CiviCRM 5.3

I've created a profile with the information I want to gather from people. I've enabled the option to create a Wordpress user.

I go to the contribution page containing the profile, and it shows me all the appropriate fields to create a new WP user, as well as all the other profile fields.

I go through the process, and it all seems to work. It inserts an entry in CiviCRM. But it doesn't create the Wordpress user... Not even a pending user.

Have I missed something somewhere?

Thanks

# Answer
> 1 votes
It might sound obvious, but I'll admit getting caught by this on one occasion because I didn't test as an anonymous user!

# Answer
> 0 votes
Follow the steps as described here

You may have missed the below step -

For WordPress you will also need to check the box "Anyone can register" in the WordPress general settings.

---
Tags: wordpress
---


title: Development - Refresh of parent page

text:
# Question
Title: Development - Refresh of parent page
Wordpress with CiviCRM 5.3.2

Hi guys, I'm struggling with a small problem.
I've added a tab (using tabset) to create a new tab while viewing a contact. That tab lists any dogs registered to that particular person. I've added an 'edit' and 'delete' link to the far right of the listing and all of that works. I wrote a quickform that opens when the 'edit' link is clicked. I can update the dog's information, click submit and it does update the entity in the database. The issue is, how do I tell the parent of this edit popup to refresh? The change I've made in the edit is not reflected in the listing until I reload the page manually.
I've read in a lot of places of some ways of doing it but I haven't figured out WHERE to initiate it. In particular there is a CRM.refreshParent and/or the crmPopupFormSuccess. I don't know where I would put these? I used civix to create the basic form, then made modifications to the php file to do a preprocess and postprocess, of which does the update, etc.
So, how and where do I tell the parent page to refresh when I close the popup of the form? Some direction would be appreciated.

Norm

# Answer
Solved my issue with the code snippet which is mentioned here - https://docs.civicrm.org/dev/en/latest/framework/ajax/ called CRM.livePage.js. I added it to my tpl file as suggested above and it now refreshes the tab I'm on!

Thanks Norm
> 0 votes

# Answer
There should be a .tpl template file that goes along with your .php file. You can put the javascript in that file.

The files created for your form via civix and their locations are described here: https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-form
> 0 votes

---
Tags: developer, civicrm-entity, civix, quickform
---


# Question
Title: Where is the CiviCRM ERD / data-dictionary?
In a variety of contexts it is useful to have a Entity Relationship Diagram (ERD) / data-dictionary:

* Using the API
* (Xavier avert your eyes) querying the database with SQL
* Developing extensions; and even
* Refining the core.

Where is the definitive data-dictionary for CiviCRM? And how do we patch it?

# Answer
> 10 votes
You should use the **API** as the data dictionary. The **API explorer** (available in every installation) provides a convenient interface to browse the data dictionary.

The demo sites each have an API explorer and they are the authoritative public data dictionary for CiviCRM. For example http://dmaster.demo.civicrm.org/civicrm/api/explorer (login first with username:demo and password:demo). Other versions are also available..

The entity select box shows a list of all available entities. For each entity, the three most important actions from a 'data dictionary' perspective are

* **getfields** \- for the given entity, this action shows available fields
* **getactions** \- for the given entity, this action shows available actions
* **getoptions** \- for the given entity *and field* this action shows available options (only available for multiple choice fields).

Here are some examples of useful API calls:

**To list all entities**

`civicrm_api3('Entity', 'get');`

**To list fields for an entity**

`civicrm_api3('[EntityName]', 'getfields');`

**To list options for a field** (only available for multiple choice fields):

`civicrm_api3('[EntityName]', 'getoptions', array( 'field' => "[FieldName]"));`

**To list actions for an entity**:

`civicrm_api3('[EntityName]', 'getactions');`

FWIW, the above four API functions are used to build the API explorer, which is quite neat, IMO.

As you might expect, in most cases the API is a fairly close match to the database structure. This database structure is defined in a series of XML files that you can find in our git repo (for example this xml file defines the table civicrm\_group).

A couple of areas that merit a bit more explanation:

* **Custom data:** At the database level, each *custom set* is a database table and each *custom field* is a database column. All custom data is registered in two tables civicrm\_custom\_group and civicrm\_custom\_field. These tables are exposed in the API as the entities CustomGroup and CustomField.
* **Options:** At the database level, a lot of the simple drop-down options that you see in the user interface (for example *activity status*) are stored in the two tables civicrm\_option\_value and civicrm\_option\_group. These are exposed in the API as OptionValue and OptionGroup. The more complex options (for example *membership status*) typically get their own table and API Entity.

To answer the second question, when you say "patch the data-dictionary", I'm not entirely sure what you mean, but if you were "refining the core" and wanted to for example, add/edit/remove a field, I would

1. Edit the xml file that creates the database table you are interested in
2. "Run GenCode.php" to rebuild the data files
3. Do various other things depending on what you changed!

Of course if you are going down this route, I would recommend discussing any changes with someone who has a deep understanding of CiviCRM and its data structures.

# Answer
> 4 votes
The developer documents on the CiviCRM Wiki are very extensive and cover the codebase and development standards and best practices. There are reference sheets digging into specific areas for the project at hand.

There are XML files on GitHub that describe the database structure and fields.

Your CiviCRM instance should also have an API explorer and generator in civicrm/api/explorer as well as an API parameter list in civicrm/api/doc that are helpful.

# Answer
> 2 votes
There is no real data dictionary for CiviCRM. The data in core is generated from some xml schema's which you can find on GitHub at: https://github.com/civicrm/civicrm-core/tree/master/xml/schema

# Answer
> 0 votes
I think the best answer it the one that points folk to https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html which is derived using SchemaSpy per the answer here

https://civicrm.stackexchange.com/a/20160/96

---
Tags: api, sql
---


# Question
Title: How do you stop names from doubling - Views
I have a membership database and a View of Local Leaders info, but it is showing each person twice in the View's list. I have tried to delete the contacts and input them back in they still show up double.

# Answer
If I had to guess, I'd say your "Look up Leaders" functionality is built with Views in Drupal or Backdrop, and it shows up double because there are two different "Other" phone numbers for these contacts. It's treating them as two different entries.

If that is the case and if it's possible to remove or relabel the second phone number location type in the contact records (ie. not have two "Other" phone numbers -- although you could have multiple phone numbers if they have different location types) I think it would solve the issue.

*EDIT* Upon closer inspection, the second "Other" number appears to duplicate the "Mobile" number. In the contact record, try deleting the duplicate number with the "Other" location type.
> 4 votes

# Answer
If I had to guess - you have duplicate contacts.

I would check out the user guide - https://docs.civicrm.org/user/en/latest/events/online-event-registration/#contact-matching-and-duplicate-management

Go through your contacts and merge duplicates. (Contacts\>\>\>Find and Merge duplicate contacts) Maybe start with a couple to see if that is the source of your issue. This could have happened due to many factors - but most likely because you have a form or created an import and did not select any duplicate matching rules.
> 0 votes

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


# Question
Title: Views Bulk Operation (VBO) : Config List does not display a Custom Field
I have created a new Custom Field (yes/no, searchable) in an existing group which already contains 15 of them.

I want then to create a VBO to be able to modify this field value from a View.

But my new custom field is not displayed in the Operation Settings Token list (while all the previous 15 are displayed).

Why ? How can I fix that ? Any help is welcome.

(I run Civi 5.6.0 / Drupal 7.60)

# Answer
Some times when adding new fields to an existing 'set of fields' you will need to clear Drupal caches before these fields are available through the field chooser in the View.
> 1 votes

---
Tags: drupal-views
---


# Question
Title: Email of membership receipt needs specific custom tokens added - how to find them?
I am trying to work with an existing CiviCRM setup I have stepped into.

The automatic email of a donation or membership payment needs more features added.

1) The Company number 2) the type of product being purchased (as in Silver membership, Gold, Student or Retired), 3) the official registration of the body they have donated to or paid membership to, and 4) the type of donation that may be given, as in for campaign A or for campaign B.

My organization is using CiviMail, CiviContributes and CiviMember. We do not use CiviEvent even though it is installed.

I do not know where to find, in this slightly customized version of CiviCRM, 4.1.3, those fields or those tokens. Can someone please help point me in the right direction?

There are about 1300 members/supporters being managed with this system since 2011. I think there are a lot of legacy aspects that have been tried and left hanging, looking as though they can do thing, but they don't, like CiviEvent.

Thanks in advance for your help.

------------- existing message template ----------------

{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} {capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture} {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}

{if $formValues.receipt\_text\_signup}

{$formValues.receipt\_text\_signup|htmlize}

{elseif $formValues.receipt\_text\_renewal}

{$formValues.receipt\_text\_renewal|htmlize}

{else}

{ts}Thanks for your support.{/ts}

{/if} {if ! $cancelled}

{ts}Please print this receipt for your records.{/ts}

{ts}SPECIAL Association for PUBLIC GOOD (Australia){/ts}

{ts}ABN 15 555 555 555{/ts}

{/if} {if !$lineItem} {ts}Membership Information{/ts} {ts}Membership Type{/ts} {$membership\_name} {/if} {if ! $cancelled} {if !$lineItem} {ts}Membership Start Date{/ts} {$mem\_start\_date} {ts}Membership End Date{/ts} {$mem\_end\_date} {/if} {if $formValues.total\_amount} {ts}Membership Fee{/ts} {if $formValues.contributionType\_name} {ts}Contribution Type{/ts} {$formValues.contributionType\_name} {/if}
```
   {if $lineItem}
   {foreach from=$lineItem item=value key=priceset}
     <tr>
      <td colspan="2" {$valueStyle}>
       <table> {* FIXME: style this table so that it looks like the text version (justification, etc.) *}
        <tr>
         <th>{ts}Item{/ts}</th>
         <th>{ts}Fee{/ts}</th>
     <th>{ts}Membership Start Date{/ts}</th>
     <th>{ts}Membership End Date{/ts}</th>
        </tr>
        {foreach from=$value item=line}
         <tr>
          <td>
      {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
          </td>
          <td>
           {$line.line_total|crmMoney}
          </td>
          <td>
           {$line.start_date}
          </td>
      <td>
           {$line.end_date}
          </td>
         </tr>
        {/foreach}
       </table>
      </td>
     </tr>
   {/foreach}
  {/if}
   <tr>
    <td {$labelStyle}>
     {ts}Amount{/ts}
    </td>
    <td {$valueStyle}>
     {$formValues.total_amount|crmMoney}
    </td>
   </tr>
   {if $receive_date}
    <tr>
     <td {$labelStyle}>
      {ts}Received Date{/ts}
     </td>
     <td {$valueStyle}>
      {$receive_date|truncate:10:''|crmDate}
     </td>
    </tr>
   {/if}
   {if $formValues.paidBy}
    <tr>
     <td {$labelStyle}>
      {ts}Paid By{/ts}
     </td>
     <td {$valueStyle}>
      {$formValues.paidBy}
     </td>
    </tr>
    {if $formValues.check_number}
     <tr>
      <td {$labelStyle}>
       {ts}Check Number{/ts}
      </td>
      <td {$valueStyle}>
       {$formValues.check_number}
      </td>
     </tr>
    {/if}
   {/if}
  {/if}
 {/if}
</table>

```

{if $isPrimary}

```
  {if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later }
   <tr>
    <th {$headerStyle}>
     {ts}Billing Name and Address{/ts}
    </th>
   </tr>
   <tr>
    <td {$labelStyle}>
     {$billingName}<br />
     {$address}
    </td>
   </tr>
  {/if}

  {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later}
   <tr>
    <th {$headerStyle}>
     {ts}Credit Card Information{/ts}
    </th>
   </tr>
   <tr>
    <td {$valueStyle}>
     {$credit_card_type}<br />
     {$credit_card_number}
    </td>
   </tr>
   <tr>
    <td {$labelStyle}>
     {ts}Expires{/ts}
    </td>
    <td {$valueStyle}>
     {$credit_card_exp_date|truncate:7:''|crmDate}
    </td>
   </tr>
  {/if}

 </table>
</td>

```

{/if}

{if $customValues} {ts}Membership Options{/ts} {foreach from=$customValues item=value key=customName} {$customName} {$value} {/foreach} {/if}

# Answer
Hi and welcome to the CiviCRM SE page!

With respect to the membership type/product, those should be delineated in any membership receipt template without any additional customization needed. And since you're working with Civi 4.1.3, if these are memberships on behalf of an organization, the receipt should include the company name. (This behavior doesn't work correctly in 5.x, unfortunately.) If the company number is a custom field, you should be able to pull it in based on its ID number, located at the end of its editing link. For example, ../civicrm/admin/custom/group/field/update?action=update&reset=1&gid=5&id=11 would be referenced as {contact.custom\_11} as a token.

In the contribution template, the type of donation should already be included - is it not coming through, in your testing?

With respect to the official registration details, how are those currently stored in Civi?
> 1 votes

---
Tags: civimember, tokens
---


# Question
Title: Change or turn off the auto renew cancellation system email
I've probably gone round the circle so many times I've missed it's obvious start! However, I can't find the origin of the system email that goes to people when they or the system cancels their auto-renew membership.

It contains the text, "Your auto renew membership sign-up has ended and your membership will not be automatically renewed."

As far as I can see, this is not the System message, 'Memberships - Auto-renew Cancellation Notification', which in our system has a very different text (when viewing the default message as well as our modified message.)

So... where should I look to find this text?

Sorry if this is a totally obvious answer that I've missed... :-)

# Answer
This looks to me like text from the Recurring Start and End notification... did you check there perchance?
> 1 votes

---
Tags: civimember, auto-renew
---


# Question
Title: Bogus Error Mandatory fields first name and last name OR email address missing from form
Event registration form on Civi 4.7.15 (WP 4.7.1) keeps throwing this mandatory fields missing error, even though all fields are filled in with good values.

Happens on empty cache and regardless what values I put in the form fields. I'm stumped.

(See also this thread.)

# Answer
Did a bit of googling and figured this one out -- I didn't realize I needed to visit the access control screen \[Administer / Users and permissions / Permissions (access control)\] in order to enable the form to accept user input on submit.
> 2 votes

# Answer
We had a similar issue and tried several tests to resolve the issue. Checked all Anonymous Roles to YES, not this problem. Turned off all WordPress Plugins, not this problem. Changes theme, BINGO!

There was a conflict with one of the JQuery/Lightbox type page overlay option within our theme that cause the forms not to submit. Removing that option fixed the issue.

The overlay window was loading a separate page and somehow it was loading the Registration form too!

So, Theme conflict in WordPress.
> 2 votes

# Answer
I think the error is highlighting that the information your requesting from participants doesn't include

First Name AND Last Name OR Email address.

If you could confirm the registration form has these or provide a link to the registration form it should make it easier to identify.
> 0 votes

---
Tags: civievent, fields, activity
---


# Question
Title: Registration forms not submitting - What Permissions needed
Is there a specific Permissions setting we need to turn on for forms to be submitted by anonymous users registering for event?

Error Message: Please correct the following errors in the form fields below: Mandatory fields (first name and last name, OR email address) are missing from this form.

Using CiviCRM 5.70 for WordPress

The form works fine When I am signed into WordPress.

# Answer
> 1 votes
Tried several tests to resolve the issue. Checked all Anonymous Roles to YES, not this problem. Turned off all WordPress Plugins, not this problem. Changed theme, BINGO!

There was a conflict with one of the JQuery/Lightbox type page overlay option within our theme that cause the forms not to submit. Disabling that option fixed the issue.

The overlay window was loading a separate page and somehow it was loading the Registration form too, doubling up the Registration form!

So, Theme conflict in WordPress.

# Answer
> 0 votes
It sounds like the profile you added either does not include First and Last name or Email, which are required fields for events, or you didn't fill out all those items on the form. Do you have a screenshot of the page or a link you can give us?

---
Tags: permissions
---


# Question
Title: Civisualize: Creating Your Own Visualization concept question
Is CiviVisualize and the CRM API designed so that when someone wants to create their own visualizations, they only have to create a template in templates/dataviz/? Then, using the CRM API they can call a SQL Search Query in the template.tql file to customize which data they want to represent. Or, is there more files that must be created?

# Answer
for creating a new visualisation, you only need to add a template into template/dataviz indeed.

You will need to fetch some data to display it. They are two ways for that, either you are lucky and what you need can be taken with an existing API, and you simply have to

```
var data={crmAPI entity="Something" param1="42"}

```

but more often than not, you will want to aggregate data or do more sql massaging, in that case, you will need to create an extra queries/lizzy.sql

and then you can use it as

```
var data={crmSQL query=lizzy}

```

and voila ;)
> 2 votes

# Answer
CiviVisualize is an extension that uses the API, the API exists independently of CiviVisualize and will not be set up to work with CiviVisualize. CiviVisualize on the other hand will probably be set up in such a way that it respects what the API does. Your question:

```
they only have to create a template in templates/dataviz/

```

really only depends on what is in CiviVisualize. Documentation on CiviVisualize can be found here: https://github.com/TechToThePeople/civisualize. If your question is not clearly answered in the documentation I would probably raise an issue on the GitHub repository so the developers of the extension are aware and can answer.
> 0 votes

---
Tags: civisualize
---


title: Development - Custom Payment Gateway

text:
# Question
Title: Development - Custom Payment Gateway
Wordpress with CiviCRM 5.3.2

Good Day!

we are developing custom payment gateway for civicrm. in Payment Processor Settings we need to create a login screen to get our gateway account details instead of "Processor Details for Live Payments" settings using different form elements is there anyway to develop .

Thanks a lot for any suggestion or help .

# Answer
> 1 votes
Which payment gateway are you wanting to develop? If it is one supported by Omnipay then take a look at the Omnipay Multiprocessor Extension

If you are considering any work in this area I'd strongly encourage you to discuss this in the ~dev-financial channel on CiviChat

As regards Settings - there are significant changes coming up in 5.8 as described by Eileen here

---
Tags: wordpress, civicrm.settings.php
---


# Question
Title: How can I change the user access permission (read write mode for different user) using drupal and civicrm?
I want to set a different values for different users(Read/write permission) by using php **not by a customizing** (Drupal menu - \> People -\> permission).

# Answer
> 1 votes
Assuming you are interested in CiviCRM permissions rather than Drupal content, take a look at the Hooks section in the Developer guide, specifically the Permission Hooks subsection.

---
Tags: drupal, permissions
---


# Question
Title: How do I stop Civicrm front end pages throwing a fatal error?
On upgrading joomla to 3.8, access to civicrm front end pages (eg event listing)results in no response ie white screen.

Currently running Civcrm 5.6.1. The error does not occur if I log in to the front end as su.

On updating to joomla 3.9 it throws a red fatal error: 0 - @import url(/administrator/components/com\_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com\_civicrm/civicrm/css/crm-i.css); @import url(/administrator/components/com\_civicrm/civicrm/bower\_components/font-awesome/css/font-awesome.min.css); Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. You do not have permission to access this page.

# Answer
I tried many things, including restoring files from two months ago, and then updating, joomla and civicrm, and then reconnecting to the current database, and also rebuilding from vanilla copies of joomla and civicrm. But this did not solve the problem. The problem disappeared after I edited and saved the 'registered users' access rights in a minor way. The problem was still resolved after I set the access rights back to how they were. What a relief. Tony, many thanks for your reply.
> 3 votes

---
Tags: civievent, joomla, error-page
---


# Question
Title: Setting Up CiviEvent to Manage Two Side by Side Events with the Option of Registering for Both
What might be the best way to set up CiviEvent that can register attendees for two events, with one that is directly before the other event, as well as having the option where people can register for both at a discount?

I haven't used CiviEvent before, and from reading the documentation wasn't sure of the best approach. I thought there may be three ways of doing it:

1. Set up three distinct events in CiviEvent. One for each individual event and one for both.
2. Set up two individual events where each has an option in the pricing to include the other event.
3. Set up one "parent" event that includes pricing options to go to either both or one of the "child events"

In option 1, having three events may be problamatic as there would be two attendance lists for each event.

It seems that the second option might be easier but then I don't know how it would handle registration for the second event, as the person registering for one event would only appear on that individual event registration list.

For the third option, I'm not sure how the registrations would work for working out who was going to which child event. Would this be using Smart Groups? And I could forsee difficulties setting up automated responses depending on which child event had been selected.

Any guidance much appreciated! (I am using Drupal 7.60 with CiviCRM)

# Answer
> 1 votes
Have you tried Webform CiviCRM module? It will let you add multiple CiviEvents as simple checkboxes, set fees, assign discounts based on conditionals, sign up multiple participants, relate them to each other all on one page.

---
Tags: civievent, drupal
---


# Question
Title: How to make the callback URL from Mailchimp accessible from anonymous users in Wordpress?
I'm trying to set up this Mailchimp extension for CiviCRM, but I got this error :

So I tried to create a new webhook in Mailchimp, but when I copy-paste the webhook URL that CiviCRM gave me ( `https://www.mywebsite.org/civicrm?page=CiviCRM&q=civicrm/mailchimp/webhook&reset=1&key=xxxxxxxx` ) I got this message in Mailchimp :

> We couldn't verify the URL is working. Please double check and try again. HTTP Code: 500

I tested this link in my browser and it seems to work when I am connected to my Wordpress site, and it displays an error 500 when I am not connected.

So I thought that this problem could be solved by changing the permission for anonymous users in **WordPress Access Control** ( `civicrm/admin/access/wp-permissions` ) but the only users displayed on the list are :

* Editor
* Author
* Contributor
* Subscriber
* Civicrm editor
* SEO Manager
* SEO Editor

This "anonymous user" role doesn't exist and even if I check all permission boxes for all users in the "`Mailchimp: allow webhook posts`" line , the link always returns an error 500.

What can I do to make this URL working ?

Thanks for any help!

# Answer
> 2 votes
WordPress does not require that a role be given to users who only visit your site (e.g. to read posts) so long as it is public - roles are only required when logging in. However, for a WordPress client using the MailChimp sync, we found that we needed to create an Anonymous User role with the webhook permissions assigned - once you do this, pasting the webhook in MailChimp should no longer result in an error.

To clarify, no one has to be assigned the Anonymous User role for this to work.

Hope this helps! Tamar

---
Tags: wordpress, roles, mailchimp
---


# Question
Title: Can I export custom data from a Contact, an Organization and an Activity in one export?
I am trying to set up a custom field mapping to export after I search for Activities. I would like to export data associated with the Activity, but also include data from the Individual Contact and related Organization. All the fields are available when I export my activity, but the data does not export for the Organization.

Thanks

# Answer
There is a very useful extension called "**Extended Reports**" that has an Activities report that allows you to pull information about the Source, Target and Assigned contacts, but if you are looking for information about an organization that is related to one of those contacts but is not directly linked to the activity (and you don't have access to a developer), then you'd probably be better off searching twice:

1. Search \> Advanced Search
2. **Search 1:**
> 1. Select "Display Results as" = Activities
>     2. Enter desired search criteria for Activities
>     3. Search and Export search results
3. **Search 2:**
> 1. Without changing the criteria you used to search for the activities, click to expand the Edit Search Criteria bar
>     2. Select "Display Results as" = Related Contacts
>     3. Select the relevant relationship
>     4. Export results
4. Use a **vlookup** function to match data accordingly (facilitated if you export contact IDs)

Hope this helps! Tamar
> 1 votes

---
Tags: export, activity, field-mapping
---


title: Directory Paths: Make them portable

text:
# Question
Title: Directory Paths: Make them portable
I got this warning status message. How can I fix this error? TIA\]

# Answer
I understand messages like this can be worrisome but the msg actually tells you exactly what you need to fix the problem, eg it is suggesting you replace what you currently have set as the paths with the tokens shown. Try clicking on the 'Directories' link and then reading the help message that you will find there. If you need more help then paste a screenshot or the string in the 'paths' that you currently have, and someone will help coach you through which bits to replace with eg \[cms.root\]
> 1 votes

---
Tags: directory
---


# Question
Title: Unable to create InnoDB tables. MySQL InnoDB support is required for CiviCRM but is either not available or not enabled in this MySQL database server
I'm trying to install an old CiviCRM version on Drupal 6, the purpose is to migrate an old database data to the latest CiviCRM version, but I'm getting this error when I try to install CiviCRM in a clean Drupal install:

`Unable to create InnoDB tables. MySQL InnoDB support is required for CiviCRM but is either not available or not enabled in this MySQL database server.`

Everything else seems to be ok, I'm gettinig this error in a windows environment. First I tried with wamp, now I'm trying with Laragon. I tried also with vagrant and homestead which is a linux environment I think, same results.

I tried setting innoDB as the default engine and a lot stuff that is there on internet, but anything seems to work. Any idea?

This is what "SHOW ENGINES" return:

# Answer
Just go to `civicrm/install/index.php` and change the line with code `if ( $dbName != 'Drupal' )` and either exclude the entire if statement (comment it out) or change it to `if(true)`.
> 1 votes

---
Tags: drupal, installation, upgrade, migration
---


# Question
Title: Email not working after upgrade to PHP 7.0
WordPress 4.9.2 CiviCRM 4.7.29

I'm trying to upgrade to PHP 7 from 5.5, but CiviCRM mailer stops working. The Send test email results in:

To verify the email settings I used Easy WP SMTP

And it is able to send a test email.

The server does not support SSL or TLS. Any ideas about what to try next?

# Answer
> 1 votes
It's likely that you've added (or removed) the `php-crypt` library in your PHP upgrade process. This would cause your password to be encrypted in an incompatible method. Re-enter your credentials or match your `php-crypt` to what it was previously.

# Answer
> 1 votes
Check this answer on the SE question **SMTP connection failing problem**. Seems related with your problem due to the PHP update above version 5.5.

---
Tags: wordpress, email, 4.7, php7
---


# Question
Title: CiviSEPA turns special characters of generated XML files into ASCII characters or question marks
I have noticed that when using CiviSEPA to generate an XML file to be submitted to the bank for payment collection, no special characters get through. Some characters are converted into ASCII "equivalent" characters and some others into question marks `?`.

I am using UTF-8 within CiviCRM. Also, the XML file generated starts with:

```
<?xml version="1.0" encoding="UTF-8"?>

```

So the XML file encoding seems to be capable of using UTF-8 characters. Some examples:

```
Name       | Turns into
---------- | ----------
Mónica     | Monica
Begoña     | Begona
Mª Dolores | M? Dolores

```

This seems to be a "feature" as some conversions seem to be getting the "closest" ASCII equivalent. But then the *Transaction Message* seems to be getting a worse treatment: `La fundación le agradece su aportación` turns into `La fundaci??n le agradece su aportaci??n`.

I have tried generating XML files mostly with the *pain.008.001.02* PAIN version but it seems to be the same for the other PAIN versions.

So I would like to know whether the XML files may contain any UTF-8 characters (and the average bank will accept that). If this is so, do I have something wrong in the CiviCRM configuration? Is there a way to fix this?

# Answer
> 2 votes
I do recall having read the specification for sepa (don't judge me, I had to) that says:

1. the xml file is utf8 encoded
2. but can only contain ascii-7 characters

Did you try to upload the xml to your bank? I suppose they offer a test mode, you might want to try to check how it looks there

---
Tags: civisepa
---


# Question
Title: How do I replace the "From" address from my mailings?
I setup a default adress in **CiviMail -\> From Email Adresses** , like this :

`"Example" <example@example.org>`

but the problem is that when I send mails, the "From adress" change and become :

`"Example" <xxxx@gmail.com>`

(I specify that I use a gmail account in the SMTP sending settings)

Is it possible to force that mailing adress so it become "example@example.org" ?

At the begining, I was using a private adress (in my own domain) for civiCRM SMTP's settings (and it worked fine), but lately we need to migrate these mails to Office365 / Exchange mails and I have never been able to get CiviCRM mailings to work with the new Office365/Outlook/Exchange settings, that's why I opted for an SMTP account that uses gmail.

# Answer
> 0 votes
So I am assuming that the only thing that changed between "it worked" and "it doesn't" is to switch from your own smtp to your gmail one.

Beside the problem you mention, using smtp from gmail will not work to send mass emails, they have a lot of limits and as soon as your list has more than a handful of emails, you will have problems.

There as several providers (sendgrid, mailjet...) that are integrated with civi, and I'd recommend you switching to one of them

And it should solve out your gmail.com problem too

---
Tags: civimail
---


title: Settings - Upload Directories

text:
# Question
Title: Settings - Upload Directories
I got this message when I go to this area? How to fix this error about civicrm.settings.php. TIA\]

# Answer
> 1 votes
This means that the settings are hard coded in the civicrm.settings.php file in the sites/default/ directory on the server (the location may vary depending on your setup/CMS). You can manually remove the lines from the file that set the values.

---
Tags: directory
---


# Question
Title: What can I do so that mailings sent through Civi are not marked as spam?
I need to send a mailing but I've had problems before because a large share of the intented recipients never read it because the mailing was detected as spam. How can I solve this?

# Answer
> 5 votes
An alternative solution is to use a third party service to send the emails and not the web server. They'll be better placed to ensure your not marked as spam. Services such as CiviSMTP (Paid), Mandrill (Free to small lists or with Mailchimp plans otherwise Paid) and Sendgrid (Paid) can all be used. I would recommend this as a longer term solution rather then trying to manage your own reputation.

# Answer
> 4 votes
Parvez's answer recommending external mail delivery services is a good idea for most CiviCRM installations. There are lots of providers so prices are relatively cheap, and those providers are highly motivated to ensure delivery of your CiviCRM emails.

For sites which deliver directly (ie you run an MTA of your and deliver direct from your server to the receiving hosts), this is the list of things you might want to have in mind:

* Don't be spammy!
* Configure SPF, DKIM and DMARC correctly.
* Ensure your outgoing emails have a valid return address
* Review the logs of your MTA for delays, rejections and other indicators
* Monitor blacklist entries for your domain and ip
* Make unsubscribe easy (so people don't junk you)
* Check headers of the delivered emails for clues when mail does get junked - some providers will add clues there ("Possibly junk because the return address is not deliverable", etc)
* Consider who your "hosting neighbours" are - are spammy-looking emails being sent by other organisations from the same mailserver that your site is using?
* If you can, accept that results may vary - some mail providers are less tolerant of mass mail, and some are just plain bad ... move on if possible!
* Explore letting go of open tracking & link tracking - these are probably indicators of junk mail.

I'm sure there's more - feel free to edit this answer and add to it, or drop suggestions in the comments.

# Answer
> 2 votes
One important step is to make sure the domain you're sending from (actually the Return-Path address, which with CiviMail is probably the bounce address) has SPF set up. It needs to whitelist the SMTP server that you use for Civi's outbound mail (which may be the Civi server itself if using mail() or Sendmail), as well as any other SMTP servers that send mails from your domain (which may belong to eg. your organisation, your ISP or Google).

Also check if your SMTP server appears on any blacklists.

---
Tags: mailing
---


# Question
Title: Create a new membership rather than renew an existing one
Our members can join by credit card (paying manually each year, nothing clever) or by Direct Debit (set up as an auto-renew membership). We want to give credit card-payers the option to 'renew' to paying by Direct Debit. But this is complicated as the logic of payment dates/end dates is rather different between the two types.

I'd rather Civi just created a brand new Direct Debit membership in these circumstances, rather than trying to renew the old one. But the standard membership signup forms will always try to renew an existing one.

Does anyone have any suggestions for how to make Civi create a new membership in these circumstances? I can't see any obvious hooks for membership renewals. Should I intercept the entire form in hook\_civicrm\_postProcess?

# Answer
Caldera Forms CiviCRM now allows you to choose whether you want to renew an existing membership or create a new one entirely, see here https://civicrm.org/blog/danaskallman/caldera-forms-civicrm-cfc-for-donations-and-membership.
> 3 votes

---
Tags: wordpress, civimember
---


# Question
Title: CIVI Crm Wordpress with Xampp crashes my SQL
I installed CIVIcrm on latest version of wordpress, and appart from PHP version 5 (they recommend 7) it seems like it installed fine, however, it crashes my Sql any idea?

Here are some of the errors , file is too long, so will only paste some of it:

```
DB_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code]
=> -1 [message] => DB Error: unknown error [userinfo] => CREATE TABLE
`civicrm_participant_status_type` ( `id` int unsigned NOT NULL AUTO_INCREMENT
COMMENT 'unique participant status type id', `name` varchar(64) COMMENT 'non-
localized name of the status type', `label` varchar(255) COMMENT 'localized
label for display of this status type', `class` varchar(8) COMMENT 'the general
group of status type this one belongs to', `is_reserved` tinyint COMMENT
'whether this is a status type required by the system', `is_active` tinyint
DEFAULT 1 COMMENT 'whether this status type is active', `is_counted` tinyint
COMMENT 'whether this status type is counted against event size limit', `weight`
int unsigned NOT NULL COMMENT 'controls sort order', `visibility_id` int
unsigned COMMENT 'whether the status type is visible to the public, an implicit
foreign key to option_value.value related to the `visibility` option_group' ,
PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE
utf8_unicode_ci [nativecode=1813 ** Tablespace for table
'`wpcivi`.`civicrm_participant_status_type`' exists. Please DISCARD the
tablespace before IMPORT.] [backtrace] => Array ( [0] => Array ( [file] =>
C:\Core\01-Xampp\htdocs\wpcivi\wp-
 content\plugins\civicrm\civicrm\packages\DB.php [line] => 985

```

# Answer
> 1 votes
It looks like you may have attempted to install this more than once, or maybe run out of diskspace? The error message above shows:

```
nativecode=1813 ** Tablespace for table '`wpcivi`.`civicrm_participant_status_type`' exists. Please DISCARD the tablespace before IMPORT.

```

https://dev.mysql.com/doc/refman/5.6/en/server-error-reference.html#error\_er\_tablespace\_exists

This looks like it might have some answers for you: https://stackoverflow.com/questions/15694168/error-tablespace-for-table-xxx-exists-please-discard-the-tablespace-before-imp

---
Tags: wordpress
---


# Question
Title: How will I maintain a hierarchical structure in civicrm?
I want to maintain a following hierarchical structure for different user.How can I do that?
If any extension is available then let me know.

# Answer
CiviCRM is pretty egalitarian - they are all just Individuals.

There are various ways you could model this which depends to some extent on what you want to do based on that data.

One option is Relationships - eg create a Manager/Managee relationship and create relationships for all the places where you have lines. If you want to record a level in the hierarchy you could use a custom field.

If you want to use those relationships to control access (so that eg Line Manager1 can see only P1, P2, P3) then have a look at the Relationship Permissions ACL extension
> 2 votes

# Answer
I agree with Aidan.

However if you go for Related Permissions approach I would suggest you introduce a concept between LM1 and P1, P2 and P3. eg i would create a Practitioner Group as an Org. So you would then connect

* LM1 to PG1
* PG1 to P1, P2 and P3.

The reason is so that if LM1 leaves and you need to bring in LM1b in to the story then all you need to do is break the relationship between LM1 and PG1 and create one for LM1b to PG1.

You then turn on 'second degree permissions' and that ensures that LM1 can only see all those daisy-chained contacts via PG1.

Hard to explain - easier to draw but hopefully you get the idea.
> 2 votes

---
Tags: data-model
---


# Question
Title: Contribution Report Section Headers no longer list subtotal amounts
Previously, if you used a section header on a contribution detail report, the section header would show the number of contributions and the subtotal of that section in parentheses. So for example, if you were using Financial Type as the section header, it would show "Financial Type Name (# of gifts, subtotal of gifts). Now it only lists the number if gifts and the NOT the subtotal. is this expected behavior? Anyone know why the change?

Using Civi5.3.1 under WordPress.

# Answer
> 2 votes
I would recommend that you test one wpmaster or dmaster to see if it is still an issue and if it is not then upgrade your site to the latest release.

---
Tags: reports
---


# Question
Title: Contact layout editor db update crash on upgrade to 1.2.1
I upgraded a site to 5.7 and got a message to upgrade the contact layout editor to 1.2.1. After installation a database update has to be run which stops with the message ***\[Error: Upgrade org.civicrm.contactlayout to revision 1000\] DB Error: no such field*** I tried again on another site and got the same problem. Uninstalling & re-installing the extension fixed the problem, but that might not suit those who had made many changes. Is there a fix for this ?

# Answer
> 2 votes
Thanks for pointing out the bug in the upgrade code. I've pushed up a fix and published a new release: 1.2.2.

https://github.com/civicrm/org.civicrm.contactlayout/releases/tag/1.2.2

---
Tags: drupal, contact-layout-editor
---


# Question
Title: Is it possible to set cash contribution status to 'complete' automatically?
The use case is this: People come with their children to attend a creche facility. To do this they need to be members. They make a cash payment on the spot. Their details are all entered using a Webform that redirects to the contribution page. All good. But the contribution record is always set to Pending as the only way to deal with cash payments on a contribution page is to set the Pay Later option which always sets a Pending status. So the contribution record always has to be manually edited to change the status to complete even though the transaction was completed on the spot as it were. Any way around this? Thanks

# Answer
I think you should be able to do this with CiviRules: when there is a webform submission of the right type, find the contribution, check it is cash and then change the status to Completed. You will need the CiviRules webform Drupal module in addition to the CiviRules extension.
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Recurring contributions fail with PayPal Pro - "DPRP is disabled for this client"
We recently set it so that members can sign up for a recurring donation. All of our payments for recurring donations are failing, though. You can see in the attached picture that there are three failed recurring payments. One of them is mine, and I know that I entered the payment information correctly, so the payment should not have failed. I've recently, successfully, made other payments on this site with the exact same payment information.

We recently upgraded to CiviCRM 5.3.2 from 4.6.28. We are using Drupal 7.60. We are using PayPal as our payment processor.

List of recent contributions, showing failed recurring payments:

Membership page for my membership, showing pending membership and failed payment.

# Answer
Ends up that the issue was that we do not have the Recurring Payments module enabled in our PayPal account. When someone submits a recurring contribution, they get a warning stating "DPRP is disabled for this client".
> 2 votes

---
Tags: paypal, recurring-contributions
---


# Question
Title: CiviCRM-Entity Case - view block on a Drupal node
I'm attempting to display a View Block with a CiviEntity (type: CiviCRM Case) on a Drupal Node using Display Suite (block field).

When I set up the Display Suite Block Field, I'm presented with options for the type of entity, if I choose any of the Civi Entities (Civicrm Case, Civicrm Contact, etc.) they will not show up in the 'Manage Display' section of node setup.

Is there something I'm missing to be able to display a view based on CiviEntities on an existing Drupal node?

# Answer
> 1 votes
If you install the CiviCRM Entity module you can put Entity Reference fields on node types that can reference civicrm\_case, civicrm\_contact, and 40 other CiviCRM entity types.

You can reference the data in Views, either individual fields or rendered view modes of the entity types.

Your question doesn't quite make sense to me, so if you could elaborate about what you are trying to do a little bit or provide a screenshot or two, it could be helpful.

You can definitely use and add Display Suite Blocks. For instance, you can create a Display Suite block, check the civicrm\_contact checkbox for the "Entities" field. Then down toward the bottom of the form, select which block you want to show on the Drupal contact pages, at paths, "/civicrm-contact/\[contact\_id\]" where \[contact\_id\] is the numeric id of a contact.

You have to first add the block to the display of the contact page, the full content view mode, at "/admin/structure/civicrm-entity/civicrm\_contact/display/full". To make the Display Suite Block available as a field, you have to enable a Display Suite layout for the full content view mode. You then place it in a layout region, and save, and it will show on all contact pages.

I'm a bit confused what you mean by showing civi case or contact blocks on nodes..You can use entity reference fields to reference cases or contacts from a node, which would mean you wouldn't need to use Display Suite Block fields, or you can create Views base blocks listing cases or contacts, and then choose them in your Display Suite Block field settings, and check "Node" for the "Entities" field.

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


title: post hook edit entity

text:
# Question
Title: post hook edit entity
We have a post hook that sends some data to an external api when a participant is created or edited.

`function kavo_civicrm_post($op, $objectName, $objectId, &$objectRef) {
 if (($op == 'create' || $op == 'edit') && $objectName == 'Participant') {`

Based on the response of that api a custom field on the response of that API a couple of custom fields on the participant should be set. This is done using the php api, but results in a loop with the post hook being called, even when following the add\_callback instructions in the post hook documentation.

`try {
 civicrm_api3('Kavo', 'createparticipant', ['participant_id' => $objectId]);
 $successState = CRM_Kavo_Status::KAVO_ATTENDED();
 CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, 'set_kavo_state', [$objectId, $successState]);
 } catch (CiviCRM_API3_Exception $ex) {
 $contact = $worker->getContact($participant);
 CRM_Core_Session::setStatus($ex->getMessage(), ts("Failed sending participant %1 to KAVO.", [1 => $contact['display_name']]), 'error');
 $failedState = CRM_Kavo_Status::KAVO_FAILED();
 CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, 'set_kavo_state', [$objectId, $failedState, $ex->getMessage()]);
 }`

`function set_kavo_state($participant_id, $state, $message='success'){
 $kavo_status_field = CRM_Kavo_Field::KAVO_PARTICIPANT_STATUS();
 $kavo_message_field = CRM_Kavo_Field::KAVO_PARTICIPANT_MESSAGE();
 civicrm_api3('Participant', 'create', array(
 'id' => $participant_id,
 $kavo_status_field => $state,
 $kavo_message_field => $message
 ));
}`

The kavo create\_participant call does our call to the external api Is there another way to edit the participant being edited in a post hook?

# Answer
> 1 votes
The participant create in `set_kavo_state()` triggers your post hook again which then calls `set_kavo_state()` etc. You need to determine whether the post hook is being called just to update the `$kavo_status_field` and `$kavo_message_field` fields - and therefore not set up another callback to `set_kavo_state()`.

Do you actually need to call your external API for participant edits? If you could limit the post hook to only trigger on 'create' you would avoid the loop.

# Answer
> 1 votes
You have two choices:

* Use `hook_civicrm_pre` instead of `hook_civirm_post`. This isn't ideal because it's synchronous and will slow down your writes.
* Since you're updating custom fields only, continue to use `hook_civicrm_post`, but instead of calling `Participant.create`, call `CustomValue.create`, which won't trigger the post hook a second time.

# Answer
> 1 votes
If you are using Drupal, you can use the Drupal static cache infrastructure to break the cycle. In this particular example, the static cache is only available for one page load / http request. You can set a database cache as well, see References below for detailed explanation and instructions

```
function set_kavo_state($participant_id, $state, $message='success'){
  $stop = &drupal_static(__FUNCTION__);
  // could use more logic in this conditional if need be ... but at least you will know if you've come back a second time...
  if (!isset($stop)) {
    $kavo_status_field = CRM_Kavo_Field::KAVO_PARTICIPANT_STATUS();
    $kavo_message_field = CRM_Kavo_Field::KAVO_PARTICIPANT_MESSAGE();
    civicrm_api3('Participant', 'create', array(
      'id' => $participant_id,
      $kavo_status_field => $state,
      $kavo_message_field => $message
    ));
    $stop = 1;
  }
}

```

References: Drupal API documentation A Beginner's Guide to Caching Data in Drupal 7

---
Tags: api, hooks
---


# Question
Title: Civi event links - Event Info-> 404 error
I'm a newby just getting started and trying to learn how to set up events in Civi (5.6.0), using Wordpress (fresh install tester site).

In manage events, if I am looking at one of my events (which are saved, happy, and do show up via shortcodes on the Wordpress site) if I click 'event links' and then 'event info', I get a 404 error. All the other event links open fine.

The URL it is trying to go to is this: https://\[myURL\]/civicrm?page=CiviCRM&q=civicrm/event/info&reset=1&id=4

Any idea how to get it to show the event page? Thanks!

# Answer
You need to create a Base Page (if it doesn't exist) and enter its slug in CiviCRM by going to "Administer \> System Settings \> CMS Database Integration".
> 1 votes

---
Tags: wordpress, civievent
---


# Question
Title: Event members only for 3 days then open to the public
I have a need to be able to enter a period when an event opens for registration/access to a file to members only for a period of time (normally 3 days). So the goal, to be clear, is to open an event for registration to members only for 3 days, then open to the general public.
Ideally, if those open dates were also available to civiMail as a token - but that might be asking a bit much. I'm prepared to write an extension to make this happen but if someone has something similar, then I can build on that too.

# Answer
> 1 votes
There are methods to do members-only events on this Stack Exchange question: Is it possible to restrict event registration to members?

Since you're willing to write an extension, it's probably a good use of your time to start with the Members Only Event extension and add the ability to automatically open the event to the public after a certain date, which would be added to the custom fields that the extension creates. Please don't forget to submit a pull request with your feature to the author!

---
Tags: civievent, civimail
---


# Question
Title: Stock CiviCRM on Ubuntu package of Wordpress leads to /var/lib/wordpress/var/lib/wordpress/ paths
I am using CiviCRM on Wordpress on Ubuntu where the Wordpress comes from a deb package, not from the original source. The only real difference that I know of is that Debian/Ubuntu split the Wordpress code into /usr/share/wordpress for the static PHP files, and /var/lib/wordpress for the content files and uploads.

Anyway, probably because of some weird interaction between the Ubuntu package and CiviCRM, I end up with a whole bunch of resources trying to load from a path that starts with https://mydomain.com/var/lib/wordpress and which creates a 404 error in the webserver log when it tries to access /var/lib/wordpress/var/lib/wordpress on my disk. What has obviously happened is that part of the filesystem path has accidentally been embedded into the URL for the resource.

Problem is, I'm not sure where that setting comes from or how to change it. Can anyone verify this, or is it really just me? Should I report this as a bug against the Ubuntu package maybe? Among the resources that have the wrong path are:

`/uploads/civicrm/persist/contribute/files/delete-this-WjYpCHVDVl
/uploads/civicrm/persist/contribute/index.php
/plugins/civicrm/civicrm/js/wysiwyg/crm.ckeditor.js`

# Answer
I don't feel that this is a good solution to the problem, but as requested, I'm reposting this as an answer. I "solved" this error by creating a symlink using:

`$ mkdir -p /var/lib/wordpress/var/lib`

`$ ln -s /var/lib/wordpress /var/lib/wordpress/var/lib/wordpress`
> 1 votes

# Answer
This is a shortcoming in CiviCRM, unfortunately. The problem is that CiviCRM tries to guess where WordPress and its resources are via directory traversal. This works (by and large) for "standard" WordPress installs but not for those where `wp-content` has been moved or where the CiviCRM plugin directory has been symlinked.

Until this is remedied, your best bet is not to use the deb package and install WordPress manually in the `DirectoryRoot` location instead.
> 0 votes

---
Tags: wordpress
---


# Question
Title: Installation issues - unmet dependencies
trying to install the civicrm buildkit using the instructions found here : https://docs.civicrm.org/dev/en/latest/tools/buildkit/

I am on ubuntu 16.04. When I run `curl -Ls https://civicrm.org/get-buildkit.sh | bash -s -- --full --dir ~/buildkit` I get the error:

```
 The following packages have unmet dependencies.
 nodejs-legacy : Depends: nodejs (>= 0.6.19~dfsg1-3~) but it is not going to be installed
 npm : Depends: nodejs but it is not going to be installed
       Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
       Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
       Depends: node-ansi-color-table but it is not going to be installed
       Depends: node-archy but it is not going to be installed
       Depends: node-block-stream but it is not going to be installed
       Depends: node-fstream (>= 0.1.22) but it is not going to be installed
       Depends: node-fstream-ignore but it is not going to be installed
       Depends: node-github-url-from-git but it is not going to be installed
       Depends: node-glob (>= 3.1.21) but it is not going to be installed
       Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
       Depends: node-inherits but it is not going to be installed
       Depends: node-ini (>= 1.1.0) but it is not going to be installed
       Depends: node-lockfile but it is not going to be installed
       Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
       Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
       Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
       Depends: node-gyp (>= 0.10.9) but it is not going to be installed
       Depends: node-nopt (>= 3.0.1) but it is not going to be installed
       Depends: node-npmlog but it is not going to be installed
       Depends: node-once but it is not going to be installed
       Depends: node-osenv but it is not going to be installed
       Depends: node-read but it is not going to be installed
       Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
       Depends: node-request (>= 2.25.0) but it is not going to be installed
       Depends: node-retry but it is not going to be installed
       Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
       Depends: node-semver (>= 2.1.0) but it is not going to be installed
       Depends: node-sha but it is not going to be installed
       Depends: node-slide but it is not going to be installed
       Depends: node-tar (>= 0.1.18) but it is not going to be installed
       Depends: node-underscore but it is not going to be installed
       Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

```

My nodejs version is v11.2.0 (I tried to update to fix this issue). I have tried removing it and reinstalling it. I have done a `sudo apt autoremove`. I'm not sure what else to try here. Any suggestions on how to fix this?

# Answer
The command you're running, on Ubuntu 16.04, attempts to install the `nodejs-legacy` package. As it says, it can't because it relies on a particular version of `nodejs` that won't be installed.

So first - this problem should be replicable with a simple `sudo apt install nodejs-legacy`, which simplifies the variables and takes CiviCRM out of the equation. It's probably even replicable with `sudo apt install nodejs`.

Second, it sounds like you have something installed - perhaps a newer version of nodejs? - that's preventing an installation of the packaged version of `nodejs`.

After removing nodejs, try running `dpkg -l | grep nodejs` and see what, if any packages are installed.

Alternatively, removing `--full` from your command will disable attempting to autoinstall packages. If your environment is a good one, this should work fine. You can review the packages you need installed in this part of the script.
> 1 votes

---
Tags: installation, developer
---


title: How to Pay Later by Credit Card

text:
# Question
Title: How to Pay Later by Credit Card
We have some events which require very early registration, that the participants would like to pay later by Credit Card (easier than cheque)

Being given the contact\_id and the contribution\_id, the user can open the Credit Card Payment Form (e.g. via a small php program which fetches those 2 ids and then opens the form) :

/civicrm/payment/add?reset=1&id=1275&cid=5289&action=add&component=contribution&mode=live

where : id=contribution\_id and cid=contact\_id :

But then the user still has to select the payment processor (sorry for being in french : Passerelle de paiement), which may be confusing and source of errors.

Why is this necessary, since the payment is attached to a Contribution Page, which is itself attached to a Payment Processor ?

Is there a way to have the payment\_processor\_id parameterized in the URL (e.g. ...&ppid=xx) ? ... or smth equivalent ?

# Answer
> 1 votes
The answer to this question is provided in the response to "Pay Later Online?"

---
Tags: payment, paylater
---


# Question
Title: Upgrading Custom Extension for PHP 7: How to I instantiate a mysqli data object
I've just upgraded a site from CiviCRM 4.6.38 LTS to CiviCRM 5.7 because we upgraded the server to PHP 7.1.x. As a result 2, custom extensions are warning me because they used mysql\_real\_escape\_string().

PHP 7.1.x doesn't support mysql\_real\_escape\_string() so I need to change to mysqli\_real\_escape\_string() and pass my mysqli data object. The issue I have is that these extensions use the old PHP/MySQL connection as in:

```
$dao = CRM_Core_DAO::executeQuery($sql);

```

Is there some documentation I can use to quickly get up to speed on updating my code and acquiring a mysqli connection object?

# Answer
> 3 votes
CiviCRM has its own database abstraction layer that can handle the escaping for you, so you don't have to use low-level functions like `mysqli_real_escape_string`. You can use it in 2 ways:

1. Parameterize your query like this:

```
CRM_Core_DAO::executeQuery('SELECT * FROM civicrm_contact WHERE id = %1',
  [1 => [$id, 'Integer']]
);

```
2. Escape your variables beforehand with `CRM_Utils_Type::escape()`.

---
Tags: php
---


# Question
Title: What is the purpose of Contact Link in the Caldera forms activity processor?
I'm using the Activity Processor with Caldera forms.

At the bottom of the processor config page, there are three fields:

* Target Contact ID
* Source Contact ID
* Assignee Contact ID

Which make sense to me as ways to connect the activity to the other contacts in the form (or other contacts in CiviCRM).

But what is the purpose, if any, of the Contact Link field at the top of the page?

My best guesses are that either it is redundant and hard to remove, or that it serves some subtle purpose I am not aware of.

# Answer
The Contact Link at the top of the page serves as a form of *labeling* **and** as a way to **connect/link** other entities (processors) like an Activity to a Contact on the form.

It's purpose may become redundant in the future, but just to be replaced with Caldera Forms' magic tags (kinda like CiviMail tokens).

The link, and magic tags are a way to share and pass data/properties between processors or fields, they serve as a placeholder for later available data.

In Caldera Forms, the processors are processed/executed in the order they are added to the form (the order you see them in the Processor tab, from top to bottom).

A processor has three stages of processing:

1. `pre_processor`
2. `processor`
3. `post_processor`

*Most* processors in Caldera Forms CiviCRM do their *tasks* at `pre_processor` stage, and store their data in a transient object, the Contact processor would create a contact in CiviCRM and store it's result referenced by it's Contact Link so when the Activity processor is *processed* grabs it's necessary data from the *Linked Contact*.

Hope that gives a better picture on the Contact Link's purpose :)
> 3 votes

---
Tags: wordpress, caldera-forms
---


# Question
Title: Display both regular and discounted fees in events page
is there a way to display both regular and discounted fees in an event page?

I would want to put the regular price under our Early Bird price.

# Answer
For a no-coding solution, you can use a price set, and have the early-bird price options located just above their counterparts, but with the "Expire On" value set.
> 2 votes

---
Tags: civievent, price-sets, discounts
---


# Question
Title: Is there a way to update a partial refund for an event registration and associated contribution?
On 4.7.15

Tried to update a contribution record from Pending Refund to Completed (not integrated with accounting software)

Got "Cannot change contribution status from Pending refund to Completed" message

Customer registered on-line (we use Drupal) but made a selection error that requires a small refund. I was able to change selections from within Civi, and prices updated correctly. Now that the refund has been processed through Authorize.net, I want to update the Contribution record.

# Answer
> 4 votes
Try installing the Line Item Edit extension, then edit the line item.

# Answer
> 2 votes
I have discovered how to record a partial refund on registrations entered on-line as multiple registrations for the same organization.

Scenario: Secretary registered 5 people for full conference passes. Subsequently learned that 4 of them should have been 1-day passes. It happens that the record that the payment info is associated with is not one of the ones being changed.

What I did: I edited the four incorrect registrations clicking **Change Selections**, applying the correct discount code, making the correct selections, and clicking **Save**. All the **Participant Status** fields were changed by CiviCRM to *Pending Refund*. I did not click **Record Refund**, but observed that the **Fees** area was adjusting the total fees and indicating the difference from the Total Paid in the Balance column and the Status of the Contribution record for the payment had changed to *Pending Refund*. When I completed all the edits, I went to the event record for the payer, and clicked **Record Refund** and completed the **New Refund** form. It showed the correct Refund Due. I added in a *Fee Amount* because we add a processing fee for refunds. The *Net Amount* calculated correctly. All **Participant Status** fields were automatically updated to *Registered* and the status of the **Contribution** record for the registrations was updated to *Completed*, all the selection changes were recorded there, and the total fee was adjusted correctly. The only thing I don't see in the completed contribution and registration records is the actual refund amount, so I would record that in the contribution note field.

---
Tags: civievent, civicontribute
---


# Question
Title: How to safely restart Scheduled reminders
Recently scheduled reminders stopped working on a site.

on investigation of error logs I found that one reminder out of several was incrrectly configured. I deleted the reminder. The next time the scheduled reminder job ran, all went well but a backlog of 3 months of event reminders sent at the same time.

I've found a similar error on another site, and have disabled scheduled reminder task while investigating and deleting the incorrectly configured reminder.

before I turn the scheduled reminder task back on, how can I stop the backlog of old reminders from sending?

# Answer
> 7 votes
I have made the same mistake myself, more than once - ugh! To avoid emails being sent when a scheduled job needs to catch up on backlog:

1. Switch from **production to staging** mode
2. Manually execute the schedule reminders job - this will result in an activity being recorded on the participant's contact record, but will not send the email (the desired impact)
3. Switch back to production - the activities recorded on the participant's contact record will prevent schedule reminders being sent for the same events

Hope this helps!

Tamar

---
Tags: scheduled-reminders
---


# Question
Title: Multiple automatic discounts for memberships
So we have three membership levels - a 1 year, 2 year, and 3 year. The discount level for 1 year and 2 year are the same, but it is higher for the 3 year. I have the discounts for them set up the same way, except one applies to 1 and 2 year and the other applies to 3 year. However, only one is showing on our membership page. Is it a problem of there only being one allowed?

The point of the discount is that it automatically applies if the person still has a current membership. If it has expired, they are charged the full price.

The user that I am logged in as when looking at this membership page has the 3 year membership type.

Here's what I get on the membership renewal page, the setup for the 1 & 2 year discount, and the setup for the 3 year discount:

# Answer
I was able to reproduce the issue using the discount code configuration you provide in your screenshots and it appears that it has been reported to the developers of CiviDiscount here. So, bottom line is, your codes are set up correctly, but currently only one autodiscount can be applied per contribution or event page.

You may wish to offer funding in the same thread listed above if resolution of this issue is of high priority to you.

Hope this helps, Tamar
> 2 votes

# Answer
I've raised a PR on cividiscount extension https://github.com/civicrm/org.civicrm.module.cividiscount/pull/210 which fixes the similar use case. More details about the steps to replicate, etc in the PR description.

@jenni-simonis - Can you pls verify if it works for your case as well?

Thanks.
> 1 votes

---
Tags: civimember, cividiscount
---


# Question
Title: Caldera Forms (Wordpress) - Handling of Duplicate matching rules
Does anyone know what duplicate matching rules are applied when a contact registers on a website using Caldera Forms to capture the contact details? When using creating a profile in CiviCRM which can used accessed via shortcode in Wordpress to present the profile as form on your website, we can specify tell CiviCRM what to do when a duplicate match is encountered from these 3 options:

1. Issue warning and do not save
2. Update the matching contact
3. Allow duplicate contact to be created

I want to have the ability to do the same with Caldera Forms. In particular, I want to be able to allow a duplicate contact to be created for a specific use case for our organization.

# Answer
> 2 votes
Dedupe rules are set in the contact processor. If you want it to create a duplicate, create a dedupe rule in Civi that it can never satisfy. A dummy one basically :)

---
Tags: wordpress, duplicate-contacts, caldera-forms
---


title: Hook pre/post in pledge changed status

text:
# Question
Title: Hook pre/post in pledge changed status
On 5.6.0

* After create a pledge.
* If is created a new contribution that change the status of the pledge from "Pending" to "Completed" is not incoming in any hook\_civicrm\_post or hook\_civicrm\_pre with objectName equal to "Pledge" or "PledgePayment"

Which is the correct way to update the pledge programmatically?

# Answer
I see this line in `CRM_Contribute_BAO_Contribution`:

```
//update pledge and pledge payment, CRM-3961
CRM_Pledge_BAO_PledgePayment::resetPledgePayment($id);

```

Looking at `CRM_Pledge_BAO_PledgePayment::resetPledgePayment()`, I see it calls the DAO method, not the BAO - which is why the hooks (which ARE present) are bypassed.

I think this would be a good enhancement for core CiviCRM. `CRM_Pledge_BAO_PledgePayment::resetPledgePayment()` is a very short function, which could be easily refactored to instantiate the PledgePayment BAO instead of DAO, and call the `add()` or `create()` method instead of `commit()`. This would cause your hooks to fire.
> 2 votes

---
Tags: hooks, pledges, civipledge, status
---


# Question
Title: How to show contribution items in CiviReports for Contribution Reports
I have contribution items in a single contribution report and need to show a quantity of an item purchased in a month.

What is the ideal way to get quantity used for a month in multiple contributions.

I dont see the option for the same.

# Answer
> 1 votes
I believe what you are referring to are line items - if the contributions in question are event contributions, then you can use **Extended Report** \- "Participant Line Items" that will allow you to filter by event, otherwise, **Extended Report** \- "Contributions with Price Set Data" should also show you what you need- but it may take a bit of trial and error, i.e. the report offers several grouping options for line items:

* Price Field Label
* Price Field Value Label
* Line Item Financial Type
* Price Field (line item)
* Price Field Option (line item)

You'll want to select whatever option(s) you are grouping by as display columns as well as the following columns:

* Quantity
* Line Total
* Unit Price (if interesting)

E.g. Grouping by Price Field Option (line item) will yield the following:

Hope this helps! Tamar

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