title: Dashboard Summary on Memberships Page

text:
# Question
Title: Dashboard Summary on Memberships Page
I've just found out that the Membership Dashboard - specifically the summary table at the top of that page - is not visible if you don't have the permission 'CiviCRM: view all contacts'. Is there any way around this?

We've just implemented ACLs on a site and the staff member looking after memberships would like the dashboard back...

# Answer
This looks like a hardcoded limitation in CiviCRM, and changing that would require some development work (i.e., there's no workaround or trick to it, just needs code changes).

Interestingly, there's a comment in the code that indicates a desire to add support for ACLs instead of the sledgehammerish 'view all contacts' requirement: https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/Page/DashBoard.php#L51

So my answer would be: yes, you're seeing it right; there's no way around this short of patching core, and it sounds like core is willing to be patched.
> 2 votes

---
Tags: civimember, permissions, acl
---


# Question
Title: How do I allow custom date field over 10 years ago?
Civi 4.7.3 and Wordpress 4.4.2

Since upgrade from 4.7 to 4.7.3 I cannot seem to add a custom date field and allow the user to select a date older than 10 years ago. Recreated on Demo site: Click here to view demo field.

I set the options to allow 90 years before previous date, but still I only get last 10 years in the list from the calendar.

Shall I raise this on Jira?

# Answer
> 2 votes
> Also posting my answer to How do I override the default date range of JQuery date widget? here - for those following this Question:

I think the answer may be that this is working in 4.7.7 - set your date range in the Custom Field - Edit screen \[I want to go back 30 years\]:

Custom Date SE field:

And this is indeed giving me a dropdown going back 30 years (I can select 1986):

# Answer
> 1 votes
I've just checked this on the demo site. It appears that you can type in any date up to the limit (in this case dates after and including 1 Jan 1926). However, the date picker widget only shows the last ten years.

I'm not sure you would want the date picker widget to show all 90 years as that would make the drop down list very long. So I think this may be working as designed.

# Answer
> 0 votes
We noticed the same issue, but it was only happening if eg we set a years for the past and not set one for the future. If we also added one for the future it worked.

Our thinking is that if only is one set then the options are potentially infinite and hence the default +/- 10 kicks in

---
Tags: custom-fields, profile, dates, date-preferences
---


title: Drupal Webform CiviCRM Warning message

text:
# Question
Title: Drupal Webform CiviCRM Warning message
When my Drupal CiviCRM Webform is filled out and submitted, the CiviCRM database appears to be updated correctly. That is, a new contact is created with all the proper information included from the form. The Webform confirmation page announces: "Thank you, your submission has been received." However, a red error box also appears that says:

"Warning: implode(): Invalid arguments passed in CRM\_Core\_BAO\_CustomGroup::postProcess() (line 1551 of /home/mywebsite/www/crm/sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php)."

Any idea what this means and how to get rid of the error message?

Drupal 7, CiviCRM 5.14.1

# Answer
That's just a notice -\> best to hide all notices and errors on a production site:

go to your: admin/config/development/logging

and set the radio button to: None
> 3 votes

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


title: Need to change membership inheritance

text:
# Question
Title: Need to change membership inheritance
We have household memberships set up for the household members to inherit from the household.

We also limit the number of memberships per household (currently set to 4).

We did this because on import, any attempt at having the entire household inherit from one member resulted in multiple memberships (always 4). Not nice.

Now, after almost a year of use, we have an issue with credit card renewals if the member wants to auto renew. Despite the fact that the renewal email came from the household, the credit card company put the renewal on the household member whose credit card was used. The household and spouse did not inherit the membership.

I can't change the inheritance rules given that they can only be changed when the membership type is not in use. We have thousands of members and 8 membership types.

I can think of a couple of possible ways to accomplish this, none nice. Ranging from create a whole duplicate set of membership types and transitioning them manually when renewals come in (ugh, ugh) to exporting the entire membership table, changing all membership types to have a max of "0"(unlimited) members and allowing inheritance from any member of the household, to attempting to delete one membership level at a time and re-import those.

Has anyone figured out a way to get this done in a reasonably painless way.

Thanks.

# Answer
Just sharing that we have developed and released a CiviCRM extension which solves this problem, see https://github.com/agileware/au.com.agileware.membershiprelationshiptypeeditor

Membership Relationship Type Editor for CiviCRM - edit existing Relationship Types and re-calculate inherited memberships

We hope this is useful to people using CiviCRM.
> 6 votes

# Answer
The way you pose of updating via the UI sounds like the best plan unless you have access to a programmer who can mess around in the database for you - if you do, they can update the `civicrm_membership_type` table by adding the relevant `relationship_type_id` and `relationship_direct` values, and then they would probably need to run a script to update any records that were received before this change.

Although a bit after the fact, it's not too late to change your process from recording any financial related information on the household record to the an individual contact record precisely for this reason - when people pay on line, they typically log in as themselves, not their household, or, even if not logged in, payment information is entered for an individual, not a household, so this will prove to be a more consistent method with the added help of permissioned relationships (e.g. so that spouses/members of a household can see what financial obligations need to be paid for regardless of how they are logged in).

Hope this helps!
> 1 votes

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


title: `json` parameter in the request API

text:
# Question
Title: `json` parameter in the request API
The parameters in the API are confusing, especially the depth + the `json` paramter.

I have seen these three combinations and my question is, which variant is wrong and which is not.

I can't figure out from the results what exactly is going on as most of my queries don't yet return what I'm expecting, so I want to get this clear first. I think Civi has some kind of fallback magic as in some requests I get `undefined_fields` but it returns correct results.

---

Entity related stuff goes into the root level, as seen in different (inofficial) files:

```
{
  'api_key': '...',
  'activity.id': 123,
  'json': {
    'options': {
      'limit': 1
    }
  }
}

```

---

The API Explorer suggest entity/attribute related stuff goes inside the `json` parameter:

```
{
  'api_key': '...',
  'json': {
    'activity.id': 123,
    'options': {
      'limit': 1
    }
  }
}

```

---

Variant without nesting and `json` beeing integer as seen on https://docs.civicrm.org/dev/en/latest/api/usage/ :

```
{
  'api_key': '...',
  'activity.id': 123,
  'limit': 1
  'json': 1
}

```

P.S I'm accessing the REST API via HTTP calls to `/sites/all/modules/civicrm/extern/rest.php`.

# Answer
The last one look OK to me, the JSON parameter AFAIK is there just so I get the results in JSON format rather than XML format.

But are you doing your api call with the REST, in Javascript or in PHP? And did you check the API chapter in the Developer Guide? It can be found here: https://docs.civicrm.org/dev/en/latest/api/
> 1 votes

# Answer
It looks like you're doing this via REST. The API explorer gives this:

`https://dmaster.demo.civicrm.org/sites/all/modules/civicrm/extern/rest.php?entity=Activity&action=get&api_key=userkey&key=sitekey&json={"sequential":1,"id":123,"options":{"limit":1}}`

If you explain more about what you are trying to do you may get better answers.
> 1 votes

---
Tags: api
---


# Question
Title: Replacing the Contact Dashboard with Views
Has anyone started a project of creating views to replace the contact Dashboard that would show:

```
Recurring Contributions
Memberships
Donations
Event Attendance
etc.

```

I am considering starting this project and wanted to make sure I did not duplicate any work.

# Answer
> 3 votes
I think the Views block shared here may be a step in the right direction.

# Answer
> 0 votes
See https://civicrm.org/blog/brandonferrell/drupal-views-in-civicrm-dashlets

The civicrm\_views\_dashlets module lets you add views to the dashboard, but it does not replace it.

---
Tags: drupal-views, dashboard
---


# Question
Title: Failure in setting up Sparkpost for outgoing mail
I've created a sending and bounce domain on Sparkpost, ccrmmail.vietfeir.com. This domain has been verified by Sparkpost. I have an api key with all grants. When I try to save and send, I get this error:

```
Could not check status for domain vietfeir.com (Exception Sparkpost error: Permission denied. Check that the API key is authorized for request https://api.sparkpost.com/api/v1/sending-domains/vietfeir.com.).

```

How can I configure this correctly to use ccrmmail.vietfeir.com instead of just vietfeir.com?

# Answer
> 2 votes
I got Sparkpost support to help me with this. I needed to add a DKIM TXT entry in my DNS for vietfeir.com and generate a new API key.

---
Tags: civimail, sparkpost
---


title: View contacts but not activities

text:
# Question
Title: View contacts but not activities
I'm a bit stumped on permissions. I'm trying to create a user role that can

* See and edit any user
* See and edit custom fields for the user
* NOT see or edit activities for any user
* NOT see any financial information for any user

I tried this combination of settings:

* CiviCRM: view all contacts : CHECKED
* CiviCRM: view all activities : NOT CHECKED
* CiviCRM: Delete activities : NOT CHECKED
* CiviCRM: access CiviCRM backend and API : CHECKED
* CiviCRM: access Contact Dashboard : CHECKED

This arrangement seems to allow the user to see all contacts but also all activities on all contacts.

If I remove "CiviCRM: view all contacts" then the user can see no contacts at all, and no activities.

I don't really understand why "view all contacts" gives access to see activities when the activity permissions are turned off. That seems counterintuitive.

And I can't find a combination of permissions that allows a user to see/edit all users, but not see/edit any activities.

Suggestions?

(CiviCRM 5.8.2 on Drupal 7. I'm aware a security update is needed to CiviCRM.)

# Answer
> 5 votes
I guess Activity type ACL extension will do your job. This extension provides additional permission for each activity type. By default its set to false for all activity type.

HTH

Pradeep

---
Tags: permissions
---


# Question
Title: How can I include a non-participant's details in the receipts?
I have setup an event on a webform with 2 contacts. Parent: Contact1 - Child: contact2

* Contact1 is there only to create a relationship with CONATCT2 and not a participant of the event.
* Contact2 is the actual participant.

When the receipt is triggered after successful payment, obviously Details of Contact1 does not show in the receipt because he is not a participant.

How can I include the details of Contact1 in the receipt template please? Can anyone help please? Thanks

# Answer
It's a slightly different question but you should be able to use the same technique as described here, i.e. use the api in your message template to look up the info: https://civicrm.stackexchange.com/a/29232/181
> 3 votes

---
Tags: webform-civicrm, email, receipts
---


title: Failure in setting up replies mailbox

text:
# Question
Title: Failure in setting up replies mailbox
CiviCRM 5.14.0 I am using the Sparkpost extension This is a new site in testing phase

I have set my from email address to be: "Site Administrator" This domain has been verified by Sparkpost and is a working mailbox.

If I set up a mailing and click on Track Replies in the response tab, I get this message:

```
The "Track Replies" option conflicts with the "Reply-To" option. The "Reply-To" option has been disabled.

```

I assume that this is just a warning that the system will not use the "From" email address for the reply.

When the recipient clicks reply in the email client, the reply address looks like this:

r.105.160.ac5032573de28c3c@vietfeir.com

This address obviously does not exist on in my Postfix virtual\_users table. I also believe it should be r.105.160.ac5032573de28c3c@ccrmmail.vietfeir.com and use the domain of the From address.

I changed the reply address to r.105.160.ac5032573de28c3c@ccrmmail.vietfeir.com and got this error.

```
An error occurred while sending mail. The mail server responded:
5.1.1 <r.105.160.ac5032573de28c3c@ccrmmail.vietfeir.com>: Recipient address rejected: User unknown in virtual mailbox table.
 Please check the message recipient "r.105.160.ac5032573de28c3c@ccrmmail.vietfeir.com" and try again.

```

Now, ccrmmail.vietfeir.com is a CNAME that points to sparkpostmail.com but it is still being rejected by my Postfix server.

I'm not sure what to do to fix this.

# Answer
> 2 votes
I changed the address to include a local part so VERP. This now works

---
Tags: civimail, sparkpost
---


# Question
Title: Paypal Payments Pro give 'Internal service Error' on checkout
I'm trying to hook up Paypal payments using Paypal Payments Pro.

I'm trying to use the sandbox and live payments account and I keep getting the 'Internal Service Error' on checkout. This happens when using the form and also the checkout button.

Can anybody point me in the right direction with this? Has anybody set this up themselves?

The live account is definitely active.

Would be good to know if anybody has this running correctly. The account is a UK Website Payments Pro Account

# Answer
> 0 votes
Not 100% on the route cause however I ditched any customisation and rebuilt from the ground up. I imagine something changed and hasn't been updated to reflect new functionality in the code base.

There was a brief question mark over the paypal checkout button, just need to make sure you are running the latest v4.26 of webform\_civicrm.

---
Tags: paypal
---


# Question
Title: Cannot filter on contact subtype in Drupal8 views
I don't know the depth of CiviCRM's official commitment to Drupal 8 yet, but I've followed the instructions posted here for setting it up.

After creating a contact subtype of "Committee" and creating a Drupal view for "CiviCRM Contacts", I attempted to filter on the Committee subtype. When saving, I got a raw server error displayed:

```
The website encountered an unexpected error. Please try again later.

```

Checking the Apache logs, I saw:

```
Uncaught PHP Exception InvalidArgumentException: "The configuration property display.default.display_options.filters.contact_sub_type.value.Committee doesn't exist." at /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php line 76

```

This seems to imply that the CiviCRM Views integration isn't providing something that the Views module wants in order to validate the filter value.

Anyone have any suggestions for next steps? Is CiviCRM's dev team developing for Drupal 8 and do they want related bug reports?

# Answer
You may find it helpful to join https://chat.civicrm.org/civicrm/channels/drupal which is where some active discussion about D8 is happening.

Including this update about webform integration
> 1 votes

# Answer
Thanks for this report.

You can report issues at https://lab.civicrm.org/dev/drupal/issues.

While CiviCRM works under Drupal 8 fine in terms of independent CiviCRM functionality, the support for various integrations into Drupal 8 is still a work in progress. Coleman with support from David Snopek and Will put out a prototype / mockup of D8 webform civicrm May 25 2018. There is going to be a Make It Happen fundraising effort and I'm sure that developer resources and effort will be appreciated.

For view support the plan is to implement a D8 version of entity civicrm module, and then leverage D8 Views support for entities. We at JMA recently pushed some changes to improve D8 entity civicrm support for contacts, but weren't using subtypes like you are. So it may or may not work when using entities. We are also ensuring there is good support for events in views via entities, and starting to help @jackrabbithanna with improvements to earlier Drupal versions of his entity civicrm module.

Feel free to contact me at joe dot murray at jmaconsulting dot biz if you'd like us to get specific D8 integration issues working for you.
> 1 votes

# Answer
Are you using civicrm\_entity? It seems to work when using that module. Tested on CiviCRM 5.14 and Drupal 8.6.
> 0 votes

---
Tags: contacts, drupal-views, drupal-8
---


# Question
Title: Logged in user registers for an event on behalf of a colleage, unintentionally overwrites their contact record details
We have recently required users to be logged in to access member-only discounts when booking events.

We are finding that some people are logging in and then booking on behalf of a colleague. They don't book for / attend the event themselves. They're currently missing the "Not X, or want to register a different person?" link at the top of the booking form.

So they are overwriting their own pre-filled details in the profile.

When they submit the form, eg at: https://culturalenterprises.org.uk/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&id=288&reset=1

it then updates some details. Most commonly it will update the title, and email, but leave the contact first name and last name unchanged.

Is there any way I can stop CiviCRM from doing this on event registrations? When I look at the profile settings it is set to update the matching contact when it detects a duplicate, and I'm wondering if that's what is at issue here. (Though obviously I don't want to turn that off!)

I am guessing that this is intended behaviour as CiviCRM assumes the logged in use is providing updated information for themselves?

Thank you

CiviCRM 5.13.4 on Wordpress.

# Answer
> 2 votes
Here’s the solution to the issue you're facing – https://civicrm.org/extensions/no-overwrite

---
Tags: civievent, contacts
---


# Question
Title: Extended Security Release confusion. Which version?
The information available about the Extended Security Release - https://civicrm.org/esr \- states that "The latest release of ESR is version 5.7". However I can see via the system status page on a few of my sites that 5.13.6 appears to be available, but only as part of the Extended Security Release. Can both of these bits of information be true?

# Answer
> 3 votes
Based on some posts in chat it sounds like both 5.7 and 5.13 are current ESR, with 5.7 supported for another month or so. The webpage seems out of date a little.

---
Tags: core
---


# Question
Title: Creating a summary of contents on civil mailings
Wondering if there is a feature in a civi mailing to create a summary of the various stories that are being included in a mailing whereby each story title in the summary is clickable and takes you further down in the email to the corresponding story.

# Answer
> 1 votes
There isn't an automatic feature but this is what html anchor tags do. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Linking\_to\_another\_section\_on\_the\_same\_page

So at the top of your html mail you can put

`<a href="#thing1">Thing 1</a>`

and repeat for each title/summary, and then use the id in your stories lower down like

`<div id="thing1">Here is the actual story.</div>`

---
Tags: mailing
---


# Question
Title: Display Membership type description on contribution page?
Can't seem to find the answer but sure there must be a simple way to achieve what I need.

On the contribution pages for Civi I would like to show the membership type description for the various membership types that need further explanation to users.

Is there a easy way to enable this or do I need to look at a more custom route?

Thanks in advance for any pointers!

# Answer
> 1 votes
Although the header and footer would allow me to put description above and below it wasn't exactly what I needed.

The best solution for me was leveraging the use of the Civicrm webform integration and adding the required mark up and form alters where I required them to achieve the required display.

# Answer
> 2 votes
If you did this as a Price Set you would be able to have some info in the post-field-help, and you can set the 'label' to be different to the membership type if you want eg

and actually the Price Options do have a pre/post help options but they show inline, presumably some minor theming could address that

Currently at https://dmaster.demo.civicrm.org/civicrm/admin/price/field?reset=1&action=browse&sid=10&new=1 but will be flushed within 24 hours

# Answer
> 1 votes
You could certainly put an explanation of the types in the introduction text box which is displayed immediately above the price set

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


title: How do I grep the CiviCRM universe?

text:
# Question
Title: How do I grep the CiviCRM universe?
I'd like to remove some deprecated code from CiviCRM core, but I'm not sure if it might be used by other extensions in the CiviCRM universe. Is there a way to search the code of all known extensions?

# Answer
You can use build kit to generate a repo including the civi "universe" https://docs.civicrm.org/dev/en/latest/tools/universe/

```
civibuild create universe

```

or

```
mkdir ~/src/universe
fetch-universe ~/src/universe

```

could be worth checking extension usage to see if there are any widely used ones that don't make the cut to get included.

Happy grepping!
> 4 votes

---
Tags: extension
---


# Question
Title: Wordpress Clean URLs show "Page Not Found"
Edited my civicrm.settings.php file to enable clean URL's (as described in https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/clean-urls/) It does not work and any time I try to go to a clean URL page I get the standard wordpress "nothing found page"

# Answer
Please check that you the base page here: https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/uf&reset=1

The value here

Should be an existing published WP Page.

I would then revisit the permalinks page.

That should 'fix' it.
> 5 votes

---
Tags: wordpress, core, urls
---


# Question
Title: Difficulty setting up CiviMail on Bluehost
I'm following the instructions here:

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviMail+Installation

and I've been running into some obstacles.

1) Bluehost does not support sub-addressing and won't let me create a catch-all so I don't know what to do for my return channel. If anyone has been able to set one up successfully on Bluehost please share how you did it. So far I have created an email account called return@mydomain.org and entered it as my bounce processing account under Administer \> CiviMail \> Mail Accounts.

2) Test emails are not going out so I'm pretty sure my cron job isn't working. Here's the cron entry:

```
CIVI_ROOT=/var/public_html/mydomain/wp-content/plugins/civicrm/

PARAMS= -j -smydomain.org -u mailsender@mydomain.org -p xxxxxxxxxx -e Job -a process_mailing

*/5 * * * *  cd $CIVI_ROOT; $PHP bin/cli.php $PARAMS

```

If you can see what I'm doing wrong please let me know. I've tried via the control panel and also from php-cli.

This is a WordPress site with CiviCRM 4.6.3.

# Answer
Your cron script may not work as displayed because `$PHP` is not defined, and because `PARAMS= -j -smydomain.org -u mailsender@mydomain.org -p xxxxxxxxxx -e Job -a process_mailing` will not define `$PARAMS` without quotemarks surrounding the variable value (instead you get a \*sh error).

I suggest adding a MAILTO line with your email at the top so you receive the error output - this will help you debug if/when it fails.

```
MAILTO=you@example.com

```

I suspect that your website is not hosted at `/var/public_html` on Bluehost also? Might want to double-check that value, you might mean `~/public_html`

Try this, amending values to suit your email/website?

```
MAILTO=myself@example.org
PHP=/usr/php/54/usr/bin/php
CIVI_ROOT=~/public_html/mydomain/wp-content/plugins/civicrm/
PARAMS=" -j -smydomain.org -u mailsender@mydomain.org -p xxxxxxxxxx -e Job -a process_mailing"
*/5 * * * * cd $CIVI_ROOT; $PHP bin/cli.php $PARAMS

```
> 3 votes

# Answer
Regarding test mail not going out - it's not necessarily cron. Here are three things to check:

**SMTP Settings:** Do you get mail when you send a test SMTP on the screen at **Administer menu \> System Settings \> Outbound Email**? If not, your problem is SMTP-related.

**Scheduled Jobs screen:** Also, make sure you've enabled the job at **Administer menu \> System Settings \> Scheduled Jobs**. This is also a good place to see if your job ran. Also, view the log for the "process\_mailing" job for errors.

**cron** If it IS cron-related - I'm not sure why, your command looks good to me. However, I install wp-cli and use that for cron. I find it to be a more satisfactory experience, and it won't leave my password in the server logs.

Here's an example of a working cron job with wp-cli I pulled from a site running Wordpress:

```
0,15,30,45 * * * * /home/members/xxxx/wp-cli/wp-cli --require=/home/members/xxxx/sites/xxxx/wp-cli/civicrm.php --path=/home/members/xxxx/sites/xxxx/web civicrm api --timezone=America/New_York job.execute

```
> 2 votes

# Answer
The correct solution is to save yourself time by finding a hosting solution which supports CiviCRM's base requirements fully. You can work around these limitations, but *it will cost you more in time than you'd spend on hosting it somewhere more suitable*.

Bluehost mail hosting lacks VERP. Bluehost standard webhosting has mail delivery limitations, and is a product suitable for lower-end websites than a busy CiviCRM site.
> 2 votes

# Answer
If your host provides a catch-all e-mail address, that can be an alternative to subaddressing. See here.

The test e-mail question should be a separate question - so I'll answer with a separate answer.
> 0 votes

# Answer
I've used CiviSMTP. They provide an excellent service and are focused on CivCRM.
> 0 votes

---
Tags: civimail, cron-job
---


# Question
Title: Why am I receiving an ' Unable to retrieve card details from iATS. Error: Invalid Username or Password' Error?
I'm using the following steps to produce this error:

1. Under the 'Contributions' tab of a contact on CiviCRM, click 'Recurring Contributions'

2. Click 'View' under the individual's recurring contribution

3. Clicking any of the following links (View, Edit, or Process)...

...results in the following error: 'Warning: Unable to retrieve card details from iATS. Error: Invalid Username or Password' (please see screenshot below)

Donations seem to be processing fine on CiviCRM and iATS, and CiviCRM and iATS seem to be communicating fine with each other (other than this error).

# Answer
> 3 votes
Two thoughts:

1) you have an iATS admin agent code 01 (and possibly more: 02, 03) and iATS agent codes 80, 81 and up for payment processing. Is it possible that the payment processor agent code/passwd that this particular contribution is linked to did have a password edit?

