# Question
Title: How to set super-user privileges in CiviCRM for MySQL? CiviCRM requesting for multilanguage support
I have properly installed CiviCRM 10.0, PHP version 7.2, in Joomla 3.6.5 on Linux shared hosting. Works perfectly!

Now that we have configure the Spanish language in Joomla and in CiviCRM set to "Yes" the inherit CMS language option, at the bottom of the page comes this note:

"In order to use this functionality, the installation's database user must have privileges to create triggers and views (in MySQL 5.0 – and in MySQL 5.1 if binary logging is enabled – this means the SUPER privilege). This install either does not seem to have the required privilege enabled. (Multilingual support currently cannot be enabled on installations with enabled logging.)"

Anyone knows where to check and how to set super-user privileges in CiviCRM for this particular issue?

# Answer
You need to ask your hosting provider to give the database user the permission to create triggers and views. You only need super privileges if you're on an old version of mysql. Since you say you're on shared hosting they may not want to give those privileges, but try asking.
> 1 votes

---
Tags: joomla, mysql
---


# Question
Title: After update, emails have to be written out in full html!
We updated CiviCRM and the next time I tried to email a contact, I found all the buttons to insert bold, hyperlinks etc. had disappeared and the only option seemed to type it all in manually, even including the `<p> </p>` at beginning and end of paragraphs! Same thing when I looked at the mass mailing function. Is this a bug, deliberate, or some weird problem that only we have? Many thanks

# Answer
> 1 votes
Using WordPress I had a problem where CiviCRM was installed on a subdomain and I to do a workround. See WYSIWYG editor not present with WordPress. This has to be redone when you upgrade. So possibly this is a solution?

# Answer
> 1 votes
Is there any chance that you have the extension "Grant Applications" enabled? I had a similar issue and found a conflict with this extension.

---
Tags: civimail, email, upgrade, ckeditor
---


title: QR Code for Event Participant

text:
# Question
Title: QR Code for Event Participant
I am thinking of creating an extension to integrate QR code for Event Participant

Do we any extension for QR code integrated already?

Thanks

# Answer
Yes there is an extension that adds QR code in participant email. But it updates the status when generated for participant.

https://civicrm.org/extensions/qr-code-checkin

Thanks

Pradeep
> 4 votes

---
Tags: civievent
---


# Question
Title: Using Webform CiviCRM for a contribution form and allow "on behalf of an organization"?
Drupal 7.63 Civi 5.4.1

We currently use a Civi Contribution Page for our donation form. However, I am looking at changing to using the Webform CiviCRM Integration module. However, our current Civi Page allows an organization donation using "On Behalf of".

But I do not see on behalf of in the webform options. But I can set the form to allow for Individual or Org contact type.

Any ideas how to do "On behalf of" or a simple way to have first option be Individual or Org and then display the proper Contact Form?

I have played with the Webform Node Element module (allows you to add a node as a webform component). But in order to use conditionals with it, you have to put the nodes (webform for individual and webform for orgs) into seperate fieldsets and show based on selection of Ind or Org question. Then because you have a full form within another form you have 2 Submit buttons. I can hide one with CSS but then I run into multi-page issues which seems to be required to process contributions.

I have also looked at the component keys for the Civi Contact components when set for Individual vs Org. I thought maybe they used a different key depending on if the form contact was individual or org. But that does not seem to be the case.

Any ideas out there of how to handle this?

# Answer
Instead of have 2 links in my menu to two different webforms, I made an image of a Yes Checkbox.

At the top of my form I added a Markup component and put in the following code

```
<label >This donation is from an organization </label><a href="/donate-org" style="text-decoration:none; color:#444;"><img src="sites/default/files/images/BoxYes.png " alt="Donate from an organizations here" style="width:49px !important;">

```

This still feels like it is part of the form to donors but it actual is a link to my other form.
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: How to build a Drupal webform for individual/organization contributors
Is there any recipe to build a Drupal webform with the possibility to choose to contribute as an individual or as an organization?

I have tried enabling contact 1 as individual, contact 2 as organization and enabling a contribution page.

But if I fill contact 1 data, contribution is recorded successfully. And if I fill contact 2 data no contribution is recorded. Seems that webform contribution is only associated to first contact.

There is some way or some trick to achieve this?

# Answer
> 4 votes
**Yes:** you can use Webform CiviCRM to make a Contribution of behalf of an Organization -\> make Contact 1: the Organization; and make Contact 2: the Individual;

**No:** you can not present this as a choice on the same webform - as the Contribution will be assigned to Contact 1; So: make a screen/page ahead of the webforms - with two nice buttons: "Contribute as Individual" "Contribute as Organization" -\> and then link these to two different webforms;

# Answer
> 1 votes
Instead of 2 links in my menu to two different webforms, I made an image of a Yes Checkbox.

At the top of my primary form (individual) I added a Markup component and put in the following code

```
<label >This donation is from an organization </label><a href="/donate-org" style="text-decoration:none; color:#444;"><img src="sites/default/files/images/BoxYes.png " alt="Donate from an organizations here" style="width:49px !important;">

```

This still feels like it is part of the form to donors but it actual is a link to my other form.

On my other form (organization) I did the same thing but pointed back to my individual form.

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


title: Transaction Date in Extended Report

text:
# Question
Title: Transaction Date in Extended Report
Using the "Bookkeeping with extra fields" template, I noticed I was occasionally missing some transactions whenever I filtered on Transaction Date. I believe the issue is caused by the filter using only the date and not the time.

For example, if today is February 10 and I filter Transaction Date on "Yesterday", the WHERE clause looks like:

> ( financial\_trxn.trxn\_date \>= '20190209') AND ( financial\_trxn.trxn\_date \<= '20190209' )

Any transaction that isn't exactly at midnight is lost. Comparing to the Date Received filter, it uses date and time:

> ( contribution.receive\_date \>= '20190209000000') AND ( contribution.receive\_date \<= '20190209235959' )

Perhaps I'm misinterpreting the use of the filters. I can run the same query directly, but with the time included for Transaction Date, and it seems to return the correct results.

* CiviCRM 5.10.0
* PHP 7.2.13
* MySQL 5.7.23
* Wordpress 5.0.3

EDIT - originally this Q referenced ExtendedReports 3.5 but turns out it was a core report

# Answer
The issue has been reported in https://lab.civicrm.org/dev/report/issues/7.
> 1 votes

---
Tags: civireport
---


# Question
Title: Manage Events fatal error after upgrading from 5.4 to 5.10
I am running Civi on Drupal. After upgrading from 5.4.0 to 5.10.0 I go to Manage Events page and get this:

Fatal error: Call to undefined method CRM\_Event\_BAO\_Event::getAllPermissions() in /home/tamera/www/dev/sites/all/modules/civicrm/CRM/Event/Page/ManageEvent.php on line 339

Any ideas?

# Answer
> 3 votes
I can see that the `getAllPermissions()` method is present, so if you're getting a "call to undefined method" error you very likely have either an extension or a customization that's overriding the file `<civiroot>/CRM/Event/BAO/Event.php`.

Turn on debugging and backtrace (**Administer menu » System Settings » Debugging and Error Handling**) and this error should become much more detailed. If you're not sure how to interpret the backtrace to find your customizations, you can edit your question to include the backtrace and someone will likely be able to help.

---
Tags: error, 5.10.x
---


# Question
Title: Unable to take Credit Card payment via PayPal after civi update
Normally take credit card payments via civi with no problems - update to 5.10.0 and since then have been unable to take CC payment - error message staing 'Date Received is a required field.'

Process to replicate

Go to a contact (Member) -select payment tab - click Submit Credit Card Payment - Select Membership dues - enter amount - ignore Campaign - complete rest and click submit -error saying Date Received is a required field.

This happens whether send receipt is ticked or not and even though all dates are completed.

joomla 3.9.2 - Civicrm 5.10.0

# Answer
@andygoodall thanks for posting this, we believe we have a fix for your issue, We are looking to conduct a point release for 5.10 to fix the issue however i would recommend if possible manually applying the change described in this PR
> 3 votes

# Answer
This is now fixed in 5.10.1...............
> 2 votes

---
Tags: civicontribute, paypal, user
---


# Question
Title: How can I add Option Group for custom data field in CiviCRM
I'm trying to create an option group for a custom data field. It needs to be a multi-select dropdown. How can I build in CiviCRM

Eg

```
<select>
  <optgroup label="Accommodations">
    <option value="Bed & Breakfasts">Bed & Breakfasts</option>
    <option value="Camping">Camping</option>
  </optgroup>
  <optgroup label="Arts & Crafts">
    <option value="Artisans">Artisans</option>
    <option value="Artists">Artists</option>
  </optgroup>
</select>

```

# Answer
Are you trying to add these in an extension? If so, see adding custom fields with civix which suggests creating them via the GUI then exporting them.
> 1 votes

---
Tags: custom-fields
---


# Question
Title: Reports show 4 warnings after upgrading from 5.4 to 5.10
I run Civi on Drupal. After upgrading from 5.4.0 to 5.10.0, any report I open shows 4 warnings at the top:

Warning: Illegal string offset 'attr' in HTML\_QuickForm\_advmultiselect-\>toHtml() (line 807 of /home/tamera/www/dev/sites/all/modules/civicrm/packages/HTML/QuickForm/advmultiselect.php).

Warning: Illegal string offset 'text' in HTML\_QuickForm\_advmultiselect-\>toHtml() (line 808 of /home/tamera/www/dev/sites/all/modules/civicrm/packages/HTML/QuickForm/advmultiselect.php).

Warning: Illegal string offset 'attr' in HTML\_QuickForm\_advmultiselect-\>toHtml() (line 821 of /home/tamera/www/dev/sites/all/modules/civicrm/packages/HTML/QuickForm/advmultiselect.php).

Warning: Illegal string offset 'text' in HTML\_QuickForm\_advmultiselect-\>toHtml() (line 822 of /home/tamera/www/dev/sites/all/modules/civicrm/packages/HTML/QuickForm/advmultiselect.php).

Any ideas?

# Answer
These are fields that have been phased out. Deleting these reports and creating them anew from the core report templates will have solved the problem.
> 1 votes

---
Tags: civireport, error, 5.10.x
---


title: Cron through cli.php

text:
# Question
Title: Cron through cli.php
I am trying to set up the cron job through the **cli.php method** following the CiviCRM Docs.

