# Question
Title: does anyone have a recipe for a Drupal 8 Views Calendar to show civi events or civi activities
Title pretty much says it. want a View Calendar for Civi Event and also for Civi Activity using drupal 8

Was following the second recipe at https://evolvingweb.ca/blog/creating-events-calendar-drupal-8 but get to part for Contextual Filters and don't have the CiviEvent date fields available to me

# Answer
Somebody who is searching for this answer can use the following civcrm extensions.

> https://civicrm.org/extensions/event-calendar-extension and
>
> https://civicrm.org/blog/totten/experimenting-activity-calendars

I have not tested "Activity Calendars" though.
> 1 votes

---
Tags: civievent, activities, drupal-views, drupal-8, calendar
---


title: Image from Civicrm contact not shown

text:
# Question
Title: Image from Civicrm contact not shown
I'm using Drupal 7.67 and CiviCRM 5.14.2. I can upload a contact image but in the moment I'm not getting any error messages, the images are just displaying as broken image icons. This happens whether I try to attach an image via the edit contact civicrm pages or a profile page. If I copy de url image and download it, when I open the image, it says is broken. Any advice?

# Answer
So I've found this issue is due to a rogue module or theme in Drupal that has whitespace before or after the PHP opening and closing tags which is being injected into contact images and can also prevent Mosaico images from working as well.

What I suggest you do is disable all modules first (except CiviCRM and related modules as you'll need to test the images). Once you've disabled all the modules, go and check the contact images - they should now appear and if they do, you know you have a module with lines either before or after the PHP tags at the beginning or end of a PHP file.

From there, go through and activate the modules - depending on how many you have, you may want to do one or a few at a time to save a bit of time. I did 5 at a time given how many modules were on the site and when I found the batch that broke the image, I just whittled it down to find the exact one.

Once you've found the module that breaks the contact images - you may need to do a bit of digging in the code to find the whitespace if you definitely need the module. It's also a good idea to inform the maintainer of the module so that they can fix it and prevent anyone else having these issues.

If you find that the contact image is still broken after you have disabled all modules, it may be the theme although this is less likely. The same goes for the themes as above.

Hopefully this helps you out, please let me know if you have any further questions or need extra help.
> 2 votes

---
Tags: webform-civicrm, contact-image
---


# Question
Title: How do I restore City, County, State to the Address block in Contact Summary
I'm on Civi 5.20.0 and Drupal 7.67.

I installed and re-installed the Electoral extension, see

https://github.com/josephlacey/com.jlacey.electoral/issues/23

and

https://github.com/josephlacey/com.jlacey.electoral/issues/25.

To reinstall the Electoral extension, I deleted a number of custom fields, and option values, using the API, including City, County and State/Province from Option Group 21, Addressing Options.

I had used the Contact Summary Editor to create a custom layout. I have the Address block/pane on the top left of the leftmost column. Address is a 'predefined block', meaning it's in Core code, right?

But, now I don't see the City, County or State in the contact summary Address when editing, just when displayed. I do see Street Address, Postal Code and Country displayed and when editing.

The core.Address code is still there, I can see all the fields using the API Explorer to GET the Contact Summary layout, and I can update a record's Address values with the API Explorer. I just don't see the fields in the UI when selecting Edit in the Address pane.

UPDATE: I just upgraded to Civi 5.19.2 and still see the same error.

So my assumption is that I deleted something I should not have during the Electoral extension install and re-install process, like a reference to City, County and State in the Address pane Edit UI, but not sure now what, or how to restore it :) .

UPDATE 2: I was able to duplicate the problem on the dmaster demo site by disabling City, County and State/Province in Addressing Options in Option Groups, which caused those fields to not appear in `Administer -> Localization -> Address Settings -> Address Editing` and so not in Address editing in the Summary screen for a Contact. And I was able to fix that on the dmaster demo site by re-enabling the fields in Addressing Options and selecting the checkboxes in Address Editing. However, the same fix does not work on my demo site.

UPDATE 3: I had deleted the City, County and State/Province option values in Addressing Options, duh on me, then added them back in, but of course, they had a new auto-incremented ID number. I thought that restoring to the previous, original OptionValue ID would fix the problem with the City, County and State/Province not appearing when editing an Address in the Summary screen. I was able to update the ID using mysql at the command line. But, changing the Option Value ID back didn't do the trick.

# Answer
If the problem is that the county does not show up with *viewing* the address on the contact summary page... You can control what address fields are displayed by clicking `Adminster -> Localization -> Address Settings.`

Then, find the `Address Display Format` field and add to it: `{contact.county}`

If the problem is that when you edit the address, no county field shows up, then you can choose which fields show up by clicking `Adminster -> Localization -> Address Settings.`

Then, find the `Address Editing` field and check off the county option.

If the problem is that the county option is not even an option for `Address Editing`, then click `Administer -> System Settings -> Option Groups.` Find `Addressing Options` and clicked `Edit Option`. Hopefully `county` will be listed but disabled and you can simply enable it. If it's not there at all you could try adding it, but I'm not sure if it will be added in a way the CiviCRM expects.
> 1 votes

---
Tags: contacts, addresses, contact-view, contact-summary-editor
---


title: Displaying a column total in a report

text:
# Question
Title: Displaying a column total in a report
Is there a way to display a column total when viewing a report?

Specifically, we are wanting to run reports on contribution line items and quickly see the contribution line item total.

When you do Find Contributions, it displays the total, # completed, and average. Due to how we have our data set up, we need to use the line item report to view all of our donations; we can't use Find Contributions. I'm looking for a way for staff to quickly see donation totals from those line item reports.

