# Question
Title: PHPUnit_Framework_BaseTestListener class not found
I am trying to run a PHPunit test for my extension but I keep getting the following error:
`Fatal error: Class 'PHPUnit_Framework_BaseTestListener' not found in C:\xampp\htdocs\myDrupalsite\sites\all\modules\civicrm\Civi\Test\CiviTestListener.php on line 17`
Any ideas on how I can fix this?
I am using CiviCRM 4.7
CMS is Drupal 7
My system OS is Windows 10. My extension is placed in `<Drupal root>sites/default/files/civicrm/ext`
My test directory was created using `civix generate:test` on the Windows command prompt.
I run the tests using PHPUnit via the command prompt in the root directory of my extension.

# Answer
> 1 votes
I run tests the following way

1. I test in a CiviCRM instance that is generated with buildkit (the toolchain provided for CiviCRM developers see https://docs.civicrm.org/dev/en/latest/tools/buildkit/ .
2. My tests are generated with `civix generate:test`. Remarks that this generator also creates the file `tests/phpunit/bootstrap.php` that takes care of the class loading.
3. I run the test from the extension directory by executing `phpunit4` (This version is installed with buildkit).

# Answer
> 1 votes
This sounds like a mismatch in the phpunit versions:

* Currently, most of the Civi testing runs against the PHAR build of `phpunit` v4.
* `phpunit` v6 renames every class to use `\` instead of `_`, which means that all the base-classes disappear if you run on a newer build of phpunit.

---
Tags: drupal, phpunit
---


title: How can I see all test data in CiviCRM?

text:
# Question
Title: How can I see all test data in CiviCRM?
I'm doing tests on a test server, but when I make changes using test data, the test data is hidden. I know this is by design, but it makes it impossible to actually check if things are working.

I have a membership that was entered as a test, so it doesn't show up for the user.

Now, that would be fine if it was a live server. But I'm running a test server, so I would like to be able to just turn test data on across the whole install.

OR, ideally, be able to turn test data on for my user.

So no one else sees the test data...

Either solution is fine.

IS there a way of doing something like this?

Thanks

# Answer
I am unaware of a way to turn on test data as you put it but here are some work arounds.

To find test the records, in searches (advanced search, membership search etc) there is a field "Membership is a Test" by default this is set to No but if you want to find test record such as the one specified above you can switched this to Yes.

Another option, if the reason you are using test mode is to test a payment processor without spending money and this site is just for testing then I would put in your test processor details into the live payments section for you payment processor. Then you can run "Live" actions but not spend money. You can always change these details back afterward.
> 1 votes

---
Tags: civimember, testing
---


# Question
Title: Will there be a LTS release of CiviCRM 4.6.x that supports PHP 7+
If an organization is currently heavily invested into customizations built for CiviCRM 4.6 LTS, is it possible for them to continue using the LTS version of CiviCRM when PHP 5.6 EOL? (31 Dec 2018) and an upgrade to PHP 7+ is necessary?

# Answer
> 5 votes
This kind of question is hard to answer for an open source project like CiviCRM :-) There is no 'owner' of the product that can tell you this. Nor is there a group of paid developers that will be able to continue supporting this. Considering that I think it is an impossible question to answer, and the wrong one to ask at this point in time. It would have to be one of the considerations when starting with heavy customization.

Having said that, I have worked in closed source situations where this kind of thing was promised by sales manager but never materialised :-). "No we will continue to support this version as long as you want to use it" and then a year later "we really urge you to upgrade as we will no longer support this version".

As an individual and member of the CiviCRM community I would not be interested in keeping a 4.6 version alive in combination with PHP 7. It would probably mean changing the 4.6 to a new PHP 7 compliant subversion, and then keeping it alive. That would leave me hardly any space for making a living. But that is solely as an individual with none of the organizations I work with facing this problem. It is only my personal opinion, it does not mean it is not possible or will never happen.

If there is a large group interested in doing this however you might be able to fund it. Or find partners that are willing to take this on. So I would really urge others to answer your question too!

# Answer
> 4 votes
When PHP 5.6 reaches it end of life. It means basicly that no further updates are coming from the official php group. But it means you can still keep php 5.6 on your server it does not stop from working.

# Answer
> 3 votes
Skvare was considering supporting 4.6 on php 7. See this link

---
Tags: php7
---


# Question
Title: Blank System Status screen and invalid [civicrm.files] URL variable on fresh CiviCRM v.4.7.30 and WordPress v.4.9.4 install
I'm puzzled why, for a fresh CiviCRM install on WordPress, the URL variable **\[civicrm.files\]** is set incorrectly, resulting in some out-of-the-box broken behavior. Specifically:

I "successfully" installed CiviCRM v.4.7.30 on WordPress v.4.9.4. I got some pop-up warnings and jumped to the "System Status" screen, which was blank except for `System Status: Error` in the footer.

When I "inspected" the web page, I found "404 file not found errors" for some angular-modules... files, for example https://crm.staging.myorganization.org/home/myorganization/sites/staging/crm.myorganization.org/wp-content/uploads/civicrm/persist/contribute/dyn/angular-modules.e0e4119919ee72acc13134f3f09d77c0.js was not found.

After some digging, the tip to go to *Administer -\> System Settings -\> Debugging* and disabling the "Asset Cache" (from https://civicrm.stackexchange.com/a/19597/5790) made the "System Status" screen work. Yay! But that's not a good production solution.

Digging further, I found that **URL variables** were set to the following. The **\[civicrm.files\]** value is **incorrect**.

> **URL Variables**
> **\[cms.root\]** https://crm.staging.myorganization.org/
> **\[civicrm.root\]** https://crm.staging.myorganization.org/wp-content/plugins/civicrm/civicrm/ **\[civicrm.files\]** https://crm.staging.myorganization.org/home/myorganization/www/sites/staging/crm.myorganization.org/wp-content/uploads/civicrm/

However all of the **Path variables** were **correct**:

> **Path Variables**
> **\[cms.root\]** /home/myorganization/www/public\_html/sites/staging/crm.myorganization.org
> **\[civicrm.root\]** /home/myorganization/www/sites/staging/crm.myorganization.org/wp-content/plugins/civicrm/civicrm
> **\[civicrm.files\]** /home/myorganization/www/sites/staging/crm.myorganization.org/wp-content/uploads/civicrm

On the *Administer -\> System Settings -\> Resource URLs*, the default values include the following:

> **Image Upload URL** \[civicrm.files\]/persist/contribute/
> **Extension Resource URL** \[civicrm.files\]/ext/

It is the use of the invalid **\[civicrm.files\]** value here that resulted in the blank "System Status" screen. Once I changed these to the correct absolute URL, the "System Status" screen worked fine, even after I changed *Administer -\> System Settings -\> Debugging -\> Asset Cache* back to the default "**auto**" setting.

Why is **\[civicrm.files\]** set to this odd incorrect value, when **\[civicrm.root\]** is perfectly fine? This is confusing for a CiviCRM newcomer (such as myself). Of all things, the "System Status" screen should be able to report the issues for the fresh install.

---

To clarify the installed folder structure:

The `$_SERVER['DOCUMENT_ROOT']` is `/home/myorganization/www/public_html`, but I've created a folder structure under `/home/myorganization/www/sites` for test, staging, and production folders for various sites. The `~/www/sites folder` is symlinked into `/home/myorganization/www/public_html`. I've created a custom `__index.php__` file that gives the values of various PHP variables:

> Full URL= https://crm.staging.myorganization.org/**index**.php
> **$\_SERVER\['DOCUMENT\_ROOT'\]**= /home/myorganization/www/public\_html **$\_SERVER\['PHP\_SELF'\]**= /sites/staging/crm.myorganization.org/**index**.php
> **$\_SERVER\['SCRIPT\_NAME'\]**= /sites/staging/crm.myorganization.org/**index**.php
> **$\_SERVER\['SCRIPT\_FILENAME'\]**= /home/myorganization/www/public\_html/sites/staging/crm.myorganization.org/**index**.php
> **realpath( $\_SERVER\['SCRIPT\_FILENAME'\])**= /home/myorganization/www/sites/staging/crm.myorganization.org/**index**.php
> **getcwd()**= /home/myorganization/www/sites/staging/crm.myorganization.org
> **\__FILE\__**= /home/myorganization/www/sites/staging/crm.myorganization.org/**index**.php

## Bonus Question

After fixing the above, the "System Status" screen still complains "**Incorrect Resource URL:** The Resource URL is not set correctly. Please set the CiviCRM Resource URL." Why?

# Answer
The issue is that the file structure you are using is not accounted for in the installer.

We've covered the standard directory structures and detect them, however there are some use cases that we have not been able to both detect and set programmatically. In these cases, you will need to override the values.

In your case you needed to override the URLs as the `[civicrm.files]` URL is appending `/home/myorganization/www/sites/staging/crm.myorganization.org` to the URL.

I have seen this before (mostly with symlinks or if both WP is installed in it's own directory AND wp-content has been moved). Can you let us know who your host is and confirm your configuration?
> 0 votes

# Answer
This happened to me and is a common issue - especially on shared hosts. Solution is to add the correct information in your civicrm.settings.php file.

Try placing the following in the overrides section of your civicrm.settings.php file.

```
global $civicrm_paths;
$civicrm_paths['civicrm.files'] = array(
  'url' => 'https://crm.staging.myorganization.org/wp-content/uploads/civicrm/',
  'path' => '/home/myorganization/www/sites/staging/crm.myorganization.org/wp-content/uploads/civicrm',
);

```

More info can be found in this answer.
> 0 votes

---
Tags: wordpress, install, status
---


# Question
Title: Inbound email formatting differs in Activities compared to CiviCase
Is it possible to include line breaks in activities created from inbound emails, given that this is implemented in CiviCase? If so are there any suggestions about how to go about implementing this?

Currently long emails, especially if replies are included result in a confusing block of text. This has previously been noted at Inbound Email - Formatting? (emails with HTLM code are ignored), However if the activity is saved to a case and then viewed the line breaks are shown.

To reproduce. \- Send an email (with line breaks/paragraphs) that will be recorded as an activity (https://civicrm.org/blog/dahndy/leveraging-civicrm-email-to-activity-processing-in-gmail details how to with gmail) \- View the associated activity on the associated contact (search for the email you send the email from) \- Note that the email has line breaks/paragraphs removed. \- Assign the email activity to a case \- View the case - scroll down to the activites tab - view \- The same content will be displayed with line breaks.

My understanding is that the contact record Activity View uses the following to display the body of the email: {$values.details|crmStripAlternatives|nl2br} civicrm-core/templates/CRM/Activity/Form/ActivityView.tpl:138

Where as the CiviCase Activity view is using: {$form.details.html} civicrm-core/templates/CRM/Case/Form/Activity.tpl :64

In the database the detail field for inbound email the record is stored as two ALTERNATIVE ITEM's the first as plain text with line breaks, the second with the full html of the inbound email.

# Answer
> 1 votes
This bug has been fixed in RC 4.7.31 -\> https://github.com/civicrm/civicrm-core/pull/11661

---
Tags: email, civicase, activity
---


title: Template file not loading

text:
# Question
Title: Template file not loading
I added a new page in this hierarchy: `CRM/Mymodule/Page/subdir/MyPage.php` and added a template file at `templates/CRM/Mymodule/subdir/MyPage.tpl`.

But when I run *MyPage.php*, I get a blank page. Template contents aren't displayed. Adding *smartyDebug=1* to the URL doesn't trigger a popup either. Strangely though, if I *var\_dump* a variable, I can see the page with menu bar, page title and the variable info. So *MyPage.php* is being invoked.

Is it that pages don't support subdirectories? I tried adding the template file using *Region*. That didn't work either.

**UPDATE**:

I created a page and a corresponding template on `CRM/Mymodule/Page/MyPage.php` and `templates/CRM/Mymodule/MyPage.tpl` respectively and manually wrote a route. It didn't work. I then used civix to generate the same page and template. It worked. So, is it compulsory that we create using `civix`? But I had manually created the form and it had worked.

# Answer
> 3 votes
I'd say best to stick with where Civix (aka Tim) says it should go! (i.e. no subdirs) - and note that Civix can help you create the page:

https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addabasicwebpage

To generate a Page:

```
me@civisys:/home/me$ cd /var/www/extensions/com.example.myextension
me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page --help
Usage:
 generate:page className webPath

Arguments:
 className  Page class name (eg "MyPage")
 webPath    The path which maps to this page (eg "civicrm/my-page")

me@civisys:/var/www/extensions/com.example.myextension$ civix generate:page Greeter civicrm/greeter
Write /var/www/extensions/com.example.myextension/xml/Menu/myextension.xml
Write /var/www/extensions/com.example.myextension/CRM/Myextension/Page/Greeter.php
Write /var/www/extensions/com.example.myextension/templates/CRM/Myextension/Page/Greeter.tpl

```

# Answer
> 0 votes
I have set environment to Development and Disabled asset cache at at/civicrm/admin/setting/debug?reset=1 It worked for me.

---
Tags: templates
---


# Question
Title: Problem with wp-cli and setting up cron in CiviCRM
I'm trying to set up the CiviCRM cron job.

I've downloaded and installed wp-cli according to the instructions on

http://wp-cli.org/

I have logged into the server as the user running the cron job.

I can successfully run this command in the shell:

```
 /usr/local/bin/wp  --url=https://<URL of Server>/ --path=/home/<userDir>/<hostingDir>/ civicrm api job.execute auth=0

```

But if I run the same command in cron it returns this error in the Cron email:

===============================

```
Set-Cookie: PHPSESSID=73sl011599lmjbg5038j5n06q4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html; charset=UTF-8

<br />
<b>Warning</b>:  fwrite() expects parameter 1 to be resource, string given in <b>phar:///usr/local/bin/wp/php/WP_CLI/Loggers/Base.php</b> on line <b>61</b><br />
<br />
<b>Warning</b>:  fwrite() expects parameter 1 to be resource, string given in <b>phar:///usr/local/bin/wp/php/utils-wp.php</b> on line <b>118</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at phar:///usr/local/bin/wp/php/WP_CLI/Loggers/Base.php:61) in <b>/home/<userDir>/<hostingDir>/wp-includes/pluggable.php</b> on line <b>1216</b><br />

```

========================================

I've also run the whoami command via cron and it confirms that it's the same user running in the shell and the cron job.

Running wp --info in the shell gives this:

```
OS:     Linux 3.10.0-514.21.2.el7.centos.plus.x86_64 #1 SMP Wed Jun 21 17:20:54 UTC 2017 x86_64
Shell:  /bin/bash
PHP binary:     /opt/cpanel/ea-php56/root/usr/bin/php
PHP version:    5.6.33
php.ini used:   /opt/cpanel/ea-php56/root/etc/php.ini
WP-CLI root dir:        phar://wp-cli.phar
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/<userDir>
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 1.5.0

```

=================================

Running wp --info in the cron job gives this:

```
OS:     Linux 3.10.0-514.21.2.el7.centos.plus.x86_64 #1 SMP Wed Jun 21 17:20:54 UTC 2017 x86_64
Shell:  /bin/bash
PHP binary:     /opt/cpanel/ea-php56/root/usr/bin/php-cgi
PHP version:    5.6.33
php.ini used:   /opt/cpanel/ea-php56/root/etc/php.ini
WP-CLI root dir:        phar://wp-cli.phar
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /usr/local/bin
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 1.5.0

```

================

Now, the PHP binary paths are different. As is the WP\_CLI phar path.

I'm assuming this may be the problem?

But I don't know why they are different, or how to reconcile them...

Any insights gratefully received.

Thanks, Norman

# Answer
After much research and getting expert ideas...

(I'm sure this is known to many people here, but I'm posting here to hopefully help others who don't know this.)

TLDR; in Cron jobs, you should fully specify the path to the PHP binary as well as wp-cli.

=======================================

Cron runs in its own minimal environment. It does run as the relevant user, but it does not load most of the user environment info. This post was helpful for me to understand some of this:

https://serverfault.com/questions/337631/crontab-execution-doesnt-have-the-same-environment-variables-as-executing-user

I am running cPanel which does some of its own management of php. The cPanel support people were very helpful in helping me understand more.

What is not obvious is that when you login to a shell, various paths are added, even ones that are NOT in the user's .bash\_profile. Cron does not necessarily do the same thing.

One that is added with a shell login is /usr/local/bin/

So typing "which php" in a shell gives /usr/local/bin/php, but in cron it gives /usr/bin/php

In cPanel, or indeed other tools I expect, this contains references to specific php binaries that can change depending on what user you are.

I don't pretend to understand the underlying mechanism.

But the upshot is that the php command points to a different binary in the shell or via cron.

So in the cron job, you ALSO have to point at the specific php binary with a command like:

```
/usr/local/bin/php /usr/local/bin/wp --info (etc)

```

Or even a FULL path to the desired php binary:

```
/opt/cpanel/ea-php56/root/usr/bin/php /usr/local/bin/wp --info (etc)

```

In cPanel there is also a known problem when using PHP-FPM for a site where the automatic PHP detection doesn't work, so it falls back to the cPanel PHP default. They are working on fixing that. If this is a problem, then setting the full path to the desired PHP binary will work.
> 2 votes

---
Tags: cron
---


# Question
Title: Can I see/export the total field mapping in use?
I inherited responsibility for this small non-profit's database. I would like to be able to view and print a list of ALL the fields in use.

# Answer
> 1 votes
Good question. I am sure in the 'old days' you used to be able to work you way back to such a list via the breadcrumbs, or maybe i am confusing it with Option Groups. But i just gave it a go and couldn't find a way to it.

Your best bet is to jump in to the DB if you have access and grab a copy of the civicrm\_custom\_field table, plus the civicrm\_custom\_group table

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


title: 4.7.31 CiviVolunteer Issue

text:
# Question
Title: 4.7.31 CiviVolunteer Issue
After upgrading to 4.7.31 (On wordpress) - I have the following issue pop up - on pages, such as events that have CiviVolunteer fields.

```
Warning: Declaration of CRM_Volunteer_BAO_Project::copyValues(&$params) should be compatible with CRM_Core_DAO::copyValues(&$params, $serializeArrays = false) in /home5/site/public_html/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/CRM/Volunteer/BAO/Project.php on line 36

```

Line 36 has the following code:

```
class CRM_Volunteer_BAO_Project extends CRM_Volunteer_DAO_Project {

```

not sure what is wrong here. CiviVolunteer 4.7.21-2.2.3

# Answer
> 3 votes
This was reported recently, but I haven't had a moment to get into it. It should be a trivial fix, but you could also resolve this by turning down your PHP error reporting. See this relevant PHP documentation. It is inadvisable to run production sites with `display_errors` enabled.

---
Tags: civivolunteer
---


# Question
Title: Cron Job not working after Joomla 3.8.1 update
After upgrading Joomla to 3.8.1 the cron job stopped working as reported here. I have applied the update the Joomla.php file as suggested in the answers. This gets rid of the original error. However now I am getting this error: `PHP Notice: Constant JPATH_ISWIN already defined in /home/fava/public_html/libraries/import.legacy.php on line 64
 Notice: Constant JPATH_ISWIN already defined in /home/fava/public_html/libraries/import.legacy.php on line 64
 PHP Notice: Constant JPATH_ISMAC already defined in /home/fava/public_html/libraries/import.legacy.php on line 65
 Notice: Constant JPATH_ISMAC already defined in /home/fava/public_html/libraries/import.legacy.php on line 65
 PHP Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.legacy.php on line 72
 Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.legacy.php on line 72
 PHP Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.legacy.php on line 79
 Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.legacy.php on line 79
 PHP Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.php on line 60
 Notice: Constant JROUTER_MODE_RAW already defined in /home/fava/public_html/libraries/import.php on line 60
 PHP Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.php on line 67
 Notice: Constant JROUTER_MODE_SEF already defined in /home/fava/public_html/libraries/import.php on line 67
**Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by "/home/fava/public_html/libraries/import.legacy.php" at line 64.**`

I have tried manually clearing the Joomla session table but no luck. I have also update CiviCRM to 4.7.27 and applied the patches as mentioned here but the same error is still occurring.

# Answer
I have updated Joomla to 3.8.5 and updated CiviCRM to 4.7.31 (I'm using PHP version 5.6.34.) and the CRON job **still** didn't work.

I found and applied this patch and it worked. Thank you to Andrew Thompson for your work on this issue.
> 1 votes

# Answer
It looks like import.legacy.php is re-definining existing constants (or called twice)

I'm not familiar with Joomla, but can you try to remove requiring this file in civi (comment out line 565 in that file)

https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Joomla.php#L565
> 0 votes

---
Tags: joomla, cron-job
---


# Question
Title: Recurring Paypal Contributions are showing (Pending Incomplete)
We are on Civi 4.7.29 and Wordpress 4.9.4

Today I noticed about 20 transactions with the status Pending Incomplete. They are all intended to be recurring. I found out that we are getting notifications from Paypal on everyone of these transactions and some of these people confirmed the payment was a success on their end. But it is not updating their memberships in Civi and it is not sending them a receipt from civi or recording it as a completed contribution.

Does anyone know where I should start with resolving this? I did find several other posts related to this issue, but I did not see an answer with any of them.

We confirmed that payments go through properly with no issues, if it's a single/non-recurring payment.

thank you

\***Edit\****

I just noticed that when trying to make a recurring payment with my credit card instead of paypal I get this error message

DPRP is disabled. DPRP is disabled for this merchant.

# Answer
> 3 votes
Apparently Paypal charges extra for recurring functionality and you have not subscribed to the additional $30/mo DPRP service.

> DPRP is disabled. DPRP is disabled for this merchant.

https://www.paypal-community.com/t5/About-Business-Archive/quot-DPRP-is-disabled-for-this-merchant-quot-plz-help/m-p/991717#M14689

In your bounty comment you state:

> I am looking for a solution that will allow us to accept recurring payments through Civi.

In this case I would recommend you look into Stripe.com which provides these options without charging monthly fees. There is a CiviCRM-Stripe payment extension in active use and development.

# Answer
> 1 votes
We had a similar problem with Civi on Joomla which was resolved by updating to 4.7.30.

---
Tags: wordpress, paypal, recurring-contributions, pending
---


# Question
Title: CIVICRM mailing links not working properly in schedule job
When a TEST mailing is sent with tracking link clicks enabled, then the URL DOES NOT include "public\_html/"; however, when the mailing is scheduled and sent with tracking link clicks, then "public\_html/" is INSERTED into URL.

Wordpress Version --\> 4.9.2 CIVICRM Version --\> 4.7.27

# Answer
> 2 votes
We are having this problem as well, also in WordPress 4.9.2. We have discovered that the issue arises because permissions get corrupted. According to SiteGround, our host, these permissions in particular are problematic:

* ./wp-content/uploads/civicrm/templates\_c/en\_US/%%31/313
* ./wp-content/uploads/civicrm/templates\_c/en\_US/%%D6/D67

We don't know what is causing permissions to break in the first place. For example, yesterday, we sent out three emails with trackable links within 1 hour. The first two worked perfectly. The last one didn't work - 'public\_html' inserted into all the links.

Our solution has been to create a cron job in cPanel to reset permissions every 5 minutes.

---
Tags: mailing, scheduled-job
---


# Question
Title: Domain Access and CIVICRM ACL of data and drupal
I have CIVICRM Drupal 7 install with several sub-domains. It's working fine until I have tried to control access to contacts based on the subdomain/drupal users and their roles.

I have tried following the guide from the CIVICRM documentation here

However, I am finding it a little confusing as it appears to refer to both ACL "users" and "roles" and CMS "users" and "roles" interchangeably though they clearly are not.

I am trying to achieve more-or-less the exact example case given on the page:

> A charity based in Chicago has three regional offices, and needs to give its fundraising staff the ability to create and edit contact records for prospective donors. They have decided that the fundraising department in each office can only have access to its local contacts. While the permission add contacts can be granted to authenticated users in the CMS (Drupal, Joomla! or WordPress), if view all contacts and edit all contacts were also assigned in this way, there would be no way to differentiate between the three groups of donors (locations). This could only be achieved with a CiviCRM ACL

I would like to also have certain groups of contacts - created by specific drupal roles - also propagate to all users.

The article explains in some detail how to create CIVICRM groups anf ACL roles but not how to link them to Drupal roles or the domain of origin of a contact.

How would I do this, or is there a reasonable guide to achieving such a setup?

# Answer
It sounds like what you want is CiviCRM multi-site capabilities with the multisite extension. This will give you most of what you want without ACLs, and integrates well with Domain Access. I've also written an extension to properly handle creating new user logins via CiviCRM profiles with Domain Access.

To handle the "propagate some groups to all users" scenario - with multisite, every subdomain will have a "master group". Any contact in that group will be visible to all contacts on that subdomain. If you set a master group as the parent of another group, all those contacts become visible to those domain members. Since a group can have multiple parents, simply make the "visible to all" contacts have all the master groups as parent groups.
> 2 votes

---
Tags: drupal, acl
---


# Question
Title: How to setup an auto email for a specific group sign up?
I am looking for instructions on how to set up an auto email when someone signs up and joins a specific group. Thank you for your assistance.

# Answer
> 2 votes
Agree with Peter, you can find the CiviRules extension here: https://civicrm.org/extensions/civirules (or in the extensions list when you do **Administer\>Extension** and then click on the **Add New** tab)

Documentation on how CiviRules work can be found here : https://docs.civicrm.org/civirules/en/latest/

# Answer
> 0 votes
If there is an Activity connected to the 'join a group' then you could use Scheduled Reminders.

Assuming there isn't then I think CiviRules extension may be the only non-code route.

For Drupal systems, you could use Webforms for the 'sign up' form and then use Webform to trigger the email.

---
Tags: forms
---


title: Restricting price option to a group

text:
# Question
Title: Restricting price option to a group
According to this answer Can I offer different pricing for an event based on user group? it is possible to restrict a price option that is set up as a check box, radio button or selection to a group. However, I don't see the option to limit the option to a specific group?

# Answer
> 1 votes
The answer you're referring to says you need the Group-Based Pricing extension installed. It also seems that the extension isn't being maintained, and folks have had to tweak it to work with modern versions of CiviCRM. This fork seems more up-to-date.

---
Tags: price-sets
---


# Question
Title: 404 Not Found Error when running reports
We moved our WordPress site from one cPanel account to another whilst changing domains. Everything in CiviCRM seemed to be working OK. But we've just hit a problem.

I can go to Reports -\> Contact Reports -\> Contact List - and get the screen with columns, filters, sorting OK.

But when I try to Refresh Results, or Print etc I get a 404 Not Found error.

Any help or hints of where to look would be much appreciated.

# Answer
Most common reason I have run into a 404 error when I've moved accounts? File permission issues. Usually there are some files that are attached to the wrong user/group, typically. Your host should be able to look at the logs for you and pinpoint the file(s), directory(ies), etc where the permission errors are happening. I like it if I can get into a chat with them, as I can then run the process, generate the error, and they can see it in the logs.
> 0 votes

---
Tags: error, error-page
---


# Question
Title: Unintended Text in civiBooking Resource Configuration
in civiBooking, additional text is showing under Resource Configurations while trying to add a booking.

Trying to add a booking, all the options (Conference Room/Hourly -$50, Conference Room/Daily -$200, Hourly - $50, Daily - $200) have the additional text /Phone or /Email added.

Neither Phone or Email was set up as part of the resource configuration (Image 2) or size units (image 3). Where is it coming from? How do I get rid of it?

# Answer
> 1 votes
It looks like that text is likely from the "Resource configuration size unit" option list.

From the Resource Configuration Set page (**civicrm/admin/resource/config\_set?reset=1**), you can edit the individual options for the configuration set in question. You can select a different "Unit" on the options, which shows up at the end of the selection as you noticed.

If there is no appropriate option listed, you can also edit the option list that is used here. Go to **Administer \> System Settings \> Option Groups** and look for the **Resource configuration size unit** group.

It looks like you've already set these values correctly. Did you change the values at some point? If you create a new "size unit" and select that, does it affect the display?

---
Tags: civibooking
---


title: civiVolunteer database table creation?

text:
# Question
Title: civiVolunteer database table creation?
When are civiVolunteer database tables created? When I run a search on volunteer opportunities and when a donation is made to our organization, we get database errors saying that tables civicrm\_value\_civivolunteer\_5 and civicrm\_value\_civivolunteer\_7 are missing. An inspection of the database reveals that we have a table called civicrm\_value\_civivolunteer\_3, but that's it.

I cannot disable civiVolunteer without an error, which is another clue that something is wrong with the civiVolunteer installation. I recently took over this website, so I do not know any of the specifics of the installation. I just need to fix the problems.

So, does anyone know what I need to do to get the missing tables in place? Will reinstalling civiVolunteer be enough?

# Answer
> 1 votes
Those tables are for custom data. CiviVolunteer uses standard CiviCRM custom data tables (created in the normal way, just as you would create custom fields) so that error is rather unusual. Was the site migrated from one server to another?

# Answer
> 1 votes
I suspect you can resolve this by deleting the records in `civicrm_custom_group` which name the missing tables in the `table_name` column. (As always, make a backup and try it on a sandbox first, if you can.)

My guess as to the site got this way? Running the CiviVolunteer installer multiple times.

---
Tags: database, civivolunteer
---


# Question
Title: How can I let members edit their relationships?
We have organizational memberships - each organization can have up to five individuals who are listed as members. We do this via the membership "Relationship Type" feature, and it works well.

However, competing platforms have a dashboard that allows the contact person for an organization add/remove the individual members that should be part of the record. How can this be implemented with CiviCRM?

Civi 4.7.31, Backdrop 1.9.2 - so Views/Webform/etc. are all options. It's acceptable for a member administrator to search contact names in the database. Writing custom code is an option if there's a simple-ish way to do this.

# Answer
> 2 votes
I've done something similar with Views, VBO and a custom action. There is an "Add relationship with contact" action in VBO but for more control over the action you can write a custom action.

In my case, the view is of Civi contacts with one of several relationship types to the org. The action is a 'Set as Correspondent' button. Only one person at a time holds the Correspondent relationship with the org so the action uses `civicrm_api3()` to find and end any current Correspondent relationships, create a new relationship between the selected contact and org and create an activity for info purposes.

Your action could do something similar but check there are no more than 4 existing relationships of that type before creating a new one.

# Answer
> 1 votes
I have a similar requirement for a project. This piece is not yet in active development, but I anticipate building an Angular form (probably based on crmUiWizard) to allow management of relationships and possibly also a limited subset of contact details. In my case it's (probably) NOT acceptable for a member administrator to search contact names in the database (without limitations); might need to rely on the dedupe feature to allow entry of new contacts without creating a mess.

# Answer
> 0 votes
It might be possible to do this via a View that lists people that are linked to the contact person's Org and provides customized links from the view to a webform (passing contact IDs via URL to populate the webform). You may also need the Relationship Permissions ACL extension and have these relationships set up to grant editing permissions.

e.g. If you have a view that is pulling the current user (contact person with permissions to add/edit), you can use the View to also get the Org and the other members based on relationships, then feed them into a Webform with CiviCRM functionality enabled, feeding the contact IDs into the webform using the URL. ("If the url contains e.g. cid1=123, it will be used to pre-populate this contact (takes precidence over other default values).")

You could set up the form to only allow input for 6 contacts (the org and 5 members) and specify their relationships in the webform/civicrm settings, you can feed the contact IDs if they exist, or allow new contacts to be created if they don't.

# Answer
> 0 votes
Set up a View that shows the logged in person the Org they are related to, and the Indivs related to that Org. Provide an 'update' button/link to load the url of a webform where they can they edit or add new Contacts.

I can probably add more if I understand at what point this approach is problematic (eg Backdrop has Webform but not Webform-CiviCRM?)

---
Tags: civimember, relationships, user-dashboard, backdrop
---


# Question
Title: Change log crashes - table entity_log_civireport doesn't exist - how to fix?
After switching logging on, clicking the tab 'Change Log' hangs for ever and the following error occurs (full traceback availabe). This is, I guess, a temporary table that for some reason Civi has failed to create. Does anyone have any clues on fixing this problem. Civi is 4.7.27 / Drupal and is otherwise functioning well (hosted at CiviHosting)

**#9 /home/dcmadmin/www/www/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB\_common-\>raiseError(-18, NULL, NULL, NULL, "1146 \** Table 'dcmadmin\_civicrm.entity\_log\_civireport' doesn't exist")**

(previously I raised this as a question about 'Unable to reach the server' but that's only a symptom of the above problem.

# Answer
I wonder whether log tables are being created in the wrong order by the config change that switches on Logging? If the error you see always refers to this same table, maybe creation of another log table triggers expects **dcmadmin\_civicrm.entity\_log\_civireport** to exist already. Chicken and egg? David
> 0 votes

# Answer
Andy, what version of MySQL are you running? If it's 5.7 check whether SQL Mode has ONLY\_FULL\_GROUP\_BY set in it. If so try deleting this out and restarting MySQL. Removing this has fixed this error for me and also another one where I couldn't run the Detailed Contributions report. It seems the MySQL 5.7 has changed the default behaviour for the SQL Mode and some of the CiviCRM queries don't seem to like the more strict handling.

You can check if this is the likely casue by checking the backtrace to see if it contains and error such as:

```
Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'civicrm.contribution_soft_civireport.amount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by]"]

```
> 0 votes

# Answer
I was facing same issue, and on removing sql mode - ONLY\_FULL\_GROUP\_BY, worked for me. SET GLOBAL sql\_mode=(SELECT REPLACE(@@sql\_mode,'ONLY\_FULL\_GROUP\_BY',''));
> 0 votes

---
Tags: drupal, 4.7, logging
---


title: Hide Line items if user is logged in

text:
# Question
Title: Hide Line items if user is logged in
I am working on an event registration. We need to hide certain price set line items based on various factors. Most are based on previous field response but there is one line item that needs to be hidden if user is logged in. I found this post: https://wordpress.stackexchange.com/questions/69814/check-if-user-is-logged-in-using-jquery

But can't seem to get it to work in my custom template. I probably have some syntax wrong.

Any thoughts or a alternate solution would be appreciated.

Thanks

# Answer
> 1 votes
So I've done something similar (I used the group a user was a part of vs just a user) with a template 'extra' file that contained javescript and a quick call to the API. Not sure if this is the ideal method but it worked to show/hide some content.

https://civicrm.org/blog/dave-greenberg/now-its-easier-add-custom-behaviors-templates

Javascript Contact API - how do I 'do something' with results

---
Tags: wordpress, civievent, custom-templates
---


# Question
Title: How to Add contacts to an Event or Membership from the Search task list
I am sure that Advanced search results used to provide the Actions of 'Add Contacts to Event' and 'Add Contacts to Membership'.

But I can't find any reference to this in Civicrm 4.7, neither in our site, nor the demo sites - nor the current literature.

I'm on 4.7.27, Drupal latest.

I found these earlier references to Add Contacts to Event: https://docs.civicrm.org/user/en/latest/events/manual-event-registration/ https://issues.civicrm.org/jira/browse/CRM-1988

I've also looked in Drupal Permissions without seeing anything obvious there. We're not using ACL.

Any ideas whether these two features are still available? They'd be massively useful to us.

# Answer
> 3 votes
'Add Contacts to Event' was renamed to 'Register participants for event'

I don't recall an 'Add Contacts to Membership'

---
Tags: civievent, civimember
---


# Question
Title: Change order of custom profile fields on Drupal register page
I have created a custom profile in CiviCRM (**Administer \> Custom Data and Screens \> Profiles**) designated to be displayed on the Drupal registration page (see second screenshot), for users creating a new account. Initially, the CiviCRM profile was listed after the Drupal core elements: username, password, etc. But now the custom CiviCRM profile is displayed first.

How can I rearrange the order? I looked in Drupal blocks and do not see anything regarding these and I've tried assigning an order of "50" to no avail.

CiviCRM 4.7.27, Drupal 7

In the screenshot below, you can see that the "Tell us more" and darker text section is the CiviCRM custom profile and what follows it are the Drupal core elements that I want to be at the top.

# Answer
You need to use a `hook_form_alter` function in Drupal to accomplish this. In doing so, you can modify the weight of the items to appear *below* the existing form items.

```
function yourmod_form_alter(&$form, &$form_state, $formID) {
  if (($formID == 'user_register_form')) {
    $form['civicrm-profile-register']['#weight'] = somevalue;
  }
}

```
> 1 votes

---
Tags: drupal, profile
---


title: Message Template Token limitations

text:
# Question
Title: Message Template Token limitations
We want to use Message Templates for tailoring our sponsorship renewal invoice reminders. We have multiple sponsorships setup as separate Membership Types with corresponding prices sets. However data about "membership" is NOT available as tokens when using Message Templates. That data is available as Tokens when using Schedule Reminders - but this means a separate Reminder is to be setup for each Membership Type. Question is why cannot Membership data (and for that matter Event data) be available as Tokens under Message Templates?

# Answer
> 1 votes
Welcome to StackExchange Grant!

In regular messages token for other "entities" such as memberships, contributions or event registrations are not available because each contact can have any number of them.

For example, if a contact had two memberships or event registrations, CiviCRM would not know which data to "fill in" when sending the email.

This is why CiviCRM has several special functions such as event and membership reminders or thank you letters for contributions.

# Answer
> 0 votes
Fuzion made an Extension that provides additional tokens that you should be able to use in this scenario. The CiviToken extension includes

* Latest Memership Status
* Latest Membership Type
* Latest Current Membership Type etc

---
Tags: message-templates
---


title: Permit member-only pricing

text:
# Question
Title: Permit member-only pricing
**Goal: Provide member discount pricing for some events and member exclusivity for other events.**

I realize **cividiscount can provide membership discounts** \- is it required or can it be achieved via price-sets too?

Can **event registration be restricted by membership status** (free or for fee) Can't see how to do that with cividiscount.

**I can do it with a specific civicrm-webform** but wanted to see if I'm missing something in native civicrm.

I would guess that member-only events would be a common use case.

# Answer
The Group Price Extension states that it

> allows you to limit the display of individual prices in price sets to specific groups. This can be used to implement members-only pricing for events, as well as other use cases.
> 1 votes

---
Tags: civievent, civimember, webform-civicrm
---


title: Drupal Home Page

text:
# Question
Title: Drupal Home Page
Any way to make my CiviCRM Drupal site go to the module when I hit the homepage? Right now I have to type ?q=civicrm/dashboard after my root.

Thanks

# Answer
Ugh.. found it /#overlay=%3Fq%3Dadmin%252Fconfig%252Fsystem%252Fsite-information

(Drupal) configuration -\> site information -\> front page
> 2 votes

---
Tags: drupal
---


# Question
Title: Civicrm SagePay takes the primary address as billing address
I just came across this error in Civicrm. We have sage pay payment intergration with our site.

The issue is that even when someone enters the billing address civicrm passes primary address to sagepay . This is a general issue and is happening with all the module ie - civiEven, Contribution,

My assumption is an error in the payment processor that passes the values to sage pay

Any thoughts are highly appreciated.

ex :

# Answer
apparently its something to do with the circle interactive sagepay payment plugin
> 1 votes

---
Tags: civievent, payment-processor, civicrm-home
---


# Question
Title: Send Schedule Mailings job succeeds but scheduled mailing not completely sent
On Civi 4.7.27 send first large mailing to 12733 emails through SparkPost, only some were delivered (about 900), and the job says it has not completed. Unfortunately, it is 16h later and the Send Schedule Mailings (Entity: job Action: process\_mailing) keeps succeeding every 5 minutes.

The settings were default, so the job attempted to send all 13k emails at once, which I confirmed by finding one child job still in state of 'Running' in the civicrm\_mailing\_job table with 0 offset and all mailings included.

My suspicion is that the job timed out.

How can I invoke a job that will complete the sending? Can I determine from one of the tables which emails have been sent to, and can I restart from there?

# Answer
We found that applying this line's change from this PR to the mosaico extension solved our problem: https://github.com/veda-consulting/uk.co.vedaconsulting.mosaico/pull/182/files#diff-d8205fe762b98a885815f3d4bb175886R294
> 3 votes

---
Tags: civimail, mailing, scheduled-job
---


# Question
Title: Joomla installation error: Please enter a package folder. Unable to find install package
When I tried installing by uploading the package file, nothing happened. Then I tried exactly as the installation guide says for Joomla and I get this error: Please enter a package folder. Unable to find install package

This is a new Joomla installation 3.8.5, I am trying to install CiviCRM 4.7.31. I have PHP 5.6. I'm hosted on a shared server so not sure how to check the PHP extensions and configuration or the MySQL version with my cPanel.

I have never used CiviCRM before but I have been using Joomla for years and never got that error with any installation packages.

I would love some help and am looking forward to your support.

# Answer
> 2 votes
First of all, my apologizes for my english, it is not very fluent. Now, my answer: Have you checked if this version of CiviCRM is compatible with your host PHP version? CiviCRM package is not an Autoinstaller Package as many other extensions: components or plugins. I think the process to install is: -Upload the compressed CIVICRM package (Check than is a Joomla version) to the 'tmp' folder of your Joomnla installation. Uncompress-Expand it.

-Now, in your tmp folder there must contains a folder 'com\_civicrm/ In administrator/extensions/install-uninstall/install from directory add the /com\_civicrm/ subfolder at the end and click install. If everything goes right you will get a 'component successfully installed'.

The link to Civicrm help : https://docs.civicrm.org/sysadmin/en/latest/install/joomla/

Good Luck! Francesc

# Answer
> 1 votes
in order to check/know what versions of php, SQL engine, etc. you can see it at Joomla BAckend, System, System information (last menu item). You will get information about many parameters. Have you checked by FTP if the uncompressed folder of com\_civicrm exists before going on the installation step via joomla installer?. If you clean the Caché, the system deletes the contentsd from the folder /tmp/ Also, maybe the hosting have any limitations? Have you tried to install in local?(For example with Xammp-bitnamy) Francesc

---
Tags: joomla, error, installation
---


title: Transactional email bounce tracking

text:
# Question
Title: Transactional email bounce tracking
I've just spent the day trying to set up bounce processing, and have it working for civimail, but found out that it doesn't work for transactional emails? I tried installing the transactional emails extension by unzipping it to my ext folder with the rest of my extensions, but it doesn't show up. Has anyone had luck installing it? I'm on CiviCRM 4.7.27 on Joomla 3.8.6

# Answer
I'm not sure what fixed it, but I deleted my civi and browser caches, reinstalled the extension, and refreshed my view and transactional emails showed up and it works wonderfully, thanks Fuzion!
> 3 votes

---
Tags: extension, bounce
---


title: Export Checksum

text:
# Question
Title: Export Checksum
Is it possible to export a checksum? This is an essential step to using a range of external services - alternate bulk email(Mail Chimp), QR code creation for name tags, etc.

But checksum does not appear as a field for exporting. Is there an alternate method for either generating the checksum or exporting it?

# Answer
> 1 votes
A checksum isn't store anywhere until it is *generated*. So there is no way to export them (like from a report), you should generate them first. The checksum is apparently made up from the contact hash and some things like an expiry date.

More here How do contact hashes work, and how do I keep them secure?

# Answer
> 1 votes
MattWire has done an extension https://github.com/mattwire/uk.co.mjwconsult.checksum which indicates you can send a checksum via an external mail system - but you would be needing to copy/paste a different checksum for each and every contact you are sending to

# Answer
> 0 votes
There is an API which checks a checksum specifically from online pages, that might help you? You can find it here : https://civicrm.org/extensions/validate-checksum-api

---
Tags: export, checksum
---


# Question
Title: Contribute Widget showing Placeholder on Wordpress
There are a few posts that report this error but none of the solutions seemed to work for me.

Wordpress 4.9.4 Civi 4.7.27 http://radiowaterloo.ca/

I have a contribution widget in the Content Sidebar. On the home page, it displays "placeholder", similar to what others have reported. On any other page on the site, it displays as expected.

JSON output is also the same whether I look at the homepage or another page:

var jsondata3 = {"currencySymbol":"$","is\_error":false,"is\_active":true,"title":"FRIENDS OF CKMS FUNDING DRIVE 2018","logo":null,"button\_title":"Contribute Now!","about":"

CKMS NEEDS YOUR HELP!\</strong\>\</big\>\</p\>\r\n\r\n

The radio station is entirely run by volunteers and does not receive any ongoing funding from government or universities. The majority of our operations are funded by fees paid by the on-air hosts and donations from listeners like you!\</big\>\</p\>","num\_donors":"2 Donors","money\_raised":"Raised $ 30.00 of $ 2,500.00","campaign\_start":"Campaign ends on March 24th, 2018","money\_target":2500,"money\_raised\_percentage":"1%","money\_target\_display":"$ 2,500.00","money\_low":0,"home\_url":"Learn more.\</a\>","homepage\_link":null,"colors":{"title":"#000000","button":"#FFFFFF","bar":"#2786C2","main\_text":"#000000","main":"#33FFF6","main\_bg":"#FFFF00","bg":"#96C0E7","about\_link":"#556C82"}};

# Answer
> 0 votes
You've got a Javascript error on your homepage that isn't present on other pages:

`Uncaught TypeError: (intermediate value)(...) is not a function at jquery.flexslider-min.js?ver=4.9.4`

If you fix this, I expect the widget will work.

---
Tags: wordpress, civicontribute
---


title: What file permissions for ConfigAndLog

text:
# Question
Title: What file permissions for ConfigAndLog
What are the best file permissions for

/sites/default/files/civicrm/ConfigAndLog/

username john, group apache

I currently have 770, but I get an error in my ssl\_error\_log

AH01797: client denied by server configuration: /var/www/xyz/sites/default/files/civicrm/ConfigAndLog/CiviCRM.e612b0519ce870b4405c16c4.log

Shouldn't it just be apache that plugs things in, or are there are things that enter into this log file as well?

Thanks!

John

# Answer
> 2 votes
The files and directory need to be group writeable, and you need the which ever user that is running cron to be in that group. Check to see if cron is being run by root, that can create log files that are root only.

---
Tags: configandlog
---


# Question
Title: possible to create Joomla user that is not automatically activated?
I have set up a profile that includes fields to create a Joomla user. That works -- when the profile is submitted, the user is created. However, that user is created as enabled, so they can log in to the website immediately.

Based on my testing, it seems CiviCRM does not respect the "new users must be approved by admin" setting in Joomla. Is there a way to set up the system where the Joomla user is automatically created, but in a "disabled" state? I need for an administrator to approve each new user before they can log in.

# Answer
> 0 votes
If you want this to apply for all the registrations you can do it the following way

Create a new user group and assign public as parent

and then add new users to the above group upon registration

afterwards your admin can go and move the user from public group to a registered group.

I haven't tested this but it should work

---
Tags: profile, joomla, registration, user-account, user
---


# Question
Title: CiviMail not sending emails - Joomla 3.6 or 3.7 & Civi 4.7.18
I can send an email from any other area of Civi. For example if I select a contact and send an individual email, it works...

BUT CiviMail - IS DRIVING ME CRAZY!!!

I am routing all email to spamexperts (using SMTP setting in Civi Admin) and again, it all works in other areas of the website, and even any other area of Civi itself.

I've check and confirmed the CRON job runs, I am even running it manually again just to be sure. The CRON job for "send mailings" shows in the log that there is no errors, and everything is "sent" but it doesn't ever send any emails.

If I check the spamexperts delivery logs, I can see all my other emails going through that I send from other areas of Civi, but there is NO record of the civimail mailings even getting to spamexperts.

I am at a total loss, any ideas anyone? I owe you big time if you can point me in the right direction!

# Answer
> 1 votes
It's not easy to get it working properly indeed.

Sending a "normal" email and civimails follow a different path. The former is simple: you call the "send an email" you configured (usually the mail() function, but can be configured, eg to use smtp directly), wait until it's done and that's it.

This doesn't scale and if you aim, like civimail does, at sending lots of emails, you need to queue these emails, possibly split them in separate batches and have a cronjob that process them in the background to send these emails

And were it becomes even more complicated is that you have a lot of different ways to run that cronjob, because civicrm aims at serving a lot of different configurations.... and each have lots of opportunities to have something not working.

As you are using joomla, the "common solution" we use (drush) isn't an option. You do not detail your system, do you:

* have access to the command line (ssh)
* can set up cronjobs
* have php-cli installed and with the same configuration as the php used for your server?

You haven't described enough how have configured CiviCRM. If this is not how you are using it, could edit your question and add these details and what you get if you run

```
path/to/php /path/to/civcrm/module/bin/cli.php -s site -u user -p password -e Job -a execute

```

As described: https://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs

# Answer
> 0 votes
I had this same problem working through setting up a new CiviCRM instance. There was indeed a lot of set up, but I wanted to share some of it.

### TIL Cron isn't enabled by default

Cron does not execute in the same context as the shell testing job.execute. For me, I was running `cv api --user=admin job.execute` and it was working fine. However, adding that to crontab did not execute the task. To get cron running, I had to do the following:

1. `sudo service cron status` told me cron wasn't even executing! `sudo service cron start` solved that
2. To view the cron logs, I uncommented the cron line `sudo vi /etc/rsyslog.d/50-default.conf`
3. To view cron executions `tail -f /var/log/cron.log`

### The job executes, but what is the result?

Now I knew the command was running, but what was it doing? I modified the cron job to show me `crontab -e`

`* * * * * /usr/local/bin/cv api --user=admin job.execute > /tmp/cv.cron.log 2>&1`

Now I can see the failures, which was cv not finding civicrm.settings.php file. This is where the context of cron differs from my shell. I run `env` in my shell and compare it to cron's. By creating a new cron job:

`* * * * * env > /tmp/cron.env.log`

`less /tmp/cron.env.log` after `tail -f /var/log/cron.log` to make sure it ran. There's no environment! My path is `/usr/bin:/bin`. No wonder cv cannot find my site.

### Change the current working directory & Use absolute paths

I changed my cron job to change directory into the `/drupal/sites/default` folder and now my cron jobs show up. My full crontab command:

`* * * * * cd /home/andy/git/drupal/sites/default && /usr/local/bin/cv api --user=cron job.execute > /tmp/cv.cron.log 2>&1`

I'm sure your paths will differ. Now that I can see the json response I can remove the `> /tmp/cv.cron.log 2>&1`

### TL;DR

cron needs to know where your files are.

---
Tags: civimail, joomla
---


title: Path changes with move to VPS

text:
# Question
Title: Path changes with move to VPS
I have a civi site working from a subdomain on my main VPS account. I want to move the account to its own cpanel account, allowing the client full access to the site. However, I'm concerned about path changes and whether I need to change anything beyond what's in civicrm.settings.php, Resource URLs and cache. Is changing the BaseURL, etc. in settings enough to manage all absolute path references?

Thanks, Kate

Current: /home/sherida1/public\_html/jgsny\_restore

New: /home/jgsny/public\_html/

# Answer
> 2 votes
At least a couple times a month, I copy our live site over to the dev version, which means different paths. I just make sure I:

delete the templates\_c directory and let it recreate itself

change the civicrm.settings.php file

check the directories page in CiviCRM: administer \> system settings \> directories

check the resource URLs page in CiviCRM: administer \> system settings \> resource URLs

clear caches and update paths: administer \> system settings \> cleanup caches and update paths

Running through all these steps always fixes any changes in my installation directory.

---
Tags: civicontribute, joomla, webserver
---


# Question
Title: How can I have both Participants Custom Data and Contacts Custom Data in a Drupal View
I want to create an Event Participants View which displays both **Participants** Custom Data and **Contacts** Custom Data.

But when I want to add new fields, the **Contact** Custom Data are not proposed.

Isn't this feasible ?

I am on Drupal 5.57 / Civi 4.7.27

# Answer
> 2 votes
You need to add the Relationship (click open the Advanced fieldset on the right side in your View) to bring the Contact data to the party.

Here's how:

1. Create a View: Show **CiviCRM Participants**
2. Relationships: add **CiviCRM Contributions: Contact Record ID**

3. That will bring the **entire CiviCRM Contact with custom fields** to the party

---
Tags: custom-fields, drupal-views
---


# Question
Title: Using CiviMember to automatically create a Drupal user
I am relatively new to Drupal (I using version 7) and CiviCRM. I have set up a website in which members will be entered manually, rather than using an online signup form.

I am envisaging the workflow to be:

1. Admin user logs on to Drupal website and goes to CiviCRM
2. They create a Membership for a Household
3. For each member of that Household, they create a related Contact

At this point, I want a new Drupal user to be created for each Contact, so that they can log in to certain restricted parts of the website.

All the documentation I have seen so far shows it working the other way around - creating a Drupal user causes the creation of a CiviCRM contact.

So, is what I am asking to do possible and does it make sense in the Drupal/CiviCRM context.

Thanks,

Carl

# Answer
> 4 votes
This can work -\> when on the Contact Summary View -\> under Actions -\> an Admin can create a user account for that Contact;

And then to Automate this workflow: you can use CiviCRM Entity module + Drupal Rules configured to create a Drupal user account when a Membership (of specific id) has been added;

Working example:

---
Tags: drupal, civimember, civicrm-entity
---


title: Private and public contacts

text:
# Question
Title: Private and public contacts
How can I set up Civi so that volunteers have only see private contacts but cannot see their details or their interactions (emails, calls etc).

# Answer
You're asking two different (but related) questions:

* How can I hide a group of contacts from a set of users?
* How can I show a group of contacts but hide their activities?

For the first question, you should:

* Make sure the non-privileged staff have a CMS role that does NOT have the "View All Contacts" or "Edit All Contacts" permissions.
* Add all the contacts they SHOULD have access to into one or more groups.
* Use ACLs to grant access ONLY to the contacts the staff should see.

If you want to allow a set of users to see contacts but not their activities:

* Install the Activity Type ACL extension.
* It's called an "ACL extension", but really this adds CMS permissions to roles so that you can deny contacts access to certain activity types.
> 2 votes

# Answer
You could set up your Volunteers with a different CMS role and then set that role to not have access to Activities - but I suspect that is a blunter tool than you require. You probably need to expand your question to clarify what you mean by 'private contacts'
> 0 votes

---
Tags: civimember
---


# Question
Title: Upgrade to version 4.7.31 seems to have broken DAO.PHP
Version 4.7.31 was installed and now an hourly cron job is erroring like this:

"Parse error: syntax error, unexpected '\[' in /.../administrator/components/com\_civicrm/civicrm/CRM/Core/DAO.php on line 651.

Any clues?

# Answer
It sounds like you perhaps aren't using a supported version of PHP. I would check your version; my guess is that you're on PHP 5.4, since 5.5 is the minimum supported version in Civi 4.7.31.

I would restore your site from a backup if you're not in a position to upgrade PHP immediately - but my advice is to try to upgrade PHP. PHP 5.4 is known to be insecure and hasn't received security updates in almost 3 years.
> 2 votes

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


# Question
Title: Certain Themes break WYSIWYG in wordpress
It appears that the wysiwyg does not work well with ThemeForest themes. It does not load in certain pages like the title page of contribution pages. It works just fine when I use a default theme.

Suggestions on how to get this working and override the theme ?

# Answer
If anyone new is having this problem, the solution is to upgrade to CiviCRM 4.7.31+. CiviCRM ships with the BackboneJS library; so do certain WordPress themes. Sometimes that causes a conflict. Conflict mitigation was added in 4.7.31.
> 1 votes

# Answer
Try installing this extension and then switching the editor to tinymce under administer - display preferences. Maybe it's a conflict with ckeditor.

https://civicrm.org/extensions/tinymce
> 0 votes

# Answer
I am using a Theme Forest theme with similar problems, cannot select profiles, etc. I switch to WordPress TwentySeventeen theme, everything in CiviCRM functions normally (but the website looks like ^%^%). I select my profile needed and switch back to my Theme Forest theme. Just do this at a low traffic time for your site and most times it only takes a few minutes to do. I have never tried the wysiwyg but I assume this would work for this situation as well.
> 0 votes

---
Tags: wordpress
---


# Question
Title: Dequeue Backbone from theme load and load CiviCRM Backbone
I've got a WordPress theme that's giving me issues with the Backbone JS module. According to https://issues.civicrm.org/jira/browse/CRM-17352, it's because CiviCRM isn't running Backbone in no\_conflict mode. Unfortunately, I'm not familiar enough with all of this to figure out where the no\_conflict() call would be placed in the code.

According to Backbone isn't loading on Civi 4.6.11/WP 4.4.1, Andrew West suggests dequeue-ing the theme's loading of Backbone, and enqueue-ing the CiviCRM backbone. I get the concept, understand how to limit the if statement to the civicrm base page, and already have the child theme, but I'm unclear of how I tell it to enqueue the specific version of Backbone for CiviCRM?

EDIT: Adding `var Backbone = Backbone.noConflict()` to wp-content/plugins/civicrm/civicrm/packages/backbone/backbone.js blows up in an impressive array of 15 errors on the Manage Online Event page, with Backbone Undefined. Scary thing is that it seemed to render more of the page, but still not correct.

# Answer
If anyone new is having this problem, the solution is to upgrade to CiviCRM 4.7.31+. CiviCRM ships with the BackboneJS library; so do certain WordPress themes. Sometimes that causes a conflict. Conflict mitigation was added in 4.7.31.
> 1 votes

# Answer
Assuming the file you want to load is the one located in the CiviCRM plugin folder at 'civicrm/packages/backbone/backbone-min.js', then you'd use:

`wp_enqueue_script( 'your_backbone_handle', CIVICRM_PLUGIN_URL . 'civicrm/packages/backbone/backbone-min.js', array(), CIVICRM_PLUGIN_VERSION );`

See https://developer.wordpress.org/reference/functions/wp\_enqueue\_script/

The only slight issue with this is that the constant `CIVICRM_PLUGIN_VERSION` is not updated with each minor dot release (it should be) which means that you may need to manually bump this each time you upgrade CiviCRM in case it ships with a new version. Replace it with your own version numbering in that case.

Disclaimer: I'm not sure if this is the only Backbone-related file you need to enqueue. Also, this may not solve the issue with your theme but it is the method by which you should target CiviCRM's copy of Backbone :-)
> 3 votes

# Answer
FWIW, if you want to extend an analogy from the `jQuery.noConflict()`, you might try patching `js/noconflict.js`. The theory is to load files in this order:

1. Civi's version of each upstream library (jquery, backbone)
2. Civi's \*.js files (which reference the upstream library)
3. `noconflict.js` (which obscures Civi's version)
> 2 votes

---
Tags: wordpress, theme, backbone
---


# Question
Title: Backbone javascript conflict causing Configure Event / Repeat to fail
Problem with a Civi 4.7 installation on WordPress 4.7.2 -- due to other complications involving Backbone, we are NOT running JetPack.

I found a related question in CiviEvent 4.7.7 Issue with Repeating Event while trying to discern why the Repeat tab in Event Configuration fails to behave as it should. Specifically, I'm unable to make an event repeat weekly. User has selected a Repeat-every value (e.g. Tuesday). Instead of verifying that either a Repeat-every value or a Repeat-by value was selected, the javascript requires user to select one of the Repeat-by values -- which it obviously shouldn't. And even when user has done this (pretending, for the sake of argument, that user does not want a weekly repetition), the Save button simply clears the form. No error messages appear, but the Chrome javascript console shows four Uncaught Type errors on the page, of which three are in Backbone:

`Uncaught TypeError: Cannot read property 'Application' of undefined
 at HTMLDocument.<anonymous> (crm.designerapp.js:11)
 at j (jquery.min.js:2)
 at Object.fireWith [as resolveWith] (jquery.min.js:2)
 at Function.ready (jquery.min.js:2)
 at HTMLDocument.J (jquery.min.js:2)
backbone.collectionsubset.js:225 Uncaught TypeError: Backbone.CollectionSubset is not a constructor
 at child.Backbone.Collection.subcollection (backbone.collectionsubset.js:225)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:34)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at m.fn.init.$.fn.crmProfileSelector (jquery.crmProfileSelector.js:25)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:89)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at HTMLDivElement.<anonymous> (jquery.crmProfileSelector.js:88)
 at HTMLDivElement.dispatch (jquery.min.js:4)