Running the command from my ssh session on the server as `www-data` user, I am getting the error:

> could not match userID and contactID

But neither the CiviCRM logs, nor the Drupal logs, nor the apache error log gives me any further hints on what this means.

I am running CiviCRM 5.9.1 on Drupal 8.6.9.

How can I solve this?

# Answer
I managed to find the solution. It seems the Drupal account used for the cron has to be synchronized with CiviCRM (to create its CiviCRM Contact) first before it can run.

Use the menu to trigger manual synchronization: `Administer -> Users and Permissions -> Synchronize Users to Contacts`.
> 2 votes

---
Tags: cron
---


# Question
Title: What is the best way to raise awareness of a extension upgrade that breaks core fuctionality, e.g. all the menus went away?
On Friday one of the extensions, summaryfields popped up showing there is an upgrade available. Well, for many, this upgrade causes all the civi menus to go away. So while people should never ever apply an upgrade to production without first doing it a test environment, it happens and they are left scrambling to resolve it, (disable the extension).

I'm pretty sure the folks who released the upgrade tested it and it worked in their environment, but apparently something got missed.

The question is when something like this happens what's the best way to alert people not apply this upgrade? Is there a way to "unpromote" it?

(An issue was raised in github for this last Friday.)

# Answer
> 3 votes
I'd like to build out more infrastructure for this.

I've started an Extension Compatibility List which so far has the ability to blacklist an obsolete extension (my original use-case was for merging an extension into core), but it could be extended to blacklist a version of an extension with known bugs or security flaws.

# Answer
> 0 votes
Maybe a blog post / mailing list announcement? I've seen this type of thing happen before both with civi and elsewhere, and there's been a blog post / mailing list announcement made. Here's one example: https://civicrm.org/blog/dave-greenberg/do-not-use-v42x-upgrades-using-drush-possible-data-loss

---
Tags: extension, upgrade, summaryfields
---


# Question
Title: CiviDiscount compatibility with CiviCRM 5.9
Is CiviDiscount compatible with CiviCRM 5.9? We can't make it work with a 5.9 install on Joomla 3.9.1. Thank you

**Edit:** The issue is when trying to access the CiviDiscount GUI (e.g. Administer \>\> CiviDiscount), the user is taken to CiviCRM dashboard/home instead of the CiviDiscount UI.

I'm using a user in the Super Admin user group so it's not permissions related.

Discounts in the front end (both autodiscounts and entering a discount code), e.g. in event registration, work fine, but we can't administer the discounts.

Our work-around is to do this in the d/b.

# Answer
Yes, CiviDiscount is compatible with CiviCRM 5.9.

I have a 5.9 environment with Drupal and is working as expected.

Your issue could possibly be permission related. CiviDiscount recently introduced a permission - administer CiviDiscount

Joomla permission documentation -

https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/#permissions-in-joomla

Would also advise to clear CiviCRM caches –

/administrator/?option=com\_civicrm&task=civicrm/clearcache

/administrator/?option=com\_civicrm&task=civicrm/admin/setting/updateConfigBackend&reset=1
> 4 votes

# Answer
Clearing caches brought it back for me.
> 0 votes

---
Tags: cividiscount
---


# Question
Title: Main menu disappears after updating Summary Fields extension under wordpress
I use latest civi 5.10.0 in Wordpress 5.0.3. Today I was warned to update Summary Fields to 4.0.0 version. After update the main menu disappeared from my civi installation. The Cleanup Caches and Update paths did not help.

Finally I can disable the extension, the menu appeared again and works correctly.

# Answer
> 0 votes
The developer released 4.0.2 which fixes the issue. It sounds like their test env possibly isn't getting all the caches or something flushed.

# Answer
> 3 votes
The developer updated the issue. There is a missing line in the code. They say they will release version 4.0.1 overnight. If you want to fix it yourself before that look at issue linked above in the comment.

# Answer
> 2 votes
Sadly the fix in 4.0.1 didn't fix the issue. See Navigation Menu Lost for more details.

---
Tags: wordpress, extension, summaryfields
---


title: Navigation Menu Lost

text:
# Question
Title: Navigation Menu Lost
I received an update alert in the "Summary Fields" plugin. The Admin Navigation Menu has disappeared after updating. Now I get an error when I tell you to disable the plugin. The problem is that it disables other plugins. But he's giving error to Summary Fields. There was no improvement in the problem I did with the cache and bus clearance. I'm using CiviCRM 5.9.1 when I do. I upgraded to 5.10.0, but the problem still has not improved. Joomla 3.9.2 CiviCRM 5.10.0

https://lab.civicrm.org/dev/joomla/issues/8

# Answer
> 3 votes
It's hard to tell which version of the summary fields you are having issues with but I'm guessing it's 4.0.1 which was suppose to fix the exact same issue with 4.0.0. It obviously doesn't. I filed another issue on github for the newest problem.

https://github.com/progressivetech/net.ourpowerbase.sumfields/issues/45

I think the fix is to change line 4 in sumfields.php

From: use CRM\_Myextension\_ExtensionUtil as E;

To: use CRM\_Sumfields\_ExtensionUtil as E;

# Answer
> 1 votes
They developer released 4.0.2 which should fix the issue. Sounds like they may have an issue with their test env.

---
Tags: extension, civicrm-home, menu, summaryfields
---


# Question
Title: After Upgrade to 5.10 unable to close Case
I get yellow screen with message as `One of parameters (value: 2019-02-13 00:25:00) is not of the type Timestamp` when i close the ongoing case. This use to work on 5.9.0 but recent upgrade to 5.10 stopped working. Any clue?

# Answer
Yes, this is a regression bug caused due to recent change to datetime on Activity forms. This is now fixed at PR#13497 and should be part of 5.11 release. You can either wait for 5.11 release or apply patch from here.

Thanks

Pradeep
> 2 votes

---
Tags: civicase
---


title: Data Security and Location

text:
# Question
Title: Data Security and Location
Does CiviCRM have servers located in Canada and can they assure Canadian clients that their data is stored only on those servers?

# Answer
Do you mean the "spark" product offered separately by CiviCRM?

You don't have to use spark you can download and install CiviCRM yourself with any hosting company. If you are looking for someone to set it up for you then take a look at https://civicrm.org/partners-contributors
> 1 votes

# Answer
My partner Alan Dixon and I host/store all our client CiviCRM instances/data on a number of private dedicated servers in Toronto and Montreal data centres and also work exclusively with partners/consults in Canada (i.e. we do not outsource to sub-contractors outside of Canada).
> 0 votes

---
Tags: location
---


# Question
Title: Why can users no longer update their own billing/credit card details in CiviCRM? Using iATS Payments
Payment processor objects can implement the CiviCRM Core method updateSubscriptionBillingInfo to implement payment-processor specific code to update card-on-file type information with the payment processor service, for recurring payments.

iATS Payments Extension did/does just that and thus allowed people to update their own billing/credit card details for recurring contributions. Why is this no longer working?

# Answer
> 2 votes
If you have been using this feature you may have noticed this is no longer working in higher 5.x versions of CiviCRM. This regression can be fixed with this solution (PR) which was posted here: https://github.com/civicrm/civicrm-core/pull/12668 \- unfortunately it was closed. If this feature is important to you - all you need is to add one-line of code (highlighted in green) to this file: CRM/Contribute/Form/UpdateBilling.php

**UPDATE:** As a work around, there's now a patch to the iATS extension which will ship with the next release. It's not a great solution, but easier for most people than patching core

---
Tags: civicontribute, iats
---


# Question
Title: How do I use the CiviCRM "spinner" in an extension?
My extension places a field on a page that loads data via AJAX from the database. The field appears blank until the data is loaded. How can I show the CiviCRM spinning logo if my data isn't loaded yet?

# Answer
You can add the class "crm-loading-element" to the element, and then in your ajax success handler remove the class.

If you want the actual CiviCRM logo, you can add both the classes "blockUI blockOverlay" instead, but depending on the field size it may look off. The other one seems to fit better.

If you want the screen to gray out the way some of the popups do, you can do:

`CRM.$.blockUI(CRM.$('div.something').addClass('blockUI').addClass('blockOverlay'));`

where div.something is just some larger div surrounding your form, but somewhere within div#crm-container, then your ajax success handler remove it with:

`CRM.$.unblockUI(CRM.$('div.something').removeClass('blockUI').removeClass('blockOverlay'));`
> 1 votes

---
Tags: extension, developer
---


title: Error on Event Registration Page

text:
# Question
Title: Error on Event Registration Page
We created and event without problem however once someone clicks the Register Now buttom on the page the following message is seen. I am running version 5.9.0

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to member your administrator or service provider with more details about what action you were performing when this occurred. You do not have permission to access this page.

Return to home page.

The full error trace is below please help.

```
**BACKTRACE**
#0 /var/www/html/sites/default/files/civicrm/ext/ca.bidon.reporterror/CRM/ReportError/Utils.php(31): reporterror_civicrm_generatereport("Jamaica Teachers Association", (Array:2), NULL, (Array:0))
#1 /var/www/html/sites/default/files/civicrm/ext/ca.bidon.reporterror/CRM/ReportError/Handler/FormsNoReferer.php(54): CRM_ReportError_Utils::sendReport((Array:2), (Array:0))
#2 /var/www/html/sites/default/files/civicrm/ext/ca.bidon.reporterror/reporterror.php(168): CRM_ReportError_Handler_FormsNoReferer::handler((Array:2), (Array:0))
#3 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(368): reporterror_civicrm_handler((Array:2))
#4 /var/www/html/sites/all/modules/civicrm/CRM/Event/Form/Registration.php(265): CRM_Core_Error::fatal("You do not have permission to access this page.")
#5 /var/www/html/sites/all/modules/civicrm/CRM/Event/Form/Registration/Register.php(107): CRM_Event_Form_Registration->preProcess()
#6 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(585): CRM_Event_Form_Registration_Register->preProcess()
#7 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#8 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Event_Form_Registration_Register), “display”)
#9 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Registration_Register), “display”)
#10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#11 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(309): CRM_Core_Controller->run((Array:3), NULL)
#12 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#13 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#14 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:3))
#15 /var/www/html/includes/menu.inc(527): civicrm_invoke("event", “register”)
#16 /var/www/html/index.php(21): menu_execute_active_handler()
#17 {main}

```