2) does your passwd for the agent code linked to that particular recurring series perhaps have any non-alphanumeric characters in it? Those are not recommended as we have seen them work in some cases but fail in others.

---
Tags: civicontribute, iats
---


# Question
Title: Unwanted "Contribution Amount" appears in Line Item which makes it look like its incorrect
1. Added a Price Set.
2. Go to Contribution Page and the Receipt Email shows all the Price Set Items but along with it also shows Contribution Amount.

Before Adding defaultPriceSet from the above-mentioned method the $lineitem array structure is as given below

> ```
> [line_item] => Array
>         (
>             [5] => Array
>                 (
>                     [25] => Array
>                         (
>                             [price_field_id] => 9
>                             [price_field_value_id] => 25
>                             [label] => Guidebook 1 Cooktown to Gunnawarra
>                             [field_title] => guidebook selection
>                             [description] =>
>                             [qty] => 1
>                             [unit_price] => 30.000000000
>                             [line_total] => 30
>                             [participant_count] => 0
>                             [max_value] =>
>                             [membership_type_id] =>
>                             [membership_num_terms] =>
>                             [auto_renew] =>
>                             [html_type] => CheckBox
>                             [financial_type_id] => 5
>                             [tax_amount] => 0
>                             [non_deductible_amount] => 0.00
>                             [tax_rate] => 0.00000000
>                         )
>                 [32] => Array
>                     (
>                         [price_field_id] => 10
>                         [price_field_value_id] => 32
>                         [label] => Up to 125 g (Weekenders)
>                         [field_title] => Postage and Handling
>                         [description] =>
>                         [qty] => 1
>                         [unit_price] => 5.000000000
>                         [line_total] => 5
>                         [participant_count] => 0
>                         [max_value] =>
>                         [membership_type_id] =>
>                         [membership_num_terms] =>
>                         [auto_renew] =>
>                         [html_type] => Select
>                         [financial_type_id] => 5
>                         [tax_amount] => 0
>                         [non_deductible_amount] => 0.00
>                         [tax_rate] => 0.00000000
>                     )
>
>
>                [74] => Array
>                     (
>                         [price_field_id] => 21
>                         [price_field_value_id] => 74
>                         [label] => Cap
>                         [field_title] => Cap
>                         [description] =>
>                         [qty] => 1
>                         [unit_price] => 20.000000000
>                         [line_total] => 20
>                         [participant_count] => 0
>                         [max_value] =>
>                         [membership_type_id] =>
>                         [membership_num_terms] =>
>                         [auto_renew] =>
>                         [html_type] => Text
>                         [financial_type_id] => 5
>                         [tax_amount] => 0
>                         [non_deductible_amount] => 0.00
>                         [tax_rate] => 0.00000000
>                     )
>
>                 [75] => Array
>                     (
>                         [price_field_id] => 22
>                         [price_field_value_id] => 75
>                         [label] => BNT Sticker
>                         [field_title] => BNT Sticker
>                         [description] =>
>                         [qty] => 2
>                         [unit_price] => 4.000000000
>                         [line_total] => 8
>                         [participant_count] => 0
>                         [max_value] =>
>                         [membership_type_id] =>
>                         [membership_num_terms] =>
>                         [auto_renew] =>
>                         [html_type] => Text
>                         [financial_type_id] => 5
>                         [tax_amount] => 0
>                         [non_deductible_amount] => 0.00
>                         [tax_rate] => 0.00000000
>                     )
>
>                 [76] => Array
>                     (
>                         [price_field_id] => 23
>                         [price_field_value_id] => 76
>                         [label] => Badge/Hat Pin
>                         [field_title] => Badge/Hat Pin
>                         [description] =>
>                         [qty] => 2
>                         [unit_price] => 10.000000000
>                         [line_total] => 20
>                         [participant_count] => 0
>                         [max_value] =>
>                         [membership_type_id] =>
>                         [membership_num_terms] =>
>                         [auto_renew] =>
>                         [html_type] => Text
>                         [financial_type_id] => 5
>                         [tax_amount] => 0
>                         [non_deductible_amount] => 0.00
>                         [tax_rate] => 0.00000000
>                     )
>
>             )
>
> ```