backbone.collectionsubset.js:225 Uncaught TypeError: Backbone.CollectionSubset is not a constructor
 at child.Backbone.Collection.subcollection (backbone.collectionsubset.js:225)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:34)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at m.fn.init.$.fn.crmProfileSelector (jquery.crmProfileSelector.js:25)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:89)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at HTMLDivElement.<anonymous> (jquery.crmProfileSelector.js:88)
 at HTMLDivElement.dispatch (jquery.min.js:4)
backbone.collectionsubset.js:225 Uncaught TypeError: Backbone.CollectionSubset is not a constructor
 at child.Backbone.Collection.subcollection (backbone.collectionsubset.js:225)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:34)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at m.fn.init.$.fn.crmProfileSelector (jquery.crmProfileSelector.js:25)
 at HTMLInputElement.<anonymous> (jquery.crmProfileSelector.js:89)
 at Function.each (jquery.min.js:2)
 at m.fn.init.each (jquery.min.js:2)
 at HTMLDivElement.<anonymous> (jquery.crmProfileSelector.js:88)
 at HTMLDivElement.dispatch (jquery.min.js:4)`

So my question is this. **How do I get this working properly in Civi 4.7.16?**

# Answer
> 1 votes
The root cause of this is that civi uses backbone.js, but not in no-conflict mode. There is an issue open at https://issues.civicrm.org for this. Once that issue is resolved, this plugin will start to work.

# Answer
> 1 votes
If anyone new is having this problem, the solution is to upgrade to CiviCRM 4.7.31+. CiviCRM ships with the BackboneJS library; so do certain WordPress themes. Sometimes that causes a conflict. Conflict mitigation was added in 4.7.31.

# Answer
> 0 votes
Found it!

**Analytify - Google Analytics Dashboard** (for WordPress) v. 2.0.13 by WPBrigade. Soon as that one was disabled, Repeat Events worked right as rain.

Now to find a usable Analytics plugin for WP 4.7 …

---
Tags: civievent, javascript, backbone
---


# Question
Title: open source for call center compatible with CiviCRM
I am a new CiviCRM user, I need a software open source compatible with CiviCRM to do a Call center (a bit like callhub). Any suggestion will be welcome.

Thanks

Moustapha D. SPA Canada society for the protection of animals Canada

# Answer
> 2 votes
According to Alternativeto.net, there are no open source alternatives to Callhub. Arguably Asterisk VoIP is an alternative, but you would have to add a lot of software on top of it.

Regardless - while Callhub has CiviCRM integration, there are no alternatives that already have CiviCRM integration. You would have to create it yourself.

# Answer
> 1 votes
if you don't get something 3rd-party that suits I could describe to you how we have approached something like this using Drupal Views and Webforms. However we have not taken it to the point of then using dialling from the screen.

But what it does allow is for an Admin to allocate calls to the callers, or callers can self-allocate.

The caller then clicks on their next call and it loads up data about the person to be called above the webform that will record the outcome of the call.

Depending on the outcome, calls are either set to remain on the callers list (eg for a No Answer) or given an outcome that may require follow up etc, or just Closed.

All of this data is recorded in CiviCRM as Activities so it is easy to track both the efforts of the callers and the outcomes of the calls.

---
Tags: extension
---


# Question
Title: Version check error - Permission on Bitnami/Google Cloud
According to the log, the version check is not being executed: (after a plain/basic deployment of Bitnami CIVICRM package at Google Cloud).

Output log from: ( Administer -\> System Settings -\> Scheduled Jobs Log)

```
*Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}
Full message:
Finished execution of CiviCRM Update Check with result: Failure,
Error message: File not writable*