# Answer
From the error it looks like the user doesn't have necessary permission to access the page. You will need to give permission to user to register online.

Thanks

Pradeep
> 4 votes

# Answer
I eventually figured out the issue. First the problem was with fees and a setting in the contribution component namley "Automatically update related contributions when Membership Type is changed". Once this was selected the issue resolved. This seemed to have been added with later versions of civicrm
> 2 votes

---
Tags: civievent
---


# Question
Title: Mass update / import bulk email preferences?
So - here is the deal - we have an excel sheet with hundreds of contacts - with which email they would like set as bulk mail. While doing an import, I see no option to indicate bulk mail preferences - any suggestions?

Civi 5.10, Drupal 7

# Answer
The API CSV import extension using the email entity has a way to import these.

It looks like you can match on external ID.
> 2 votes

---
Tags: email, import, data-import
---


# Question
Title: Mosaico email template extension or Mailchimp email integration?
As a small NGO we are about to Upgrade CiviCRM from 4.1.3 to current version 5.9 (as at 18/01/19) and Migrate CiviCRM from Drupal 6.35 to WordPress CMS.

The two quotes we have offer Mosaico email template extension or Mailchimp email integration. Which woudl work best for an organisation sending out about 10-12 emails a year to 2-3,000 people? What are the pros and cons of each?

Many thanks Margaret

# Answer
> 5 votes
We recommend Mosaico so that all the data stays in CiviCRM. Has it been explained to you that Mosaico works as 'part' of civicrm not as a third party service and hence no 'integration' or 'charges'?

# Answer
> 1 votes
I'd say it depends on what budget you have for ongoing support and who you are hosting with. Mosaico version 1.x is no longer supported and version 2 and it's various dependencies are all at alpha or beta stage.
I love mosaico and it's well integrated but it can be complex to setup and maintain. CiviMail can be very demanding, in particular if you're on any kind of shared hosting and most of the development is focused around Drupal at present with Wordpress a bit of a poor cousin.
The mailchimp CiviCRM integration is stable, simple to setup and the templates are compatible with Mosaico if you decide to switch once it's a bit more stable.

---
Tags: evaluating-civicrm, mosaico, mailchimp
---


title: Is there a way to disable a contact?

text:
# Question
Title: Is there a way to disable a contact?
I am using CiviCRM 5.7.3.

Is it possible to disable a contact? For background, we receive a list of organizations and their program ID's so those applying for grant applications can choose those they are employed by. We have to keep the data in the system if the organization closes down, but I don't want people to be able to search for it in our forms. Is it possible to disable a contact so it cannot be searched? If not, does anyone have any recommendations on what I could do?

# Answer
When you delete contacts, by default they go into trash and don't completely disappear so you can still keep them. More info here https://docs.civicrm.org/user/en/latest/organising-your-data/contacts/#deleting-contacts
> 3 votes

# Answer
Can you use groups or tags? You did not say what CMS you are using or what form you are using to gather grant applications. But you may be able to create a group "Inactive" and add those orgs to that group. And then in your form select from *where not* Inactive. Or you might have to do the opposite. Select from "Active".
> 1 votes

---
Tags: contacts
---


# Question
Title: Searching for users by Total Contributions (CiviContribute, Drupal7)
I process donations on a third party site and would like to import these records to CiviContribute.

I've imported each donation as a separate contribution, e.g. Peter has made a donation on 14/01/19 for $500.00 and on 15/07/18 for $800.00. This is so I can track how many donations are made on average, whether donation sizes are increasing for donors who make multiple donations, etc.

I'd like to add all donors who have donated over $1000.00 in total, to a smart group so they can receive tailored email content. However when I do searches, it only shows users based on whether they have donated $1000.00 in one individual donation, not by their lifetime donations.

Does anyone know how I can do this?

# Answer
> 2 votes
There is also a "custom search" in CiviCRM called "Contribution Aggregate". This is a very simple search that has been around for a long time but it may be sufficient for your needs.

It can be used by navigating to \>\>Search \>\>Custom Searches \>\>Contribution Aggregate

# Answer
> 2 votes
If I read you right, I would recommend the Summary Fields extension which then lets you have a standard Custom Field for Total Contributions and you can build smart groups etc off that field.

(Note (Feb 2019) there has been very recent discussion about some blips with the latest release (https://civicrm.stackexchange.com/search?tab=newest&q=summary%20fields)

---
Tags: drupal, civicontribute, search
---


# Question
Title: Mosaico 1.1 - "Unexpected error talking to server" when saving template
Just installed Mosaico 1.1 for CiviCRM 5.7.2 on Drupal 7.

Tried to make a dummy template and hit the save button but received an error saying "Unexpected error talking to server - contact us!" It then cleared the image that I had inserted there.

(I followed the steps of 1) installing shoreditch, 2) installing flexmailer, 3) installing mosaico)

Any ideas on what to do?

Have tried asking on the Mosaico github and contacting the developers but no luck.

Cheers, Josh

# Answer
> 0 votes
We are using Mosaico 2.x for more than a year (currently Version 2.0-beta4) succesfully and without problems. I strongly recommend you use version 2. See Mark Mosaico 2 stable for more info.

---
Tags: drupal, mosaico
---


# Question
Title: How to hide old contacts from default search? (best practices for old contacts)
Deleting contacts causes problems because it removes their contribution records.

At the same time we don't want old contacts to show up unless they are explicitly requested (such as when searching for deleted contacts).

**Is there any way to hide old contacts and exclude them from all queries?** I know how to do this with advanced searches, but I don't want my basic user to have to deal with this.

Are there other ways to deal with old contacts and keep the database from becoming bloated?

I appreciate any help.

# Answer
> 6 votes
CiviCRM has a "trash" feature which flags contact records as trash without actually deleting them. Contacts with the flag set to 1 are excluded from most reports, etc.

Their contributions, etc., will not be deleted but may be hidden from reports and interfaces as well. That may or may not be what you want. If you wish to see all the contributions, I don't think there is anything you can do without writing code to deal with most interfaces, but a lot of the reports have a filter to show/hide contributions from trashed contacts.

You can toggle this feature under Administer \> System Settings \> Misc, and there's a CMS-level permission "CiviCRM: access deleted contacts" that controls which users can see trashed contacts.

All said, I'm not sure that deleting or trashing contacts is the appropriate solution. It seems rather drastic to delete contacts for the purposes of returning manageable result sets. A better solution might be to hire a CiviCRM partner to build a custom search interface that better suits your needs. Or, a low-cost approach that occurs to me is to use your advanced-search know-how to build a Smart Group of current contacts as defined by you, then train collaborators to run their searches within this group.

# Answer
> 3 votes
You could create a custom field for all contacts called "Status" with options of Active and Archived. That will give you the selection you need in most places to easily include / exclude the appropriate contacts, especially on many reports and Advanced Searches. Then create two smart groups - Active and Archived - which include the appropriate contacts, and that will make the selection easier in most other places. Depending on the size of the database, how often you are rebuilding the smart group cache, and your host, you could take a hit on performance, so you have to use your judgement there.

This isn't transparent to users, but at least it's easily understood and it's simple - if they are Archived, check the field on the contact record. This gives you the flexibility of including the Archived contacts' contributions, event attendances, etc, when you want to compare numbers across years, but excluding them easily when creating current communications, etc.

The other thing I like about this is that it makes keeping the database up to date everyone's responsibility in real time on a going forward basis. There are going to be even basic users who learn of a contact that leaves an organization, or moves away, etc. This gives them the ability (and hopefully the responsibility) to mark that contact as Archived in the database as soon as they get the information, instead of waiting to tell someone, or for it to be caught the next time six months from now when someone goes through the database to find the Archived contacts.

# Answer
> 3 votes
I have an extension called Constituents Only that provides this functionality. It repurposes the "Do Not Trade" checkbox as an "Exclude from Search" checkbox. Non-searchable contacts are primarily accessible via the relationships tab to other contacts.