After adding defaultPriceSet it adds New Line Item which is as given below

```
(
    [1] => Array
        (
            [setID] => 1
            [priceFieldID] => 1
            [name] => contribution_amount
            [label] => Contribution Amount
            [priceFieldValueID] => 1
            [membership_type_id] =>
            [amount] => 1.000000000
            [financial_type_id] => 1
        )

)

```

How to get rid of this line item as it seems to show that user is charged twice as seen in below screenshot of email receipt Ignore the price value ,just look into the Contribution Amount row the total of which is same as the total of other items in the table so I need to exclude Contribution Amount from the table of Receipt,what is the correct way to remove that.?

3. I debugged and found that code under CRM/Price/BAO/PriceSet `CRM_Price_BAO_PriceSet` has a method which adds the row in the line item `getDefaultPriceSet`. This method generates the Contribution Amount array, how to skip this so Email Receipt looks clean?

where when I use a Price Set with multiple values

checkbox values Material A $20.

select list Material B $30

textfield with quantity Material C:- 1 * $20 = $20 the Receipt it prints has following rows Material A . $20
Contribution Amount $70 (which is total of $20 + $30+ $20)
Material B . $30
Material C $20

(edited) For a user point of view this looks very confusing
as Material A, Material B and Material C is already listed and . it does
not make sense to print Contribution Amount I am using Civicrm 5.13.4 version

# Answer
> 2 votes
You can edit the contribution receipt under **Mailings menu » Message Templates**, **System Workflow Messages** tab. You can insert a conditional in the Smarty to exclude a line based on one or more variables in it. E.g. in the Online Receipt, the Smarty that generates the line items is pasted below. You could put `{if $line.description eq 'Contribution Amount'}` just under the `foreach` with a closing tag at the bottom and it should omit this line.

```
{foreach from=$value item=line}
            <tr>
             <td>
             {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
             </td>
             <td>
              {$line.qty}
             </td>
             <td>
              {$line.unit_price|crmMoney:$currency}
             </td>
             {if $getTaxDetails}
              <td>
               {$line.unit_price*$line.qty|crmMoney:$currency}
              </td>
              {if $line.tax_rate != "" || $line.tax_amount != ""}
               <td>
                {$line.tax_rate|string_format:"%.2f"}%
               </td>
               <td>
                {$line.tax_amount|crmMoney:$currency}
               </td>
              {else}
               <td></td>
               <td></td>
              {/if}
             {/if}
             <td>
              {$line.line_total+$line.tax_amount|crmMoney:$currency}
             </td>
            </tr>
           {/foreach}
          </table>
         </td>
        </tr>
       {/foreach}

```

---
Tags: contributions, price-sets, receipts
---


# Question
Title: Need help with export.php (CiviCRM 4.6 & Drupal 7)
I'm using an older version of CiviCRM (4.6) with Drupal 7 on Linux and until now I've not really used the command line stuff for CiviCRM, only for Drupal.

But I now need to do exports & imports of contacts etc to & from CiviCRM and so I've installed Drush & got it working. I've tried doing an export with the export.php script with Drush and can manipulate the search results to some degree. But for some reason if only exports the first 26 rows ... is the a parameter that I should be using to get the full rowcount?

Also, where is the best place to get a more detailed list of examples, list of possible parameters, usage notes etc?

Any pointers appreciated, thanks!

Neil

# Answer
> 1 votes
There are a few things that can help you out:

* Most importantly, the API Explorer (**Support menu » Developer » API Explorer**). It will build your `drush` command for you through a GUI.
* You can see there that adding an option with "limit=0" will return all records.
* There's documentation built into the API explorer, but there's also API documentation in the Developer's Guide.
* One major caveat! `drush` and `export.php` don't really handle JSON inputs well - which you need to pass options. Instead, use `cv`.
* cv is like drush, but for CiviCRM. This can take arguments similar to `export.php` but can also get JSON as an input, for instance:

```
 echo '{"options": {"limit":0}, "first_name": "Juliann"}' | cv api Contact.get --in=json --out=csv

```

To use `cv` with the API explorer for simple commands, just use the recommended `cv` command. However, if the command includes JSON, use the format above, and grab the exact JSON from the JavaScript example API Explorer generates.

---
Tags: import, export, drush, cli
---


# Question
Title: How to change the name of the receipt attached to new membership
By default it's called receipt.pdf and I would like to rename it and make it French also ;-). Where can I set this name?

by the way, is it possible to not have this receipt attached?

# Answer
> 1 votes
While this technique might not find everything, a general technique for some of the translation questions you have can be solved by using `grep` from the root of the civicrm folder, e.g.

`grep -r receipt.pdf *`

If you know that it's likely to be under the CRM folder, which seems likely here, you can save some speed by cd'ing into that folder first.

If you don't know exactly how it's written, for example sometimes strings are concatenated, you can do something like:

`grep -r receipt * | grep pdf`

which will find all lines that have both "receipt" and "pdf" in the line somewhere. In fact doing that shows that the *offline* membership receipt is already translated with ts().

It looks like there's a few places, so you can replace `receipt` with `ts('receipt')` in the places where it isn't already ts'd:

`CRM/Contribute/BAO/ContributionPage.php:441: 'PDFFilename' => 'receipt.pdf',
CRM/Contribute/Form/AdditionalInfo.php:474: 'PDFFilename' => ts('receipt') . '.pdf',
CRM/Contribute/Form/CancelSubscription.php:302: 'PDFFilename' => 'receipt.pdf',
CRM/Contribute/Form/Contribution/Confirm.php:1307: 'PDFFilename' => 'receipt.pdf',
CRM/Contribute/Form/UpdateBilling.php:371: 'PDFFilename' => 'receipt.pdf',
CRM/Contribute/Form/UpdateSubscription.php:336: 'PDFFilename' => 'receipt.pdf',
CRM/Member/Form/Membership.php:1077: 'PDFFilename' => ts('receipt') . '.pdf',`

For your other question, there's a settings at Administer - System Settings - Misc to not attach pdf receipts, but it might not apply everywhere.

# Answer
> 1 votes
You can disable attaching the receipt by going to **Administer menu » System Settings » Misc** and setting *Attach PDF copy to receipts* to **No**.

---
Tags: receipts, pdf
---


title: How to find out who created an event?

text:
# Question
Title: How to find out who created an event?
Is there an easy way to find out who created an event like how we are able to see who created an email?

# Answer
> 3 votes
CiviCRM DOES store that information, but doesn't expose it to the user interface. So you have two choices:

* Check with SQL. This will give a list of all events with creators:

```
select ce.id, ce.title, cc.display_name from civicrm_event ce JOIN civicrm_contact cc on ce.created_id = cc.id;

```