Interestingly, if you run a line item report (http://example.com/civicrm/report/price/lineitem) and you don't have any sort criteria, it will display a total at the bottom, but if you enable sorting, that total goes away.

Any ideas?

Many thanks, Carl

# Answer
> 1 votes
Check out the Pivot Report extension at https://civicrm.org/extensions/civicrm-pivot-reports and the ReportPlus extension at https://civicrm.org/extensions/reportplus . Both should give you a way to produce the report you want, I believe.

---
Tags: civireport
---


# Question
Title: How do you get contact_id in a custom form?
```
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive');
$contactId = (int) $_GET['cid'];
$contactId = $form->getVar('_contactID');

```

Are all possible solutions at different places, but none seem to work when in a Form\_CustomData.

In this case the cust data is in an Activity for a civiCase

For the avoidance of doubt, this is to get the ID for the contact (not the user)

*Edit: additional info.*

# Answer
Can you explain a little more what you are after in what circumstances?

Generally speaking: when in a form Custom Data I would expect to see something like entityId or \_entityID. Depending on the defintion of the custom group this would be the contact\_id (or membership or activity etc.)
> 1 votes

---
Tags: custom-fields
---


title: Using fieldOptions with Custom Fields

text:
# Question
Title: Using fieldOptions with Custom Fields
I have a "Select list" within a Contribution Form. I want to populate the "Select List" with Custom Field values.

I have created the Custom Group under Contacts, so i want to search all contacts and get the custom field "Title" from that Custom group.

Then depending on the "Option" selected i want field values to populate.

I have tried to use the:

hook\_civicrm\_fieldOptions but its not working (https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_fieldOptions/).

Any advise on how to do this?

Thanks

This is the HTML for field i want to populate:

```
<tr class="custom_field-row custom_276_-1-row">
    <td class="label"><label for="custom_276_-1">Proc Fee</label>
      <a class="helpicon" title="Proc Fee Help" aria-label="Proc Fee Help" href="#" onclick="CRM.help("Proc Fee", {"id":276,"file":"CRM\/Custom\/Form\/CustomField"}); return false;"> </a>    </td>
    <td class="html-adjust">
      <div class="select2-container crm-select2 crm-form-select" id="s2id_custom_276_-1" style="width: 195px;"><a href="javascript:void(0)" class="select2-choice select2-default" tabindex="-1">   <span class="select2-chosen" id="select2-chosen-6">- none -</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen6" class="select2-offscreen">Proc Fee</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-6" id="s2id_autogen6"><div class="select2-drop select2-display-none crm-container select2-with-searchbox">   <div class="select2-search">       <label for="s2id_autogen6_search" class="select2-offscreen">Proc Fee</label>       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-6" id="s2id_autogen6_search" placeholder="">   </div>   <ul class="select2-results" role="listbox" id="select2-results-6">   </ul></div></div><select class="crm-select2 crm-form-select" data-crm-custom="Commission:Proc_Fee" data-api-entity="Contribution" data-api-field="custom_276" data-option-edit-path="civicrm/admin/options/proc_fee_20191113181638" name="custom_276_-1" id="custom_276_-1" tabindex="-1" title="Proc Fee" style="display: none;">
    <option value="">- none -</option>
    <option value="accordpt30">Accord - PT - 0.30%</option>
    <option value="accordresidirect045">Accord - Resi - Direct - 0.45%</option>
</select> <a href="/civicrm/admin/options/proc_fee_20191113181638?reset=1" class="crm-option-edit-link medium-popup crm-hover-button" target="_blank" title="Edit Options" data-option-edit-path="civicrm/admin/options/proc_fee_20191113181638"><i class="crm-i fa-wrench"></i></a>
          </td>
  </tr>

```

# Answer
As I haven't seen your code, I can only suggest what worked for me:

```
function myext_civicrm_fieldOptions($entity, $field, &$options, $params) {

  if ($entity == 'Contribution') {
    if (isset($field) && $field == 'mycustomfield_123') {
      $myArray = [
        1 => 'Title 1',
        2 => 'Title 2'
      ];
      $options = $myArray;
    }
  }
}

```
> 2 votes

---
Tags: custom-fields, ajax
---


title: Keeping CiviCRM invisible to end users

text:
# Question
Title: Keeping CiviCRM invisible to end users
I am evaluating Civi currently using WAMPServer with Wordpress (which our website is built on). Civi creates a webpage as a front end for things like showing event information and registration etc.

While the idea is to have Civi as a plugin on the back end of our website and be therefore attached to it, we don't necessarily want any event information being displayed on the website. Rather, the CRM would just be used to manage and track that information and we would manage the registration etc. internally (At least for now).

My question then is; does the webpage content have to be visible to the end user or can it be hidden and Civi be used purely as a backend system? Subsequently, what are (if any) the security risks of having this auto-generated page dishing out potentially confidential information.

Total noob to Wordpress and Civi so apologies in advance.

# Answer
> 0 votes
I can't think of a down side to the CiviCRM "base page" existing on your WordPress install - other than that you can't use that page for public-facing content. Anyone visiting that page will see holding text, not CiviCRM content of any kind. Viewing CiviCRM content requires query strings to be appended to the "base page" URL plus the appropriate permissions.

---
Tags: wordpress
---


title: Custom Field "File" Display Issue

text:
# Question
Title: Custom Field "File" Display Issue
I have a custom field "File" which for some reason is not displaying the file. However, it is being uploaded correctly. The functionality is working fine just the display looks corrupted and if i try to download it it comes up as its not supported.

I have done the following steps:

* Checked the Safe File Extensions, that is configured correctly.
* Replaced the /CRM & /templates folder.
* Checked the path where the files are stored (files/civicrm/custom/), i can view the images here and it doesn't come up as corrupted.
* Checked the database and it is all put correctly.

The Code for the file is being displayed like this:

```
<td class="crmf-custom_277_7">
      <a href="/civicrm/file?reset=1&id=26&eid=2&fcs=ec389ea37b95642675519d22c181498543740964824c3dbb9cb80c2c483e714b_1574332030_168" class="crm-image-popup" title="carmstrong.jpg"></a>
</td>

```

When i click on it, the file is being downloaded as a corrupted image file.

Image of the how it appears in the UI:

# Answer
> 2 votes
Judging from the whitespace you've found in the images 'code' this is the same issue as another I've had regarding contact images not working and Mosaico images not working so I'm just going to copy most of an answer from another question that I answered which the same fix:

So I've found this issue is due to a rogue module or theme in Drupal that has whitespace before or after the PHP opening and closing tags which is being injected into images.

What I suggest you do is disable all modules first (except CiviCRM and related modules as you'll need to test the images). Once you've disabled all the modules, go and check the images - they should now appear and if they do, you know you have a module with lines either before or after the PHP tags at the beginning or end of a PHP file.

From there, go through and activate the modules - depending on how many you have, you may want to do one or a few at a time to save a bit of time. I did 5 at a time given how many modules were on the site and when I found the batch that broke the image, I just whittled it down to find the exact one.

Once you've found the module that breaks the images - you may need to do a bit of digging in the code to find the whitespace if you definitely need the module. It's also a good idea to inform the maintainer of the module so that they can fix it and prevent anyone else having these issues.

If you find that the image is still broken after you have disabled all modules, it may be the theme although this is less likely. The same goes for the themes as above.

Hopefully this helps you out, please let me know if you have any further questions or need extra help.

---
Tags: custom-fields, upload
---


# Question
Title: Case Details Report- Active Case Role filter
Trying to run a case details report for all cases of type "x" opened between a given date range.

Noticed that not as many cases as expected show.

On further investigation found that there is a filter in the template Active role:is equal to- options yes or no Which effectively switches between open and closed cases

Anyone know the reason for this?

there is no option for neither, and the filter can't be removed, so I'm now left creating two reports for every case type on the system. Or creating a drupal view per case type

# Answer
> 2 votes
Craig - it's worse than that: creating two reports with 'Yes' & 'No' will still not give you all the cases if they don't have relationships.

See https://lab.civicrm.org/dev/report/issues/24 and the related PR.

# Answer
> 1 votes
It looks like it was added here. The gist of it seems to be to address an issue when wanting to see only current staff. You might want to file an issue at lab.civicrm.org requesting a "neither" option. I don't know of a quick fix other than to see if reverting those changes listed here solve it.

---
Tags: civireport, civicase
---


title: List all recent activities

text:
# Question
Title: List all recent activities
I'm a newbie with CiviCRM.. sorry if my questions sound stupid. As I understand, activities are central to this CRM. Yet, I can't find a quick way (e.g in the menu) to display all recent activities. I have to digs into reports (3 or 4 clicks) or have a "preview" within the CiviCRM dashboard. What am I missing? Thx!

# Answer
> 1 votes
Welcome to SE! You need to use Find Activities under the Search menu. This allows you to filter by date (and other things). If you want something more complicate try Advanced Search with Display as Activities.

---
Tags: activities, activity
---


# Question
Title: CiviCRM Profile not showing on User Account Page
I am using CiviCRM on Backdrop (Drupal 7). I am new to CiviCRM, but not new to Drupal.

I have read the CiviCRM documentation on Groups, Profiles,etc. Well all of it pretty much. Also read old an new posts about Accounts and Roles and Profiles. I am pretty sure I have everything set up correctly.

I have a CiviCRM Profile used for new user registration which works fine. It is creating the Backdrop Roles, Civi Group and Membership Type as I want.

Logging in as the new user having got a password sorted, there is no sign of the Civi Profile or a link to it on the User Account Page. In the Profile Settings I have checked the 'View/Edit Drupal User Account \[ x \] CiviContribute' field so it should show up.

I have unchecked the Backdrop Permisssions for 'access all custom data' and in the Civi ACLs I have tried setting both 'A profile' and 'A set of custom data fields' in the 'Type of Data' but no go. The Profile is not seen on the Account Page. Even when logged in as the Administrator I cannot see this data on a user's accounts Page.

I must be missing something here, but what?

# Answer
I would check what is happening by setting up a Profile with the simplest possible profile eg just First and Last and Email

That will help rule out the issue being related to any of your Fields or permissions related to eg Custom Fields.
> 1 votes

---
Tags: drupal, backdrop
---


# Question
Title: script cli code for importing contacts in civicrm
Can some one give a code to how to import contacts in civicrm by using script line command. I a have a 45000 contacts and importing from civicrm interface i am getting gateway timeout error. I need help in importing contacts from CLI.

# Answer
Welcome to civicrm stackexchange.

Couple of options here.

1. One option is to split your file into smaller chunks.
2. If you have the ability to alter the php settings on the server you can change these to increase the time over which the import can run the option you probably want to look at is max\_execution\_time - in your php ini file. Depending on your hosting this will be in different places.
3. Depending on whether your site is live or not - if you are in the set up stage you could always look at exporting your site to a local machine which you can edit the php ini on. then copy the database back - however if you don't have a local dev environment set up this might require a lot of set up.
4. If you want to dive into the code - then you'll need to write some custom code to do this. You are probably best to import via the api - that way you can let civicrm take care of making sure everything in the database matches up correctly. As a first step I'd checkout the api explorer under Support -\> Developer Api Explorer v3. You might want to check https://github.com/eileenmcnaughton/nz.co.fuzion.csvimport for inspiration -\> and don't forget you'll need to call civicrm\_initialize() prior to making an api call. You can use drush,wp or cv to evaluate a file against the site.

If you really wanted to court disaster you could try importing contacts directly into the sql tables - but I wouldn't recommend this as a first step.
> 2 votes

---
Tags: contacts, import
---


title: Personalize browser version of email

text:
# Question
Title: Personalize browser version of email
I'm trying to figure out how to get the browser version of an email to match an email using tokens in terms of personalization. The email shows the person's first and last name, the opt out and unsubscribe links, and the link to the browser version.

for example, the url for the opt out link in the browser version loses the id # as shown below. Same problem with the unsubscribe link. The first and last name also disappears.

Email version (with dummy IDs): `https://mydomain.ca/civicrm/mailing/optout?reset=1&jid=5555&qid=55555&h=a5aa5a5aa555aa5a`

Browser version: `https://mydomain.ca/civicrm/mailing/optout?reset=1&jid=&qid=&h=`

Any suggestions on keeping the personalization in the browser version?

Thanks!

# Answer
> 1 votes
This issue is recorded here: https://lab.civicrm.org/dev/core/issues/1064

And there is currently some work being done on this here: https://github.com/civicrm/civicrm-core/pull/14591

If you are keen to get this merged into core recommend testing it and commenting on the PR.

---
Tags: email
---


# Question
Title: Can I specify the email location to send to?
In both CiviMail and when creating an Email activity, I can specify the contact recipient(s), but the recipient email address is always that contact's Primary email address.

Instead, I want to specify "send to Billing email" or "send to Home email". Is that possible out of the box, or is there a suitable workaround?

# Answer
> 3 votes
You can already do this with CiviMail. It can be found behind the wrench icon next to the recipient selection:

# Answer
> 1 votes
With an email activity you send an email to a non-primary address by going to the contact summary tab and hovering over the other email address and then clicking. But I can't see a more systematic way of sending to another category of address in CiviMail. Seems to rather defeat the purpose of having the different categories of address. Perhaps some specific functionality picks up the billing address, but I can't see how some of the others might be used!

---
Tags: email
---


# Question
Title: CiviCRM Event - Event Confirmation EMail
I am looking for the possibility to translate and modify the Event Confirmation EMail.

Installation: Wordpress 5.3 CiviCRM 5.19 Thanks Felix

# Answer
Welcome to Stack Exchange!

You can edit any emails that are automatically sent from the System Workflow tab on this page - /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2FmessageTemplates&reset=1

You're able to edit any email templates that are generated from the system such as event emails, membership emails and contribution emails.

Hope this helps!
> 4 votes

---
Tags: wordpress
---


# Question
Title: new event From Template does not copy custom fields
On the demo site - http://wpmaster.demo.civicrm.org/wp-admin/ I have created a new set of custom fields for Events - "Events custom fields" with one text field - "test1".
I have added value "tst" for this custom field in the event template "Free Meeting with Online Registration".

When using this template on a new event the custom field value is not populated with what's in the template. Do I have to use hook to copy over custom data? If so what's the hook?

# Answer
> 3 votes
According to https://lab.civicrm.org/dev/core/issues/766 this looks like it has now been fixed.

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


# Question
Title: How do I make "on behalf of" user proof?
There is no nicer way to say this. My client's end users couldn't follow instructions if they were tattooed on their hands.

It's time to renew memberships. All members are organizations, so all contributions are "on behalf of." The users can't be trusted to enter the names of their member organization correctly. Is there any way to make the "organization name" into a drop down based on relationship?

I can't think of another way to keep users from entering initials instead of the proper organization name. I swear, they will be so creative with input that I can't even design a dedupe rule clean up afterwards.

Help and guidance is greatly appreciated.

# Answer
> 2 votes
This is how we solved this problem for a client that has teachers as their constituents who all belong to a School Board/District. We're using the autocomplete functionality that webform\_civicrm module provides to force teachers to select rather than to type. You can only imagine how many ways one could type "Grande Prairie Roman Catholic Separate School Disctrict No. 28" before we locked this down...

# Answer
> 1 votes
You might be able to do it with hook\_civicrm\_buildForm, removing the existing `onbehalf[organization_name]` field and replacing it with a field of the same name but as a dropdown that only has the logged-in user's related orgs.

e.g.

```
$form->removeElement(xxx...);
$form->addElement(xxx...);

```

Haven't tested that.

---
Tags: civicontribute, civimember, contributions
---


# Question
Title: Best WordPress theme framework for correct display of CiviCRM?
For those who develop for CiviCRM on WordPress, what theme frameworks do not work with CiviCRM, what theme frameworks do work without problems, and which seem best for displaying CiviCRM content?

I've looked at Genesis, and Gantry.

# Answer
> 4 votes
Watch out for themes or plugins that use Backbone.JS calls. They seem to be causing some issues right now. One such theme is Salient.

The JetPack plugin also seems to be suffering from the same problems. (Search the StackExchange for backbone and you'll see a few different threads.)

The Virtue theme has styling issues.

Twenty Fourteen provides good displays.

# Answer
> 3 votes
From my personal experience Genesis, X-Theme and Divi work just fine, no functionality/styling issues so far.

# Answer
> 2 votes
Avada, Divi, X theme, Genesis, Virtue and in general most well-developed WordPress themes work fine. I think BeTheme is OK too.

The Slider Revolution plugin causes JS problems and can be disabled and replaced easily. A lot of commercial themes bundle this plugin.

You can still expect to do some work making CiviCRM pages display nicely because CiviCRM uses it's own CSS and classes - this can be disabled using CiviCRM Admin Utils in WordPress. This is not a WordPress theme problem, that's a CiviCRM design decision which has been discussed at length in Github.

---
Tags: wordpress, evaluating-civicrm, theme
---


title: Customize Menu - All Addresses

text:
# Question
Title: Customize Menu - All Addresses
I would like to insert a new point in the menu "All addresses". How can I show all addresses without going through the search function. Wordpress 5.3 CiviCRM 5.19 - Thanks Felix

# Answer
> 1 votes
The way I would do it is create a Constituent report through here - /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Freport%2Fcontact%2Fsummary&reset=1

You can add in the fields you'd like the report to show (so address fields in your case).

Once you've created the report, you can copy and paste the report URL and add it to the menu here - /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fmenu&reset=1

---
Tags: menu
---


title: Grant Export Custom field Cutoff

text:
# Question
Title: Grant Export Custom field Cutoff
On a brand new Drupal 7 / CiviCRM 5.6.0 install I created a custom field group for Grants and added one Contact Reference field and then created 2 grants. When I search for grants and export and try to export that Contact Reference field, the name of the Contact is limited to 16 characters.

Further testing indicates that the name of a Contact Reference field on a Contact record also is limited to 16 characters when exported.

# Answer
`ContactReference` custom field saves `contact id`, and that field has max 16 numbers.
But when CiviCRM prepares Contact to export, that `contact id`(max 16 numbers)
transforms to contact's `display name`(more than 16 chars).
When CiviCRM tries to insert(to temporary table) more than 16 chars to field(with max length 16 chars) then it slices that field.

This issue can be hot fixed in CiviCRM Core.
1. Find `civicrm/CRM/Export/BAO/ExportProcessor.php` file;
2. Find `getSqlColumnDefinition` method;
3. Replace `varchar(16)` to `varchar(255)`.

CiviCRM Core need to add new condition: if is Custom Field with type `ContactReference` then use `varchar(255)` instead of `varchar(16)`.
> 0 votes

# Answer
Here’s a PR that was closed and does not cleanly apply anymore but when applied manually I have a functional export for ESR 5.13.x

https://github.com/civicrm/civicrm-core/pull/12598
> 0 votes

---
Tags: export, civigrant
---


# Question
Title: Using CiviGrant as the applicant/recipient
Our charity doesn't offer grants but applies for a fair few. Having had a play around with CiviGrant, I can't see any immediate problem with using the component as a way of tracking grants that we've applied for and received etc. but the documentation from Civi suggests it's only for managing grants going out of the charity:

> In contrast to CiviContribute, which tracks money going *into* your organisation, CiviGrant tracks money going *out* of your organisation. CiviGrant has a data structure and workflows that support the grant application process with the ability to manage the amount applied for, amount received and any reports necessary for the process.

I created a sample organisation as a contact to attach to the grant and all seems OK to use as a way of managing incoming grants. Just wondering if the community knows something I don't as to why this might not work e.g scaling, reports etc.

# Answer
That's totally possible - I have one medium size org that uses Grants exclusively for this purpose. We're using some simple Word Replacements -\> in civicrm/admin/options/wordreplacements?reset=1 to help Staff use native CiviCRM Grants to track income:
> 6 votes

---
Tags: wordpress, evaluating-civicrm, civigrant
---


# Question
Title: Importing contributions: "Expected one Contribution but found 25"
I am getting an error when I import contributions.

I have successfully imported contributions before from other data sets. This dataset is a little more rich and I have now added a 3 custom fields to contain the messaging options that the user can complete. The initial mapping and basic checks pass. However at the step of the actual import, every record fails with the error "Expected one Contribution but found 25"

I have reviewed the mapping and can't see any obvious issues. I have searched stackexchange and the web with no result that seems to relate to my situation.

I would love to hear any ideas. I don't see any records in the CiviCRM log, though maybe there is some further switch I should be enabling to get more information.

In response to a comment, I enabled debugging and backtrace. I ran a test import, but no errors of any kind were thrown into the CiviCRM log in the ConfigAndLog directory. It does log other errors there, so I can only assume that it doesn't see this as an error of that kind. I continue to receive the "Expect one ... found 25" error in the front end output.

The problem occurs as I say in my "Answer" below when I try to use one of the existing fields to set "Contribution status". I assume and accept that the data is probably incorrect for the column in the db (though I can't find it), but the resulting error makes no sense. I'm fine with that but thought I'd share back into this space since asked and it might be helpful in clarifying the error that is thrown.

I am running 5.19.3 on WordPress 5.3

# Answer
In the absence of clear error information, I went into trial and error mode.

I disabled each mapping in turn. In the end, I found it was the attempt to import "contribution status" that triggered the failure. It is likely that the contents didn't match required values in the database. Though, in this case, the error message seemed to have nothing to do with that. My previous experiences with similar problems generated more clear errors that the content of the field was invalid.
> 3 votes

---
Tags: civicontribute, import, data-import
---


# Question
Title: Contribution page - the field labels are missing
I have installed civicrm and created a new contribution page. But the field labels are missing. Below is the link:

http://ny.missionaryfamiliesofchrist.us/index.php/donate

I would appreciate any help to fix this.

Ron

# Answer
> 1 votes
They are there, however, your label text is white on a white background.

---
Tags: contribution-page
---


# Question
Title: How can I see which contacts have been assigned which roles and permissions?
How can i find out which contacts have been assigned which roles? I am looking to ensure that only a few key staff can access and edit our database... I can see we have two roles set up but I don't know how to find out who has been assigned which role...

# Answer
> 2 votes
Welcome to SE! The place to start is in the documentation about roles and permissions at https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/

It does depend on the CMS as Jaap says, but they are all covered here. You will see who is assigned to which role in the CMS (Its under Users in WordPress) but then you need to allocate permisssions to these rolls to control which CiviCRM features each role has. There are some more complex option too, with roles and permissions specific to CiviCRM, but you probably don't need these.

---
Tags: permissions, roles
---


# Question
Title: Unsubscribe link in publicly viewed newsletter error
I was thinking (first problem) to use the "view in browser" url to build a link page for viewing past newsletters. If a user clicks on the unsubscribe link, the url "mysite.com/civicrm/mailing/unsubscribe?reset=1&jid=&qid=&h=fakehash" creates an error page:

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

Looking for a cleaner redirect...

# Answer
> 1 votes
I used a redirect since the url seems to be consistent for the web view.

---
Tags: civimail
---


# Question
Title: How can I find membership totals on a month by month basis eg. total members end of Jan, Feb ect so i can then analyse the increase month by month?
I have found how to get Civi to show me how many new members of each type joined per month. However I need the total of all members at the end of January Feb etc so I can see if there is an increase in members and of which type.

# Answer
> 1 votes
I would firstly suggest checking out the Membership Churn extension

---
Tags: groups, smartgroups, civicrm-home
---


title: Contribution Page not Submitting

text:
# Question
Title: Contribution Page not Submitting
I have a contribution page here https://flbc.edu/donate/flbc-donation/, but when I click on confirm it just brings me back to the same initial page. It was working before and I just upgraded to the newest Civi and now it is not working. Any ideas why this might be happening?

# Answer
When reproducing your experience, I see:

```
flbc.edu/:1 Uncaught SyntaxError: Unexpected token '<'

```

Which is weird, since it seems to be loading your whole page as javascript.

It shows it on the initial page load as well as after submitting. And the province selector after selecting a country is also broken, that's probably a symptom of the same problem.

When I look at the html source of your page, I notice that it ends with:

```
<script type='text/javascript' src='https://flbc.edu/wp-content/plugins/js_composer/assets/js/dist/js_composer_front.min.js'></script>

```

That's bad - you're not getting your closing html or body tags output.

Conclusion: I suspect you might be hitting some kind of server limit (your page has a lot of css/js loaded).

Do look at your server logs, there's probably a hint in there. I don't think it's CiviCRM-specific.
> 0 votes

---
Tags: contribution-page
---


# Question
Title: Payment gateway for WordPress and Drupal
We have to build a payment gateway for CiviCRM in South Africa would like to know what all the modules are that are capable of taking payments?

We CiviContribute and CiviEvents makes use of payment gateways but are there any other modules we need to consider when specking this project out?

For both Drupal and WordPress please.

# Answer
> 1 votes
CiviMember also intersects with the payment plugin, potentially.

But the basic functionality can be built without reference to how it's used.

You'll want to start with this:

https://docs.civicrm.org/dev/en/latest/extensions/payment-processors/

---
Tags: payment-processor
---


# Question
Title: Relative date filters (ending.month changed?)
I am working with an old installation updated to 5.19.3 (Joomla) and checking it with one fresh installed. There is one difference in the table `civicrm_option_value` field: 'value' by the realtive-date-filters.

The upgraded database has the values ending.month', 'ending\_2.month', 'ending.quarter' and the new one 'ending\_30.day', 'ending\_60.day'and 'ending\_90.day'. Have I had one error in a upgrade or is the difference not important?

# Answer
It looks like the (default) options for relative comparisons on dates have been slightly improved (or at least, that would have been the intention). You wouldn't normally want to break a site that was making use of the old ones, so I wouldn't describe that as an upgrade error. Whether the difference is important would be up to you. If you're not using the old ones, then you could update, or even add the new ones.

You can do that with the web interface at: Administer -\> System Settings -\> Option Groups, and choose Date Relative Filters.

These are intended to be configurable, so the preferred behaviour for upgrades is to not break any existing configuration.
> 1 votes

---
Tags: upgrade
---


# Question
Title: User lets membership expire, and then signs up again, membership stays as expired?
I have a question about membership status. I'll attempt to explain this so it makes sense, any ideas/help much appreciated!

An existing paying member let their membership expire. They then went online and signed up again for membership but this time using GoCardless Direct Debit for the first time.

It found the existing record by the email address they used.

The **Contribution** made for the membership went into 'pending' state with an ETA completion of 29th November 2019 00:00. This is all expected to account for the time that GoCardless sets up the direct debit.

In the **Membership** tab on the contact, it's still showing as 'Expired' whilst it's waiting for the DD to set up. Is this expected behaviour?

When any user signs up for membership for the first time, the Membership goes to 'Pending' state and I think we expected a similar thing would happen when a user renews an expired membership.

We use WordPress Member Sync that looks for those in 'Pending' state and still allows them access to our member-only portal on our site. We did this because of the delay when setting up a direct debit with GoCardless, we wanted users to get access straight away, so we give access to those even in 'Pending' state.

So, this means that if a user has previously expired, and signs up again. They won't get access until the Direct Debit clears because it remains in 'Expired' state rather than changing to 'Pending' once the new contribution has been made.

Is this expected behaviour? Does anyone know why the Membership changes to 'Pending' on a new sign up, but remains on 'Expired' status when a user submits a new membership once it's expired?

I hope that all makes sense! Let me know if clarification is needed on anything. Thanks all for any help provided.

# Answer
> 3 votes
For anyone else that stumbles across this because they are facing something similar:

I got a response on mattermost from Matt @ MJW consulting pointing me to this issue - https://lab.civicrm.org/dev/membership/issues/18

Other people have come across this, there is a patch, but it hasn't been progressed yet.

# Answer
> 0 votes
Membership stuff can be tricky, but I believe once the pending Contribution is actually received, the *new* Membership will update to Current. I'm assuming you have set up the new payment processor in Civi.

# Answer
> 0 votes
You may need to look at your Membership Status rules. Having a membership start off as Pending can be set using these rules, but i suspect they can only run off the 'member since' date which only happens on the first sign up

# Answer
> 0 votes
I have seen the same behaviour on a membership site which is also using GoCardless. So, yes, I think it is the expected behaviour.

I believe a membership can only be in the 'pending' state when it is first set up. There is a logic to it staying as 'expired' even after payment has been received but not cleared so I don't think it would make sense for all organisations for it to change to 'pending'. Perhaps you need another status with 'expired but pending'?

After the payment has cleared I would expect the membership status to change to 'current'. Note that this will actually happen on Mon 2 Dec because GoCardless sends notification the working day after the payment has cleared (usually at around 11am in my experience) and 29 Nov is a Friday.

---
Tags: civimember
---


title: Filter options dynamically in webform

text:
# Question
Title: Filter options dynamically in webform
We work with schoolchildren in Florida, US. Schooling here is grouped into Elementary (grades 1 thru 5), Middle (grades 6 thru 8) and High School (grades 9 thru 12). I have a webform that asks the grade and the school, where school is a dropdown with too many choices. Is there a way to limit the choices in the school dropdown to those that offer the grade entered?

School facilities in our CiviCRM are Organization contacts with tag(s) indicating the grade grouping(s) each serves. Most school facilities serve only one grouping, but some serve all groupings (Elementary, Middle and High).

# Answer
If you use Drupal's webform (with webform civicrm to integrate civicrm), you can use the "webform conditionals" function.

Alternatively, you could create some custom javascript for the form.
> 4 votes

# Answer
If you have Drupal, I highly recommend Alan's answer. If you are a WordPress user, there is a Gravity forms CiviCRM integration. I know that Gravity forms can do the conditional show/hide like Webform can. I do not have experience on the CiviCRM integration.

Another option is to have the initial page with buttons for Elementary, Middle & High Schools. Once they select that, they can see the form for that range with just their list of schools available in the dropdown. Not as slick as the conditional function but very doable.
> 3 votes

# Answer
For WordPress I think there is more integration/options with Caldera Forms
> 0 votes

---
Tags: webform-civicrm
---


# Question
Title: How do I control the imported user role when using CiviCRM WordPress Member Sync?
I'm working on an inherited CiviCRM/WordPress site using the CiviCRM WordPress Member Sync https://wordpress.org/plugins/civicrm-wp-member-sync/ and the Members plugin https://wordpress.org/plugins/members/ and I can't find an answer to the question below in any docs.

In the past, someone used the Manual Synchronize feature of Member Sync to manually sync all CiviCRM members to WordPress, but all users were Administrators. After a reinstall of CiviCRM, an import of a CiviCRM database, and deleting all the old WordPress Administrators, I now need to manually sync the users again. But of course I don't want them synced as administrators; I need them synced as lower level roles in order to restrict access to page content and of course not give admin privledges.

How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method.

Is this controlled by Association Rules? I need to add a rule for each CiviCRM membership level?

Will the "New User Default Role" in WordPress\>General Settings override synced users Association Rules?

Do I need to use https://wordpress.org/plugins/groups/ ?

# Answer
> 2 votes
> How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method. Is this controlled by Association Rules?

Yes, exactly. Association Rules are the "glue" between CiviCRM Memberships and WordPress Roles (or Capabilities).

> I need to add a rule for each CiviCRM membership level?

Yes. FYI, if you have a large number of Membership Types, have a look at the newest feature in CiviCRM WordPress Member Sync, which allows you to do "bulk creation" of Association Rules.

> Will the "New User Default Role" in WordPress\>General Settings override synced users Association Rules?

No. It comes into play when syncing to Capabilities, since WordPress users must have a role of some kind. When syncing to Roles, the selected role is granted instead.

> Do I need to use https://wordpress.org/plugins/groups/ ?

No, but CiviCRM WordPress Member Sync has deeper integration with the Groups plugin than with the Members plugin.

The integration with Members consists solely of granting WordPress users the `restrict_content` capability, which is what Members uses to determine access to, well, restricted content. The capability is removed when the Membership expires.

The integration with Groups is more sophisticated, in that Group membership can be independent of the user's role or capability. Capabilities can be assigned to groups in much the same way that roles are collections of capabilities. Membership Types can be added to (or removed from) groups depending on the status of the membership.

So... if you have removed the WordPress admin users and want to recreate them with a different role, make sure you have edited your Association Rules so that the Contacts with the appropriate Membership Type sync to your desired current and expiry roles.

FWIW, by default CiviCRM WordPress Member Sync will not sync users with the admin role in WordPress. This can be modified with a filter, but since you're avoiding granting WordPress users admin rights, you shouldn't be caught by this.

# Answer
> 1 votes
When you use the synchronise the outcome should be that someone would only become an Authenticated user ie the default user role so perhaps check under "New User Default Role" and ensure it is not set as Administrator in WordPress\>General Settings.

---
Tags: wordpress
---


# Question
Title: Search > Find Memberships: Difference between Membership Status Current AND Current Member?
Search \> Find Memberships -or- Search \> Advanced Search and I use the Membership criteria in my search I usually set the Membership Status to *Current* but I just noticed today below the Status field there is a radio button fieldset with a label *Current Member?*

What is the difference between the Status = Current and the fieldset for Current Member? being checked

# Answer
There is a setting in each MEmbership Status where you decide if a Status should be considered 'current' or not.

```
Current Membership?
Should this status be considered a current membership in good standing.
EXAMPLE: New, Current and Grace could all be considered 'current'.

```

It is confusing that 'current' is used in two different ways.
> 5 votes

---
Tags: advanced-search
---


# Question
Title: Is there a work around for the limit (10) of soft credits that can be added to a contribution?
We need a way to work around the limit of soft credits that can be added to a contribution. I understand the limit is 10 but that is insufficient for our needs. Please advise.

# Answer
> 1 votes
There is technically no limit in the soft credit : it's only a limitation in the public form.

If it's a rare case i would propose to simply add the missing soft credit using the API explorer :

* go to menu Support -\> Developer -\> API Explorer v3 (or v4 but my screenshot is in v3)
* choose entity `ContributionSoft`, Action `create` and set value for `Contribution`, `Soft Credit Amount` and `Contact ID`
* Then use `Execute` button

Like so :

Otherwise, you will have to create an extension to somehow overwrite the CRM\_Contribute\_Form\_Contribution::$\_softCreditItemCount value and it should do the trick :

```
  /**
   * @var int
   *
   * Max row count for soft credits. The value here is +1 the actual number of
   * rows displayed.
   */
  public $_softCreditItemCount = 11;

```

---
Tags: civicontribute, soft-credit
---


# Question
Title: Scheduled Job Membership renewal reminder not running
Schedule Job for mailings is not working correctly. Other scheduled jobs are working - membership status updates, smart group updates,etc. There should be 250+ renewal emails sent to members with expire date of 12/31/2019, but nothing is sent out. Server will restrict to 50 emails at a time, but should send in tranches of 50. I tried manual execution of scheduled jobs and get same response. We're running Civicrm 5.1.14 with Joomla 3.9.15 on PhP 7.2. Any thoughts? I didn't find any recent examples of this error on stackexchange.

Based on work done by a third party Civicrm partner firm, we have two cron jobs:

```
 /usr/local/bin/php /home/jgsny/public_html/administrator/components/com_civicrm/civicrm/bin/cli.php -s jgsny.org -u civicrm -p xxxxxx -e Job -a execute

```

AND

```
/usr/bin/wget -O - -v -t 2 'https://jgsny.org/administrator/components/com_civicrm/civicrm/bin/cron.php?name=civicrm&pass=xxxxxxx&key=xxxxxxx'

```

The cron job sends a single message:

```
--2019-12-02 12:55:01--  https://jgsny.org/administrator/components/com_civicrm/civicrm/bin/cron.php?name=civicrm&pass=xxxxxx&key=xxxxxxx
Resolving jgsny.org (jgsny.org)... 209.124.74.61
Connecting to jgsny.org (jgsny.org)|209.124.74.61|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: 'STDOUT'

     0K                                                        0.00 =0s

2019-12-02 12:55:02 (0.00 B/s) - written to stdout [0/0]

```

# Answer
> 1 votes
The cron job `Job.execute` is running all active cron task defined in menu Administer -\> System settings -\> Scheduled Jobs

If your cron is running as it seems to be, you might first want to check :

* if the task `Send Scheduled Reminders` is enabled in Administer -\> System settings -\> Scheduled Jobs
* if the frequency is correct - it should be daily or hourly maybe
* when you click View Job Log - do you have any error

---
Tags: joomla, scheduled-reminders
---


# Question
Title: How long is start date? 00h00mm00ss or a 24hour period?
I have simple membership statuses that say: Status 1: from membership date to start date Status 2: from start date to end date.

On start date, the membership has changed from not member to member but the status stayed on Status 1. (I have set the cron every hour so it would be updated the way it should).

When is the time limit: 00h00mm00ss or a 24hour period?

How does it work in CiviCRM?

# Answer
> 1 votes
After testing, here is how it works.

If we use again my example with twice the same event date **3rd of April**:

Status 1: from membership date to start date
Status 2: from start date to end date.

Status 1 will change **by the end** of the 3rd of April which means start date from the previous status is "Master" and start date lasts 24 hours. Status 2 will appear on the 4th of April. And this is not related to cron Job.

So if you want to start Status 2 on the 3rd of April at 00h00'00", for example if an Insurance is running from this date or if the member has to be of legal age, then set the end event of Status 1 on start date and -1 Day.

---
Tags: civimember
---


# Question
Title: how can I create an hook when external id change
I would to ask you , on how can create an event (programatically) when I change the external ID in contact form, how can I t make some kind of process like validation in another module or service I know I can create something like a hook but I dont know how to start working with hooks in civiccrm, is there any document, book ,link, video, note where I can learn about it? I would really appreciate this, thank you in advance.

# Answer
**Create an extension**

The first step to create a hook is to create an extension. I'd recommend installing civix which can generate an empty extension by simply typing the command :

```
civix generate:module myextension

```

Go check https://docs.civicrm.org/dev/en/latest/extensions/ for more details about extensions.

All you need to know for now is that civix will create a file called myextension.php where you can put your hooks. There are a few hooks commented as examples in the generated files.

**Create the hook**

A hook is simply a function that start with the name of your extension and finish with the name of the hook. For example `hook_civicrm_post` will be named `myextension_civicrm_post` in the extension we've just created.

In your case, I believe `hook_civicrm_post` is the one you want to use but you can see the documentation about the hooks in :
> 1 votes

---
Tags: wordpress, hooks, external-id
---


# Question
Title: How can I update CiviCRM installed with Drupal 8 using Composer?
I've got CiviCRM installed and working with Drupal 8 using Composer via https://gitlab.com/roundearth/drupal-civicrm-project

What I'm not clear on is how best to update CiviCRM using Composer. Is it as straightforward as runnning something like:

```
composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8 civicrm/civicrm-core:5.19.3

```

I can't find any documentation on updating.

# Answer
> 4 votes
I've been updating it using the following:

* composer require civicrm/civicrm-core
* composer civicrm
* cv upgrade:db

That is after making a backup first.

Has worked for my installation.

# Answer
> 4 votes
My experience with anything composer-ish seems to be:

1. Struggle with it for a while until the site becomes messed up beyond repair.
2. Restore from backup and struggle some more until it's messed up again.
3. Create a brand new install and then copy over the sites/default folder and .htaccess and such.
4. Replace the database with my backup.
5. Run the upgrades.

# Answer
> 4 votes
In practice it's as simple as doing a `composer update` for the most part - assuming you're configured "sensibly" - the RoundEarth setup makes (or at least made!) some assumptions re: versioning that are not helpful for upgrading. So here goes:

1. You should declare both `civicrm-core` and `civicrm-drupal-8` in your composer json file. In the require section you should have something that looks like this:

```
"civicrm/civicrm-core": "^5.23",
"civicrm/civicrm-drupal-8": "^5.23"

```

**Note:** When upgrading to a new "minor" release of CiviCRM you should change your version constraints e.g. `"^5.24"` or to automatically get the latest CiviCRM stable version when you run `composer update` use `"^5"` as your version constraint.
2. You should have the same version against both of these (^5.23 as an example.)

You should install CV to manage database upgrades so that your upgrade process becomes the following commands (for the most part!):

`composer update && cv up:db`

When using a composer-based workflow you can install CV using `composer require civicrm/cv` which will place the cv binary in `vendor/bin`

Note that using the `dev-master` version of `civicrm-drupal-8` has the potential to cause issues as it's developed alongside `civicrm-core` \- you should use the same version number as you use for `civicrm-core`.

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


# Question
Title: Contribution form issue: cannot submit donation
It's Giving Tuesday and this donation form on my client's website won't allow credit card donors to submit their donations :o

https://apprenticelearning.org/civicrm/?page=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=3

When I've filled out all the information and try to submit a donation, this shows up (once Inspected):

VM625:1 Uncaught TypeError: Cannot read property 'id' of undefined at v (eval at (jquery.min.js?r=Z0KlZ:2), :1:694) at w (eval at (jquery.min.js?r=Z0KlZ:2), :1:1555) at Object.eval (eval at (jquery.min.js?r=Z0KlZ:2), :1:1450) at Object. (jquery.min.js?r=Z0KlZ:2) at i (jquery.min.js?r=Z0KlZ:2) at Object.fireWith \[as resolveWith\] (jquery.min.js?r=Z0KlZ:2) at x (jquery.min.js?r=Z0KlZ:4) at XMLHttpRequest.c (jquery.min.js?r=Z0KlZ:4)

Any help would be so appreciated!

# Answer
Stripe uses javascript to submit the credit card credentials to the stripe server (so that they're never handled by the CiviCRM server). The console is showing that it's unable to do that because of javascript errors.

A browser may or may not stop processing if it encounters javascript errors, it depends on the browser/settings.

On your referenced page, it's CiviCRM loading the jquery.min.js file, so that suggests it's a purely CiviCRM issue - there's likely some Civi or extension javascript running that's trying to execute some jquery and getting an error.

As per Pete's comment, I'd start with thinking about what has changed since it was last working (e.g. a CiviCRM or extension update, a change with WordPress, etc.).
> 1 votes

---
Tags: civicontribute, contributions
---


# Question
Title: Can all contacts that share an email be unsubscribed at once?
Often we have multiple contacts with a shared email address, as when a parent provides their own email when they register one or more children. We use the option in civimail to only send one email to each unique address to avoid duplicates. If they unsubscribe, only one of the family contacts is actually unsubscribed, so the other contacts with the same address continue to receive email. To the parent it looks like we are ignoring their unsubscribe request. Is there a way to have an unsubscribe request apply to all contacts with the same email address?

# Answer
Short answer: no.

An unsubscribe request is handled here:

https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Form/Unsubscribe.php

The parameters to an unsubscribe request are translated into the corresponding contact, not the email address.

So what you're asking would require the code to scan the database for contacts with the same email address to unsubscribe, which in some circumstances wouldn't be the desired result.

Conceptually, unsubscribes/subscribes are stored/handled by contact id, not email address.

Your options would be to write your own unsubscribe handler, or (perhaps) to use civirules.
> 1 votes

---
Tags: civimail
---


title: I Can't See Who Created Grant Records

text:
# Question
Title: I Can't See Who Created Grant Records
I cannot see who has created the grant records on any individual. Here sometimes the cancellation etc for the grant is going on in the registrations. Or you can enter more than one grant. But it is unclear who created these records. How can I get this information

For example: I created a grant for the person "A". The authorized person is checking this record. However, the data does not appear to indicate that the recording is mine or another person.

# Answer
Check in the civicrm\_log table in the database and if there's an entry there for it then the modified\_id will be the contact\_id of the person who did it. But civicrm\_log only logs minimal info. If you have detailed logging turned on at administer - system settings - misc, then there'll be a log\_civicrm\_grant table that records every change.
> 1 votes

---
Tags: joomla, reports, grant
---


# Question
Title: What would cause contributions and contacts to go missing?
Recently we noticed a several contacts and their contributions were missing from our database. These contacts and contributions were not manually deleted. The contacts are not in trash (I believe civi does not allow contacts with contributions to be permanently deleted. The contributions would need to be deleted first).

I suspect that the data was overwritten. Can anyone advise:

(1) What change to the server or database could allow data to be overwritten? I am the site admin, not the sys admin (we are on shared server). Would an upgrade be a likely cause? Or would I need to ask the sysadmin about an actual move from one server to another?

(2) Is there a best practices for recovering data? I think the best approach would be to pinpoint the date the data was lost, export contacts and contributions that are in the backup but not the current version, and import to current version. But I am open to suggestions.

(3) Does anyone have suggestions on how to catch this kind of issue?

# Answer
1/ unlikely to be upgrade related

2/ assuming you have access to 'log' tables you can write an sql query to identify records where the first/last names have changed from the previous log record

3/ if you mean how to find and prevent in future, use the logs to try and identify who/when and figure out what the person was trying to do and train them otherwise (assuming user error at backend) OR if problem occured by front-end process then perhaps check your Matching rules
> 2 votes

# Answer
A common cause of that experience is when administrators are doing backend work on contacts but using "front-end" forms - in those cases, the administrators will sometimes inadvertendly overwrite contact information in confusing ways.

Using "front-end" forms as an administrator is possible, but you have to be aware of the automation that sometimes is lurking in the back.
> 1 votes

---
Tags: backups
---


# Question
Title: How to add Contact "Notes" field in webform?
I need to create a signup form via webform and would like to include a Notes section where people can make write something during signup. I would like that to appear in the "Notes" section of contact. Cant seem to locate that option, any ideas please? Thanks

# Answer
> 4 votes
Here's a similar question: Can I add a space for people to write notes: like dietary needs and or comments?

And here's an outstanding request for the feature here: https://www.drupal.org/project/webform\_civicrm/issues/2320295

The conclusion is: consider putting the note somewhere else, e.g. an activity or custom field.

Although the notes field seems like the right place, it's not a bad idea to NOT put it there, since the notes field tends to be private for administrators and hiding the contact's notes in there means they might not get seen.

If you work forwards and think about what those notes are for, that might suggest a better location. A custom field seems like the right answer.

---
Tags: webform-civicrm, forms
---


# Question
Title: can't "enable" a disabled event -- the "More" dropdown seems to be hidden behind other events and isn't clickable?
I'm trying to "enable" a disabled event in CiviEvent but the user interface doesn't let me click the "Enable" item in the "More" dropdown menu. It's like it's grayed out and hidden behind the other elements.

I've tried both Firefox and Chrome and had the same problem in both.

# Answer
> 1 votes
I've tried and failed to reproduce your experience, I suspect it's specific to your "theme".

Here are a couple of other strategies:

1. Use an administrator theme for the CiviCRM administrative pages.
2. Shrink your content using the browser zoom (e.g. for chrome, "Ctrl -").

# Answer
> 0 votes
Temporary workaround: I made sure the event was the only one in the "Manage Events" list and then its dropdowns don't get covered by the additional events. Would still love to know what's causing the loss of focus on the dropdown though :-)

---
Tags: user-interface
---


# Question
Title: Allow only 1 selection in a price set with multiple price fields
We offer individual and joint membership with a couple of different rates for each type. I have created a price set that has 2 price fields and each price field has a couple of options. I want to set the price set so that only one option can be ticked across both price fields. There isn't an option for this and but I hope someone has a solution. I can put all types of membership into 1 price field but it reduces the system options and makes laying out the contribution page harder. Any help appreciated.

# Answer
> 3 votes
Yes, the price fields are independent, and the design limits you to putting all the membership types/flavours into one price field if you need to force only one.

Of course, you could write some javascript to do something like what you want, though that would be a bit of a hack.

A simple alternative is to create separate contribution/membership pages for each membership type - so the visitor would be presented with different links for each membership type before getting a form. That allows your form to be simpler and have additional membership-type-specific messaging and behaviour.

---
Tags: civimember
---


# Question
Title: Stripe processor: payment going through but registration is not! "Could not find valid value for id"
I'm on Joomla 3.19.13 with CiviCRM 5.18.2 and using the Stripe Payment Processor 6.2.2.

This seems to be a problem popping up on Wordpress sites (https://civicrm.stackexchange.com/search?q=Could+not+find+valid+value+for+id) but I'm on a Joomla system. My problem seems most similar to this one -- but in my case the registration DOES NOT come through, but the credit card payment DOES go through the Stripe processor, without email, address, name, etc. Nightmare!

Even worse, this seems to be an intermittent problem. We've just opened this event registration a few days ago, and so far we have 20 successful registrations with payments processed as they should be. But 1 payment has gone through successfully without any registration data or identifying data in Stripe, and 6 or 7 of these "unknown" Stripe payments appear to be stuck in the "Uncaptured" stage in the Stripe system.

I've found multiple instances in the CiviCRM logs like this:

```
Nov 30 23:13:41  [error] $Fatal Error Details = Array
(
    [message] => Could not find valid value for id
    [code] =>
)

```

Tail end of backtrace like this:

```
Nov 30 23:13:41  [debug] $backTrace = #0 /home/fawcoho/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(385): CRM_Core_Error::backtrace("backTrace", TRUE)
-1 /home/fawcoho/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Request.php(121): CRM_Core_Error::fatal("Could not find valid value for id")
-2 /home/fawcoho/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)

```

Any troubleshooting ideas welcome -- Stripe has already confirmed that for these incorrect payments they are receiving the credit card info (number, expiry, CVC) but not any other identifying information.

# Answer
That looks like a bug in the events component (possibly, specific to Joomla). The error is happening in the constructor of an object that is managing the event registration process (https://github.com/civicrm/civicrm-core/blob/master/CRM/Event/StateMachine/Registration.php), presumably after the payment has occurred. It's failing to get the id of the event, which it normally will pick up from the url or as a hidden post value from a form.

The numbering of the error line suggests that your CiviCRM version is not up to date, and I suspect you're using the event "cart" feature which is not as maintained as the standard event form/flow.

Conclusion: probably not stripe related, but a CiviEvent error.

Also, here's a similar post: CiviEvent: Could not find valid value for id (Drupal 7.6.1)
> 2 votes

---
Tags: civievent, payment-processor, stripe, online-registration
---


# Question
Title: Deleting and Restoring a Contact detaches Contact from User
One of our administrators mistakenly deleted three contacts while trying to remove them from a distribution list. I restored the three contacts from trash, but didn't notice that the three restored contacts now no longer showed a Drupal User ID next their Contact ID in the CiviCRM summary screen for the contact.

The users were unable to sign up for events (you have to be have a membership to access signup), and when we realized this, I found each User, clicked the Edit button, then I clicked the "LMGA Member Info" button in the upper right of the Drupal User Edit screen. Just opening that tab showed the CiviCRM info for this member, and then I found that the CiviCRM summary screen for this user now showed Contact ID/User ID. The link seemed to have been restored by Drupal accessing the CiviCRM tables.

I think all is well now, but I'm unsure of what actually happened and why. Can some kind soul please enlighten me?

Thanks, Rick

# Answer
> 2 votes
It's on purpose that it removes the link to the user when you delete. It was added years ago here: https://github.com/civicrm/civicrm-svn/commit/3d9843c5912cb9d77e557b4a8cd4ef711f2cdcbb

and seems related to deduping https://issues.civicrm.org/jira/browse/CRM-6861

But yes Civi will reattach them once you do something that triggers the matching which is usually on email address, i.e. if the drupal user and the contact record have the same email.

---
Tags: drupal, civimember
---


# Question
Title: Form Submissions Overwriting Existing Contacts
Our form is overwriting existing contacts when a new submission is made.

All of our dedup rules are related to same names and emails; I do not see any dedup rule that would overwrite a (seemingly random) contact record with a new contact's information.

How can I prevent this in the future?

This issue began with my question here.The suggestion was excellent, and helped me get to a better understanding of what happened. But I'm still missing precisely where the overwrite is happening. (To be fair, the full suggestion is to check the logs, but I lack the ability to write a query that pinpoints what I want to understand)

# Answer
Thanks for everyone's input. It was a very odd matching rule, one that matched on last name with length = 1, weight = 1. I will see when this was added to the site.
> 2 votes

# Answer
What is your Matching Rule in the Webform configured at? This is where you find that:

Next -\> post a screenshot of that Rule (in your CiviCRM config) as well as a Screenshot of your Webform tab (showing all the elements on the form as well as their Form\_keys
> 0 votes

---
Tags: webform-civicrm
---


# Question
Title: How to email a link to a confidential document in Civi
A client runs several night shelters for the homeless & uses Civi. They want to email a 'daily activity' report to staff & volunteers - the content of which is confidential. All staff & volunteers have access to Civi. The report consists of information about who is duty manager, a list of guests with notes and some information about other local homeless accommodation - so much of it is fairly dynamic and could be in a message template, a Word document or spreadsheet. Because it's confidential we don't want to send the actual report in the email, because the receiver of the email would of course retain the email with the report in their account. To avoid this we want to just send an email with a link to the report that's somewhere in Civi. We tried Google Docs but ran into access problems. Suggestions are very welcome on how this might be achieved in Civi, please! We're using Drupal, Civi is at 5.19.3, open to using webforms & Views.

# Answer
I would be building it as a View and setting the Roles for access to the View from there.
> 3 votes

---
Tags: drupal, civimail, reports, message-templates
---


# Question
Title: Providing Smart-Group Specific Price Sets
I see there is an extension that indicates it will allow group-specific price sets: https://github.com/zengenuity/civicrm\_groupprice

I'm running civi 5.20 on Joomla, and when I activate this extension and edit a Price set, I don't see the option to limit a Price Set to a group.

Is anyone using this extension successfully? I see is is built for civiCRM v4.4, so I'll hazard a guess it doesn't work with 5.20 .. but I wonder, what are people doing instead, to provide group-specific pricing?

My requirement is that I need to provide Member and Non-Member pricing for an event with several options (like Opening Night + Conf and Conference Only), and Members and non-members pay different amounts... How can I do this?

# Answer
> 1 votes
You could try CiviDiscount which offers options for eg auto-discounts for people logged in or using a checksum who are Members

---
Tags: civievent
---


# Question
Title: Combining Event, Membership & Contacts into single report
So I can easily create a Search Builder for what I want, my challenge is creating a report that I can print an take to an event

Criteria: Either registered for event OR A member of a specific group

From Contacts Name, Email

From Membership Status, End Date (if any)

From Event Registration (if any)

The problem is that all the report templates are missing one or several of these items, or assume you only want event participants or current members.

Am I missing something or this is a known limitation?

# Answer
> 3 votes
If you are using Drupal, you can create a View that shows all that data. When you build the View, on the right click Advanced and in Relationships add the CiviCRM tables so you can show both Event & Membership data. Add the Drupal Views Data Export module so you can download the results and print it.

# Answer
> 1 votes
Under Actions use the Export as CSV for the event and the members reports. Then copy and paste the one list with the other and sort them however you want. I know it is not one simple step within Civi but it should get you what you are looking for.

# Answer
> 0 votes
I think that you can do this with the constituent detail report under contact reports.

First of all, I think you need to create a temporary group with the people you are interested in. Find the participants for the event you want and add them to the temp group. Then find the contacts in the group you are are interested in and add them to the temp group.

Then in the constituent detail report filter by the temp group. In the columns selection, remove all to do with contributions and activities, add email in for the contact and select other columns as you require.

---
Tags: civireport
---


# Question
Title: Do any token extensions provide a token for "age" rather than just DOB?
Age is displayed on a contact record but only DOB is a token available in message templates.

Are there any extensions that make age available for use? I've not been able to locate anything.

# Answer
This sounded like a useful feature, so I added Age tokens to Eileen's CiviTokens extension, which seems to be the most widely used extension of its kind. Until a new release comes out, you'll have to pull from the master branch of the git repo.
> 5 votes

# Answer
I don't see any either, but the code to use in such an extension (as either a token or even a smarty modifier) seems pretty straightforward:

https://github.com/civicrm/civicrm-core/blob/5.19.2/CRM/Contact/BAO/Contact.php#L2677-L2684

```
      if ($contact->birth_date) {
        $birthDate = CRM_Utils_Date::customFormat($contact->birth_date, '%Y%m%d');
        if ($birthDate < date('Ymd')) {
          $age = CRM_Utils_Date::calculateAge($birthDate);
          $values['age']['y'] = CRM_Utils_Array::value('years', $age);
          $values['age']['m'] = CRM_Utils_Array::value('months', $age);
        }
      }

```
> 5 votes

---
Tags: contacts, tokens, message-templates
---


# Question
Title: How to prevent CiviCRM contact from receiving emails for Scheduled Reminders
When a contact (dashboard) is edited, I see Communication Preferences as
the option where I can tick NO BULK EMAILS or under Privacy "Do not mail"
Will that stop the emails from being sent during scheduled reminders(ran
through CRON)
Where is the code for the same located in the CiviCRM core? Can I add
event subscriber to it ?
I am using sendgrid as Mailer

# Answer
> 2 votes
From UI you can set the contact email to 'On-hold' this will prevent contact from getting any automated email from CiviCRM. The other option is use to mailing hooks to abort emails being sent based on some flag set for the client.

HTH

Pradeep

---
Tags: email, scheduled-reminders, opt-out
---


# Question
Title: How to customize the layout of a Contribution form created in Wordpress
The title pretty much describes the question. In Wordpress it is easy to customize the layout of a post/page by using child theme. I wonder how to do so for a CiviComponent, say, contribution page.

# Answer
You can setup a custom template directory (Administer \> System Settings \> Directories \> Custom Template Directory) and add code to a Main.extra.tpl (the directory is (your\_path/CRM/Contribute/Form/Contribution/Main.extra.tpl) and also see this Styling Contribution pages with buttons.

Or use an extension which is a preferred way: https://docs.civicrm.org/dev/en/latest/framework/templates/customizing/.

You can also add a custom style sheet for civi under Administer \> System Settings \> Resource URL's \> Custom CSS URL for global styling changes. Conversely, if you want your theme to handle styling then configure CiviCRM Admin Utilities which will give you an option on disabling civicrm.css on the front-end.
> 3 votes

---
Tags: wordpress
---


# Question
Title: Drupal views: text search in country name
When viewing CiviCRM contacts in a Drupal view, you can filter on the Address:Country , but the filter widget proposes you to filter on one or more of the 300+ countries in CiviCRM.

When exposing this filter, the user sees those 300+ countries. If only ~50 countries actually have contacts, such a dropdown is not very useful. Most countries will return 0 results.

It would be good enough if I can have a text search on the name of the country, but I can't get that to work. The filter only supplies the country id (eg using a 'combine' filter on the single field requires you to enter a number as a search string - that works).

Is there any way to pull the country table into the view and, for example, rewrite the view using `hooks_views_query_alter` to allow you to filter on the country name ?

Or any other solution someone found, like limiting the dropdown to used countries only ?

# Answer
> 2 votes
You might find this module even better than you expect:

Views Selective Exposed Filters (views\_filters\_selective)

"Restrict exposed filter values to those present in the result set."

Whenever you're looking at a selection (or subselection), it'll filter the select options to only those options that are in the result set. So you never have the issue of pointlessly offering filter options that will give the visitor an empty result.

https://www.drupal.org/project/views\_selective\_filters

\[thanks Aidan\]

# Answer
> 1 votes
> Or any other solution someone found, like limiting the dropdown to used countries only ?

In a Views filter of Country you should be able to select the ~50 that you want listed, and then set the option that says something like "limit to selected items only"

---
Tags: search, drupal-views, addresses
---


title: Printer Friendly Contact Record

text:
# Question
Title: Printer Friendly Contact Record
What is the best way to setup a custom printer friendly link on each contact record? i would like to have a print button on the top of each contact record that would allow someone to view a better looking pdf version of the information on a contact record.

# Answer
> 0 votes
If you use Drupal, I'd recommend setting up a view that lays out the bits you want for your print-friendly data screen, and then use the Drupal print module to give you the print-friendly and/or pdf-generated versions.

The print module can actually generate both print-friendly and pdf-generated versions of any page (via a url trick, prefix with "print/"), i.e. you can use a url like this:

```
/print/civicrm/contact/view?reset=1&cid=yourcontactid

```

but they probably won't look very nice. You can do some customziations via the print.css file of your theme.

It's probably harder than you think, less useful, and not a good idea most of the time as noted in the comments above.

---
Tags: contacts, printing
---


# Question
Title: Attachment too large for mailing - should there have been a warning?
Recently had a user attach a .docx file that was 14 MB to a mailing. (Probably a single picture in the document was to blame.) As one would expect, the messages bounced rather than being delivered. However, the mailing reports just showed a bounce type of Syntax. As you can imagine, this is rather unhelpful. Digging around, I finally turned to the system's logging for maillog where I found the report of the attachment too large. Should I have found this information somewhere in CiviCRM itself? Perhaps in the mailing report that I overlooked?

# Answer
> 1 votes
There's an administrative setting that controls that limit here:

Administer -\> System Settings -\> Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)

The "syntax error" you are seeing is likely what the Civi mailer is getting back from the smtp server. I've seen that as a kind of catchall error message from mailers (e.g. it's what sparkpost will report when not configured). I don't think that Civi can do anything other than pass it on - i.e. the reporting error is from the system that's trying/failing to send out the mail.

Personally, I think there should be a message in the CiviMail system strongly discouraging attachments and encouraging attachments to be uploaded and linked to instead. That will increase deliverability.

The only really good use-case for attachments is if the document is private.

So the answer to your question is: "no".

---
Tags: civimail, civireport, logging
---


title: Send scheduled reminder to group

text:
# Question
Title: Send scheduled reminder to group
I am trying to send an Activity-triggered scheduled reminder to a group. These contacts will not be otherwise associated with the Activity.

Recipients \> Send to group doesn't seems to be working and there's something in the documentation that suggests only members of the group that *also* meet some other criteria (Activity associated contacts?) will get the email, but this isn't clear.

So maybe it would work to use the 'Limit or Add Recipients' \> 'Also include' option. But this doesn't exist in scheduled reminders *only* for Entity type = Activity.

Thinking about asking someone to write an extension to override this on our site, but want to check there's not some deep reason this is omitted for Activities.

Or maybe it's a bug, and Recipients \> Send to group is supposed to work...?

Thanks for the help.

# Answer
> 2 votes
We ended up commissioning AGH Strategies to write an extension. Check out github.com/aghstrategies/com.aghstrategies.activityemail and the readme: github.com/aghstrategies/com.aghstrategies.activityemail/blob/… - that was the missing piece for us.

---
Tags: activities, groups, scheduled-reminders
---


# Question
Title: SMTP error 501 when extension Transactional Mail - Bounce and Tracking Handler is enabled
I use CiviCRM (v5.20.0 on PHP 7.3.11 in Joomla) to send scheduled reminders for membership expiration. The mails are sent via SMTP. This works okay when i send a reminder to my own account so i expect it to work for all other accounts. Though I would like to see if mails are indeed sent but I don't see any logging where i could find if, when and to whom an e-mail has been sent.

Now I found an extension called Transactional Mail - Bounce and Tracking Handler and i installed it. When i try to send mail via the Job Send Scheduled Reminders, I see following error (only when the extension is enabled):

```
Failed to set sender: b.1.49.90b5f37ff0be023e@ [SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP). (code: 501, response: : domain missing or malformed)]

```

Any help would be appreciated.

# Answer
The invalid sender address in the messages suggests that you have not set up your CiviMail -\> Mail Accounts bounce account with a proper domain - that sender would normally have that domain after the @ sign.
> 1 votes

# Answer
Thanks for the answer. I was testing with my own mailaccount in Civimail. When I changed the setting to Used for Bounce processing, i lost all my emails in the inbox although the account was setup as IMAP. I was lucky to have a backup :) I found out how to track to whom a reminder has been sent (Reports\>Contact reports\>Activity Summary). For me this also is okay so far.
> 0 votes

---
Tags: civimail, error, smtp
---


# Question
Title: Why should I use an ~/extensions directory rather than the default ~/ext for new extensions?
It seems like not an uncommon practice - or at least, by two CiviCRM partner shops that I know of :) - to use an ~/extensions directory for adding new extensions, rather than the default ~/ext directory.

Why is that?

I don't see that recommendation/practice in the docs anywhere, or at least not at https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/

# Answer
There are several things in play at different levels with regard to the CiviCRM extensions directory location. The concepts to be aware of are:

* CiviCRM shipping codebase
* Drupal multisite
* Drupal's files directory

## CiviCRM bundled extensions

As @Demerit's answer states, `sites/<sitename>/modules/civicrm/ext` contains the extensions which ship with CiviCRM core. Don't put custom / additional extensions here; they may get deleted or overwritten on upgrade of the CiviCRM codebase.

(Would be good to add a link here to *which* extensions are bundled with core? This list will vary over time but presumably there's a `core-extensions.json` or something like that in the build process. IDK.)

## Drupal multisite directory

* `sites/default`
* `sites/all`
* `sites/example.org`

This level of the structure relates to Drupal's multisite mapping. Drupal will read modules, themes, etc from two of these: whichever best matches the current site, and `sites/all`. CiviCRM has a (non-Drupal) concept of multisite, but doesn't care about this level of the structure AFAIK. Your Drupal site developers likely do so if you have `sites/all/civicrm` and `sites/example.org/civicrm` you might infer that the latter is applied only to the example.org sites, but you'd need to check CiviCRM configuration to be certain.

Above and below, the active multisite directory and the shared directory (`default`, `example.org` etc and `all` also) will be referred to as `<sitename>`.

## Drupal files directory

Drupal's `sites/<sitename>/files` directory is configured to be writable to the PHP application (and it's recommended to configure the webserver to prevent direct execution of PHP code in that folder). See Drupal public file directory documentation for more.

Many developers resist having a web application's files writable to the webserver - preventing a web application modifying its own code is a defense against attacks which persist over time by introducing malicious code to files which will be executed by the application later. This is what KarinG's answer is referring to. Others will prefer the convenience of allowing applications to self-manage and therefore self-update.

CiviCRM's default placement of extensions in `sites/<sitename>/files/civicrm/extensions` reflects the latter position, as CiviCRM can then download and run extensions from within that directory.

Developers who prefer to manage their codebase through tools such as Git may prefer to use the former model and relocate the extensions directory to `sites/<sitename>/civicrm/extensions`, `sites/<sitename>/civicrm-ext` etc. Since this isn't a Drupal practice there's no established standard for the structure.

## CiviCRM ain't Drupal

It's worth noting that CiviCRM doesn't require you to keep extensions in the webroot at all, unless an extension requires direct access (probably not a good sign?). So you could merrily set the extensions directory to `/tmp/whatever` and CiviCRM would function quite fine. Only convention, if you subscribe to it, dictates that the extensions might live alongside Drupal modules, themes etc.
> 5 votes

# Answer
The `ext` dir that ships in the tarball is for extensions bundled directly with core like IATS. If you put other extensions in there they will get wiped when you upgrade, so it's common to put them somewhere outside the civicrm folder.

See also https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#enabling-extensions
> 5 votes

# Answer
The reason we do that with client sites is because I don’t think it’s a good idea to put code under /files. It belongs at the level of /modules. Permission requirements for code and /files are quite different. Another benefit is that it allows me to more easily put the code for a project in git.
> 4 votes

---
Tags: drupal, extension
---


title: Annual Memberships Renewed Early

text:
# Question
Title: Annual Memberships Renewed Early
We have memberships that are "fixed" from Jan 1 through Dec 31. This works fine except for that we want that if anyone creates or renews a membership in November or December, that their membership will be valid for this year and next year.

So if I create/renew my Membership in September 2019, I will be a member from then until December 2019.

But if I create/renew my Membership in November 2019, I will be a member from then until December **2020**. Here I will get Nov/Dec of this year "for free" and then be a member for all of next year.

Presently, if I create/renew a Membership in November 2019, it ends December 2019.

# Answer
> 5 votes
You need to configure the rollover date in the Membership Configuration. Please see:

https://docs.civicrm.org/user/en/latest/membership/defining-memberships/

---
Tags: civimember
---


# Question
Title: Delete wordpress user when related Civicrm contact is deleted
I would like that when an admin deletes a CiviCrm contact it also deletes the wordpress user that is linked. I am using "CiviCRM WordPress Member Sync" so when a contact is created it is added to wordpress but it doesn't delete the wp user when contact is removed. This would be quite precious for me as I know I will later need to delete so many users and I don't want to do it twice, on Civicrm and Wordpress.

Would you have a solution ?

Thanks

# Answer
> 3 votes
In general there is a risk of having a CMS user deleted when the CRM contact is deleted, since the CMS user can (in theory) be the author of pages, comments etc

Therefore Civicrm does not offer this directly and I think you would need to find/make a customisation/extension or see if there is a tool in WP that you could use that would make it easy to find all WP users that are not connected to a civi contact and then delete them (there are solutions for this with Drupal using Views and VBO, and potentially also Drupal Rules in case any of that provides hints for WP)

---
Tags: wordpress, contacts, user, delete
---


# Question
Title: Auto-register people for events based on membership
We are going to introduce a new tier of membership to our organization that gives people unlimited access to certain category of events. So the event would typically cost $X, but if you are a member, the event is free.

I know that I can use CiviDiscount to let the user register for $0. But as a value-add, I'd like to actually auto-register them for the event. I'm looking for validation of how I might do this.

Here are some things I have thought of...are there others you would suggest? Which of these do you think would work best or easiest?

* Could I use CiviRules? So...trigger on new event create, filter by type of event, action is register anyone with membership X? I don't honestly know if CiviRules could do that but it was a thought.
* Could I create a Drupal view that lets a member of our back-office team select an event from a list, and select a membership, and then executes some kind of VBO or Rule that registers those people?
* Could I use webform? Perhaps create a webform that pre-selects people in membership X and lets a back-office member quickly register than on a selected event?
* Could I use the Civi API and write a script (perhaps that I trigger by cron) to register people with the right membership to events?

Thank you

# Answer
You can already do this (manually) by searching for the contacts with a certain membership (advanced search) and then select the action register participants for an event.
> 2 votes

# Answer
We have used VBO for changing registration status so if this was not yet currently an option for adding people to the event it feels like not a big stretch, but since automated would be the best route i would be looking down the Drupal Rules approach if civirules can't offer it
> 0 votes

---
Tags: civievent, drupal-views, civirules
---


title: Civicrm Custom Profile Wordpress

text:
# Question
Title: Civicrm Custom Profile Wordpress
I have a wordpress site with CiviCRM. I use this to provide a 'members area' for contacts with a civicrm membership.

When contacts first log on I would like to get each member to fill out a survey, and once they have provided the information - they will no longer need to see it.

I believe the best way to present them with this survey is by using custom fields in a profile and embed it in a wordpress page using shortcodes. But is there a way to hide, or disable the custom profile from the users view once it has been completed?

# Answer
Not as a built-in CiviCRM feature.

Perhaps you don't want to use profiles for this, but could instead use a Wordpress specific form builder? You need some integration with Wordpress because using a state related to whether or not they've filled in a form would be handled within the CMS (which handles user authentications, sessions, etc.).

I believe Wordpress provides a couple of form builder options that integrate with CiviCRM. https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/forms/

Alternatively, you could replace the permissioning with workflow (in a limited way) and use the profile but only link to it at specific times, e.g. via the membership thank you message.
> 3 votes

---
Tags: civimember, profile
---


# Question
Title: Thank-you letter incorrect contribution currency
My setup: CiviCRM 5.20.0 on Drupal 7.

I entered contributions in different currencies. In Find Contributions, check some entries. At Actions select Thank-you letter print or email.

I put tokens Contributions:

`{contribution.currency} {contribution.total_amount} {contribution.fee_amount} {contribution.net_amount}`

and it gives me lines like these:

CNY HK$ 1,299.90 HK$ 0.00 HK$ 1,299.90

GBP HK$ 500.00 HK$ 0.00 HK$ 500.00

where CNY and GBP are the currencies of those contributions and HK$ is the symbol of the default currency.

It seems the amounts variables just took the system default.

Would you suggest some work-around? e.g. how to strip the wrong currency symbol.

Thank you.

# Answer
> 3 votes
Well - there's a bug worth reporting here, but I understand your priority is getting these letters out. This should do the trick:

* Go to **Administer menu » Localizations » Languages, Currency, Locations**.
* Change **Monetary Amount Display** to `%a`.

---
Tags: contributions, message-templates, smarty, currency
---


# Question
Title: Which payment processor to use for the new 'Paypal checkout'?
A while ago there was a announcement that CiviCRM now offers "PayPal Checkout".

Which payment processor should we be using to utilise Paypal checkout?

In the list of Paypal payment processors on the latest version of CiviCRM the options provided are:

* Paypal express
* Paypal Website payments pro
* Paypal Website payments standard

Ideally i'm looking for the simplest setup to remove PCI compliance responsibility.

# Answer
> 2 votes
You need to install Omnipay extension to use Paypal checkout payment processor.

---
Tags: contributions, paypal
---


# Question
Title: Fetch Node data from drupal into CiviCRM
I am interested to know if it is possible to fetch node data from Drupal into CiviCRM.

Is there anyway to do this?

My End Goal is to to populate a "select list" with node titles from drupal and depending on which title you choose, fields values will change.

Thanks,

Moe

# Answer
I wasn't able to figure this out so data is Fetched directly into CiviCRM. However, I ended up using Drupal EntityQuery and fetched the data into a webform then Used Javascript PopUp Feature and parsed the data back into the CiviCRM form using Jquery.

Thanks
> 2 votes

# Answer
On which forms do you wish to add the fields/logic?

I feel like there are two questions here:

1) How to build an arbitrary list of options from a third-party source of data (Drupal)

2) How to set the value of one field based on the value of another fields.

For (1), arbitrary lists, you can look into hook\_civicrm\_fieldOptions, which can dynamically modify the option list for any field. I believe the value still needs to be valid, but if it's a select that stores an integer or a string, I think it's OK.

For (2), I have an extension called fieldconditions, but it is not end-user oriented because it requires writing custom javascript (I would be happy to improve it, if anyone is interested).

Alternatively, CMS-specific form builders (Caldera for WordPress, Webform for Drupal7) might be able to help, until formbuilder is ready (also known as afform).
> 2 votes

---
Tags: drupal, custom-fields, ajax, jquery
---