I have a version 2.0 (which I haven't found time to make public yet) that will return the related contact when searching - that is, if "Jane Doe" is searchable and her spouse "John Doe" is not, searching for "John" will return `Jane Doe (John Doe)`. It also adds a checkbox to Advanced Search to search unsearchable contacts. However, this isn't quite what you're asking for, and version 1.0 is. I hope to release a new version at some point which toggles the behavior between the 1.0 and 2.0 versions, but incorporates newer features like the "search unsearchable contacts" checkbox.

# Answer
> 1 votes
Here's a kind of wacky idea that might work for you: modify the contact type field in the civicrm\_contact table to allow a new 'Archived' value in the enum list. Then run an occasional cron that converts Individual contact types to Archived contact types if they're "old" by whatever criteria you have. CiviCRM will ignore these contact records pretty much in every normal search/report. Or it might break something ... best to try this out on a test copy first. You'll still be able to access information in these records, using views, for example, if you're using Drupal.

# Answer
> 0 votes
Or you can also create a Report filtered on not-old contacts (as a Smart Group, for instance)

---
Tags: contacts, core
---


# Question
Title: How to send confirmation when importing contributions
When importing contributions, on the 2nd page where CSV columns are linked to database fields, there is no field "send a confirmation". Is there a way to add this field (and generate a confirmation after import)? Or do we have the use another method?

# Answer
Confirmation sending can't directly from import. There ARE ways to do it, but it slows down the import considerably, so I'd recommend doing it separately. Here are your options:

### Bulk confirmation

* When importing, have an easy way to search for the contributions that were just imported. Perhaps that's already possible because of your data. If not, add a custom field "Needs confirmation" to your data, and populate that.
* Using **Find Contributions**, find the contributions you just imported.
* From the **Actions** menu, select **Receipts - print or email** and send confirmations as per the manual receipts documentation.

You could also use CiviRules, but as I started to document the process I realized how complicated that would be - I definitely think the bulk confirmation above is the way to go.
> 4 votes

---
Tags: contributions, import
---


title: Adding a Privacy Option

text:
# Question
Title: Adding a Privacy Option
For the contact field Communication Preferences\> Privacy

How difficult would it be to add a new option "Do Not Voicemail"

One of our clients is a counselling service. So this would be useful for them.

They have a stopgap solution usign other custom data fields- but this is in a separate section of the record to the communications info.

What is the process for making requests for this kind of amendment in core?

Is anyone able to pitch a rough cost?

Would this feature be useful to anyone else?

If I can get the client's approval I can look at the Make It Happen process.

# Answer
You could do this fairly easily with the Contact Layout Editor extension (assuming you're on CiviCRM 5.x).

* Use the extension to remove the existing Communication Preferences block from the Summary page.
* Build a custom block that includes the normal communication preferences fields plus "Do Not Voicemail".
* You'll probably want to remove "Do Not Voicemail" from the custom field block in a similar manner so it doesn't appear twice.
> 4 votes

---
Tags: contacts, privacy
---


# Question
Title: Extension settings lost on upgrade - known issue?
On a couple of my own extensions and some that are not my own, I've seen that the extension settings go missing immediately upon upgrading the extension. These extensions all define settings metadata in a php file *a la* hook\_civicrm\_alterSettingsFolders() (e.g. https://github.com/twomice/com.joineryhq.activityical/issues/27)

It's not just that the setting values are cleared; rather, the settings themselves are uknown to CiviCRM. This is evident when viewing the Settings page for the extension; if that extension settings page is built dynamically using the Settings API to build the list of settings fields for that form, the form will contain no fields at all, because the Settings API finds no settings.

The workaround for this situation is to clear CiviCRM caches (e.g., run `cv flush` or use Administer \> System Settings \> Cleanup Caches and Update Paths). After doing that, the settings are once again available, although unfortunately their values have been cleared and must be reset.

Extensions where I've seen this recently:

Is anyone else seeing similar behavior, and are you aware of a cause, a fix, or something extension devs can do to avoid this issue?

# Answer
> 0 votes
This is a known issue with a fix in the works - see Github PR#13551.

# Answer
> 0 votes
I have not experienced this yet @twomice. I tend to use `Civi::settings()->set` as well in my upgrader and/or config file in my extension too, perhaps that might help?

---
Tags: extension, settings, cache
---


# Question
Title: Anyone else seeing an overlapping admin/civi menu bug with Joomla 3.8.13 and CiviCRM 5.6.0?
After an upgrade to Joomla 3.8.13 and Civi 5.6.0 the Joomla admin menu dropdown is stacking under the Civi menu. I can't reproduce on https://joomla.demo.civicrm.org as even if the versions weren't 3812 and 560, the Joomla admin menu isn't long enough.

# Answer
> 3 votes
I can confirm that restoring the z-index that was removed in root/administrator/components/com\_civicrm/civicrm/css/joomla.css corrects this issue. The rest of the removed code makes no difference. This works for me:

```
ul#civicrm-menu {
z-index: 1;
position: relative;}

```

# Answer
> 3 votes
There was a commit that fixed css for shoreditch theme probably that might have caused the regression in Joomla. Can you try to replace the code from the commit and see if it works? If so I can file a issue and submit the patch for regression.

# Answer
> 0 votes
I checked my joomla.css and the z-index lines are already there but i still can't see the administrator menu any more:

text-align:left; }

/\* Joomla Admin Menu alterations */ /* Moved from civicrm.css in v3.2 \*/

ul#civicrm-menu { position:relative; z-index: 1; }

div#toolbar-box div.m { padding: 0px !important;

Anything else I can try please?

---
Tags: menu, css
---


title: How to force a field to be mandatory?

text:
# Question
Title: How to force a field to be mandatory?
I want to make it so that all new contacts *must have* a contact type. I have found where the contact type is in the templates, and have managed to add the wee * besides it, but I am struggling to find what tag or code I need to add to make it be an actual mandatory field. Is there some way of doing this?

# Answer
Welcome to SE, You can set contact type mandatory by using hook\_civicrm\_buildForm something like below

```
function extension_civicrm_buildForm($formName, &$form) {
  if ('CRM_Contact_Form_Contact' == $formName
    && !($form->getVar('_action') & CRM_Core_Action::DELETE)
  ) {
    $form->addRule('contact_sub_type',  ts('This field is required.'), 'required');
  }
}

```

HTH

Pradeep
> 3 votes

---
Tags: templates, user, custom-templates
---


# Question
Title: Hide CiviCRM navigation menu based on permission
Any suggestions for a not-too-hacky way to hide the whole CiviCRM top navigation menu for users who don't have a particular permission? I could load some menu-hiding css or js conditional on permissions, maybe in Civi pageRun+buildForm hooks or Drupal preprocess\_page hook - but that feels hacky.

CiviCRM 4.6, Drupal 7.

# Answer
> 2 votes
There's a CiviCRM navigation hook that you could use in an extension *but*...

To me this is the wrong approach. Hiding the menu does not stop users from accessing those pages or using the API via JavaScript.

# Answer
> 1 votes
Can this be done with Drupal user permissions (/admin/people/permissions) and roles? Our organization has a few staff users with varying levels of access; the "CiviCRM: access CiviCRM" permission is what gives users access to the top menu and the API, AFAIK. I've only given that permission to staffers who need full access, and i built custom menu blocks to give partial functionality to other staffers.

So, I have a Member Relations ACL role that has the "Access CiviCRM" permission, and then other ACL roles that don't have that but are enabled on some subcomponents. We're Drupal 7/Civi 4.7.4 right now and this approach has been working for us since 4.4.x. The permissions for Civi are pretty granular and there may be a way to accomplish what you need without writing module code.

# Answer
> 1 votes
I know this is an older post but I was looking to do something very similar and it took me a while to figure it out - so I'm sharing in case someone else finds it useful.

I did use the hook\_civicrm\_navigationMenu. But most of the documentation surrounded how to add something, not remove it. I used the unset function (just like it is used in the hook\_civicrm\_tabset). The only tricky part is adding the right references to hide the correct menu. For me, I wanted to hide the Mailings menu for 'uncertain' users as @davejenx describes them.

```
// identify id of Mailings menu in $params array
$mailingsmenuID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Mailings', 'id', 'label');
// remove the menu
unset($params[$mailingsmenuID]);

```

---
Tags: menu
---


# Question
Title: Activity list is not showing in contacts after upgrade to latest civicrm 5.9.1
Activity list is not showing in contacts after upgrade to latest civicrm 5.9.1

I enable SQL debugging and its shows last query: SELECT COUNT(DISTINCT(tbl.activity\_id)) as count FROM ( SELECT civicrm\_activity.id as activity\_id from civicrm\_activity left join civicrm\_option\_value on civicrm\_activity.activity\_type\_id = civicrm\_option\_value.value left join civicrm\_option\_group on civicrm\_option\_group.id = civicrm\_option\_value.option\_group\_id INNER JOIN civicrm\_activity\_contact ac ON ac.activity\_id = civicrm\_activity.id INNER JOIN civicrm\_contact contact ON ac.contact\_id = contact.id where ac.contact\_id = 40023 AND civicrm\_option\_group.name = 'activity\_type' AND civicrm\_activity.is\_deleted = 0 AND civicrm\_activity.is\_current\_revision = 1 AND civicrm\_activity.is\_test= 0 AND ( civicrm\_option\_value.component\_id IS NULL OR civicrm\_option\_value.component\_id IN ( 1,2,4,5,6,8,9 ) ) ) as tbl LEFT JOIN civicrm\_case\_activity ON ( civicrm\_case\_activity.activity\_id = tbl.activity\_id ) WHERE civicrm\_case\_activity.id IS NULL;

Which means it return only count of activity not the list.

# Answer
> 1 votes
I would suggest that you try clearing the cache first of all to see if that helps. You can do this by deleting the files in the `templates_c` folder. The location of this will depend on your CMS. You can find more details in the documentation on upgrades.

If that doesn't help please edit you question to provide some more detail (including which CMS you are using).

---
Tags: contacts, activities
---


# Question
Title: Send metadata to stripe payment processor
I would like to send the financial type to stripe as a metadata.

The API instructions are here: https://stripe.com/blog/adding-context-with-metadata

I just don't know where to modify Stripe extension to add this functionnality.

Thanks.

# Answer
You could start a feature request on the Stripe-CiviCRM project page on Github, and ask for guidance there.
> 1 votes

# Answer
I’m also wanting to do this.

Could it be possible to use the alterPaymentProcessorParams hook to add metadata to the Stripe request?
> 1 votes

---
Tags: api, payment-processor, stripe
---


# Question
Title: CiviCRM report for Case activities listing Case data
I would like to generate an Activities report (eg upcoming scheduled activities) which includes case data (eg case ID, case Subject, case Role contacts, case custom fields) of the case to which each listed activity relates. Is there an 'approved' way of doing this? Thanks.

# Answer
Are you using drupal? You might get what you want with a drupal view.

The "extended report" extension (https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport) has a case pivot report where you can filter on activity date for example. It might get you close.

A sideways thought: You mention upcoming scheduled so I assume there is a further end use for this report, which might be achievable other ways. For example scheduled reminders or civirules might be able to give advance notice when certain conditions are met.
> 1 votes

---
Tags: custom-fields, civireport, civicase, activities
---


# Question
Title: How to increase the number of participants registered in single transaction
currently the system limit to 10 registrations (including oneself) for a single email. Can we increase the number? if so, how? Thanks.

# Answer
According to this the functionality is in core code, not that I have noticed it, but also it is possible that it only works to reduce the number below 10.

If you are not wanting to capture info details for all the Additional Particants then you should be able to do this via a Price Set field iirc.
> 1 votes

---
Tags: civievent
---


# Question
Title: How can I adjust the fonts and layout of PDF reports?
I have managed to clean up the display of membership lists (civireport) to the satisfaction of our users by linking a CSS file to the report header, but I do not find how to adjust the font and layout of generated PDF (is that even possible?)

# Answer
The PDF generator uses the HTML to create the PDF. So changing CSS will have effect. But.. to have a different font in the PDF, the font should be available on the server. If the font is not available on the server (and the pdf generator) then a fall-back font is used.

Here's some more info about DOMPDF (the tool CiviCRM is using for creating PDF's):

1. https://stackoverflow.com/questions/12581156/custom-fonts-for-dompdf
2. https://github.com/dompdf/dompdf/wiki/About-Fonts-and-Character-Encoding
> 2 votes

# Answer
Did you look at print.css? It is in the civicrm/css folder.
> 2 votes

# Answer
You need to use inline css. I think it has something to do with Civi using mail framework to generate its templates.
> 0 votes

---
Tags: civireport, pdf
---