Add `WHERE ce.id = x` before the semicolon at the end to just show a single event (where `x` is the event's ID).

* I wrote an extension that allows you to view (and change) the name from the user interface called Edit Event Manager.

---
Tags: civievent
---


title: Attachment API File Upload

text:
# Question
Title: Attachment API File Upload
I'm working on a file upload of an image with a registration form. The file is being passed to PHP correctly, and I can check its properties in the $\_FILES variable. I used the API Explorer to get the code example below. This question (Uploading files through the API) touches on this, but the answer just directs the person to the API Explorer.

`$result['attachment'] = civicrm_api3('Attachment', 'create', [
 'name' => $name,
 'mime_type' => $_FILES['image']['type'],
 'entity_id' => $result['contact']['id'],
 'field_name' => 'custom_3',
 'content' => $_FILES['image'],
]);`

The error I receive is: `Mandatory key(s) missing from params array: 'id' or 'content' or 'options.move-file'` but I have no idea what this means. `content` is set in the params. This API call happens after a working sequence of creating a Contact, Address, Email, Websites, and more for the signup. I can find no other guidance on completing this.

# Answer
"content" needs to be a string if using that - it represents the actual attachment contents. What you probably want is the move-file one. If you're at /civicrm/api in the explorer click on the Code Docs tab at the top and pick Attachment for the Entity, then at the bottom of the text that appears is an example, just yours is slightly different since it's a custom field.

Also some assorted samples in here, e.g. https://github.com/civicrm/civicrm-core/blob/5.14/tests/phpunit/api/v3/AttachmentTest.php#L91
> 1 votes

---
Tags: api, php, attachments
---


title: CiviMail mailer settings example

text:
# Question
Title: CiviMail mailer settings example
I'm not sure if it just me, but I am not 100% clear on what each of the CiviMail mailer settings do when combined together?

**Mailer Batch Limit:** The total number of emails that will go out on each CiviMail run? If multi-threading does this number multiply by the number of threads or does this number get shared out over the number of threads?

**Mailer Throttle time:** The sleep time in micro seconds between each individual email? If multi-threading does this time multiply by the number of threads or does this number effectively become redundant because multiple jobs are all running at this speed meaning emails are actually sending faster than this value?

**Mailer Job Size:** The size of smaller lists the entire list of contacts will be split into to create threads. See point about Mailer Batch Limit, does this mean the batch amount will be processed from each job.. or will the batch amount be split over all the jobs?

**Mailer CRON job limit:** The number of cron jobs fired off.. how is this determined? number of jobs or number of spare processes?

In short, I think it could be clearer what is going on?

# Answer
> 1 votes
There is some more detail in the documentation.

And there are also notes from Tim on Github. Those notes share the idea that it is confusing. However I do think it answers your question. It would have been helpful though when those notes are added to the documentation.

---
Tags: civimail
---


title: Webform conditions with memberships

text:
# Question
Title: Webform conditions with memberships
I have a webform where our users can add new contacts to CiviCRM. This form creates an activity record. And this form should create a membership for these contacts. The membership has some custom fields; let's say field Reason and has values "Good, Bad, Audit" and a Referral field that contains the name of a person.

So far, this is standard CiviCRM Webform. I can create the new contact record, create their membership, and populate the membership custom field with the option that the user selects.

Now, this webform allows users to select existing contacts. Those existing contacts already have a membership, and already have a value in that Reason field.

My goal is that for existing contacts, IF the user selects "Audit" for the reason field, then the membership *does not update*. So the membership record, membership type, membership dates, Referral custom field and Reason custom field should stay the same as what they were previously. But this only happens if the Reason custom field is selected as "Audit". For any other reason field value, the membership should update as normal.

What I have tried:

* I can't figure out how to do this using webform conditionals. Is there a way? I would need to somehow capture the contact's membership field values before the user submits the contact.
* Could I do this with a webform hook? In that case, which hook should I be looking at so that it processes *before* the webform/civicrm integration?
* I looked at using CiviRules, with the Webform CiviRules integration, but this seems to fire after the webform is submitted.

Thank you

# Answer
I think you could use hook\_webform\_submission\_presave

http://api.drupal.psu.edu/api/drupal/modules%21contrib%21webform%21webform.api.php/group/webform\_hooks/nittany7

But hook\_civicrm\_pre might be better https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_pre/
> 1 votes

# Answer
You’ll need to intercept on validate -\> so a hook\_form\_alter with a custom validate. Here is an example.

https://drupal.stackexchange.com/questions/22952/custom-validation-for-a-form
> 1 votes

---
Tags: webform-civicrm
---


title: Workflow and Automation

text:
# Question
Title: Workflow and Automation
I'm trying to figure out how to do automated workflows. This is an example of one such process:

1. Member fills in a request to host an event using Caldera Forms (at the moment). I currently have some custom code that creates the event in CiviCRM for me, using the API, upon submission.
2. Reviewers must approve the event request
3. Once approved, an email needs to be sent to the event host with specific event information
4. We then wait for the event host to send us a document with the announcement
5. Reviewers must approve the announcement
6. An announcement is then bulk emailed to all members
7. Opens to the general public 3 days after the given date of opening to members

I've looked at CiviCase, which would be great to manage each of these events but is there a way to trigger the activities above from a Case? I need to be able to pull information from the event record for various parts of this (steps 3 and 6, for example). I currently do this manually - I send the email by manually updating the email before sending. We get so many requests that I sometimes lose track of where I am with each of these events. If I also have to manually update CiviCase, that adds to the workload and kind of defeats the purpose of streamlining this process.
Thoughts? Suggestions? I can write scripts to call the API if need be, if that is the only way but seems that it would be part of the app? Thanks Norm

# Answer
Take a look at civirules, with the email api extension also enabled so that the action of sending an email is available. That might get you partly there. You can set rules for when events change or activities are added, which could trigger your email.
> 1 votes

---
Tags: civicase, tokens, automation
---


title: Add field on Case type form

text:
# Question
Title: Add field on Case type form
I want to add a field on Case type setting (civicrm/a/#/caseType/1 which is build in angular js) either just below the description field or as a tab besides case role tab. What is the easiest way to do this?

Civi version - 5.14.0

# Answer
If you're ok with it not being tightly integrated (i.e. automatically available in the xml or to the api), then you can do something like below, which adds a field labelled "Boo" to the case type edit screen.

Thanks for asking this question. It's probably helped me more than you, since it's helped clarify for me how this all works. And it occurs to me that customizing an existing form is probably a much more likely task for developers than writing your own angular form from scratch, which is what all the tutorials show.

```
function myextension_civicrm_alterAngular(\Civi\Angular\Manager $angular) {
  $changeSet = \Civi\Angular\ChangeSet::create('add_casetype_custom_field')
    ->alterHtml('~/crmCaseType/caseTypeDetails.html',
      function (phpQueryObject $doc) {
        $doc->find('div.crm-group')->append('
          <fieldset class="crm-collapsible">
            <legend class="collapsible-title">{{ ts(\'My Custom Fields\') }}</legend>
            <div ng-controller="CustomFieldCtrl">
              <div crm-ui-field="{name: \'mycustomfield\', title: ts(\'Boo\')}">
                <input crm-ui-id="mycustomfield" class="crm-form-text" name="mycustomfield" ng-model="mymodel.cusfield">
              </div>
            </div>
          </fieldset>
        ');
      });
  $angular->add($changeSet);

  CRM_Core_Resources::singleton()->addScriptFile('my.extension.name', 'js/angCustomField.js');
}

```

Reference: https://docs.civicrm.org/dev/en/latest/framework/angular/changeset/

And here is the contents of js/angCustomField.js:

```
(function(angular, $) {
  var crmCaseType = angular.module('crmCaseType');
  crmCaseType.controller('CustomFieldCtrl', function($scope) {
    // Need to replace this with an ajax call right here to look up the value from the db.
    $scope.mymodel = { cusfield: 'value looked up from db' };

    // just show that this is executing and we have the right id
    console.log($scope.caseType.id);

    // alias the real save() function so that we can do our stuff too
    var proxiedSave = $scope.$parent.$parent.save;
    $scope.$parent.$parent.save = function() {
      console.log($scope.caseType.id);
      console.log($scope.mymodel.cusfield);

      //
      // Do ajax api or whatever here to save the value to db
      //
      // IMPORTANT: Always validate the input server-side before using it even if you have javascript validation client-side since that can be easily bypassed. This isn't specific to angular it just seems to be ignored in all the angular tutorials. Even a plain html form with e.g. a select list can still submit values not in the select list - always need to validate server-side.

      // Now call the original save
      return proxiedSave.apply(this);
    }
  });
})(angular, CRM.$);

```

Some notes:

* Note we're adding our own nested child controller in the line that has `ng-controller="CustomFieldCtrl"`. This matches up to the controller in our js file.
* The `ng-model="mymodel.cusfield"` value HAS TO HAVE A DOT IN IT. It just doesn't work if it doesn't. This matches up to the `$scope.mymodel = ...` line in our js file.
> 4 votes

---
Tags: civicase, angular
---


# Question
Title: Civi adds whitespace into contact images
I have a problem in CiviCRM when I try to add a contact image into a contact record.

I'm using Drupal 7, CiviCRM 5.13.4 and PHP 7.1.

From what I can make out, something is adding in whitespace to the images that I try and upload which naturally shows the image as being broken.

When I look at the image in the file system, the image is fine there but if I go into the source code of where the image is in a contact record, the image downloads and when I open it, the top line is blank (whitespace).

I have seen this on several sites but can't seem to find an answer anywhere so it would be good to know any possible reasons for this to happen so the fix can be applied to several sites.

I am wondering if it is a rogue module or something similar that is causing the problems. I thought it may be the theme which I disabled to test but the issue remained so that got ruled out.

Any advice would be greatly appreciated!

# Answer
> 3 votes
After much digging, I found the reason why contact images were not appearing.

It was due to a module that had a PHP file with two new lines before the opening PHP tag `<?php`.

To figure this out, I created a local copy of the website and went through the modules list, enabling them one by one to see at what point the image broke.

Once I'd found which one broke the image, it wasn't hard to go through the files, searching for the whitespace.

Removed the two new lines before the tag and the image instantly worked.

Hopefully this will come to some use if anyone has a dodgy contact image!

On a side note, this also fixed the Mosaico problem I was having - Failed to locate Mosaico graphics driver

---
Tags: drupal, contacts, contact-image
---


# Question
Title: SYBUNT (some year but not this year) showing 2011 as this year
When doing this option in civireport or LYBUNT (last year but not this year) Its showing this year as 2011.

everything else is showing the correct years... why is this not?

# Answer
> 1 votes
The sample report instance has the filter saved at 2011. If you do a new create report from template it defaults to current year.

https://lab.civicrm.org/dev/core/issues/1091

---
Tags: civireport
---


title: Problems setting up cron

text:
# Question
Title: Problems setting up cron
Civi 5.14 on WordPress 5.0

Hello, I have installed and am configuring Civi for a new client. He is on Inmotion Hsosting and civi is installed in a subdomain. I am having problems getting cron to run. It is not running by itself at all. Am I am missing a step somewhere or is my command line missing something? The wordpress user password is only numbers and letters, no other characters.

Cron Command line:

**php -q /home/username/secure.domain.org/wp-content/plugins/civicrm/civicrm/bin/cli.php -s domain.org -u wordpressuser -p wordpressuserpassword -e Job -a execute \> /dev/null 2\>&1**

Thank you

***UPDATE***

I just finished talking to Tech Support for the host and they said that cron job has been running every 5 minutes without fail. Yet in Civi it says it has not run since June 29th, 2019 3:46 PM.

On another note. I just tried a test scheduled mailing. I set it to send 5 minutes later. It still has not sent. The server host shows that my cron command is running every 5 minutes but it is clearly not doing what it should be doine. Civi says the resource URL is wrong and cron is not running. could this be related?

# Answer
> 2 votes
I prefer the wp-cli method to all other methods. Can this work at your host? https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#wp-cli

If you do not have Command line access, but the host provides a cron interface and wp-cli you can create a shell script to call:

```
#!/bin/bash
/path/to/cli/php /path/to/wp --user=<cron user> --url=https://<site> --path=/path-to-web-root --timezone="<php timezone>" civicrm api job.execute auth=0

```

In your example calling just `php` may be the issue as cron may not now the path to the cli php executable.

# Answer
> 0 votes
Did you possibly try using https://www.easycron.com/ (as described https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#webcron) and seeing if that will work. Like this you can see if the problem is with your civi instalation or your web host.

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


title: Reports and Custom Searches

text:
# Question
Title: Reports and Custom Searches
We currently have circa 1000 community groups across the UK and need to run a report on the amount held in each region or county.

I can obtain the numbers by running individual advanced searches for each region by setting the criteria etc, but is there a simple & effective way but building a report around this information?

Many thanks

Terry

# Answer
There is an extension called Report Plus which provides nice matrix on Contact, Contribution Membership etc. I guess you can use this extension to build your report.

HTH

Pradeep
> 1 votes

---
Tags: custom-reports, advanced-search
---


title: What is deleting my Tag?

text:
# Question
Title: What is deleting my Tag?
I've run into this twice this month and scratching my head. Read this image upside down: We hit post create Address hook -\> my regex extension creates a Tag - all good; happy dance; then something in Core deletes my Tag :-( why?

# Answer
> 0 votes
That looks like your extension is deleting the entity tag?

---
Tags: hooks, tags
---


# Question
Title: Error (One of parameters is not of the type Integer) while clicking the 'mailing.viewUrl' in a sent mailing
In sent Mailings, the 'mailing.viewUrl' is rendered into: https://terranova.tamera.org/civicrm/mailing/view?reset=1&id=95c21fb7cc1b7aac

and clicking it gives me this error:

> $Fatal Error Details = Array ( \[message\] =\> One of parameters (value: e05fa931f15dedbb) is not of the type Integer \[code\] =\> )

With the following stack trace:

> $backTrace = #0 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Error.php(343): CRM\_Core\_Error::backtrace("backTrace", TRUE) #1 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Utils/Type.php(535): CRM\_Core\_Error::fatal("One of parameters (value: e05fa931f15dedbb) is not of the type Integer") #2 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1519): CRM\_Utils\_Type::validate("e05fa931f15dedbb", "Integer") #3 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php(1397): CRM\_Core\_DAO::composeQuery("\nSELECT CF.id as cfID,\n CF.uri as uri,\n CF.mime\_typ...", (Array:2), TRUE) #4 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/BAO/File.php(332): CRM\_Core\_DAO::executeQuery("\nSELECT CF.id as cfID,\n CF.uri as uri,\n CF.mime\_typ...", (Array:2)) #5 /home/tamera/www/www/sites/all/modules/civicrm/api/v3/Mailing.php(571): CRM\_Core\_BAO\_File::getEntityFile("civicrm\_mailing", "e05fa931f15dedbb") #6 /home/tamera/www/www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101): civicrm\_api3\_mailing\_preview((Array:3)) #7 /home/tamera/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(168): Civi\API\Provider\MagicFunctionProvider-\>invoke((Array:9)) #8 /home/tamera/www/www/sites/all/modules/civicrm/Civi/API/Kernel.php(99): Civi\API\Kernel-\>runRequest((Array:9)) #9 /home/tamera/www/www/sites/all/modules/civicrm/api/api.php(43): Civi\API\Kernel-\>runSafe("Mailing", "preview", (Array:3)) #10 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Mailing/Page/View.php(145): civicrm\_api3("Mailing", "preview", (Array:3)) #11 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(311): CRM\_Mailing\_Page\_View-\>run((Array:3), NULL) #12 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(85): CRM\_Core\_Invoke::runItem((Array:15)) #13 /home/tamera/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM\_Core\_Invoke::\_invoke((Array:3)) #14 /home/tamera/www/www/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM\_Core\_Invoke::invoke((Array:3)) #15 /home/tamera/www/www/includes/menu.inc(527): civicrm\_invoke("mailing", "view") #16 /home/tamera/www/www/index.php(21): menu\_execute\_active\_handler() #17 {main}

# Answer
Looks to be this issue: https://lab.civicrm.org/dev/core/issues/1037

You could try applying the PR linked there - or wait since it has been merged so will be in a release soon.
> 2 votes

---
Tags: civimail
---


title: Resource URL is incorrect

text:
# Question
Title: Resource URL is incorrect
Wordpress 5.0 Civi 5.14

***UPDATE*** I am now convinced that the resource URL error is a real issue and not just a false positive. I just tried to add some component to the CKeditor. I saved it, I cleaned up the cache. The new components are not showing up on the ckeditor in the contribution pages. This is not an issue on my other clients civi installs, just this one.

Hello, I just finished a fresh install of Civi on a new site for a client.
I am getting the Alert that the Resource URL is incorrect. As far as I can tell, it is correct.

Also the contribution page url is showing incorrectly in the configurations. It is showing as: subdomain.mysite.org/?page=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1

It should be: subdomain.mysite.org/**civicrm**?page=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&reset=1&id=1

I think that might be a clue to the resource url problem, but I have been digging for hours and I can't find where to fix it.

See screenshots below.

\****UPDATE TO SHOW civicrm.settings.php \*****

# Answer
The alert is incorrect. As long as you are not having any other issues besides the alert, you can tell the alert not to remind you again.

In addition (now that I see the issue with Contribution pages - sorry I missed that), make sure you have the base page set under CMS settings in the CiviCRM administration settings.

In WP go to settings, Permalinks. Make sure that they are not set to Plain

Lastly make sure the base page is published. the page '/civicrm' is added on install
> 3 votes

# Answer
Normally it's `[civicrm.root]/`. Is that screenshot just an example of values you've been playing with? Does it work with `[civicrm.root]/`?

And `[civicrm.root]/` is what it is set to on https://wpmaster.demo.civicrm.org.

Also check your civicrm.settings.php file to see if it's overriding it for some reason.
> 1 votes

# Answer
I just had this problem on a Drupal installation and found a cause. In my situation, it was a false positive.

To check if the resource URL is correctly set CiviCRM tries to download the following picture from the server

`https://<server>/sites/all/modules/civicrm/packages/jquery/css/images/arrow.png`

It does the check, however, on the server itself, and that was protected by an IP firewall, that prevented browsing from the server. If you have SSH access you can check it with the following command:

`curl https://<server>/sites/all/modules/civicrm/packages/jquery/css/images/arrow.png`
> 1 votes

# Answer
I am on wp and the error I have (which is just a notice) is make the resource urls are portable. That's the false positive. I don't think the incorrect resource url error that you have is a false positive seems to be something wrong.
> 0 votes

---
Tags: wordpress, resource-urls
---


# Question
Title: Public URL for CiviMail: access denied even for admin
Drupal 7.67, CiviCRM 5.13.5

Hey everyone,

Trying to view a mailing I've sent through CiviCRM before. I'm logged in with my admin account with all permissions granted.

I've navigated to the specific sent mailing \> View Report \> Mailing Settings \> Public URL. Clicking on that URL gives an "Access Denied" error.

All the mailings I send have "Public Pages" set as the Mailing Visibility (under Publication on the specific mailings). I've also double checked and I do have the "CiviMail: view public CiviMail content" checked for all roles.

Any ideas on how I can fix this?

# Answer
Sounds as if you may the ‘Hashed Mailing URL's’ option selected in your CiviMail Component Settings –

Administer \> CiviMail \> CiviMail Component Settings

/civicrm/admin/setting/preferences/mailing?reset=1

If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID
> 2 votes

---
Tags: drupal, civimail, permissions
---


# Question
Title: Bounce processing webhook gets error "Failed to verify signature" in Mailgun
Have mailgun extension and added mail account for bounce processing with mailgunDB as protocol and my API (using private API) as password. Every time a mailing goes through it has an error "failed to verify signature" and the details are about the webhook I added in mailgun. ..

***ERROR*** message: Failed to verify signature code:

***LAST ERROR*** Array ( \[type\] =\> 2 \[message\] =\> fopen(api/v3/MailSettings/Getoptions.php): failed to open stream: No such file or directory \[file\] =\> /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/File.php \[line\] =\> 431 )

***ANONYMOUS USER*** REMOTE\_ADDR: 54.149.33.164 HTTP\_USER\_AGENT: mailgun/treq-16.12.0

***SESSION*** CiviCRM: Array ( )

***SERVER*** SERVER\_SOFTWARE: Apache/2.4.29 (Ubuntu) REQUEST\_URI: /civicrm/?page=CiviCRM&q=civicrm/mailgun/bounce&reset=1 REDIRECT\_HTTPS: on REDIRECT\_SSL\_TLS\_SNI:\**** REDIRECT\_STATUS: 200 HTTPS: on SSL\_TLS\_SNI: \**** CONTENT\_LENGTH: 1672 HTTP\_HOST: \**** CONTENT\_TYPE: application/json HTTP\_ACCEPT\_ENCODING:gzip HTTP\_ACCEPT: */* HTTP\_USER\_AGENT: mailgun/treq-16.12.0 PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SERVER\_SIGNATURE: Apache/2.4.29 (Ubuntu) Server at \****

SERVER\_NAME: \**** SERVER\_ADDR: xxx SERVER\_PORT: xxx REMOTE\_ADDR: xxx DOCUMENT\_ROOT: /var/www/html/wordpress REQUEST\_SCHEME: https CONTEXT\_PREFIX:
CONTEXT\_DOCUMENT\_ROOT:/var/www/html/wordpress SERVER\_ADMIN: admin@example.com SCRIPT\_FILENAME: /var/www/html/wordpress/index.php REMOTE\_PORT: 56852 REDIRECT\_URL: /civicrm/ REDIRECT\_QUERY\_STRING:page=CiviCRM&q=civicrm/mailgun/bounce&reset=1 GATEWAY\_INTERFACE: CGI/1.1 SERVER\_PROTOCOL: HTTP/1.1 REQUEST\_METHOD: POST QUERY\_STRING: page=CiviCRM&q=civicrm/mailgun/bounce&reset=1 SCRIPT\_NAME: /index.php PHP\_SELF: /index.php REQUEST\_TIME\_FLOAT: 1561936897.072 REQUEST\_TIME: 1561936897

***BACKTRACE***

```
#0 /var/www/html/wordpress/wp-content/uploads/civicrm/ext/ca.bidon.reporterror/CRM/ReportError/Utils.php(31): reporterror_civicrm_generatereport("DOMAIN", (Array:2), NULL, (Array:0))
#1 /var/www/html/wordpress/wp-content/uploads/civicrm/ext/ca.bidon.reporterror/CRM/ReportError/Handler/FormsNoReferer.php(54): CRM_ReportError_Utils::sendReport((Array:2), (Array:0))
#2 /var/www/html/wordpress/wp-content/uploads/civicrm/ext/ca.bidon.reporterror/reporterror.php(168): CRM_ReportError_Handler_FormsNoReferer::handler((Array:2), (Array:0))
#3 /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(372): reporterror_civicrm_handler((Array:2))
#4 /var/www/html/wordpress/wp-content/uploads/civicrm/ext/uk.teamsinger.civicrm.mailgun-master/CRM/Mailgun/Utils.php(30): CRM_Core_Error::fatal("Failed to verify signature")
#5 /var/www/html/wordpress/wp-content/uploads/civicrm/ext/uk.teamsinger.civicrm.mailgun-master/CRM/Mailgun/Page/HandleBounceWebhook.php(19): CRM_Mailgun_Utils::checkSignature(NULL, NULL, NULL)
#6 /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(311): CRM_Mailgun_Page_HandleBounceWebhook->run((Array:3), NULL)
#7 /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:13))
#8 /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#9 /var/www/html/wordpress/wp-content/plugins/civicrm/civicrm.php(1392): CRM_Core_Invoke::invoke((Array:3))
#10 /var/www/html/wordpress/wp-content/plugins/civicrm/includes/civicrm.basepage.php(365): CiviCRM_For_WordPress->invoke()
#11 /var/www/html/wordpress/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#12 /var/www/html/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(FALSE, (Array:1))
#13 /var/www/html/wordpress/wp-includes/plugin.php(531): WP_Hook->do_action((Array:1))
#14 /var/www/html/wordpress/wp-includes/class-wp.php(750): do_action_ref_array("wp", (Array:1))
#15 /var/www/html/wordpress/wp-includes/functions.php(1105): WP->main("")
#16 /var/www/html/wordpress/wp-blog-header.php(16): wp()
#17 /var/www/html/wordpress/index.php(17): require("/var/www/html/wordpress/wp-blog-header.php")
#18 {main}

```

# Answer
> 2 votes
That extension hasn't been updated in a while and it looks like mailgun used to send signature parameters as request parameters and now has changed and sends them as part of a json payload. So it looks like the extension needs to be updated for that.

---
Tags: civimail
---


# Question
Title: How to setup a contact journey and add them in specific mailing group after a delay?
I would like to setup a web signup form with 2 of our newsletter groups. After contacts sign up, I would like to send them 2 welcome emails after 10 days of delays. Then add them to the 1 of 2, or both newsletter whatever they have selected at the time of signup.

Setting up a form with groups, sending them welcome emails are an easy part using civirules.

I am struggling with how I can determine what group they were signed into at the beginning, so after 10 days of delay, they can go into that specific groups? I do not want to send them Newsletters before they receive the 2nd email. Any help would be appreciated. Thanks

# Answer
I would

1. Use webform(Drupal) or Caldera(Wordpress) for signup
2. Setup webform(Drupal) or Caldera(Wordpress) to create activity of type XXX as completed status with todays date on submission.
3. Setup Schedule reminder for Activity of type XXX

a. 10 days after activity date

b. 20 days after activity date
4. Setup 2 smart group

a. Contacts having activity with activity datetime for past 10 days of type XXX

b Contact having activity with type XXX and not in group 4.a

Cheers

Pradeep
> 2 votes

---
Tags: groups, smartgroups
---


title: New Project/Campaign set up in CiviCRM

text:
# Question
Title: New Project/Campaign set up in CiviCRM
I've set up a number of projects/campaigns on CiviCRM so we can record donations against them and clearly see how much has been raised against each project. However, I need to set up a new project and the look of the system has changed since I last did it so I can't work out how to do it. I'd be so grateful for some advice!

Best wishes

# Answer
> 1 votes
1/ you might need to add a screenshot to your Question so folk can see what you are seeing

2/ you could visit https://dmaster.demo.civicrm.org/civicrm/dashboard and compare what you are seeing with what the Demo site shows

3/ you could visit https://dmaster.demo.civicrm.org/civicrm/admin/menu?reset=1 and compare what the Navigation Menu looks like there compared to yours

---
Tags: civicampaign
---


title: API Contributions and Payments

text:
# Question
Title: API Contributions and Payments
I'm using the API to create Contacts start Memberships through a signup form. We are offering 1-year memberships at various price points, and I have those set up in CiviMember. My code successfully creates Memberships.

What I'm trying to figure out are the API options for payments. There are API options for creating both a `Contribution` or a `Payment`.

**Do I need to create both in my API call?**

What I found was that a `Payment` requires a `contribution_id`, so it seems like they're connected. In another question I saw it's possible to associate multiple `Payment`s with one `Contribution`. It just seems these two concepts duplicate a lot. Is it correct then that a `Contribution` just records that a `Membership` price was agreed to, so it's like an itemized bill at a restaurant? And then that a `Payment` can be $20 in cash and the rest on a card (one or multiple `Payment`s)?

Also, we accept checks, so I noticed that a `Contribution` can be marked with `is_pay_later` to capture that. Would that flow for a person registering with a check be that I create a `Contribution` with the API at first-signup to record their agreed-upon "bill," and upon receiving the check later a person manually enters the `Payment` in the backend?

# Answer
> 1 votes
Each contribution should have one or more payments.

1. When you are creating contribution using contribution api with completed status a payment is recorded automatically.
2. If you creating contribution with pending status eg incase of check payments then when you receive payment from bank you use payment api to record payment for the pending contribution

In your case if you recording membership via code then i would suggest you to use Order api where you can pass membership and contribution params in the api params and it will create all required records in one call. You can refer here on how you can use order api to create membership or participant records with its payment in one call.

Cheers

Pradeep

---
Tags: civicontribute, api, contributions, payment
---


# Question
Title: How do the Rebuild Smart Group Cache scheduled job and the Smart group cache timeout setting interact?
According to the UI (Administer \> Customize Data and Screens \> Search Preferences) the 'Smart group cache timeout' setting allows you to specify "the number of minutes to cache smart group contacts".

According to the documentation, Job.group\_rebuild "rebuilds the smart group cache" and has a recommended frequency of 'every time cron job is run'.

Why do we have and need both these approaches to keeping our smart groups up to date? Isn't one enough?!

# Answer
> 5 votes
The rebuild job will build any smart groups that are not yet built. It is a good idea to run this job often if you hate your server or being able to see counts on the manage groups page is more important to you than your server not hanging. Otherwise the rebuild groups scheduled job has no benefit.

If you do not run that job then smart groups will be built on demand. This is particularly suitable if you have a lot of smart groups. If group has expired it will be flushed and rebuilt.

Note I DO recommend running the job that flushes expired groups by scheduled job - just not the one that rebuild them all, even the ones you don't really need

I've put up a PR on this https://github.com/civicrm/civicrm-user-guide/pull/397

---
Tags: smartgroups
---


# Question
Title: PayPal recurring payments are in pending state
How do I get PayPal Express recurring payments to be recorded correctly? They are in pending mode. No error in ConfigAndLog that corresponds to the processing time. It uses PayPal Express, there is no email configured (which seems to be the most common response to this error). There is a user name + signature option.

Non-recurring payments are going through OK. No details recorded against the recurring ones.

CiviCRM 5.14.0

PxPay Recur Payment gets stuck in pending mode Paypal payments - Pending (Incomplete Transaction)

# Answer
> 4 votes
From my experience, PayPal Express and PayPal Payments Pro have always conflicted with Civi. PayPal Standard works fine for both recurring and one-time payments, but the other two options do not work for recurring payments. My organization went back and forth with PayPal over this issue for months. Then we tried to fix it on our end with zero positive results. We finally concluded based on what others said in this forum that other than PayPal Standard, most PayPal options are not compatible with Civi. We now take our credit card payments with iATS, which is specifically designed to work with Civi and also have the option of using PayPal Standard if the user prefers it.

# Answer
> 0 votes
There was a patch release for 5.14 (5.14.2 is the latest I think - or 5.15.0 has the fix) that may relate

---
Tags: civicontribute, paypal
---


# Question
Title: “Network Error Unable to reach the server” recording Contact activities
We have a CiviCRM 5.15.0 installation under WordPress 4.9.10 and 2 MySQL db: one for Wordpress data and one for CiviCRM data. We manage more than 6500 contacts.

Going inside a contact we have this error message with a blank popup adding a meeting or phone call in the contact summary:

> **Network Error** Unable to reach the server. Please refresh this page in your browser and try again.

There are **NO ERRORS** adding contributions, registering for events, adding pledges, sending emails.

Analyzing logs we have no errors on Apache, but we found a

```
CRM_Core_Error::backtrace("backTrace", TRUE)

```

on

```
wp-content/uploads/civicrm/ConfigAndLog/

```

last file

You can see how the errors come out on this video https://youtu.be/lrMq6A2t9Uk

# Answer
You have custom plugin or extension that is interacting with Activity type which expects custom fields in the system and is either disabled or deleted.

Solution: 1. Turn off the extension if the system no longer needs it. 2. Enable/Add the custom field or custom group back into the system

Cheers

Pradeep
> 1 votes

---
Tags: wordpress, contacts, activities
---


# Question
Title: How can I convert/export my mailing (a newsletter) into a PDF
Please can you advise on the above. Can't seem to work it out!

# Answer
> 2 votes
Welcome to SE CiviCRM. When viewing the mailing you can click on print icon on top right corner. Which will pop up a screen to print, where you have an option to print as PDF. Other than this i don't see any option in CiviCRM to export the mailing into PDF

HTH

Pradeep

# Answer
> 1 votes
Possible option/solution –

Copy the HTML (source code) of your mailing

On any contact record, from the actions button, select Print/Merge Document

Paste the HTML source code into the Document Body field (Make sure you have selected to paste in source mode)

Click Download Document or Preview

This will allow you to create a PDF of your mailing.

---
Tags: activities
---


# Question
Title: Drupal View adding trailing zeros to Activity ID
I have a Drupal View displayed as a block, which includes a link to a webform using the Activity ID and the Contact ID for logged in users. It's been working fine but now I find that it's adding trailing zeros onto the aid, e.g. https://my.site/volunteer-role?cid2=540&aid=78668.0000

This is the link in a global custom text field: "volunteer-role?cid2=\[contact\_id\]&aid=\[id\]"

Any ideas how I can remedy this?

# Answer
> 2 votes
I fixed it! While getting a screengrab, I noticed there was some aggregation on the Activity Field which I must've set it in error!

I reset this to the default and it's working.

---
Tags: activities, drupal-views
---


# Question
Title: CiviMail and Smart Groups: when does CiviCRM identify the actual list of email recipients?
If I set up a mailing to a smart group, and schedule it to go out one month from today, will CiviMail send to the contacts in the smart group as they are defined at the point when I create the mailing, or at the point when the mailing is sent out?

# Answer
> 5 votes
CiviMail does this at the time when the mailing is created, i.e. when the groups are chosen etc.

The primary reason behind this is to account for permissioning and what contacts to send the mailing to. Doing so at mailing creation time is relatively easy, since we know the contact id of the user, and hence know what contacts the user has permission to send mail to.

It gets a lot more complicated (but not impossible) to do this during mail delivery, primarily because the cron job will need to evaluate the groups in the context of the person who created the mailing

# Answer
> 3 votes
The function that creates the recipient list is the unfortunately named CRM\_Mailing\_BAO\_Mailing::getRecipients() which clears out the rows in table civicrm\_mailing\_recipients and reinserts them.

It's called when editing and scheduling the email, but not when it is about to be sent.

# Answer
> 3 votes
I can confirm that this is still the behaviour of civiMail and Smart Groups.

There is an extension that addresses this:

https://github.com/3sd/civicrm-recalculate-recipients

# Answer
> 2 votes
I do not know out of the top of my head, but I would start checking by looking at the table civicrm\_mailing\_recipients. If the contacts in there are added at the time of mailing creation I know where I would put my money :-)

---
Tags: civimail, smartgroups
---


# Question
Title: What's the best way to make use of the GDPR extension's capabilities via webforms in Drupal?
I've generally used webforms integrated with CiviCRM on Drupal sites for mailing list sign-ups. Been looking at how to simply link those with the GDPR extension so that the acceptance of privacy policy etc. is logged. Anyone got a slick solution?

# Answer
There's a drupal module available here https://github.com/tapashdatta/webform\_gdpr/tree/5.x ,
> 3 votes

---
Tags: drupal, webform-civicrm, gdpr
---


# Question
Title: Honoree section not appearing on contribution page even though enabled
I have a website on Drupal 7 that is using the latest version of CiviCRM (5.13.4).

I'm trying to set up a contribution page with an honoree section. The options appear when setting up the contribution page and I have set the section as enabled without issue but when viewing the page, the section where a user should be able to enter the honoree information isn't appearing.

I have checked for errors, turned on debugging, etc and nothing relevant has appeared so there aren't any clues as to why it isn't appearing on the front end.

I've scoured the internet but I can't seem to find much help so hopefully someone here will be able to make sense of what might be happening.

Any advice / help would be greatly appreciated!

EDIT: I can see in the source code there is the JavaScript for the honoree section but that is all. The console gives no errors as to why it isn't appearing.

# Answer
After a lot of frustration, I found a custom template that the donation page was using with some JavaScript that was supposed to show the honoree section when it was enabled.

This was created a few years ago and evidently no longer worked.

Disabling this template allowed the honoree section to come through and show on the donation page.
> 2 votes

# Answer
This is likely to be a JavaScript error. Check for console errors; if you have errors but it's not obvious how to resolve them, edit your question to include the errors (as text, not screenshots please).
> 0 votes

---
Tags: drupal, contributions, contribution-page, honoree
---


title: Shared email address (parent/child)

text:
# Question
Title: Shared email address (parent/child)
One of the organisations I'm supporting has an issue with the email address fields...

They have a record for a child, and another for the child's parent(s). When it comes to sending emails they will 99% of the time be wanting to send emails to the parent, but aren't keen on having to click he relationship field to open parents record in order to get the email address.

Is there a way to share this, similar to that for postal address, or any other clever ideas to help with this?

# Answer
* Parent's emails should be visible from the child's "Relationships" tab without actually clicking through to the parent.
* Alternatively, the Relationship Block extension allows you to put the parent's info on the summary screen. Not ideal, but it saves you a click.

After that, I think you're looking at commissioning an extension, or a modification to an existing one. It probably wouldn't be hard to include a clickable email address via the Relationship Block extension. Doing a "shared email" extension is pretty doable these days also, due to some under-the-hood improvements in CiviCRM 5.
> 2 votes

---
Tags: email
---


title: "Unable to reach the server" error

text:
# Question
Title: "Unable to reach the server" error
After executing a search that returns more than one page of data, I get an error when I click on "next". "Unable to reach the server. Please refresh this page in your browser and try again."

The Apache2 error log shows:

```
apache2/error.log shows [Mon Jul 08 12:58:29.922448 2019] [php7:warn] [pid 4022] [client 96.9.90.28:57008] PHP Warning:  fopen(/var/www/vietfeir.com/public_html/wp-content/uploads/civicrm/ConfigAndLog/CiviCRM.4a976861044aadd15e2c85b9.log): failed to open stream: Permission denied in /var/www/vietfeir.com/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/log/Log/file.php on line 216, referer: https://ccrmdemo.vietfeir.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fsearch&_qf_Basic_display=true&qfKey=082061e63d30f54afa566bb

```

All of my files have permissions set to 644 and the directories are 755.

All files are owned by www-data:www-data

This is intermittent. I sometimes do not get the error.

# Answer
> 1 votes
Eileen McNaughton wrote:

> It's possible you have FULL\_GROUP\_BY mode enabled in mysql & that is causing problems - the log file should be /var/www/vietfeir.com/public\_html/wp-content/uploads/civicrm/ConfigAndLog/CiviCRM.4a976861044aadd15e2c85b9.log (or similar) and have more error details – eileen 16 hours ago

I removed the ONLY\_FULL\_GROUP\_BY mode and the problem was solved. Thanks, Eileen.

---
Tags: search-results
---


# Question
Title: Personal contacts displaying in business members directory
A website for a client runs CiviCRM on Wordpress.

Part of their membership site contains a membership directory so the public can see their registered/active members.

The members are essentially businesses. In CiviCRM we have people setup as individuals and businesses as organisations, with a relationship between them. Those relationships may be staff, directors or owners.

The issue we have is the membership directory is also showing people who have relationships with those organisations (in the list) instead of just the business.

Question is, what setting do we need to change to fix this?

# Answer
> 1 votes
Check the settings for this particular membership type to see if the membership is extended to related contacts.

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


title: Report based on country

text:
# Question
Title: Report based on country
Could anyone tell me how to set up a report based on the country of the member (Northern Ireland, Republic of Ireland, England, Wales, Scotland).

Thanks in advance Debs

# Answer
Welcome to CivICRM SE! You can get a report for the Republic of Ireland using the standard reports and filtering on Country, but CiviCRM doesn't have a field for the countries withing the UK by default. I don't think it would make sense to edit the Country field in the postal address unless you will never have any postal addresses outside the UK/ROI.

You will have to create a custom field for this. Obviously you can enter this manually when you set up the contact. You could populate this automatically from the postcode, but this would require some lookup from postcode to UK country (for example https://www.robertsharp.co.uk/2017/08/09/a-table-that-shows-the-uk-region-for-all-postcode-districts/ has the mapping) so would require some coding. There is a postcode lookup extension https://civicrm.org/extensions/uk-postcode-lookup but I think that's for looking up addresses and won't provide the UK country. Also be aware that postcode isn't the same as administrative area. For example Hay-on-Wye is in Wales, but has an English postcode. Hope that helps.
> 2 votes

# Answer
My client also wanted reports by the 4 'home' countries. So I added them to the 'civicrm\_country' table and modified the entries in the 'civicrm state\_province table' to point to the correct country. Works well.
> 2 votes

# Answer
Deborah, Welcome to CiviCRM SE. Unfortunately there is no such report to group members based on Country. You may need to add bit of customization by using hook to add ability for grouping members based on country under Sorting tab of the report.

If you are using Drupal CMS than you can build your own report using Views module in table format and group them based on country.

HTH

Pradeep
> 1 votes

---
Tags: civireport
---


title: How to create an standalone GDPR form?

text:
# Question
Title: How to create an standalone GDPR form?
I am using GDPR extension, which provide a popup form after online event signup or contribution.

I would like to provide a standalone form for anonymous user with newsletter signup, privacy, and data policy option that would be integrated with GDPR extension, so that I can trace when the contact last accepted GDPR policy.

Is it possible to do? thanks

# Answer
> 3 votes
Can be achieved by GDPR webform https://github.com/tapashdatta/webform\_gdpr/tree/5.x

---
Tags: gdpr, newsletter, privacy
---


# Question
Title: width of email field on contribution form
Using a WordPress installation. Initially the contribution form shows an amount field and an email field. Is there a way to make the email field wider. Currently both are the same width. Inspecting the page it appears that both fields use the same style attribute. I would like the email field to be about twice the width of the contribution field.

Any suggestions would be appreciated.

# Answer
> 1 votes
One way to customize styling is by putting your custom CSS inside the css/extras.css file. But I'm not sure which page you mean. The front-end contribution page has different sizes (https://wpmaster.demo.civicrm.org/contribution-page/) and the back-end New Contribution form doesn't have email on it.

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


# Question
Title: Event registration page refreshes when clicking continue
I'm running into a problem with event registration pages. Since upgrading to CiviCRM 5.14 & 5.15 whenever a user clicks continue on an event registration page it appears to refresh, not advancing to the confirmation page. We are placing a shortcode on these pages to display the registration form. It doesn't seem to matter if I set hijack to 1 or 0.

Initial registration slug:

`/events-training/rice-lake-classroom-field-event/register-rice-lake-2019/`

After clicking continue, but a blank registration form appears:

`/events-training/rice-lake-classroom-field-event/register-rice-lake-2019/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&_qf_Confirm_display=true&qfKey=XXXXXXXXXXXXXXX`

We are running Wordpress 5.2.2 and CiviCRM 5.15 currently. I have not adopted the clean URLs introduced in v5.13, but I suspect something in this update is causing the issue. If I temporarily revert back to CiviCRM 5.12.4 (with the same 5.15 database) the event pages advance as expected.

At the same time the live links CiviCRM provides to check out an event registration page aren't loading in v5.15, but they are in v5.12.4. In v5.15 all I see is the default "Do not delete this page. Page content is generated by CiviCRM".

`/civicrm/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=24`

Doing the standard cache clearing and updating resource URLs doesn't seem to help. Any ideas on what I could try? If I permanently revert back to 5.12.4 and keep the database at 5.15 would there be any issues?

**UPDATE:** I tried completing a test registration with v5.12.4 and ran into a database error once I confirmed the registration. We decided to revert the entire site to a backup before the upgrade to 5.14. We'll want to upgrade later on so I'm still interested in ideas for getting this resolved.

# Answer
> 0 votes
I am using 5.15 and event registrations are working. I did turn on clean url but I doubt it has anything to do.

---
Tags: wordpress
---


# Question
Title: Discrepancy between # of contacts in smart group vs # of contacts in smart group mailing
Using Drupal 7.67 and CiviCRM 5.13.5.

We run volunteer inductions, and send an email to all people who have attended volunteer inductions (as per CiviEvent) after the induction. We only run inductions once a month, though there is sometimes a delay of a few days until our volunteer coordinator can send this email to induction attendees.

This is done through sending an email through CiviMail to a Smart Group. (We do it through CiviMail rather than through CiviEvent \> Email all participants, because we want to see who opens the email and clicks on particular links).

The smart group has the following criteria:

```
 - Group(s) = Attended volunteer induction - last 7 days ...AND...
 - Group Status 'Added' ...AND...
 - Event Type = Volunteer Induction ...AND...
 - Start Date - greater than or equal to "4th July 2019 12.00 AM" ...AND...
 - End Date - less than or equal to "10th July 2019 11.59 PM" ...AND...
 - Participant Status (ID) In Attended ...AND...
 - Participant is not a Test

```

We use the start date and end date to only select people who have attended a volunteer induction in the last 7 days (the actual group criteria we've configured is "event date: last 7 days including today").

We haven't had a volunteer induction in the last 7 days, apart from a test one I've just made in which there is only one attendee (me).

However I'm seeing huge discrepancies between the number of contacts that should be in the smart group (1 - just me, since the only Volunteer Induction event in the last 7 days is a test one I just made) and the number of contacts that a mailing would be sent to, in CiviMail.

**Contacts \> Manage Groups**

This page shows 32 contacts are in the group (wrong).

**From that page: "Contacts"**

Clicking the "Contacts" link on the aforementioned page/the above screenshot, again shows that there are 32 contacts in the group (wrong).

**"Edit Smart Group Criteria"**

Clicking the "Edit Smart Group Criteria" page takes me to a new search page that shows there is only one contact in the smart group (the correct number of contacts!). I didn't actually edit any of the criteria, I only clicked the button and it shows me the correct number.

**CiviMail recipients**

However when I go to CiviMail and select the smart group as the recipient, it shows that it will be sent to 31 recipients (??) rather than 1. Looking into the recipients list, the 1 contact that should actually be in the smart group based on the criteria IS in the group, plus another 30 that may have previously met the criteria but don't anymore (based on attendance date).

--

This is pretty perplexing, does anyone know what's happening here? As I mentioned, the extra contacts who are showing up in the group are contacts who previously met the smart group criteria but don't anymore (they attended a volunteer induction a couple months ago, not in the last week).

I do wonder if it's because the smart group is referencing itself... in the criteria I pasted in at the top of this post, the first line seems to imply that contacts who are in the smart group, are ...in the smart group. But in screenshot 3 (under "edit smart group criteria"), that first criteria isn't there any more.

# Answer
> 3 votes
I think we've worked it out! A while ago some contacts had been manually added to the Smart Group (their status on the contact list for screenshot 2 showed them as 'Added' rather than 'Smart'). Smart groups don't automatically remove these people, so I've manually removed them which should solve the problem.

Going to avoid manually adding people to Smart Groups now and let them do their thing!

# Answer
> 1 votes
In mailing the count of recipients may be different than the count of smart group. The contact in mailing are filtered out if

1. Contacts email is on hold
2. Privacy set to donot email.
3. Same email address grouped together (this is configurable via spanner next to 'recipient count' in the mailer)
4. Contact doesn't have email id

Cheers

Pradeep

---
Tags: drupal, civimail, smartgroups
---


# Question
Title: blank emails from cron after upgrade Wordpress
Since I upgraded to Civi 5.11 (from 4.7) I am seeing empty emails from the cron daemon every time it runs the scheduled jobs. Previously I have only had emails when there has been some issue with the cron or what looks like an error from one of the scheduled jobs. The scheduled jobs look to all be fine in the log.

The problem is that it would hide any genuine error messages as I'm not going to go through all these emails.

Running on Wordpress 5.1.1 hosted on Siteground.

Update: I still want to resolve this. Part of the problem is I don't know where the messages with some content are coming from - they are all

"/usr/sbin/sendmail: unexpected response 501 to RCPT TO command"

I don't know exactly what they mean, but they did relate to a genuine problem with delivering mail. So I'd like to keep them. But they are few and far between and I haven't seen one for ages (maybe because there haven't been any bulk mailings). If I divert stdout to /dev/null will I lose the good as well as the bad. Not sure how to test it.

# Answer
> 1 votes
This turned out to be something adding a blank line in the cron output (see comments above). Since it's not clear what is adding it or how to track it down, a workaround is to adjust the cron command slightly:

`your-cron-command | grep "."`

which will remove all blank lines from the output, so if the output is just a newline then after the grep the output will be completely empty and not send an email as normal. In some hosting control panels you might need to backslash the pipe character, or create a wrapper script and have cron call that script.

---
Tags: wordpress, cron, siteground
---


title: Cannot upload image on mosaico template

text:
# Question
Title: Cannot upload image on mosaico template
The issue occurs when attempting to upload an image in the template builder. We receive the message "Unexpected upload error (Service unavailable (with message))". It also writes to the Drupal log:

Error: Class 'Imagick' not found in CRM\_Mosaico\_Utils::processUpload() (line 231 of /home/pillar/public\_html/sites/default/files/extensions/uk.co.vedaconsulting.mosaico/CRM/Mosaico/Utils.php).

Anyone knows if there's any fix for this please? Thanks

# Answer
You need Imagick package for Mosaico to work. If you already have the package installed then i believe its should be related to SE post Failed to locate Mosaico graphics driver
> 2 votes

---
Tags: error, mosaico
---


# Question
Title: How do I put saved searches or smart groups as menu options in WordPress?
Is it possible to make custom searches (smart groups) available from the custom menu. For instance, I am tracking elections (organizations) with custom fields for special elections, open races, candidates by district etc. Would like to make it easy to search from the menu for all open races, all members of the U.S. Senate etc. Is the only way to put custom searches on the menu to learn .php and create a custom search page on the backend?

\]

# Answer
You could generate report using the Smart Group as your filter and save that report. The report can be used as a dashlet which is available upon login or you can have it emailed to you as well. More dashlet info is here:

https://docs.civicrm.org/user/en/latest/events/reports/
> 2 votes

---
Tags: custom-fields, smartgroups, custom-search
---