```

permissions on /opt/bitnami/apps/civicrm/htdocs:

```
-rw-r-----  1 bitnami daemon    6604 Feb 21 12:28 authorize.php

-rw-r-----  1 bitnami daemon  111736 Feb 21 12:28 CHANGELOG.txt

-rw-r--r--  1 bitnami bitnami      4 Mar 12 18:55 composer.json

-rw-r-----  1 bitnami daemon    1481 Feb 21 12:28 COPYRIGHT.txt

-rw-r-----  1 bitnami daemon     720 Feb 21 12:28 cron.php

-rw-r-----  1 bitnami bitnami    720 Mar 14 20:19 cron.phpbkp

drwxr-x---  4 bitnami daemon    4096 Mar  8 02:32 includes

-rw-r-----  1 bitnami daemon     529 Feb 21 12:28 index.php

-rw-r-----  1 bitnami daemon    1717 Feb 21 12:28 INSTALL.mysql.txt

-rw-r-----  1 bitnami daemon    1874 Feb 21 12:28 INSTALL.pgsql.txt

-rw-r-----  1 bitnami daemon     703 Feb 21 12:28 install.php

-rw-r-----  1 bitnami daemon    1298 Feb 21 12:28 INSTALL.sqlite.txt

-rw-r-----  1 bitnami daemon   17995 Feb 21 12:28 INSTALL.txt