# Question
Title: CiviCRM and WordPress on different hosts?
I'm considering getting started with CiviCRM. I have a website with WordPress on a hosting provider that doesn't cater to CiviCRM. Do CiviCRM and WordPress need to be on the same web host in order for integrations to work properly?

I found some documentation on this here, which makes it look like I can run CiviCRM on a subdomain, but it seems that this doesn't integrate as well. Can someone elaborate on how this is different than running them on the same server?

# Answer
> 3 votes
There are multiple ways to do integration with CiviCRM.

### CiviCRM and WordPress on the same server.

There are certainly benefits that come with hosting CiviCRM and WordPress together. Those benefits are a distinguishing feature compared to other CRMs that often lead folks to pick CiviCRM. For instance, using Caldera Form-CiviCRM integration, or the CiviEvent widget. Donation, membership and event signups automatically inherit your site's theme. A shared login system.

### CiviCRM and WordPress on different servers

Many folks choose to keep their website and CRM separate. Sometimes the CRM contains data that necessitates higher security. Sometimes a parent organization offers CiviCRM to its branch offices, who wish to maintain their own website but use CiviCRM.

You can still do a good amount of integration. There is Remoteform to do remote event/donation pages and email signups remotely (though not yet with 100% of features of a same-site page). Contact Form 7 CiviCRM integration allows remote form submission. I have a proposal in to synchronize events from CiviCRM to a remote (or local) WordPress site running Event Calendar Pro which I would release publicly if funded. However, there's no denying these are more advanced configurations which are more difficult to set up.

### The short answer

Ultimately CiviCRM requires a CMS, even as a "shell" to manage users. If you're going to go with a host capable of running CiviCRM anyway, there's no reason not to switch your WordPress site to that same server and likely save a few bucks by canceling that hosting.

# Answer
> 2 votes
It depends on what you mean with integration of your Wordpress website and CiviCRM. At the moment it is possible to have civicrm on a separate host with integration of Contact Form 7 (https://wordpress.org/plugins/contact-form-7-civicrm-integration/). Meaning that forms submitted with Contact Form 7 are submitted to the remote CiviCRM by wordpress.

There is a blog describing how this works: https://civicrm.org/blog/erikhommel/send-wordpress-contact-form-7-data-to-civicrm-with-api This blog post is a bit outdated because it describes that we have developed a custom API at the CiviCRM end. This custom API is not needed anymore, instead you could use the Form Processor extension (https://civicrm.org/extensions/form-processor). With the form processor extension you could handle what needs to be done with the data submitted by an external form.

There is no plugin (yet) for displaying data from CiviCRM in Wordpress. Work is in progress on that but not sure when it will be ready. Because we (CiviCooP) have no funding for it and we are doing this in our time as a contribution to the civicrm community.

# Answer
> 1 votes
CviCRM works as a plug-in to CMSs such as WordPress, Drupal, Joomla. There would be big issues with permissioning, logging in and all sorts of badness. You might be able to use external HTML snippets, but I wonder what the point would be. If you think about it, if you had to host CiviCRM on another server, you would still need WordPress, Joomla or Drupal to run it. There is no standalone version. So you might as well change your server provider and have them both running on the same server?

# Answer
> 0 votes
> I have a website with WordPress on a hosting provider that doesn't cater to CiviCRM. Do CiviCRM and WordPress need to be on the same web host in order for integrations to work properly?

Yes, to get the full range of integration your website and CiviCRM need to be on the same WordPress system. If your current hosting provider cannot support CiviCRM then migrate your website to one that does and add CiviCRM.

However ... it depends what integration you actually need between your website and CiviCRM. You can run them on separate systems and integrate specific features as Jon & Jaap have described.

It might be worth contacting a partner to talk through what you want to do so that you start off in the right direction.

---
Tags: wordpress, hosting
---


# Question
Title: Allow only existing CiviCRM contacts to create own Drupal account
We're building a site which will have certain content pages accessible only to logged in Drupal users.

I'd like users to be able to create their own Drupal accounts with access to those pages, but only those who have been pre-approved, who exist as contacts in CiviCRM, and are part of a 'web site users' group.

What's the best way to do this?

# Answer
A couple of thoughts.

If you want this to be a response to an action - eg you folk send out a mailing - then you can do this via a webform - send out a link with checksum to a webform and upon submitting the webform you can trigger Drupal Rules (we usually do this by giving them a civicrm Tag) and this can also instantly log them in

If you want to do this as a self-service then I would probably be adding a wee form for folk to say 'send me a login link', they enter their email, it sends them a checksum and then you do the above approach of another webform.
> 1 votes

# Answer
I operate a similar system.

Thing to do is either A) create the contacts in Drupal manually or B) write a code thing (scheduled task / hook etc) which, upon them being approved in some way (e.g. added to the Group) creates an account in Drupal and mails them the details.
> 1 votes

# Answer
I wrote a plugin for Joomla that does this - it integrates into the Joomla account registration process and requires new accounts to match a CiviCRM record. Probably wouldn't be hard to create a Drupal version using the same approach.
> 0 votes

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


# Question
Title: Personalize workflow message "Contributions - Receipt (on-line)"
Using the action "Confirmation receipt - print or email" in a list of contributions, the message sent to the donateur seems to be "Contributions - Receipt (on-line)".

When adding manually a contribution and checking the "Automatically send a confirmation?" button, the workflow message is "Contributions - Receipt (off-line)".

We personalized the "off-line" message. How to copy this to the "on-line" message? Simply copy and paste does not give a good result. Other form/database values are used.

# Answer
You can't just copy it to the on-line message. You will need to start with the current on-line message and customise it in the same way that you did the off-line one. Those are awkward templates to work with but if you just make small changes you should be ok.
> 1 votes

---
Tags: civicontribute, system-workflow-messages
---


# Question
Title: Case Dashboard- Cases with upcoming activities and Cases with recently performed activities lists show empty
In the case dashboard (D7, Civi 5.8.2)

The lists of cases with recently performed or upcoming activities are showing no results

Even though I know there are cases that meet the criteria.

Additionally the find cases results list is not showing any links under Most Recent or Next Scheduled

I think this is a local issue. I had a problem with the site yesterday and restored to overnight backup.

Looks like no data is lost, but these activities aren't showing

**UPDATE** My colleague has found 2 SQL views upcoming and most recent activities. Which were not rebuilt during the back up process.

Waiting for confirmation from client all is as expected. Will post more details as an answer later.

# Answer
It looks like Case creates 2 SQL views

civicrm\_view\_case\_activity\_upcoming civicrm\_view\_case\_activity\_recent

And in case dashboard/ find case results- these views are called on to provide upcoming and recent activity data.

When the database was restored from backup. These views had been emptied. And upcoming/ most recent activity data was showing as empty on the dashboards.

A colleague found some related SQL commands in public\_html/sites/all/modules/civicrm/CRM/Case/BAO/Case.php function createCaseViewsQuery line 3057

And by running the related SQL Query was able to repopulate the views. These now automatically repopulate each time an activity is added.
> 3 votes

---
Tags: civicase
---


# Question
Title: is it possible to merge duplicate event locations?
Multiple events have taken place at the same location, but there are multiple listings of the same location. Is it possible to merge these locations without losing any of the data from the events?

On CiviCRM 5.3.1.

# Answer
> 2 votes
Location details for events are stored in a sql table called civicrm\_loc\_block which brings together an address an email and a phone number for each event.

At a push you could identify the affected events and update them so they all share the same loc\_block id. But that would need to be done by querying/updating the SQL tables.

Basically, there isn't a function to address this in the user interface.

---
Tags: civievent, duplicate-contacts, location
---


# Question
Title: Assigning case role to contact in webform- not updating as expected
I've been trying to update a case webform so that form contacts are assigned to a given role.

I had expected that by creating roles under relationship types and then including the role in the case type settings in Civi, that the webform case tab would automatically update to offer the new roles for allocation.

It isn't doing this. Options available in webform

Options allocated in case type

Currently using civi 5.3.1 with webfromcivicrm 4.2.26

Have got this working on another site using civi 5.8.2 and webformcivicrm 4.2.24

# Answer
> 2 votes
Rephrased my search and found this question What determines the suite of Case Roles presented for assignment on the CIVICRM Webform Case Tab?

1st answer talks about relationship names/labels not matching

Newer version of create relationship only allows user to set relationship label. name is auto generated

In this case "Other Professional is". The relationship was assigned the name "Other\_Professional\_is"

Editting the relationship name to "Other Professional is", meant that it showed in the case roles.

Don't know if this level of tinkering will have knock on effects anywhere else.

---
Tags: webform-civicrm, civicase, relationships
---


title: Define CIVICRM_LOGGING_DSN in PHP?

text:
# Question
Title: Define CIVICRM_LOGGING_DSN in PHP?
Is it possible to use PHP to define the CIVICRM\_LOGGING\_DSN setting located in civicrm.settings.php? We are using Drupal.

I have successfully used the following to change some settings before:

`Civi::settings()->set('customPHPPathDir', "$root/CustomPHP/");`

Thanks for any help!

# Answer
It's not a setting you can set with Civi::settings. You can set it with a define() anywhere outside of civicrm.settings.php, but it would need to run that section in your file before running the code where it gets used, so somewhere pretty early in a page run. It always falls back to CIVICRM\_DSN if CIVICRM\_LOGGING\_DSN is not set, if your setting runs too late.
> 1 votes

---
Tags: civicrm.settings.php, drush, aegir
---


# Question
Title: How do I get the External ID to appear in my contacts through Webform?
On the CiviCRM Webform Integration, I setup the External ID to appear as a textfield. Once the form is submitted, the External ID is captured in Webform, but not in the CiviCRM contacts. Is this a bug or is my settings incorrect?

# Answer
I just ran into this very same issue today. I need to create/generate External IDs: First two digits of First Name + First two digits of Last Name + Date of Birth -\> so e.g. COCR16091970

This is easily generated with some Javascript on an Intake Webform CiviCRM form. It can however not be passed into a View and does not want to store in CiviCRM as it does not get submitted - likely on purpose because of the reasons/words of caution above by Xavier.

The only solution is to Create a Custom Data Set/ Field -\> myID - populate that with Javascript to generate unique IDs like COCR16091970 and then you can do what you want to do and store it in CiviCRM. I think that's the easier and safer way to do it. If we were to make Edits to Webform CiviCRM to allow External Identifier to be written to CiviCRM from a Webform it would be easy for admins to unintentionally create issues for down the road.
> 1 votes

# Answer
so your aim is to let the end user change the external id directly?

It has several constraints (eg. it has to be unique) that made me wonder if you wouldn't be safer to create a custom field to store whatever you intend to put into the external id.

External id is a fairly technical field that I would not expose directly to the user, both to avoid consistency problems and privacy leakage.

Eg. if you are using it to store the id from another system (say a membership id), it would be fairly easy to check if a specific member id is already registered in the database: try to create or update the webform with that id. If you have an error, it means the id is already registered in the database.

With a custom field, you wouldn't have that constraint of being unique.
> 5 votes

---
Tags: webform-civicrm, external-id
---


# Question
Title: Price Set Total Amount not displaying and JS errors
I have a Jooma 3.8.13 civicrm 5.5.1 install. I am using a price set on a membership contribution page, but the total amount is not displaying. All works fine on test drive but on the live page no total amount is displayed at all, either initially or when any items from the price set are chosen. Changing templates makes no difference, same issue on joomla default templates. The price total calculation is working as when contribution is confirmed the next pages shows the correct amounts. I know that the total amount is calculated using javascript. And I am seeing JS errors on browser console. I did the usual - Directory path in CiviCRM/Resource URL/Cleanup CiviCRM Cache

# Answer
CiviCRM Resource URL - long standing bug in Joomla version, still in civi 5.9.0. Replace \[civicrm.root\] with absolute URL.
> 1 votes

---
Tags: civicontribute, joomla, contribution-page, price-sets
---


title: How do relationships become disabled?

text:
# Question
Title: How do relationships become disabled?
I don't make use of the end date in relationships. I only ever explicitly create relationships. And yet I'm aware that there are a significant number of Inactive Relationships in my system. How do these relationships become inactive? It's not a result of manual intervention, so it must be happening programmatically as a result of some other action that is being taken.

I'd love to know what's going on.

# Answer
I do know there is a cron job (Disable expired relationships (Daily)) that inactivates relationships when the end date is in the past. That might be active in your environment, but you state that there are no end dates? Did you not have any in the past either? And is this scheduled job active on your installation?

Another cause might be the employer/employee relationship when you remove the employer from the contact summary?
> 2 votes

# Answer
The default action is that the latest employer becomes the active and current employer and the former employer becomes inactive. This occurs because this is what typically people want to happen. As a user registering for an event in 2017, I put my employer as Alphabet, but in 2019, I register for an event, and put my employer is Microsoft, CiviCRM assumes that I changed employers and no longer work for Alphabet.

Unfortunately there isn't a way to my knowledge to stop this from happening or to limit its scope. But it is easy to reactivate any inactive relationships - just becomes an extra step.
> 2 votes

# Answer
CiviCRM also does "employer relationship magic" if a postal address is shared with another contact. If you share an address with it will create an employer relationship and disable any existing one.

IMHO this does not make sense but unfortunately it is kind of deeply integrated with the core code. We had to disable/adapt this function for a customer - anyone interested can have a look here.
> 2 votes

---
Tags: relationships
---


title: Adding Sub-Options of Custom Data

text:
# Question
Title: Adding Sub-Options of Custom Data
Maybe I didn't know, but I didn't know. I need to add a sub-option to private recipients. I can explain this with an example.

Suppose you have an option. When I make a choice here, there must be sub-options that are optional in this option.

### Apple

- White Apple
- Green apple
- Red Apple

### Pear
- White Pear
- Green Pear
- Red Pear

Joomla 3.9.3 CiviCRM 5.10.2

# Answer
> 4 votes
As far as I know you can not create (sub)options depending on the value of a (top) option in core CiviCRM. So that would mean you would have to develop a little extension that does this?

As far as the county stuff goes, is that an unrelated question? If so can you please make it separate as it will be impossible to find if others experience the same issue.

# Answer
> 2 votes
re: custom data sub options: You can do that with tags and tag sets, but they would be applicable to all contacts not given sub types

https://docs.civicrm.org/user/en/latest/organising-your-data/groups-and-tags/

It will probably make life easier if you ask the country/ province/ state question on a separate post

---
Tags: joomla, civicrm-home
---


# Question
Title: In Civicase - reports ignore 'Order' on 'Status' and use status id instead?
When I run a Civicase report and request it to be sorted by 'Status' the sort order comes out according to the id of the status record (ORDER BY case\_civireport.status\_id). Whereas I have updated the 'order' field on the case status admin and believe the report should use that 'order', not the row id.

Can anyone confirm this? Might it be classed a bug?

I have tried it on https://dmaster.demo.civicrm.org and can confirm that changing the order in Administer-\>CiviCase-\>Case Statuses has no effect on the report ordering.

Thanks.

# Answer
There is a "weight" field and a "value" field for each status. Changing the ordering on the admin pages changes the weight. Changing the "value" will correspond to status\_id, but be careful about that - I'm not sure if it will autoupdate your existing data, i.e. if the **value** of "Completed" is "2" and you change it to "7", you might still have data in the system that has "2" stored and so it won't represent Completed anymore. You would then need to update civicrm\_case.status\_id in the database to match. Make a backup first if you're going to try that!

Weight is used for ordering in dropdown lists and such.
> 1 votes

---
Tags: civicase
---


title: multiple price sets?

text:
# Question
Title: multiple price sets?
I need to use 2 price sets on a membership page. The first is for National membership and has several options, mostly concerning the publications delivered with the membership level. This National membership is required. The second price set is for local chapter membership and members could select none, one or several. Each local chapter has its own price.

This could look something like this:

National membership \- email newsletter as pdf - $10 \- printed newsletter by post - $25 \- printed newsletter plus glossy magazine - $75

Local chapters \- West - $15.00 \- Central - $25.00 \- East - $10.00 \- None - $0.00

Is there a way to accomplish this?

Thanks in advance, JWP

# Answer
> 3 votes
The way we do it is to set up multiple price fields on one price set. The first price field you would make required, the second field wouldn't be required. Then people are required to select something from the first field, but then can choose what (if anything) they select from the second field.

We do it to have a required registration at the top, but then a textbook you can choose whether or not you purchase. You can have multiple items in each field, we just only have one in each.

---
Tags: wordpress, price-sets
---


# Question
Title: Validation radio custom fields on civicrm_validateForm hook does not work
I have a custom field on contact in radio type format, not required field. I'd like to set up custom error on this field by using `hook_civicrm_validateForm` when the field is null.

```
// hook in extension
function hook_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {}

```

`$fields` array doesn't contain a key for this custom field. After setting `$error['custom_xx']` the form is reloaded without displaying the error.

What I found:

`$form->_elementIndex` contains all needed keys, including this for radio. So I suppose this is not a problem.

I think that problem is caused by using `_submitValues[]` as a list of fields because \_submitValues doesn't contain null radio custom fields:

```
// CRM_Core_Form->validate():
CRM_Utils_Hook::validateForm(
  get_class($this),
  $this->_submitValues,
  $this->_submitFiles,
  $this,
  $hookErrors
);

// my hook
function example_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {
  if ($formName == 'CRM_Contact_Form_Contact') {
    if (in_array('AA', $fields['contact_sub_type'])) {
      $fieldIndex = 'custom_70-1';
      if (!in_array($fieldIndex, array_keys($fields)) || !$fields[$fieldIndex]) {
        $errors[$fieldIndex] = 'For AA contact type this field is required';
      }
    }
  }
}

```

**Edit:**

Here is my workaround - add missing keys to \_submitValues\[\] array https://github.com/caltha-eu/civicrm-core/commit/b4ee607334f3f091bffc2c32a87d862e4a3d7493

```
foreach ($this->_elementIndex as $elementIndex => $index) {
  if (!in_array($elementIndex, array_keys($this->_submitValues))) {
    $this->_submitValues[$elementIndex] = NULL;
  }
}

```

# Answer
> 1 votes
Make the field required all the time. Add another choice to the radio called "Not Required". In your validate hook check if the contact subtype is AA and if they chose Not Required set the $errors variable on your radio field to show your error. Since you made it a required field it will be in the fields array.