-rw-r-----  1 bitnami daemon   18092 Nov 16  2016 LICENSE.txt

-rw-r-----  1 bitnami daemon    8710 Feb 21 12:28 MAINTAINERS.txt

drwxr-x---  4 bitnami daemon    4096 Mar  8 02:32 misc

drwxrwxr-x 42 bitnami daemon    4096 Mar  8 02:32 modules

drwxr-x---  5 bitnami daemon    4096 Mar  8 02:32 profiles

-rw-r-----  1 bitnami daemon    5382 Feb 21 12:28 README.txt

-rw-r-----  1 bitnami daemon    2189 Feb 21 12:28 robots.txt

drwxr-x---  2 bitnami daemon    4096 Mar 11 20:39 scripts

drwxr-x---  4 bitnami daemon    4096 Mar  8 02:32 sites

drwxrwxr-x  7 bitnami daemon    4096 Mar  8 02:32 themes

-rw-r-----  1 bitnami daemon   19986 Feb 21 12:28 update.php

-rw-r-----  1 bitnami daemon   10123 Feb 21 12:28 UPGRADE.txt

-rw-r-----  1 bitnami daemon    2200 Feb 21 12:28 web.config

-rw-r-----  1 bitnami daemon     417 Feb 21 12:28 xmlrpc.php