For inline edit the formName is CRM\_Contact\_Form\_Inline\_CustomData and you will need to look up the contact subtype using the api, e.g. civicrm\_api3('Contact', 'get'...). Use the contact id from $fields\['cid'\]. (Go to /civicrm/api in your browser - it's very handy for getting the api syntax correct.)

Also note your custom field in edit mode will have a different name. It won't be custom\_70-1 it will be custom\_70-3838 or something like that, so you'll need to either look it up from $form first (e.g. in the groupTree element) or do something like loop through the $fields keys and compare substr($key, 0, 9) == 'custom\_70'.

---
Tags: custom-fields, hooks
---


title: Event Fees - DB Error: syntax error

text:
# Question
Title: Event Fees - DB Error: syntax error
after upgrading to CiviCRM 4.7.23 for Wordpress I can no longer configure Event Fees and get a DB Error: syntax error.

I tried upgrading to 4.7.24 and still no joy.

The log file contains this:

```
    Sep 28 12:41:10  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT  id, entity_id
 FROM civicrm_entity_financial_account

 WHERE ( account_relationship =  AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id' at line 4]
    [type] => DB_Error
    [user_info] => SELECT  id, entity_id
 FROM civicrm_entity_financial_account

 WHERE ( account_relationship =  AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT  id, entity_id
 FROM civicrm_entity_financial_account

 WHERE ( account_relationship =  AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id
 [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND entity_table = 'civicrm_financial_type'  )

 ORDER BY entity_id' at line 4]"]
)

```

I have since found more issues which may be related.

I can no longer edit or add Payment Processors and get an error saying: This financial account cannot have '' relationship.

I also can't add or edit Price Sets.

Further digging found this in my tracestack:

/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/FinancialType.php(196): CRM\_Core\_PseudoConstant::populate(NULL, "CRM\_Financial\_DAO\_EntityFinancialAccount", TRUE, "entity\_id", NULL, "account\_relationship = AND entity\_table = 'civicrm\_financial\_type' ")

# Answer
> 5 votes
I guess you have disabled the CiviContribute Component which lead the function to return NULL for account relationship.

# Answer
> 0 votes
If you can reproduce this \[and give us your exact steps\] on one of the demo sites (Wordpress or Drupal - http://dmaster.demo.civicrm.org/civicrm \- does not really matter) - then this (a Fatal Error) will get prompt attention; There are several code Sprints going on this week - reporting live from Montreal!

# Answer
> 0 votes
Similar issue when CiviContribute is disabled is with price sets: menu for new price set is active, but throws a DB syntax error when new price set is submitted.

See more here: CiviMember price sets are depending on CiviContribute?

---
Tags: wordpress, civievent
---


title: Webform results table not displaying

text:
# Question
Title: Webform results table not displaying
I have numerous webforms set up. When I click on 'results' then 'table' there seems to be an issue with viewing any of the results there. The results are there, as in, they can be downloaded and viewed individually through 'submissions'. All I can see are the titles of each column. Thank you.

# Answer
the Results and Table aspects you refer to are purely Drupal components. We have built many hundreds of webform\_civicrm forms and have never seen a problem with this so I doubt the problem is specifically an issue due to using civicrm.

You could try right-clicking and using your browsers 'inspector' to check the console and see if it shows any errors.

Otherwise try searching/asking in either the Drupal stackexchange or in the Drupal project Issues pages - and hopefully they won't say 'this is a civi issue' (unless of course it is and I am wrong)
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: How do you change default rows per page?
I want to change the default from 50 to 100. Where would I do that.

# Answer
> 2 votes
I'm not sure you can in the UI, but you can edit CRM/Utils/Pager.php and change the ROWCOUNT constant near the top.

---
Tags: search-results
---


# Question
Title: Remove Unnecessary Fields from Contact and from Activities
There are areas where an Individual record is opened or used in the Activities. I think there should be an option for their removal.

For example when creating individual records; We have not used the current Employer, Task Title, Nickname, Phone Location, Phone Type, Contact Source and External ID options for 6 years. But it's on the screen. I think they have to be hidden in some way.

In the same way activity records; I don't use fields like Location, Transaction Status, Priority. These sometimes cause incorrect entries and there are no menus to hide.

Is there any development or solution proposal?

https://lab.civicrm.org/dev/core/uploads/0157eea8b229b838a40d705febf77683/-001277.png

https://lab.civicrm.org/dev/core/uploads/778c239a93ab572ac2ed1455af8738c6/-001276.png

# Answer
Work is underway on a Form Builder that will allow folks to hide fields as needed.

For now, you can hide fields with jQuery, ideally loaded through an extension. However, some of the fields you mark are required and so their values would need to be set even if hidden.
> 5 votes

# Answer
I would like to pass a sample solution;

When I uninstall the following section from

```
administrator/components/com_civicrm/civicrm/CRM/Activity/Form/Activity.php
```

`'location' => array(
 'type' => 'text',
 'label' => ts('Location'),
 'attributes' => CRM_Core_DAO::getAttribute('CRM_Activity_DAO_Activity', 'location'),
 'required' => FALSE,
 ),`

it leaves the form. So there is no need for such serious teferruata. But a permanent operation can be done to prevent any updates from becoming obsolete. Could you support this?
> 1 votes

---
Tags: contacts, joomla, activities
---


# Question
Title: How can I install/manage CiviCRM patches on Drupal 8 (using Composer)?
I sometimes need to fix a bug in CiviCRM before that bug is fixed in the latest version of CiviCRM. With non-composer installations, I patch my dev site, commit my changes to `git`, and push them to a repo, then deploy to test/live sites.

Using composer, CiviCRM isn't in my git repo. What's a reasonable way to manage patches so they a) persist across upgrades, b) can be managed in `git`?

**Alternately:** I'd like to test a patch that someone thinks will fix a bug in my CiviCRM installation. How can I do that?

# Answer
Drupal 8/CiviCRM has the composer-patches package already installed. So you can add a section to the `"extra"` element in `composer.json` called `"patches"`, and list out the patch with a title and a URL (or path) to a `.diff` file. Here's an example where I add four patches to standard CiviCRM:

```
diff --git a/composer.json b/composer.json
index 453ff74..5827a69 100644
--- a/composer.json
+++ b/composer.json
@@ -68,6 +68,14 @@
         ]
     },
     "extra": {
+        "patches": {
+          "civicrm/civicrm-core": {
+            "core#609, PR 13390.": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13390.diff",
+            "core#580, PR 13373.": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13373.diff",
+            "membership#9, PR#13553 (membership renewal notification fix)": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13553.diff",
+            "reporting#8, PR 13653 (thank-you dates on contribution reports)": "https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/13653.diff"
+          }
+        },
         "patchLevel": {
             "drupal/core": "-p2"
         },

```

**Note:** If you don't use the excellent `roundearth/civicrm-composer-plugin` but instead use the full manual process to update CiviCRM, you'll need to perform the update steps every time you run `composer install` with patches.
> 3 votes

---
Tags: drupal-8, composer
---


title: Thank You Letter Report

text:
# Question
Title: Thank You Letter Report
How can I include the "Thank you Sent Date" filed in a report

# Answer
Indeed, I am not seeing the "Thank you date" field as an option to be included in the built in reports, but you could do a find on contributions - if you export the primary fields, the thank you date ends up around column CC (might depend on what version of Civi you are using), or you can and select the relevant fields for export, the thank you date being one of them.

Hope this helps, Tamar
> 2 votes

# Answer
I had a client ask me about this recently, so I submitted a patch to add the thank-you dates to the Contribution Detail and Summary reports. You can patch CiviCRM now; it will likely be part of CiviCRM 5.12 or 5.13.
> 1 votes

---
Tags: civireport
---


title: Webform emails direct

text:
# Question
Title: Webform emails direct
I've created a question on my webforms that require an answer of 'yes' or 'no' I can see there's an instruction of

'The selected component 'xxxxx' has multiple options. You may enter an e-mail address for each choice. When that choice is selected, an e-mail will be sent to the corresponding address. If a field is left blank, no e-mail will be sent for that option'

Is it possible to have one member of staff receive the result of the form if the answer is no, and another person if the answer is yes?

# Answer
Starting from the webform configuration page:

1. Add your Yes/No component
2. Click the Emails button
3. In the E-mail To column select Component Value and choose your Yes/No component
4. Click Add
5. In the Component E-mail options, enter the email addresses to receive mail for Yes and for No.
6. Configure the rest of the email settings as you want
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: Fatal error: Uncaught CRM_Core_Exception: Civi/Core/InstallationCanary.php on line 53
I am just trying to install on a WordPress platform and it said OK for all the checks and fairly sure that everything is okay. After running with Install button, I get this error and if I click in the WordPress admin menu CiviCRM:
No idea what I have wrong as DB/PHP etc are all in order. I followed the wiki article exactly.

Fatal error: Uncaught CRM\_Core\_Exception: \[0: Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA. thrown in /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/Civi/Core/InstallationCanary.php on line 53

I am using PHP 5.6, mysql Ver 14.14 Distrib 5.7.18, for Linux (x86\_64) using EditLine wrapper ; and Ubuntu 16.04 which I am fairly sure is configured properly as Wordpress runs fine. I followed every step. I am a bit discouraged.

I wanted to just get an empty version of Civi going to test out things so as to later migrate from a Drupal environment. Any Help?

Explain?. It's Ubuntu, php mysql.... What do you mean?. I installed WordPress... And everything works for that. I installed Civi as a plugin and can't get it running ...I get this error. What else do you want to know? The others are drupal installs. This is Unix instance on aws. Not sure what you mean explain? The tables were created. But I can't run plug-in. Ubuntu 16, PHP 5.6 and mysql 5.7

# Answer
The answer above about deleting the civicrm\_install\_canary table and the civicrm folder in uploads almost worked for me, except that php timed out ~30 seconds after the green 'successful installation' message appeared. I tweaked max\_execution\_time in php.ini to 360, deactivated CiviCRM, re-deleted the table and folder, then reactivated and re-installed - this time it finished gracefully and opened CiviCRM.

I am installing CiviCRM on a testing server (running on my laptop), which is a little slower than most working servers, but is configured to show errors one might not otherwise see. The cleanup and/or 'reset' process that runs after the 'successful installation' message appears to take so much time that it is likely timing out even on some working servers, which results in not finishing the process and leaving the canary table in place.
> 3 votes

# Answer
I had this same problem after installing, uninstalling, then reinstalling. I couldn't install it the second time because the uninstall wasn't very clean. I recommend deleting or renaming the civicrm folder under the uploads folder. Then, you need to delete the civicirm\_install\_canary table from the database. After that, try to reinstall it again. I was able to successfully reinstall after doing those 2 things
> 1 votes

# Answer
I had to simply drop the civicrm\_install\_canary table and my install roared to life.
> 0 votes

---
Tags: wordpress, installation, failure
---


title: Joomla move to another server/test env

text:
# Question
Title: Joomla move to another server/test env
I administer a website for a small local charity which has Civicrm 4.7.6 / Joomla 3.6.4 with php 5.6. I am wanting to upgrade all 3 to latest versions. In order to do this i need to create a test copy of my live site. When i do this using akeeba backup, civicrm is trying to access my production site. have seen civicrm documentation on this but it is undated and looks really old (references only Joomla 1.6 & 1.7). Is there a simple up to date step guide to get a working copy of my production site?

thanks Dave

# Answer
I had no problem with the domain change that I need to carry by using the following method. Would recommend to you too.

1. Go to Joomla \> Add-ons \> Manage.
2. Disable the CiviCRM add-in.
3. Install the Akeeba plug-in to make a backup. Create a backup.
4. Install the new server with Akeeba Kickstart.
5. Update the current rows 76, 109, 181, 183, 219 in public\_html/administrator/components/com\_civicrm/civicrm.settings.php and public\_html/components/com\_civicrm/civicrm.settings.php
6. Go to Joomla \> Add-ons \> Manage.
7. Enable the CiviCRM plug-in.
> 1 votes

# Answer
It sounds like your settings file needs to be edited so that you're accessing the correct database. I'm assuming you already also did this for Joomla, otherwise it would be doing the same thing.

It looks like the page you need is this: https://docs.civicrm.org/dev/en/latest/framework/filesystem/

This is what the page says:

**Joomla**

There are two instances of civicrm.settings.php in Joomla, within each of the components:

front-end at components/com\_civicrm/civicrm.settings.php back-end at administrator/components/com\_civicrm/civicrm.settings.php The files are nearly identical. The one difference is that the front-end file has the site's normal base URL, while the back-end file has /administrator/ on the end, pointing to the back-end of the site.
> 0 votes

---
Tags: joomla, upgrade, migration
---


# Question
Title: Include dates in a membership sign up form
I have a contribution page set up to allow people to sign up for a new membership or renew a membership. The membership is a fixed period type. The user must either create an account or log in. I would like the Membership price option to show the dates (or year) that they are signing up for. Thus if they are a new member, it would should the current period (e.g. "2019 Membership") and if they log in as a current renewing member, it would show that future Membership dates they are choosing (e.g. "2020 Membership"). This is on a Wordpress site.

# Answer
> 2 votes
I would recommend you to create a wordpress page

For logged in member you should be able to find his contact ID and membership ID

Using some PHP code you can select civicrm\_membership table from civicrm database. Which will provide you with membership End date and you can use that to display to the member before renewing

I guess this helps !!!

If you need more help please let me know

Thanks

---
Tags: wordpress, civimember
---


title: Counties - US ones but based in UK

text:
# Question
Title: Counties - US ones but based in UK
I have created an event and want to collect the attendees address including the county. Although based in the UK, the available options registering on the event page only offer a couple of American ones. Can this be changed to UK ones? There are UK options when you create a new contact on CIVI.

# Answer
I tend to avoid using the drop down field for counties in the UK since - unlike States in the USA, or Departments in France, for example - there is no one true definition for them (is it London, Greater London, Islington, etc.).

Instead, I remove the county drop down and add another supplemental address line if required.

Although there are some forms on the web that use a drop down for counties, I suspect more than half just use a standard text field.

*Flippant side note: the important thing to collect for UK addresses is the awesome UK postcode. As soon as you have that, everything else pales into insignificance :)*
> 3 votes

# Answer
If you go to Administer\>Localization you can select the available countries and the linked states/counties.
> 1 votes

# Answer
Add 'State' into the CiviCRM profile that's being used in the event. Be sure to also include the country field.

Remove county from the profile, this is what is confusing the matter. County in CiviCRM terminolgy means a US State county, State applies to County for the UK.

The field name 'State' can be renamed to County.
> 1 votes

---
Tags: civievent, addresses
---


title: Contribution form

text:
# Question
Title: Contribution form
On the form I've created it doesn't give U.S. states as options in drop down menu. http://www.unitybuffalo.org/civicrm/contribute/transact?reset=1&id=4

# Answer
> 3 votes
First of all, welcome to CiviCRM SE! It looks to me as though you haven't set a default country; if you go to Administer \> Localization \> Languages, Currency, Location you can set the default country to United States. Once you do that, it should limit the states/provinces listed to just US states. (Given your location, perhaps you want to include Canada and its provinces in the options; you can do so in the Available Countries section of that same page.)

Hope this helps! Lesley

# Answer
> 2 votes
The U.S. states are in there, they are just mixed in with the states/provinces for every country around the world. Usually what we do is add the country field and have it set so that the U.S. is the default, but you can choose other countries. You'll want to have it on your form before the state listing. We have to do this because we have folks from all over the world that have purchased from us.

If you only need the U.S. and no other countries (or you just want to add Canada), then you can just set only the U.S. (and maybe Canada) as an available country and then that list will be much shorter.

# Answer
> 1 votes
I was able to reproduce this behaviour if the state and country fields are not of the same location type –

Check your Donor Information CiviCRM profile and make sure all the address fields are of the same location type.

If they are all set to the same location type, then it should function as below –

---
Tags: drupal, profile
---


title: Hook for contact view

text:
# Question
Title: Hook for contact view
Is there any hook that can be used for logging contact views? We need to create report for that and first of course need to put that information to database.

# Answer
With contact view, I guess you mean when a contact summary page for a specific id is loaded you want me to increment a count number and store it in DB to display it in the report.

Currently, there is no such feature in core civicrm. You need to add a custom extension to add this functionality. See more details to build a simple ext at https://docs.civicrm.org/dev/en/latest/extensions/civix/. Some basic steps would be -

* Add a custom field to extend Contact eg `View Count`.
* Use `hook_civicrm_summary` to increment the value of this field for a specific contact ID.
* You can use this custom field to show on any report provided by civicrm.
> 2 votes

---
Tags: contacts
---


# Question
Title: CiviVolunteer Permissions vs CiviCore Permissions
Getting an error `CRM_Volunteer_Permission::check($permissions) should be compatible with CRM_Core_Permission::check($permissions, $contactId = NULL)` on line 151 of CRM/Volunteer/Permissions.php. Pops up on front end Events with volunteer options and back end.

I'm at my wits end. Followed along some other threads which seemed to be similar errors with Permissions.php but no luck.

Wordpress 5.0.3, CiviCore 5.9.1, CiviVolunteer 4.7.31-2.3.1

Thanks!

# Answer
> 2 votes
This issue is fixed on the latest version of CiviVolunteer. If not, try adding this patch https://github.com/civicrm/org.civicrm.volunteer/pull/477 to your ext.

There is only a single file change in the patch so you can do that manually by modifying `CRM/Volunteer/Permission.php`

---
Tags: wordpress, permissions, civivolunteer
---


# Question
Title: Display the payment vehicle (cash, check,...) of a contribution in a receipt
I'm supposed to change the message template used when you wanna make a PDF receipt of a contribution. I found the template and started to modify its HTML code, unfortunately I'm not able to display the payment vehicle (cash, check,...). I tested a few tokens ({$payment\_instrument} for instance) found on the internet but it didn't work. And I don't really know where I'm supposed to find all of the tokens (yes, I'm a bit of a beginner...).

Thanks !

# Answer
I think you can use Smarty to retrieve the payment instrument in your template. You can play with API explorer to return this value -

Copy the contents in smarty section and add it to your template. Eg -

```
{crmAPI var='result' entity='Contribution' action='get' id=<contribution_id_variable>}
{foreach from=$result.values item=contribution}
  {$contribution.payment_instrument}
{/foreach}

```

In the above statement `$contribution.payment_instrument` should hold a value of the payment vehicle.
> 6 votes

# Answer
you don't have a straight forward option at the moment (I guess)

Civicrm by default picks only contact Token

In-order to display payment method in the Invoice you need to create a new extension which can select the contribution payment method (as a token)

Ref Link:

https://docs.civicrm.org/dev/en/latest/hooks/

https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/

I guess this helps !!!

If you need more help - please let me know

Thanks
> 1 votes

---
Tags: contributions
---


title: City / Town Selection Problem

text:
# Question
Title: City / Town Selection Problem
I am using the City / Town option. However, county information is not available when I choose any province. When using information from provincial cities in Turkey availiable. No county. Is it a problem? How to add zone information.

# Answer
> 1 votes
Can you please check if there is any data in the civicrm\_county table? It might be that you just have to add some records in there because it is not prepopulated.

# Answer
> 0 votes
Have you enabled the state/province field?

Administer\>Localiztion\>Address Settings

Scroll down and enable state/province instead of county

I've just checked the drupal demo(but these are standard civi settings) and after selecting Turkey as a country a range of options appear in state, nothing in county.

Cheers

Craig

---
Tags: joomla, activities
---


# Question
Title: When making an in memory of donation -> why does the deceased contact not get marked deceased?
I noticed this with one of my clients who processes a lot of in memory of donations. I've reproduced this on https://dmaster.demo.civicrm.org :

**1. enabled in Memory of profile on** https://dmaster.demo.civicrm.org/civicrm/admin/contribute/settings?action=update&reset=1&id=1

**2. made a fake VISA Contribution on that Contribution page - selecting In Memory of radio button** and filling in First and Last Name https://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=1

**3. Result: Contact is created but is -not- marked deceased.** If we had also filled out the email for the deceased (standard field for the in memory of profile) then this could easily lead to some awkward moments allowing CiviCRM to email deceased people.

**4. I can understand that one may want confirmation that someone is deceased** \- rather than letting an anonymous donor update that field in the database - but to treat 'in memory of' contacts as alive people is risky.

**5. Anyone have any suggestions on how to handle processing 'in memory of' profile submission better?**

# Answer
Best response was by Andrew/AGH: "... it's way better to have a dead person look alive than to have a live person look dead."
> 2 votes

---
Tags: civicontribute, contacts, profile
---


title: View mailing in browser- access denied

text:
# Question
Title: View mailing in browser- access denied
CiviCRM 5.3 (at the moment), Drupal 7.63 Mosaico Ext- 2.0-beta4.1528762072

View Mailing as browser link from emails working fine for logged in users, not for anon

Given view public mailing content prmission to all users. Flushed Civi and drupal caches

Still no access for anon users (yup, it's set as public pages)

Only new factor for me here is the mosaico extension. Anyone else had similar issues? know where else I can look?

# Answer
Turns out clicking Save when you change permissions **really** helps.

Craig
> 2 votes

---
Tags: civimail, mosaico
---


# Question
Title: how to get an autoincrementing membership id with existing membership numbers
I've imported our membership list with existing membership numbers into CiviCRM.

The old membership numbers are currently under external ID. I'd like an autoincrementing membership number.

The best solution I have found from digging around various threads and forums is to do the following in order to use the contact id as the membership:

* Modify the database schema constraints to allow updating the contact id and to propagate those changes to all tables
* execute a script that would update the contact id to be the same as the member external id

I might be able to figure out the second part given enough time, but the first bit for sure is a bit beyond my SQL skills. Is anybody able to assist? Or there a better solution available to what I imagine is a common requirement?

# Answer
> 2 votes
I would use the Contact Identity Extension and add a custom ID type for your membership number (https://github.com/systopia/de.systopia.identitytracker).

Fiddling around with contact ID's in the database could cause strange behaviour of your system because you have to check a lot of tables and changes something goes wrong are quite high.

# Answer
> 0 votes
My solution was to make the contact id match the old membership numbers for all the contacts that I imported and then just rely on auto increment of contact id for new members. Of course there will be gaps in the membership numbers for new contacts but that isn't an issue for me.

You need to start with a new system, so that only contact ids 1 & 2 are already in use (I didn't still have these old membership numbers in use fortunately). Before you import the records, you will need to create dummy records for any gaps in your list of membership numbers and identify them so you can easily find and delete them after the import. You need to have the records in order of old membership number for import.

---
Tags: mysql, sql, external-id
---