```

# Answer
> 0 votes
Looking at `<civiroot>/CRM/Utils/VersionCheck.php`, it looks like the file downloaded is `version-info-cache.json`. On my installs, that's in the `upload` folder. Since that looks like a Drupal install, check the permissions on `<webroot>/sites/defailt/failes/civicrm/upload` and see if the web server user has write permissions.

---
Tags: scheduled-job, filesystem
---


# Question
Title: Custom fields of type select not displaying in Activity Report
A site I'm working on has recently been upgraded to version 4.6.32. Since this upgrade the client is no longer able to see data from some of the custom fields in the Activity Report.

Custom fields of type 'text' display fine, but fields of type 'select' are blank even though there is data stored in this field.

The site is running CiviCRM 4.6.32 on Drupal 7.

# Answer
> 2 votes
This appears to be a regression in CiviCRM 4.6.32. (It doesn't appear to affect CiviCRM 4.7.28.)

I have recreated this on the sandbox site.

I have raised this as a bug in the CiviCRM issue queue:

Custom fields of type select not displaying in Activity Report

**UPDATE**

It was subsequently raised as a bug by Martin Castle:

Custom data fails to pull through to reports

And a fix has been released by VangelisP:

Resolves regression issue with non-dynamic custom fields

This will hopefully be included in a future release of CiviCRM 4.6

# Answer
> 1 votes
Just updated to 4.6.36 and the bug has been resolved! Thank you

# Answer
> 0 votes
Did you check the `in_selector` column in the `civicrm_custom_field` table? I seem to recollect I had to set those to 1 but I am not sure...

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


title: CiviEvent - Members Only Pricing

text:
# Question
Title: CiviEvent - Members Only Pricing
I was curious to know whether or not it was possible to add members-only pricing to an event. I have a few default prices for an event but I wanted to be sure if it was possible or not to be able to add specific prices for members-only.

I realize there is a question similar here: Permit member-only pricing but that was 2 years ago and I was wondering if anything ever changed, I can't seem to find anything else on the subject and I figure there has to be a way otherwise I feel more people would ask about this...

Thanks! Matt

# Answer
> 5 votes
The easiest way to do this would be to use CiviDiscount.

1. Create a random code.
2. Place the discount amount - either as a monetary amount or percentage.
3. Add other settings to your desire.
4. Use drop down - discount for events - Select the event.
5. Use drop down Automatic discounts - use Automatic discount for existing members of type - chose the types.
6. Then under Automatic discount for Membership Statuses - choose the status - I would choose current and new - depending on your settings.
7. Choose price field options (under additional options) to choose the exact items you want discounted. Ignore this if all items are treated the same, such as 10% discount across the board. (thanks for reminder KilakwaBT)
8. Add any other settings to your desire.

If the member is logged in, all the discounts will be applied automatically if all of the conditions are met (no code needed). As members tend to forget to login, you may want to write a note on the event page saying Members - Login for a special discount - or something to that extent.

# Answer
> 2 votes
There is also the Group Price extension which states that it

> allows you to implement things like members-only pricing for events

---
Tags: civievent, civicontribute, civimember
---


title: How can I import e-mails to CiviCRM?

text:
# Question
Title: How can I import e-mails to CiviCRM?
I would like to be able to select and import one or more e-mails from my external inbox, into the Activities of a Case, creating a new activity. Is this possible and if yes, how? Who is familiar with this and how is it done?

# Answer
Are you using MS Outlook or Gmail? We've written a couple of extensions/plugins which allow the functionality you've described.

A couple of posts will give you some background to the project

https://vedaconsulting.co.uk/outlookforcivicrm-release https://vedaconsulting.co.uk/outlookforcivicrm-civicase

We've also recently done some work allowing you to sync CiviCRM Groups to mailing lists within your outlook client - blog post to come.

The CiviCRM extension and the outlook plugin can be found in our git repo along with installation instructions.

https://github.com/veda-consulting/uk.co.vedaconsulting.outlookapi

Thanks Erik and Pete for the nudges!
> 2 votes

# Answer
CiviCRM can be configured to read an email into an activity. The section *Email-to-Activity processing* in the chapter Email system configuration of the manual describes this in detail. But as a short summary, it entails configuring an IMAP email box and process it with a scheduled job.
> 2 votes

# Answer
This blog post gives a good overview of an excellent way to import only certain tagged emails into CiviCRM. I found it very helpful and clearly written.
> 0 votes

# Answer
This blog explains how we delivered some improvements to 'inbound email' so that they could include the case id in the subject, and have the email added to the relevant case
> 0 votes

---
Tags: email, import, civicase
---


# Question
Title: What are some best practices for inbound email handling with CiviCRM?
Our organization has grown past the point where one person can handle the inbound e-mail from our members. I'm looking for best practices from the community on how to handle this.

We don't want to give all of our staff access directly to the e-mail account. As staff come and go, we would have to connstantly change the password to that account. Also, giving everyone direct access to the account would require a tagging system to know who is handling what message. This seems less than ideal.

We could adopt a ticketing system, either something like osTicket or something like Zendesk. But I think it would be nice to have all of our interactions with our members in one clear place. After all, isn't that what a CRM is supposed to do for you?

I looked at CiviCase and at first glance it appears to be exactly right. But for some reason out of the box CiviCRM does not create a new case for each new inbound e-mail. Discovering this got me thinking that perhaps opening a case for each inbound e-mail is not the right approach?

So I'm looking for input from the community: for those of you who have grown past the point of 1 or 2 staff to handle inbound email, what do you do to capture the email and respond to it?

Thank you

EDIT: I looked at CiviRules, but unfortunately it lacks some conditions and some actions to make this possible:

* I could say "Take an action when an activity of type Inbound Email is received"
* But I could not say that the action should be to create a case.
* Presumably I also could not say to assign the activity to the case.
* I also could not say "Only take this action if the activity is not already associated with a case" (e.g. if the email subject has a case ID)

# Answer
> 1 votes
Another option to explore is if CiviRules has a 'create case' capability that could be triggered from creating an Activity, which itself had been created by inbound email

---
Tags: email, civicase
---


# Question
Title: creating summary token for same donor but different categories
I'd like to send out to our donors a summary of all their contributions in the past year.

I am using a token that summarizes the total donation amount for the past year. The issue is we have different Types of donations and don't want them all summed up together. So the question is 1. is there a way to get the sum only for specific transactions which i choose from the find contributions list and if not 2. is there a way to save the tokens for different transaction types as different tokens and if so how? Thanks alot!

# Answer
Have you seen the summary fields extension? I don't think it does exactly what you need out of the box but you can define additional fields using your own criteria with a little coding.
> 1 votes

---
Tags: tokens, summaryfields
---


# Question
Title: CiviCRM Event auto public on WordPress after saving
Our CiviEvents are being made public on our Wordpress whenever we save them. They are all listed as private, because only our community are meant to see them.

When we edit the event in CiviCRM it automatically makes the event public in wordpress on save.

Any thoughts?

Addition information as per the comment. We are using the following plugins - CiviCRM Event Organiser V0.4.1 - https://github.com/christianwach/civicrm-event-organiser AND Event Organiser V3.6.2 - https://wp-event-organiser.com/ \*This one does have an update available.

# Answer
> 2 votes
Please update to the latest version of CiviCRM Event Organiser:

https://github.com/christianwach/civicrm-event-organiser

This should respect the existing post status of your Event Organiser events.

---
Tags: wordpress, civievent
---


# Question
Title: Authorize.net does not allow query strings for silent post URL?
We are unable to get authorize.net talking back to CiviCRM in regards to recurring payments.

In talking with authorize.net folks and they pointed out that query strings are not allowed to be used in the Silent Post URL: https://support.authorize.net/s/article/Why-Are-My-SIM-Relay-Response-Transactions-Timing-out-After-Submitting-the-Request

However, CiviCRM docs say for Wordpress you need to use a query string? https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/authorize-net/  We've checked the logs and see that authorize.net is not communicating back to CiviCRM. The transaction ID's for recurring payments are missing.

So who is right here and are people successfully using WP and Civi with authorize.net?

We have checked that are servers support connections via TLS 1.2.

On WP 4.9.4 and Civi 4.7.30

# Answer
> 2 votes
The culprit was the iThemes Security plugin. Here are the settings you should **disable** to avoid getting a 403 forbidden error that prevented the IPN from registering.

Under Banned Users

* Hack Repair Default Blacklist

Under System Tweaks

* Suspicious Query Strings
* Long URLs

I also **enabled** Enable XML-RPC under Wordpress Tweaks. I had encountered failed IPN's from PayPal before so I assume this would be wise to enable as well.

---
Tags: recurring-contributions, authorize.net
---


# Question
Title: Existing organization getting updated instead a new organization
Hi We have a situation where we would need one member to be a part of many organizations.

So when a Joomla user login to their account for the first time and apply for an membership on behalf of an organization it works fine.

However if the user select **Enter a new organization** when they want to register another organization and submit the form No new account will be created instead the existing organization gets updated even though they are different organization names.

I have tried by disabling the membership section just to see if the issue when creating the relationship but it doesn't do any changes. Has anyone experienced this before ?

Any advice would be highly appriciated

# Answer
This appears to be a bug and you should report it in GitLab.

Steps to replicate.

Set up Contribution page using 'on behalf of'

Submit the form a first time, create your 'on behalf of' Org

Submit the form a second time for New Org, using new name/email.

Outcome the original Org now has the new email but the old name. Both contributions are on their record.

Testing was done via http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=4 (which will soon disappear)

Update - There is now a patch submitted and an issue filed in GitLab - https://lab.civicrm.org/dev/core/issues/26
> 1 votes

---
Tags: profile, joomla, civicrm-home, organization
---


# Question
Title: Receipt template $line.description not showing
Hoping for some assistance for some issues with the invoice and receipt for the online contributions.

Even though the script for the line item description is present in the template (below), no description is printing in HTML, text, or PDF format of the receipts.

In this case the main concern is charitable items that include the charity number in the description. I haven't worked much with the mail templates but nothing glaringly wrong is jumping out at me.

This is from "Contributions - Receipt (on-line)". I can post the whole thing if needed.

Also, on the invoice the below script for the Description is pulling something completely different from what I input at Administer \> CiviContribute \> Financial Accounts. That's the only place I've been able to find to set the description. I can't seem to find where the text that is showing has been input anywhere. If someone can give me a hint here it would be greatly appreciated.

Thanks for any assistance, Pennopoly

```
The following has had HTML stripped out

  {if $lineItem and $priceSetID and !$is_quick_config}

   {foreach from=$lineItem item=value key=priceset}

       {foreach from=$value item=line}

         {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}

```

# Answer
The description field that is rendered in the receipt is part of an option value that is used in a field in of a price set (See screenshot). But I wonder if that is useful for your what you want to do?
> 0 votes

---
Tags: civicontribute, receipts, invoice, line-items, printing
---


# Question
Title: Too nervous to upgrade CiviCRM from 4.1.1
I currently have CiviCRM 4.1.1 running on Drupal 7.16 at Siteground. When I try to make mirror versions (sandbox), things fail due to PHP versions on the host, conflicts, etc. I was told to upgrade the existing module within the CMS and upgrade the CMS in their locations, but I don't want to waste time when problems arise.

Could someone point me to the right person/group that could upgrade these for me to the latest of each that are currently stable?

I've asked some individuals for help, but can't seem to get confirmation.

# Answer
> 3 votes
Here's an alternative approach: start a completely fresh instance of D7 latest + 4.7 latest - and if that works well on your hosting -\> then export your Contacts and Contributions and Event data, etc from your old instance into your new one; That gives you a nice chance to do some spring cleaning on your CRM data;

# Answer
> 5 votes
if you are asking for professional support to undertake these upgrades and fix any issues that might arise as a result then you may want to contact some providers listed at https://civicrm.org/partners-contributors.

When we (FUzion) are approached to undertake these types of support tasks then we would require suitable access (preferably SSH), would probably prefer to set up a dev version of the system to test the upgrade, while recognising that the server environment won't be equivalent.

Other information to have to hand would be PHP version the server is running etc.

# Answer
> 1 votes
I've decided to have a fresh install as KarinG suggested. There truly needs to be some cleaning of data and this will make that activity possible without too much trouble.

Also, I've verified that the Siteground server will support the latest versions of Drupal and CiviCRM - so, here I go.

Thanks for everyone's suggestions!

---
Tags: upgrade
---


title: timestamp mismatch

text:
# Question
Title: timestamp mismatch
I have a host running in a different time-zone from where I am operation and unless I set the website time zone to the hosting time zone I get the following error in CiviCRM:

> Timestamps reported by MySQL (eg "2018-03-07 12:20") and PHP (eg "2018-03-07 11:20" ) are mismatched.

I know that my PHP time is correct, but how can I force the MySQL time to be set to my local time.

I've looked through the available answers but most of them advise setting the website timezone to match the host time, which is suboptimal

Is there anything that I can do to still be able to work in my time zone?

# Answer
> 6 votes
It turns out that if you are using Wordpress you need to set the timezone to specific location, e.g. London, rather than using the default UTC offset. When I used the London timezone the problem went away.

Configure this in WordPress at `Settings > General` `/wp-admin/options-general.php`

---
Tags: wordpress, error, mysql, php, timezone
---


title: Upload a contact image via the API

text:
# Question
Title: Upload a contact image via the API
Can someone give me a simple example of how to upload a Contact image via the API? I am guessing it will involve a call to the File API as well but not sure.

I have the original image as a URL but want to store it in CiviCRM (not just reference the URL).

Bonus points for a nicely commented answer :)

Thanks!

# Answer
> 6 votes
Contact Image URL is directly stored in `civicrm_contact` table, so I think if you have the URL which can display an image, you should be directly able to use the contact create API as below -

```
$result = civicrm_api3('Contact', 'create', array(
  'contact_type' => "Individual",
  'first_name' => "first",
  'last_name' => "last",
  'image_URL' => "<url>",
));

```

If you're on version \< 5.0, the contact summary page will render the image only iff the URL is in form of `http://site-name/civicrm/contact/imagefile?photo=imageName.jpg` and your image file should be present in your custom file upload directory.

There is now a patch(included in version 5.0) which allows the contact summary page to display any URL image irrespective of the `photo` param in the URL.

If you want to download a copy of a remote image to your local file system and use that, you could do something along the lines of:

```
$contactId = 123;
$imageName = 'jitendra.jpg';
$path = Civi::paths()->getPath(Civi::settings()->get('customFileUploadDir')) . $imageName;
file_put_contents($path, file_get_contents('https://i.stack.imgur.com/yjnic.jpg'));
civicrm_api3('Contact', 'create', [
  'id' => $contactId,
  'image_URL' => CRM_Utils_System::url('civicrm/contact/imagefile', ['photo' => $imageName], true)
]);

```

---
Tags: contacts, api, images, files
---


# Question
Title: Cleaning up images (or other files) in the custom folder
I'm wondering if anyone else has come up with a good way to manage their custom files (where documents and images which are attachments to contact records are stored.)

We have a fair amount of files in this folder. In addition, some of the contact images have been 'deleted' in Civi (i.e. mistakenly uploaded and replaced with a new image or updated with a newer image.)

Any way to cull through the files and remove files no longer in use? Or to separate contact record images from pdfs attached to activity records?

# Answer
Might justify developing a script or extension?

* The column `uri` in the database table `civicrm_file` seems to refer to these.
    + The table `civicrm_entity_file` then links `civicrm_file` records to other existing entities.
* The column `image_URL` in the table `civicrm_contact`, on my transplanted legacy installation at least:
    + in some cases contains absolute URLs that also reference files in this folder,
    + and in others contains URLs to `civicrm/contact/imagefile` with a `photo` parameter that is a filename in this folder.

So you may be able to identify unreferenced files that way, although I won't guarantee that files in that folder can't be referenced from elsewhere too.
> 2 votes

---
Tags: directory, files, upload
---


# Question
Title: Found typo causing error in CRM_Utils_System_DrupalBase->formatResourceUrl()
On CiviCRM System Status page I get a permanent error message on the top of the page.

*Warning: file\_exists(): open\_basedir restriction in effect. File(/var/www/clients/client5/web16/websites/default/files/civicrm/persist/contribute/dyn/angular-modules.aa49fb2433945dcf4a451bb96fb1a0e9.js) is not within the allowed path(s): (/var/www/clients/client5/web16/web:/var/www/clients/client5/web16/private:/var/www/clients/client5/web16/tmp:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in CRM\_Utils\_System\_DrupalBase-\>formatResourceUrl() function (/var/www/clients/client5/web16/web/sites/all/modules/civicrm/CRM/Utils/System/DrupalBase.php line 126.).*

In CRM\_Utils\_System\_DrupalBase-\>formatResourceUrl() function, in line 126, I think there is a typo: if I use `if (file_exists(DRUPAL_ROOT .'/'. $file)) {` the error message disappears. In the original text the '/' is missing: `if (file_exists(DRUPAL_ROOT . $file)) {`

Is it a bug, or I made some mistake?

# Answer
> 1 votes
Your code path is slightly different from your files path:

code: **`.../web16/web/sites/...`**

files: **`.../web16/websites/...`**

That looks like a typo - check your directories and resources settings at `Administer > System Settings > Directories` and `Administer > System Settings > Resource URLs`

---
Tags: civicrm-home
---


# Question
Title: "Failed to authenticate key" when posting to REST api
I used the API explorer to create a target url, but I cannot send a GET request with curl. The error is: "Failed to authenticate key".

Here are the steps I am following:

1. Create an url in the API explorer:

http://51.15.94.180/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=get&api\_key=userkey&key=sitekey&json={"sequential":1}

2. Looked up the site key in civicrm.settings.php (under `CIVICRM_SITE_KEY`)
3. Used the "API Key" extention to add an API key to the "admin" contact (the one that is associated with the civicrm admin account).
4. I inserted my keys (which I change here for security reasons) to produce this expanded url:

http://51.15.94.180/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=Contact&action=get&api\_key=uCMXIUhzpPv&key=VKtUrOkd&json={"sequential":1}

5. I `curl` this url, and get the mentioned error

Can anybody help?

## UPDATE

I was able to stick a debug log statement into the `authenticateKey` function of `System.php`:

```
CRM_Core_Error::debug_var("req", $_REQUEST);
CRM_Core_Error::debug_var("req size", sizeof($_REQUEST));

```

The result of this is:

```
Mar 21 11:49:21  [info] $req = Array
(
    [entity] => Contact
)

Mar 21 11:49:21  [info] $req size = 1

```

So it seems only the first key/val pair of the request is received in \_REQUEST. How can this happen?

# Answer
Turns out the problem was that I was calling curl without putting quotes around the url.
> 2 votes

# Answer
This error is generally thrown due to error in the site key included in the rest URL. Double check the following things in your API -

* Param assigned to `key` should be equal to `CIVICRM_SITE_KEY` specified in civicrm.settings.php.
* Make sure you're checking the correct setting file and value.
* `CIVICRM_SITE_KEY` should be greater than 7 characters.
> 1 votes

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