# Question
Title: Activities to be shown in a full calendar
CiviCRM 4.62 on Drupal 7.37 in a Linux Virtual Box using only the CiviCASE module.

I need a full calendar view for civiCRM activities. I need a page with month, week and day views for the current user. I also need the calendar to have the ability to easily select a different user's calendar. I have other requirements that would be nice features but I need at least those two (full calendar and change users).

In practice -- The case manager wants to see at a glance what their day, week or month looks like, particularly to find a free day and time for an appointment. They also want to see the availability of other staff in a quick and efficient manner because they may be scheduling an appointment for that other staff person.

As proof of concept (but for Events, not Activities) there is the 'CiviCRM Event Calendar' extension by osseed (Link to Git page) built 2 years ago and updated six months ago. I haven't tested it but I assume it works. It is based on the open source jquery plugin called Full Calendar (link to description page) .

I have seen mentions of other attempts to provide this full calendar feature but they fizzled out somewhere along the line. The one I tried fell short of actually showing a calendar -- Contact Calendar (Link to description page). In that case it showed a new tab on the contacts page but no calendar appeared.

I would prefer this feature to be an extension to CiviCRM so it would be useful to a larger audience than just Drupal users.

How many hours should this take for a consultant to develop?

Any other thoughts or suggestions would be appreciated.

Thanks in advance for any help you can offer. John in Oregon.

# Answer
> 4 votes
So last time I looked Civi for Drupal ships with a calendar of activities if you install the views calendar modules (and dependencies). I think its called my activities or something similar.

You should be able to tweak this to just show the activities of type for the case in question.

Just to let you know we original developed the Civi Contact Calendar Extension but we deprecated it as the functionality above was developed.

Let me know how you get on.

Best

Jamie

# Answer
> 3 votes
I'm pretty sure Views and Calendar alone could do what you need.

You can link the activity subject to the activity page on the Calendar views. Here's how you can do this:

Go to your views, you should already have added the "CiviCRM Activities: Subject" field.

1. Under Fields, add "CiviCRM Activities: Activity ID (Activity ID) and "Exclude from display."
2. Move this field above the Subject.
3. Click on your Subject field and under "Rewrite Results" click on "Output this field as a link". The link path should be something along the lines of:

activity?action=view&reset=1&id=\[id\]

In terms of having a calendar for each case manager, I suppose you can add the user and then exposing it so the activities would filter or use the contextual filters. I haven't tried this yet.

# Answer
> 2 votes
Take a look at this extension: https://civicrm.org/extensions/civicalendar

---
Tags: activities, civicase
---


title: Receiving error message blocked 444

text:
# Question
Title: Receiving error message blocked 444
When attempting to give a user administrative permission I received this message :blocked 444. I can no longer access the site. I tried re-booting my computer - that did not work. How can I fix this?

Many thanks.

# Answer
It is very likely not linked with civicrm, but an issue with the CMS that is around it (drupal, wordpress or Joomla). You should check on the support of your CMS.
> 1 votes

---
Tags: permissions
---


# Question
Title: Why have all my custom Civi fields stopped showing up in Drupal view?
Title says it all really. Sometimes, mostly after an upgrade in my experience, I will go to edit a View that uses CiviCRM Custom Fields and will find messages like 'broken handlers' etc. How can I fix this?

# Answer
In most cases this is fixed by running `drush cc all`. I don't know what the circumstances are that causes the upgrading 'clear caches' to not suffice but this seems to be the fix.

If 'Clear Caches' does not suffice you could also try Structure \> Views \> Settings \> Advanced, Clear Views' cache but I have never needed to do that.
> 5 votes

---
Tags: drupal-views
---


# Question
Title: Only logged in users can change billing and recurring amount
We are using Civi 5.1 on Wordpress 4.9

Today we got our recurring payments to work again when we switched to IATS.
When someone makes a recurring contribution, they receive an email reciept that says

> You can update billing details for this recurring contribution by visiting this web page. You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.

However, unless they are logged in, clicking those links just takes them to homepage of our site. These are donors, they are not creating log in credentials when they donate.

I would like them to be able to make changes without needing to login. I read the older post on this subject and tried those suggestions, by using the below URL.

***oursite.org/oursite-donate/?page=CiviCRM&q=civicrm/contribute/updatebilling&reset=1&coid=xxxx&{contact.checksum}***

I even tried the change & to ? as someone suggested

***oursite.org/oursite-donate/?page=CiviCRM&q=civicrm/contribute/updatebilling?reset=1&coid=xxxx&{contact.checksum}***

When entering that URL while logged off I get the below message.

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

Am I missing something?

Thank you.

# Answer
Two bits are required for anonymous users to be able to access URLs like:

/civicrm/contribute/updatebilling?reset=1&coid=4263&cs=b88004e51f6c99b0601aceab7e489315\_1530392348\_168

1. Permissions: make online Contributions
2. Administer -\> CiviContribute -\> IATS Payments Settings Check the box: Enable self-service to recurring contribution Contact Billing info:

PS - as you may have noticed this is no longer working in higher 5.x versions of CiviCRM. This regression can be fixed with this solution (PR) which was posted here: https://github.com/civicrm/civicrm-core/pull/12668 \- unfortunately it was closed. It's only one line of code you need to add to this file: CRM/Contribute/Form/UpdateBilling.php

```
$processorParams['recur_id'] = $this->_subscriptionDetails->recur_id;

```
> 5 votes

---
Tags: permissions, recurring-contributions, iats
---


# Question
Title: Is there a size limit on attachments in CiviMail?
I am trying to attach a PDF of just 5024KB to a mailing in CiviMail. The attachment is failing, with no explanation as to why. Is there a file size limit or could anyone suggest another reason a file would not attach? Many thanks.

# Answer
> 7 votes
The maximum file size attachment can be set under Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.). Navigate to CiviCRM \>\> Administer \>\> System Settings \>\> Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.). Try after updating the maximum file size.  HTH

Pradeep

# Answer
> 1 votes
You might also want to look at the upload\_max\_filesize directive in php.ini

# Answer
> 1 votes
SMTP providers have their own limits as to what attachments/file sizes they allow. For example - CiviSMTP (UAS) - has been max = 1MB for a long time. Not 100% if that has changed, but it makes sense that there are limits as to attachments to bulk email messages.

---
Tags: civimail
---


title: Best Form Option

text:
# Question
Title: Best Form Option
We are trying to make CiviCRM the first point of membership and payment data capture. For the last two years our organization has been using a home-grown MS Access database for data capture and then transferring it to CiviCRM manually - and the backlog just kept piling up. I started working as a volunteer with this outfit 2 months back and have been able to use contact, membership and contribution imports to clear the back-log and we are caught up now.

I have been able to convince the board and the executive team that it doesn't make any sense to do it this way and CiviCRM should be the first point of contact, membership and contribution data capture. But to avoid resistance to the change-over, they have requested me to try make the data entry forms look as similar to the current forms as possible. All the folks entering data are volunteer seniors and not particularly tech-savvy. We don't want to lose them because the new system looks and feels too new/different.

I am new to CiviCRM also (hadn't heard of it before April 2018 :-) )and learning on the fly. I would appreciate some guidance from the community on the easiest way to create forms. We are on CiviCRM 4.7.31 (migrating to 5.2.2 today) and Drupal 7. If there is any documentation on forms, I'd appreciate if you could point me to it. Your opinions/ comments are also appreciated.Regards,

Raja

# Answer
> 1 votes
Agree with Demerit.

Since you are using Drupal I would recommend webform\_civicrm as a more flexible solution but may take a bit more reading/experimenting.

Creating Contribution pages that use Memberships and Profiles is the standard way to approach the requirement to let folk join up and pay.

And then use Scheduled Reminders so they are sent an email reminder(s) to renew using a checksum link to save them having to add their personal data each time.

Online documentation for this should help you get most of the way: https://docs.civicrm.org/user/en/latest/membership/what-is-civimember/

The only reason to use drupal\_webform instead is because it enables one to modify the form more easily, add Conditionals to the form, and perform multiple functions in one form, eg membership, event, relationships and activities. These forms also work with checksums.

# Answer
> 0 votes
I'd look at profiles first: https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/

For drupal there is also civicrm webform: https://www.drupal.org/project/webform\_civicrm

---
Tags: forms
---


# Question
Title: How to use CiviCRM REST API in external PHP code
Been trying to get this to work for hours. Help would be greatly appreciated. userkey and sitekey are replaced with actual keys.

I'm trying to run in a php file:

```
$result = curl -X POST "https://www.mysite.org/sites/all/modules/civicrm/extern/rest.php?entity=Membership&action=get&api_key=userkey&key=sitekey&json={"sequential":1,"return":"membership_type_id,id,end_date","contact_id":2,"active_only":1,"options":{"limit":1,"sort":"join_date DESC"}}";

```

I get the error:

```
PHP Parse error:  syntax error, unexpected 'POST' (T_STRING) in /home/spulver/civicrmapi.php on line 3

```

Any ideas how to fix?

# Answer
> 4 votes
I use CURL to call rest api. Here is the snippet you can ignore/remove many lines that sets curl variable.

```
$url = 'http://domain.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=getsingle&api_key=HR76BS710C&key=8c1cf9913fd674e08c8f27804334eb5a&json={"id":1}';

$ch = curl_init();
//http://php.net/manual/en/function.curl-setopt.php
//$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_TIMEOUT, 5);
//curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_ENCODING, "");

//for debugging?
curl_setopt($ch, CURLOPT_VERBOSE, true);

$data = curl_exec($ch);
curl_close($ch);
$obj = json_decode($data);

```

HTH

Pradeep

# Answer
> 0 votes
you need to replace the url parameters **api\_key** and **key** with the relevant keys. More information can be found in the developer documents.

---
Tags: civimember, api, php
---


# Question
Title: how do I determine the specific instanceId for a given report
How do I determine the instanceId for a given report? The dropdown on the access panel gives me a subset of all reports, but I can't figure out how to get the id for other reports for email automation.

Thanks in advance!

# Answer
> 6 votes
Its quite simple to get the Instance ID for a report through its URL. Consider an example of Contribution Summary report, the url for it is `civicrm/report/instance/7?force=1&reset=1` So the instance id in this case will **7** i.e integer value anything after `civicrm/report/instance/` will be your instance id or you can use api explorer to get the instance ID.

HTH

Pradeep

---
Tags: reports
---


# Question
Title: CiviEvent menu listing not finding active event
I'm using CiviCRM 5.1.2 on Joomla 3.8.10. I'm trying to create a menu item for an event info page, and the drop-down in the Joomla menu manager is only displaying past events. The drop-down for the Event Registration Page shows the currently active and upcoming events - there are only 2 of them. But the most recent events in the drop-down for the Event Info page are from 2015. We've been using CiviCRM since 2010, so there are a lot of old events.

I'm assuming there's an issue with where the menu item drop-down is pulling the events from. I've turned on debugging and emptied caches, but otherwise I'm at a loss for what to try next. Any assistance is appreciated.

# Answer
> 3 votes
The drop-down shows 100 active events but does not filter by 'upcoming'.

As a quick-fix, edit the file `administrator/components/com_civicrm/civicrm/joomla/site/elements/civievents.php` Look for the line that reads `'rowCount' => 100,` (line 62) and add a new line after that reads: `'start_date' => array('>' => 'today'),` Save that and try again.

Issue: https://lab.civicrm.org/dev/joomla/issues/1
PR: https://github.com/civicrm/civicrm-joomla/pull/46

---
Tags: civievent, joomla
---


title: manage new scheduled job

text:
# Question
Title: manage new scheduled job
What should I put on this screen to make the cron work for mailing? I use wordpress 4.9.6 Thanks

# Answer
I assume you mean the job that is used to *send Scheduled Mailings* . You do not have to create it. It is part of the standard configuration. So the only thing to do is to enable it. But to be complete here is the configuration:
> 2 votes

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


# Question
Title: Why does the default 'from' email address not show as the first option when using 'Send Email' Activity
This seems odd. If I add a second email address to the list of "from" emails at /civicrm/admin/options/from\_email\_address?reset=1 and set it to default, i expect it to be selected as the first option when using "Send an Email' but it continues to be the second in the list.

If i change the Order of the From emails so my default is first, it continues to show as the second when using "Send an Email' (though perhaps a clear of caches would fix it, but fundamentally something seems wrong here.

# Answer
> 1 votes
This was a problem in core and has been fixed by Jitendra - will add the PR when I can dig it out.

---
Tags: email
---


# Question
Title: Award Drupal User points after contribution
I would like to create a Drupal Rule to award Drupal userpoints upon a civicrm contribution being added to a member record through membership sign up.

Ideally the points awarded are dependent on which price field (price set) is selected, ie bronze member = 10 userpoints, silver member = 20 userpoints etc

I have been playing around with rules but can't seem get this one...any pointers would be most appreciated.

(pasted from answer/comment)

I thought it would be a simple rule. When a contribution is saved, of a specific type userpoints are added to the record. But no...

So far...I created a price set with the required price options for both membership and contribution.

Then went to Drupal Rules and made various attempts at setting up a rule to award userpoints on either signing up to a membership or making a payment. A combination of the following;

In terms of the event I have tried; after saving a new civicrm contribution, after saving a civicrm price field, price field value etc

Condition: I have tried Data comparison, entity is of type, list contains item etc based on price field id, price field value id

Action; Award user points.

Non of the above (or combinations) have given me a result when adding a contribution or membership to the user record.

So I'm pretty much lost. Help...!!!

# Answer
To make this work I’m pretty sure you’ll need CiviCRM Entity module. We’ve used that to create Drupal accounts after/when a Contact purchases a Membership.
> 1 votes

---
Tags: contributions, drupal-rules
---


title: Permissions in CiviCRM

text:
# Question
Title: Permissions in CiviCRM
I would like to know if we can set permissions to user accounts where for example a user can access the donations module but not see all the records in a particular category such as donations made online?

Thanks

# Answer
> 1 votes
There is a rather hidden feature for Drupal and WordPress (last time I checked this was not working in Joomla) that you can enable at `Administer > CiviContribute > CiviContribute Component Settings` and `Enable Access Control by Financial Type`. See the help icon next to the setting for details (pasted below).

When you have done that, you should see new CMS permissions for Add, Delete, Edit, View for each financial type, so if you can arrange for your online donations to use a different financial type than other contributions then you can set permissions accordingly.

> Enabling Access Control by Financial Types is only required if you need users in one role to access some financial transactions but not ones with certain financial types.
>
> For example, Planned Giving bequests may be highly confidential and not appropriate for staff organizing events to see, even though they need to be able to administer the payments for ticket purchases.
>
> After enabling, you will be able to set create, view, edit, and delete permissions separately for each financial type by navigating to Administer \> Users and Permissions \> Permissions (Access Control), and clicking on the Access Control link for your CMS.

---
Tags: permissions, financial-types
---


# Question
Title: Notice: Undefined index: value in noverwrite_civicrm_buildForm()
I have the no overwrite extension installed latest version. Civi 5.2.2 I get the message on bringing up a profile form

# Answer
the message gives a notice, that is a low level message that does not signify a "real" problem, rather that the program should do an additional check to make sure it meets the syntax rules.

So although the notice can be fixed, I would recommend you log the issue on the actual extension repository (https://github.com/TechToThePeople/noverwrite/issues) and rest assured that the notice does not present an urgent problem that needs fixing immediately.
> 1 votes

---
Tags: extension
---


title: Importing events - location

text:
# Question
Title: Importing events - location
I found the API CSV IMPORT GUI that allows me to import events. The one thing I can't figure out how to map is the location details - city and state. How do I map those two items?

# Answer
The address is stored in an Address entity. You then create a LocBlock entity that links to that address ID, and the event references the loc\_block\_id.

This is a bit tricky to do with the CSV API Import GUI because it only supports importing one entity at a time, as opposed to using API Chaining. There are several approaches that support API chaining but unfortunately they're all significantly more complicated than API CSV Import GUI.

If you'd like a manual method:

* Note the max ID in `civicrm_address` (`SELECT MAX(id) from civicrm_address`).
* Import your event addresses. Note the new max ID.
* Note the max ID in `civicrm_loc_block` (`SELECT MAX(id) from civicrm_loc_block`).
* Create a spreadsheet with a list of new address IDs only. Import that as a LocBlock entity, mapping to `address_id`.
* Note the max ID in `civicrm_loc_block`.
* Paste the `loc_block_id` into your original event spreadsheet as a new column. If you successfully imported all addresses in the same order as they appear on the event CSV, your `loc_block_id`s should line up.
* Import the events.
> 1 votes

---
Tags: civievent, data-import
---


# Question
Title: When removing a group from a contact I get: Error - DB Constraint Violation - GroupContact, get API
\[copied from https://issues.civicrm.org/jira/browse/CRM-20711 noted on CiviCRM version 4.7.27\]

In the Contact record, when I try to remove or delete a contact from a group they've already been added to, I receive this error:

DB Constraint Violation - group\_id should possibly be marked as mandatory for GroupContact,get API. If so, please raise a bug report.

I am able to remove a contact from a group when in the Group's list of contacts view, so this isn't critical. Posting in case it happens for others.

# Answer
> 1 votes
This bug seems to occur on old (i.e. version 2.x) installations, due to an error in an old upgrade script that removed the location\_id field from the civicrm\_group\_contact table.

You can fix it using this sql:

```
ALTER TABLE civicrm_group_contact ADD COLUMN `location_id` int(10) unsigned DEFAULT NULL COMMENT 'Optional location to associate with this membership'

```

Credit for the solution goes to Eileen, via this commit:

https://github.com/wikimedia/wikimedia-fundraising-crm/commit/e5b853cd55ebf83b68a783a86bf3274dcf20dfb9

Credit for the original issue linked in the question above goes to Lizz Trudeau.

---
Tags: upgrade, database, groups
---


title: How can I find members

text:
# Question
Title: How can I find members
I would like to know if it is possible to find a person on the database only with the CIVI number, and how can I do it?

# Answer
> 5 votes
You can also just click in the search bar at the left of the Civi menu and select "Contact ID".

# Answer
> 1 votes
Yes its possible to find contact using CiviCRM Id. You can use advance search (CiviCRM \>\> Find \>\> Advance Search). Use Contact ID field to use it as a filter.

HTH

Pradeep

---
Tags: civimember, database
---


title: CiviReports issue with boolean fields

text:
# Question
Title: CiviReports issue with boolean fields
I recently noticed that boolean fields (Deceased, Do Not Email, Do Not SMS, etc) are all displayed as "Yes" on contact and membership reports, regardless of their actual values. The data itself is correct and is fine elsewhere, such as in search results and contact displays. The issue seems to be only on report display. The report filters work correctly on those fields, only the display is wrong. I checked my production system, my dev system, and the public demo system at wpmaster.demo.civicrm.org and I see the same thing.

My system is CiviCRM 5.2.2, WordPress 4.9.6, PHP 7.1.16, MySQL 5.7.21.

# Answer
> 1 votes
Already fixed! See: CiviReports issue with boolean fields

---
Tags: civireport
---


title: sparkpost undefined function status

text:
# Question
Title: sparkpost undefined function status
Can't load system status after upgrading from 4.7.31 to 5.2.2 on latest WP. When I try, Console shows `Uncaught Error: Syntax error, unrecognized expression: #/status` and the page is blank. Error log shows

> PHP Fatal error: Uncaught Error: Call to undefined function civicrmVersion() in /wp-content/uploads/civicrm/ext/com.cividesk.email.sparkpost/sparkpost.php on line 145

Tried disabling Asset Caching (in Debugging & Error Handling) to no avail. Also installed latest Sparkpost for WP, but no change. What might cause this behavior?

# Answer
> 1 votes
My bad -- I had botched the installation of the Sparkpost release for Civi 5.x compatibility. Once I realized the error of my ways, I put the Sparkpost files into the correct directory, and now Status page is happy again. No more errors!

---
Tags: wordpress, system-status
---


# Question
Title: Multilingual instances show 'no such field' errors after update
I'm not sure if this is the forum where you want this issue raised, or whether Mattermost or a bug report is best, but here goes. Please let me know if I should be raising this elsewhere.

A recurring error after updating a multilingual site is 'no such field' for a number of fields. It is still occurring after the 5.2.2 update, in particular in the civicrm\_uf\_group view, where the following fields are missing:

* frontend\_title
* submit\_button\_text
* cancel\_button\_text

Having got a bit fed up with errors like this occurring *every* update, it seemed, I have investigated further to discover the following:

1. It seems that line 375 in CRM/Upgrade/Form.php should read

CRM\_Core\_I18n\_Schema::rebuildMultilingualSchema($this-\>locales, $rev, TRUE); not CRM\_Core\_I18n\_Schema::rebuildMultilingualSchema($this-\>locales, $rev);

to tell the function that we are doing an upgrade.

2. When the schema structure is updated, a file of the form SchemaStructure\_x\_y\_z.php should be included in CRM/Core/18n, as SchemaStructure.php doesn't appear to be called during the update/upgrade process. That file should contain the class 18n\_SchemaStructure\_x\_y\_z

The upgrade to 5.2.2 is giving 'no such field' errors because the latest schema structure file is Schematructure\_4\_7\_alpha1.php, and so is the latest file to be called by the update process.

Is this a correct analysis, or have I misunderstood something?

# Answer
In the latest version, you can also rebuild the multilingual schema yourself by navigating to API Explorer `http://www.site-name/civicrm/api#explorer`

Select Entity = `System`, Action = `rebuildmultilingualschema` and click on Execute button.

If you aren't able to access the API explorer UI, try using the cv command from the terminal.

```
cv api System.rebuildmultilingualschema

```

Or using drush -

```
drush cvapi System.rebuildmultilingualschema

```
> 6 votes

---
Tags: upgrade, localisation, i18n, multilingual
---


# Question
Title: Subscribe to mailing list through the API
I am trying to subscribe a user to a mailing list through the REST API. I understand that I need to create a Contact first, then subscribe it to a given mailing list. While I can create the contact, I can't subscribe it to the list using parameters:

`entity: 'MailingEventSubscribe'
action: 'create'
email: [the-contact-email-here]
group_id: [the-mailing-list-group-id-here]`

This will result in `{"is_error":1,"error_message":"Subscription failed"}`

The CiviVRM version here is 4.2.0 I could't find documentation for the API on this specific version, so I'm playing the guessing game here :). I've been also told that the API requests can be chained somehow in order to do just 1 instead of 2, is there a documentation for this?

Can someone point me into the right direction? Thanks.

# Answer
> 0 votes
The mailing list is actually a group in CiviCRM. The functionality of a group is bit more than just mailing list, but fine if you only want to use it for that.

It means that all you have to do is add the contact to the relevant group using the GroupContact API AFAIK.

---
Tags: mailing, rest
---


# Question
Title: payment_instrument_id is not a valid integer | Importing contribution
just want to ask quick question.

I'm trying to import contribution from my csv files. In my csv files, I put the value of column **Payment method** as : Others, Cheque, Credit Card. (All the value has been set on Option value)

Then when I try to upload the csv files, I got the error reason :

```
payment_instrument_id is not a valid integer

```

The error is found at Import\_Errors.csv files.

Do you have any clue about what's happening?

# Answer
Expanding a bit on Randy's answer:

Payment Instruments have both a 'label' and a 'name'. The label is displayed via the GUI and is editable. When the payment instrument is created, the label and name have the same value, but when it is edited, only the label is changed, not the name. Confusingly, the name is used by the import.

So, when you changed 'Check' to 'Cheque', that changed the label to 'Cheque' but the name remains as 'Check' which means in the import you need to use 'Check' (the name), not 'Cheque' (the label). Note that you do not need to revert the label change.

You can get the name values by using API explorer:
entity=OptionValue, action=get
Option Group Id=payment\_instrument
> 1 votes

# Answer
If you guys found similar issue with me. Please check whether you've already made some changes to **Payment Method** option value which is by default you could access it by http://yoursiteurl.com/civicrm/admin/options/payment\_instrument?reset=1

Revert the changes you've made to default value, and try to re-upload/re-import the contribution. It solved my problem.
> 1 votes

---
Tags: civicontribute, contributions
---


title: Name order on CMS's add user block

text:
# Question
Title: Name order on CMS's add user block
How can I change the sequence of first and last name field in the block, witch comes up on Drupal's "Add new user" page's bottom. Now the sequence is first\_name *then* last\_name, but I should have last\_name *than* first\_name.

Thank you.

# Answer
You can update the profile that is being used for registration by changing the weight of the field or using top/bottom arrows to change the order how they appear.

Navigate to Administer \>\> Customize Data and screens \>\> Profiles

Check the profile used for Drupal Registration and then click on the fields link besides it

Use the arrow button to change the order of the field.

You can also change the weight of the field by clicking on edit link of the field and then changing the order.

HTH

Pradeep
> 3 votes

---
Tags: drupal, contacts, fields
---


# Question
Title: Different invoice template depending on payment gateway?
We have an client who uses two payment gateways - they have a requirement that some types of payments (contributions) use one payment gateway, and other types of contributions use another payment gateway. The resulting invoices will need a different header and contact information.

Has anyone achieved something like this before?

# Answer
> 2 votes
For a client with different payment gateways we sidestepped the issue by having different Contribution pages for each - since one was for a c4 and one for a c3 entity and used

```
{if $contributionPageId == X}

```

# Answer
> 0 votes
The invoice templates are at `Administer > Communications > Message Templates` in the `System Workflow Messages` tab.

They use smarty so can have some fairly complex logic, although I don't know whether Payment Processor is passed to the templates. You could try some smarty debugging to see what is available.

---
Tags: civicontribute, invoice
---


# Question
Title: How can I restrict access to some CiviCRM tables at the database user level?
I have a Drupal multisite setup with two sites connected to the same civicrm database. One site needs access to all of the data as usual. But I would like to hide some data from the other site, so that it accesses the DB on a "need to know basis". There are lots of custom fields for example that contain sensitive data, that the second site will never use.

I would like to secure this at the mysql level by letting the second site connect using a different DB username and to grant that user only the necessary privileges.

It would be nice if I could do this in a subtractive way - first `grant all privileges on civicrm.*` and then remove access to the sensitive tables. However this does not work in mysql. You have to grant permissions to all the tables one by one if you don't want to include them all. So I did that, and granted SELECT, INSERT, UPDATE and DELETE on all the tables. But there were problems before I even began `revoke`ing anything. The event registration form was missing some fields, for example.

I tried adding a few other permissions - LOCK\_TABLES, EXECUTE ... but clearly I am missing something.

What permission which is necessary for civicrm to work is missing from that list but is granted when you `grant all privileges`?

# Answer
Your objective is to protect the internal sensitive data from an attack on the public. An option is not to configure the defence on database level but to separate both sites (and run them on separate servers), and connect them with the CiviCRM API. To restrict the allowed API calls you can use CiviProxy
> 1 votes

---
Tags: drupal, permissions, mysql
---


# Question
Title: report mailing date and time have expired
I can not send the mailing, in the report this message: "Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently." what am I doing wrong? What should I correct? Thank you And if the problem is geolocation? And if the problem was the google API? I also had difficulty understanding OpenStreetMaps, maybe I was wrong with them? Is anyone practical with OpenStreetmap? Thanks In setting mapping I put this indicated in the screenshot:

# Answer
If your cron is not running then there is nothing to 'tell' the Scheduled Jobs (which starts the mailing job) to run.

As a quick fix you should be able to go to your Scheduled Jobs (Admin \> System \> Scheduled Jobs, or /civicrm/admin/job?reset=1 in Drupal), find the Mailings scheduler job and use 'Execute Now' under the 'More' option - this should cause any overdue Mailings to be sent out.

To set up a cron so that the Jobs run automatically you need to follow the instructions here: https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/

You also need to set any relevant Scheduled Jobs to be 'enabled' (under More)
> 1 votes

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


# Question
Title: create an Drupal core account when using a webform
I would like to create a Drupal user account when a user becomes a member via a webform. Ideally a user would get redirected from the webform to a profile, but I do not think this is possible?

I have come across this article, which was written over 5 years ago, is it still valid? https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and

It seems like it would work, but for ease would this workflow be suitable?

1. User applies for account via a profile/Drupal core registration form (Payment pending group/role gets assigned)
2. Edit some template files so the site checks for current role assigned to a user and displays a message informing they have finalise the membership process and pay if they have the Payment pending role.
3. User is directed to a webform and pays.
4. User is removed from Payment pending and Added as a full member

I'm sure both solutions would work. It would be great to hear from other people who have more experience with Civi.

Cheers

# Answer
> 2 votes
You can use Drupal Rules to create the Drupal User for a contact when they get a Membership status of 'x'.

Here is one that KarinG has shared before Using CiviMember to automatically create a Drupal user

Thank you Karin

# Answer
> 0 votes
This rule seems to work when a relationship is added. I have added an extra to to select the type of relationship, as there are multiple on the webform:

---
Tags: webform-civicrm, user-account
---


# Question
Title: Does the Stripe extension process payments for companies based in Spain?
I have a client running Drupal 7.58 and CiviCRM 4.7.19 that I would like to install the Stripe extension for. Stripe assures me that they process payments for merchants based in Spain, but the Civi documentation only says USA CA and UK. Stripe suggested that I check with the extension maintainers to make sure that it will work for merchants based in Spain. Anybody that can give a definitive answer on this one?

# Answer
> 1 votes
I don't know for sure but Mollie is a great alternative. It works with the omnipay module of CiviCRM.

---
Tags: drupal, stripe
---


title: CiviDiscount for Membership

text:
# Question
Title: CiviDiscount for Membership
I created a discount for a specific membership level, but a discount field is not showing up on the membership page. CiviDiscount is enabled and has worked in the past with event registration. When creating the new discount, I specified the membership type (annual) in the 'Discounts for Memberships' box. Do I have to specify a price set? If so, how do I do that? Nothing I type is accepted.

# Answer
If CiviDiscount is enabled, you should see the discount box at the top of the membership page even if you don't have any discounts configured. The position isn't great and can be missed if someone is expecting to see it near the amount.

You don't need to use price sets.

If you're quick, you can see an example at https://dmaster.demo.civicrm.org/civicrm/cividiscount but it is regularly reset.

I noticed though that the discount is not being applied correctly, so I have created a ticket for that.
> 1 votes

---
Tags: civimember, cividiscount
---


title: Mosaico mailings not sending

text:
# Question
Title: Mosaico mailings not sending
We've updated our CiviCRM to version 5.2.2 and Mosaico to version 2.0 beta 4 and since then we are not able to send any mailing from CiviCRM.

To be clear we can mail to a person individually. Because we are hosting our website on a VPS I was able to check the email log. I noticed that emails (to one person) are going out correctly, but when I try to send a mailing I get something like this "The sender address is not a valid 553 5.1.2 RFC-5321 address.". Sometimes the from address is empty.

I'm hosting on a Plesk server 17.5.2 with PHP 7.1.

Is there someone who has idea's for a solution?

**EDIT:** Jul 6 11:24:11 srv1 postfix/pickup\[15216\]: B363D8F4B73: uid=10006 from= Jul 6 11:24:11 srv1 postfix/cleanup\[19523\]: B363D8F4B73: message-id=\<20180706092411.B363D8F4B73@shost.tld\> Jul 6 11:24:11 srv1 postfix/qmgr\[15217\]: B363D8F4B73: from=, size=89808, nrcpt=1 (queue active) Jul 6 11:24:11 srv1 postfix/smtp\[19542\]: B363D8F4B73: to="", relay=aspmx.l.google.com\[2a00:1450:4013:c04::1b\]:25, delay=0.09, delays=0.01/0/0.07/0.01, dsn=5.1.2, status=bounced (host aspmx.l.google.com\[2a00:1450:4013:c04::1b\] said: 553-5.1.2 The sender address is not a valid 553 5.1.2 RFC-5321 address. u42-v6si5509030edm.404 - gsmtp (in reply to MAIL FROM command))

# Answer
> 2 votes
Turns out that didn't set up a bouncing email account. Weird because it worked before without it... But anyway that was the problem.

# Answer
> 3 votes
Based on your comments, I believe I see the issue.

CiviMail requires bounce processing to be enabled to work properly. The documentation might want to emphasize this point - but your error is actually mentioned in the VERP Support section.

VERP is a standard by which you send each email from a different "From" address - so when a server responds that the recipient address is no good, you know exactly which email triggered the problem. CiviMail determines the VERP address in part by the bounce processing address. With no bounce processing address, you get the "invalid sender address" either. You can solve this by configuring a bounce processing address.

**EDIT**

logs:

```
Jul  6 11:24:11 srv1 postfix/pickup[15216]: B363D8F4B73: uid=10006 from=<b.2999.15367.c7a49eeef87f384f@>
Jul  6 11:24:11 srv1 postfix/cleanup[19523]: B363D8F4B73: message-id=<20180706092411.B363D8F4B73@shost.tld>
Jul  6 11:24:11 srv1 postfix/qmgr[15217]: B363D8F4B73: from=<b.2999.15367.c7a49eeef87f384f@>, size=89808, nrcpt=1 (queue active)
Jul  6 11:24:11 srv1 postfix/smtp[19542]: B363D8F4B73: to="<emailaddress>", relay=aspmx.l.google.com[2a00:1450:4013:c04::1b]:25, delay=0.09, delays=0.01/0/0.07/0.01, dsn=5.1.2, status=bounced (host aspmx.l.google.com[2a00:1450:4013:c04::1b] said: 553-5.1.2 The sender address <b.2999.15367.c7a49eeef87f384f@> is not a valid 553 5.1.2 RFC-5321 address. u42-v6si5509030edm.404 - gsmtp (in reply to MAIL FROM command))

```

---
Tags: civimail, mosaico, shoreditch, flexmailer
---


# Question
Title: Online contributions are marked as Pending (Incomplete transaction) status
Whenever any user makes donation using Paypal payment option, it does not auto complete the payment in CiviCRM contribution dashboard. It shows it as "Pending (Incomplete Transaction)" status.

This was working (was marking the contribution with complete status) till May 2016 end, since June 2016 begining it stopped marking contribution to Completed status.

# Answer
I believe what's being described here is a particular case of CiviCRM issue financial/27 \- PayPal Standard doesn't handle IPNs. The issue mentions recurring payments, but any payment involving an IPN is likely affected.

You can help solve this by testing the proposed fix and reporting on whether it solves your problem, creates new problems, etc.

Note also that this sounds related to the same section of code improved in financial/14 which deals specifically with PayPal Express. You may want to see if upgrading to Civi 5.3.0 helps matters.
> 1 votes

# Answer
I've experienced the same problem since upgrading to 4.7.3 and beyond. What I found is the IPN is sending the wrong path to Paypal, so that Paypal cannot update.

This is a response from paypal themselves: Verify that the server is generating automatic Paypal payment notifications (IPN). The IPN sent to this URL have failed :

http:///components/com\_civicrm/civicrm/extern/ipn.php?reset=1&contactID=3&contributionID=3&module=contribute

Basically it is looking under components and not under administrator/components.

Here's what i am trying - I created the path/file under components.

I'm trying that now. I figure if it can't find the file because the wrong path is specified, I'll copy the file there where it wants it to be. If I knew where to fix the error I would - does anybody know?
> 0 votes

# Answer
I have to keep removing the following from public\_html/administrator/components/com\_civicrm/civicrm/extern/ipn.php

Remove the following two lines in ipn.php: //CRM-18245

if ($config-\>userFramework == 'Joomla') {

```
CRM_Utils_System::loadBootStrap();

```

Every time there is an update, these two lines screw up my Paypal IPNs.
> 0 votes

---
Tags: paypal, ipn, pending
---


title: Spark - Case management & Calendar?

text:
# Question
Title: Spark - Case management & Calendar?
I'm looking at starting up with CiviCRM Spark. I'm wondering whether Spark include Calendar and Case Management?

Thanks

# Answer
> 1 votes
Spark should include Case Management, yes. Whether it provides a "calendar" depends on what you need in a calendar. If you need a report that shows upcoming deadlines in order of date, you can set that up within Spark. If you want integration with your Outlook calendar or a website's calendar, that would require an extension, which isn't available with Spark.

However, Spark is a great way to see if CiviCRM meets all your other needs. If it does, then you can always move off of Spark to your own CiviCRM instance and install the extensions you want.

---
Tags: civicrm-spark
---


# Question
Title: How to enable email sending in CiviRules
I've installed the Email API for CiviRules, but nothing about emails is showing up under actions in CiviRules. Have tried uninstalling and reinstalling, but no change. Is there another step that I need to be taking to enable email sending?

CiviCRM 4.6.33 on Drupal 7.56, CiviRules 1.15, Email API 1.10.

# Answer
Updating https://github.com/CiviCooP/org.civicoop.emailapi to version 1.11 appears to have fixed this!
> 3 votes

# Answer
You should try to clear CiviCRM's cache as mentioned in CiviRules' documentation :

> If you add your action as a a managed entity (which we think is a good idea) you will obviously have to do a {yoursite}/civicrm/clearcache to make sure the new managed entity is available.

Cheers, Olivier;
> 3 votes

# Answer
I encountered the same issue a month ago. After installing both the E-MAIL API and CiviRules I wasn't able to select send email rule, but I could send emails through the API explorer.

In other words everything was working only I wasn't able to select send email action when I defined rules. It turned out that a row was missing from the civirule\_action table of the CiviCRM database.

I fixed the issue by adding the missing row (copied over from the CiviCRM instance with working CiviRules) with name emailapi\_send label Send e-mail and class CRM\_Emailapi\_CivirulesAction.

The table that works should look like this:

I don't know what caused it, but I suspect the issue arose because CiviRules and E-MAIL API extensions were uninstalled and then installed again couple of times trying to resolve an unrelated issue. I was using the newest CiviCRM version at the time (4.7.27)
> 2 votes

# Answer
Ok, so did a combination of the above to fix this on WordPress install:

Added the SQL statement manually:

```
INSERT INTO civirule_action (name, label, class_name, is_active)
VALUES('emailapi_send', 'Send E-mail', 'CRM_Emailapi_CivirulesAction', 1);

```

Deleted the plugin, manually added the v1.11, refreshed cache and it installed properly. After I was able to execute the v1.7 upgrade and complete the database update.
> 2 votes

---
Tags: email, civirules
---


# Question
Title: Installer says cannot create triggers but I can with phpMyAdmin
Any suggestions how to get the civicrm installer to recognize that I have permission to create triggers. The installer says I don't, but my host says I do. I can create triggers with phpMyAdmin. I am using MySQL - it is a new site, but I don't know the version number. I have asked. Will enter it when I know.

Here I am substituting the word username for my real username. I logged into WordPress with user: username, and logged into phpMyAdmin with user: username I ran the query you suggested and got: Your SQL query has been executed successfully. SHOW GRANTS FOR 'username'@'localhost' GRANT USAGE ON . TO 'username'@'localhost' IDENTIFIED... GRANT ALL PRIVILEGES ON username\_site.\* TO 'username'@'loc...
GRANT ALL PRIVILEGES ON username\_civi.\* TO 'username'@'loc...

# Answer
> 1 votes
I found getting SUPER privileges by the host was necessary. After that the warning about Triggers disappeared.

---
Tags: installation
---


# Question
Title: Disappearing CiviCRM menu and Network Error
Recently I upgraded a from 4.7 to 5.1. All was well and then after a weekend suddenly the CiviCRM menu has disappeared and the dashboard and most other pages are displaying the error bubble:

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

Thinking it was some dastardly upgrade gremlin i decided to upgrade to 5.2 which has made no effect. I've checked the base url - with and without HTTPS. Any other troubleshooting tips I can try to resolve this?

UPDATE:

Struggling to turn on debugging via the UI so I enabled `define( 'CIVICRM_DEBUG_LOG_QUERY', 1 );` but I am none the wiser as no entries are marked \[error\].

F12 on the browser yielded no JS errors, but having the console open produced this

Any ideas?

# Answer
This error typically means there's a JavaScript error. Open your Developer tab in your browser (by pressing F12), go to the Network tab and reload the page. Consider filtering by "XHR" requests, since it's almost certainly a problem there. Look for the one with a status that's an error and click on it, then check the "Response" tab. You'll find a more detailed error there. The error will probably be more detailed if you enable Debugging and Backtrace. Hopefully that should be enough to solve your problem, or at least update your question with more details!
> 3 votes

# Answer
I've seen this occasionally after an upgrade. If you use memcache, restart the MySQL service. Also sometimes php opcache or APC needs clearing, try restarting your web server service, apache or nginx
> 1 votes

---
Tags: drupal
---


# Question
Title: Can we expose the membership description field within a Drupal View
I have built a Members Search page using a CiviCRM Contact View in Drupal 7 and I would like to render the Description field of the membership type for the contacts that are returned. This data doesn't appear to be available out of the box so I looked at the CiviCRM Entity module, however that doesn't seem to expose the description. What sort of approach should I take?

# Answer
> 2 votes
I've added a Views relationship to the CiviCRM Entity project that will allow you to do this.

You must also enable the sub-module, CiviCRM Entity Views Extras.

It is in the 7.x-2.x-dev as of Jul 7 2018, and will be included in the next release (2.2)

Once you have the two modules installed, you will be able to add a Views Relationship titled "CiviCRM Member: Membership Type" to your View listing contacts.

Once that Views relationship is in place, all the properties of the membership type table, including the membership type description will be available to include in your view.

Here's export code for an example View that you can import to see for yourself:

```
$view = new view();
$view->name = 'contact_view_with_membership_type_description';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'civicrm_contact';
$view->human_name = 'Contact View with Membership Type Description';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Contact View with Membership Type Description';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'table';
/* Relationship: CiviCRM Member: Membership Type */
$handler->display->display_options['relationships']['civicrm_membership_type']['id'] = 'civicrm_membership_type';
$handler->display->display_options['relationships']['civicrm_membership_type']['table'] = 'civicrm_membership';
$handler->display->display_options['relationships']['civicrm_membership_type']['field'] = 'civicrm_membership_type';
/* Field: CiviCRM Contacts: Contact ID */
$handler->display->display_options['fields']['id']['id'] = 'id';
$handler->display->display_options['fields']['id']['table'] = 'civicrm_contact';
$handler->display->display_options['fields']['id']['field'] = 'id';
/* Field: CiviCRM Membership Type: Membership Type Description */
$handler->display->display_options['fields']['description']['id'] = 'description';
$handler->display->display_options['fields']['description']['table'] = 'civicrm_membership_type';
$handler->display->display_options['fields']['description']['field'] = 'description';
$handler->display->display_options['fields']['description']['relationship'] = 'civicrm_membership_type';
/* Filter criterion: CiviCRM Member: Membership ID */
$handler->display->display_options['filters']['id']['id'] = 'id';
$handler->display->display_options['filters']['id']['table'] = 'civicrm_membership';
$handler->display->display_options['filters']['id']['field'] = 'id';
$handler->display->display_options['filters']['id']['operator'] = 'not empty';

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'contact-view-with-membership-type-description';

```

# Answer
> 1 votes
Ah yes - many label type fields don't have Views Integration. Since it is a label and presumably not likely to change I would add it to the View myself - For example: as a legend in the Header (or Footer);

# Answer
> 1 votes
I'm just following up in case someone else decides runs into the same sort of requirements.

The solution was to create a helper module that created a pseudo-calculated field using hook\_field\_views\_data() to declare the field and make it available. Then it used a field handler to run a switch statement to render the appropriate description for the membership level in question.

It required very little code to pull off.

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


# Question
Title: List all Group linked in ACL for specific User
How do I list group linked for a specific user in CiviCRM

Example: I have three user group in Civi - Admin, user and staff

I have linked only one group (staff contact) for staff user with ACL

Now If I login has staff user he can only see (staff contact) group

I need SQL or a civiCRM function which can return me the group based on Contact\_ID

Thanks in Advance

# Answer
Found a way to list the group linked with contact based on ACL

$group = CRM\_ACL\_API::group(2,$request\_contactID);

The above API group function returns the group ID for the requested contact ID

Thanks
> 2 votes

---
Tags: groups
---


# Question
Title: What Permission to view a user's own Profile/Dashboard
What permission must I grant to a user so that he can view his dashboard (/civicrm/user?reset=1) ?

(Currently running Civi 4.7.27 / Drupal 7.59)

# Answer
> 3 votes
## Dashboard & Permissions

If you want to give the user ability to see information on themself, the permission seems to be `CiviCRM: access Contact Dashboard`. (I expected `CiviCRM: view my contact` to be a requirement also, but it doesn't seem to be necessary for a contact to view their own dashboard.)

If you also want to give the ability to edit the logged in user via the contact dashboard, the permission is `CiviCRM: edit my contact`.

Permission to access to other CiviCRM components may dictate which Dashboard elements appear on the user's dashboard.

Here's CiviCRM's documentation on permissions.

# Answer
> 3 votes
## Consider Profiles

Another common method for exposing a limited set of fields for users to self-manage is a **Profile**, allows contacts to edit specific fields only. Advantages of Profiles include:

* Not all CRM data is directly visible or editable to the contact, so Profiles can allow limited editing functionality to ensure organisational data integrity.
* Profiles can be accessible to contacts who do not have a CMS user account - many sites don't have matching (CMS) User accounts for all their (CRM) Contact records.

See the documentation on CiviCRM Profiles for more details, and Initial Setup → Customising the user interface also.

# Answer
> 3 votes
## ... and then there is Views

if you really want to fine tune what the user can 'see' then either directing them to a drupal path with various Views Blocks, or adding those Views Blocks to show on the Dashboard page can help.

If you also want the user to be able to modify 'some' data about themselves, then linking from the Views Block to a webform with ?cid1=\[id\] can usually take a user to a prefilled Webform where you can finely control what they see and what they can edit.

---
Tags: permissions
---


# Question
Title: Can a webform list who has already signed up for an event?
I would like to use a webform for people to signup for an event - but they need to see who else has signed up as these events need at least one of each gender. The event is a kind of 'first aid' event where you must have both men and women on duty - not just all men or all women. I've used webforms for signing up individuals for events, but not run into this requirement before.

# Answer
> 4 votes
You can list the people using CiviCRM Views and add the View to the same page as the webform. Easiest is to put the View into a block, but you can also do this with the Paragraphs module or Panels.

# Answer
> 3 votes
Create a link and point potential registrants to the standard CiviCRM public participant listing -

https://dmaster.demo.civicrm.org/civicrm/event/participant?reset=1&id=3

Where id=3 is the event ID.

There’s a participant listing option in the events info and settings section -

To allow users to see a listing of participants, set this field to 'Name' (list names only), 'Name and Email', or 'Name, Status and Register Date'. You will need to set Access Control permissions to include 'view event participants' for any Roles you want to access this listing.

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


# Question
Title: Drupal Rules are not working properly when check CiviCRM Contact's Subtype
I’m using **Drupal 7.56** and **CiviCRM 4.6.31**.

I’ve been using Rules in Drupal, as I need to copy the Household Name to the Last Name of a Particular Individual contact subtype (Child) whenever the relationship between the Household and this type of Individual (Child) has been established, but the Drupal Rule is not working.

Rule "**Copy Family Name to Individual Last Name**

I've set up the following conditions reacting on the Event **“CiviCRM Relationship has been created**”:

**Conditions**

*ELEMENTS*

***Data comparison***

Parameter: Data to compare: \[civicrm-relationship:relationship-type-id, Data value: 8\]

(Type ID of Relationship between the Household and the Individual of type '*Child*')

*AND*

***Text comparison***

Parameter: Text: \[civicrm-relationship:contact-id-a-contact:contact-sub-type, Matching text: Child\]

*Action*: Set a data Value

*Selected Data*:

```
 civicrm-relationship:contact-id-a-contact:last-name

```

*Value*

```
 civicrm-relationship:contact-id-b-contact:household-name

```

This is the output to *debug the values* of the fields for 2 contacts:

civicrm-relationship:contact-id-a-contact:contact-sub-type:

```
   0 (String, 6 characters ) Parent

```

civicrm-relationship:relationship-type-id:

```
   8

```

civicrm-relationship:contact-id-a-contact:contact-sub-type:

```
   0 (String, 5 characters ) Child

```

civicrm-relationship:relationship-type-id:

```
   8

```

These is the *Devel log*:

• Reacting on event CiviCRM Relationship has been created.

• Evaluating conditions of rule "Copy Family Name to Individual Last Name".

• The condition data\_is evaluated to TRUE

• The condition text\_matches evaluated to TRUE

• AND evaluated to TRUE.

• AND evaluated to TRUE.

• Rule "Copy Family Name to Individual Last Name" fires.

* Rule Copy Family Name to Individual Last Name fires.
* Evaluating the action data\_set.
* Evaluating the action devel\_debug.
* Evaluating the action devel\_debug.
* Rule Copy Family Name to Individual Last Name has fired.

• Saved civicrm\_relationship:contact\_id\_a\_contact of typecivicrm\_contact.

• Finished reacting on event CiviCRM Relationship has been created.

But, despite the subtype of contact the action, the action is executed; even for the “*Parent*” contact subtype, when in the conditions is set up just for “***Child***”.

Why the condition civicrm-relationship:contact-id-a-contact:contact-sub-type contains ‘***Child***’ is evaluated TRUE, for all the subtypes of contacts, even for the ‘***Parent***’ contact subtype?

If I change the type of conditions to “*Data comparison*”:

**Conditions**

ELEMENTS

***Data comparison***

Parameter:

Data to compare: \[civicrm-relationship:relationship -type-id, Data value: 8\]

*AND*

***Data comparison***

Parameter:

Data to compare: \[civicrm-relationship:contact-id-a-contact:contact-sub-type,

```
               Operator: is one of, Data value: Child, ☺Child☺]

```

These is the *Devel log*:

• Reacting on event CiviCRM Relationship has been created.

• Evaluating conditions of rule "Copy Family Name to Individual Last Name".

• The condition data\_is evaluated to TRUE

• The condition data\_is evaluated to FALSE

• AND evaluated to FALSE.

• AND evaluated to FALSE.

• Finished reacting on event CiviCRM Relationship has been created.

The conditions are never met.

Why the condition civicrm-relationship:contact-id-a-contact:contact-sub-type is one of ‘*Child*’ or ‘*☺Child☺*’ is evaluated FALSE for the contact subtype “***Child***”?

Could someone have any tip about what is happening?

Thank you so much for your help.

# Answer
I remember this issue from some time in the past, probably been on stackexchange here before. In the end, we developed a new Rules condition, provided by the CiviCRM Entity module, "CiviCRM Contact is of subtype".

It is in the "CiviCRM" section of the options list when you choose your condition.

Give that a try, I believe it will solve your problem. It is expecting one parameter, a Contact object. It then allows you to choose which subtype to look for.

It is possible you will have to load the contact first, and put your conditional down in the actions section of your rule.

To load the contact, use the "Fetch entity by ID" action, and pass it

```
civicrm-relationship:contact-id-a-contact:id

```
> 1 votes

---
Tags: drupal-rules
---


# Question
Title: Issue on closing popup and showing message after doing any action in CiviCRM
Having issue when doing action like adding, updating or deleting anything from CiviCRM. Its not closing the popup and shows success message.

For Example, When I am adding the new event registration from CiviCRM admin panel, Once I clicked on Save button, the registration got saved, but the popup is not closing and not showing the success message. Page stops with disabled buttons. Every time I suppose to refresh to see the saved records.

When I checked the ajax, One ajax request was called and succeed.

```
/civicrm/contact/view/participant?action=add&cid=50767&context=participant&snippet=json

```

Response

```
Object ID: 39731Operation: createObject Name: ContributionObject Ref: CRM_Contribute_BAO_Contribution Object
(
    [_relatedObjects] => Array
        (
        )

    [_component] =>
    [trxn_result_code] =>
    [id] => 39731
    [contact_id] => 50767
    [financial_type_id] => 4
    [contribution_page_id] =>
    [payment_instrument_id] => 4
    [receive_date] => 20180709022000
    [non_deductible_amount] => null
    [total_amount] => 0.00
    [fee_amount] => 0
    [net_amount] => 0
    [trxn_id] => null
    [invoice_id] =>
    [invoice_number] =>
    [currency] => USD
    [cancel_date] =>
    [cancel_reason] =>
    [receipt_date] => null
    [thankyou_date] =>
    [source] => HGS General Dinner- Tentative : Offline registration (by Mr. Manigandan V)
    [amount_level] =>
    [contribution_recur_id] =>
    [is_test] =>
    [is_pay_later] => 0
    [contribution_status_id] => 1
    [address_id] =>
    [check_number] => null
    [campaign_id] =>
    [creditnote_id] =>
    [tax_amount] =>
    [revenue_recognition_date] =>
    [_options:protected] => Array
        (
        )

    [_DB_DataObject_version] => 1.8.12
    [__table] => civicrm_contribution
    [N] => 0
    [_database_dsn] =>
    [_database_dsn_md5] =>
    [_database] => pantheon
    [_query] => Array
        (
            [condition] =>
            [group_by] =>
            [order_by] =>
            [having] =>
            [limit_start] =>
            [limit_count] =>
            [data_select] => *
        )

    [_DB_resultid] =>
    [_resultFields] =>
    [_link_loaded] =>
    [_join] =>
    [_lastError] =>
    [payment_processor] =>
)
{"buttonName":"upload","action":1,"id":22766,"status":"success","userContext":"\/civicrm\/contact\/view?reset=1&force=1&cid=50767&selectedChild=participant","title":"New Event Registration for Mr. Mani V","crmMessages":[{"text":"Event registration for Mani V has been added.","title":"Saved","type":"success","options":null}]}

```

Please Help! I am using Drupal 7 with CiviCRM 4.7.29.

# Answer
> 1 votes
Only that last line (starting with `{"buttonName`) should be present. The rest looks like debugging code that was accidentally left in.

If this doesn't sound like something you may have done personally, try disabling extensions and re-enabling them one by one (or half at a time) until you've found the troublesome extension.

UPDATE: Since this code isn't in an extension, it may be in core. I searched the codebase for the words "Object ID", which appear in your output - and for me they only appear in `xml/schema/ACL/ACL.xml` and `CRM/ACL/DAO/ACL.php`. If you search YOUR codebase for the words "Object ID" you're bound to find them somewhere else.

---
Tags: civievent
---


# Question
Title: how to setup payment processors for multiple organiazations on one instance of Civi? for franchise type locations
are there any extensions or alternative instructions for setting up and connecting the payment processors of civi to multiple organizations within one instance of civi? For events and memberships we have multiple locations that need to collect their own fees - franchise type setup. It makes sense to add the same account type fields needed in custom field sets for each type of processor, however, for event and memberships are there any extensions or other instructions to select proper location for each possibility and have payment go to that location directly and not our HQ organization? thanks much!

---additionally, we are using STRIPE and Paypal

# Answer
> 1 votes
not sure I totally understand but if I do what you want is to setup one "Financial Type" for each chapter and then on each donation page you can select which Financial Type the money will be assigned to. You can also, if necessary, setup multiple payment processors -- one org we work with has 10 different processor accounts and financial types in order to keep chapter funds distinct.

you also might look into the civicrm multisite extension

---
Tags: payment-processor
---


# Question
Title: Send scheduled reminders to relationship contact
I have setup a webform with an organisation and individual. The form collects an email address for both the organisation and individual. The membership is only for the organisation, but the individual will login and manage the account. This part works.

I would like to send scheduled reminders for organisations membership to be sent to the individual. Is this possible? Cheers.

# Answer
two thoughts off the top of my head:

1: create a tag, apply that tag to the org contacts, use the tag to create a smartgroup; send email to the smartgroup

2: set a relationship between the org and individual (contact person is; is contact for) and set up a smartgroup that includes all individuals with an active relationship of that type
> 1 votes

---
Tags: relationships, scheduled-reminders
---


# Question
Title: Add new smarty template to an existing page
I want to add a new template part to the activity edit & view page, I have been trying number of hooks to do it but could not figure out which one best to use.

I am trying to do something similar to what is explained here https://youtu.be/lrk8X\_jt0wU?list=PLjSU7YfE0E00Xv9b\_VqwjDjAcFUVtR8k5&t=837 but for activity edit & view pages.

```
function _myactivity_civix_civicrm_summary($contactID, $content){
CRM_Core_Region::instance('page-body')->add([
    'template' => 'templates/myactivity.tpl'
]);
}

```

Any suggestion or better approach would be great help.

Thanks in advance :)

# Answer
I am assuming you want to add some stuff at the bottom of the activity page, correct?

First of all, you need to establish if you are adding to a civicrm page or form. You can do a little test with the hook buildForm (see https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_buildForm/) and check the **formName** or with the hook pageRun (see https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_pageRun/) and check the name of the page.

Once you have established which hook you need to use you can add the template with the CRM\_Core\_Region.
> 3 votes

---
Tags: extension, hooks, civix
---


# Question
Title: Buildkit -- Warning: file_get_contents(http://localhost:7979/index.php): failed
The setup for buildkit runs smoothly, until the 'amp test' command where it fails no matter what I do. I have tried over and over again for 6 hours. I'm new to this so maybe I'm making a basic mistake. Following are the exact steps and configurations I used, along with the output. Please help if you can.

* Linux Mint 17.1 fully updated, fresh install, on
* Virtual Box (running also in Linux Mint 17.1)
* Apache/2.4.7 (Ubuntu)
* PHP Version 5.5.9-1ubuntu4.9

As far as I can tell all the prerequisites are fulfilled. Following are the commands, reports and configuration I used:

```
apt-get install curl

comment: Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

comment: Then install with:
sudo apt-get install -y nodejs

Use software manager to install:
Ruby and
Rake

git clone "https://github.com/civicrm/civicrm-buildkit.git" "/opt/buildkit"
export PATH="/opt/buildkit/bin:$PATH"

civi-download-tools

sudo service apache2 restart

amp config

Enter mysql_dsn> mysql://root:my_password@localhost:3306

Enter perm_type  [1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs [setfacl] (recommended)

Enter perm_user>  www-data
Enter httpd_type apache24

Note: Please add this line to the httpd.conf or apache2.conf:

  Include /root/.amp/apache.d/*.conf

service apache2 restart

amp test

Connect to test application
Expect response: "response-code-vh4D13nHwi"
PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
 in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153

Warning: file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
 in /opt/buildkit/vendor/totten/amp/src/Amp/Command/TestCommand.php on line 153
Received incorrect response: ""
Tip: Try running "amp config" and/or restarting the webserver.
Mint17a buildkit #

```

Even if I set the following permissions I still get errors:

* group and full permissions for /opt/buildkit = www-data
* group and full permissions for /var/www = www-data

Thanks in advance!

# Answer
Check that you've followed this instruction?

> Note: Please add this line to the httpd.conf or apache2.conf:

```
Include /root/.amp/apache.d/*.conf

```

To do this, edit your Apache configuration (on Debian I'd create `/etc/apache2/conf.d/civicrm-buildkit.conf`) and add that line.

---

Check that you can open `http://localhost:7979` (or the URL reported by your `amp test`) from the machine you're working on (`curl http://localhost:7979/index.php` etc).

* A DNS failure suggests that your machine cannot resolve `localhost` \- check `/etc/hosts` is correctly configured.
* A connection failure suggests Apache configuration - check that Apache is seeing the configuration and able to bind to appropriate ports.
* Errors in the output from curl, and further information in Apache / PHP error logs should give further information about what needs fixing.
> 5 votes

# Answer
Sorry to bump into an older post, I just wanted to share my experience while setting up CiviCRM development. So I already have an up and running instance of Civi drupal-demo site (which I did setup up an year ago) but recently I was again setting up development environment on other machine.

All the steps worked pretty well till `amp test`. Again I experienced the same PHP warnings while performing this test as OregonJohn as specified here above.

So to overcome this, I added specific permissions to the directory of buildkit in apache2.conf (in my case it is /opt/buildkit). Then I sudo chmod permissions to the directory. Here is the code I added in apache2.conf :

```
<Directory /opt/buildkit>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

```

Or you can add your root directory with more configuration if it doesn't work (not recommended).

```
<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
    Allow from all
</Directory>

```

Hope it helps new upcoming Civi developers.

Thank you.
> 1 votes

# Answer
I had the same problem and the issue was that my web server is Apache 2.4 and I had set the httpd\_type to "apache" instead of "apache24" when running amp config.

I solved the issue by giving chmod permissions to buildkit and .amp directories and setting httpd\_type to "apache24"

More info here
> 1 votes

# Answer
For me the problem was Apache was running yet it was not properly configured. Running `/usr/sbin/apache2 -V` gave me the following error.

```
[Mon Apr 21 17:36:38.019213 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Mon Apr 21 17:36:38.019345 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Mon Apr 21 17:36:38.019370 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Mon Apr 21 17:36:38.019385 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Mon Apr 21 17:36:38.019414 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.028756 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.029032 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Mon Apr 21 17:36:38.029056 2016] [core:warn] [pid 4134] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

```

This solution worked for me.
> 0 votes

---
Tags: civicrm-buildkit
---


# Question
Title: Why is inbound email activity uneditable in case activity list?
If I send an email to the configured inbound email address it correctly creates an activity. I can see the activity in the activities list on my own contact and on the contact connected with the inbound email address. I can open the activity using "view" and then I can click "edit" and make changes.

However if I then used "file on case" to add the activity to a case, and I open up the case and access the activity from there, there is no edit button.

I am an administrator will all permissions ticked.

Is this expected behaviour, a bug or a misconfiguration?

Edits: Added screenshots

1. Activities tab of contact
2. Activity open with edit button
3. After clicking edit button

# Answer
This turned out to be an issue with the specfic version (4.7.29). In later versions, inbound emails are not editable at all through the GUI. Where an edit button exists, clicking it leads to "access denied", even for administrator with all permissions.

In my case I had a requirement to allow changing the status of the activity to record whether someone had looked at the email or not. Since this is not possible through the GUI, I ended up writing some custom code to do this, and customised the template to add a "Mark as read" button to fire said code.
> 3 votes

# Answer
There's been debate recently about whether inbound emails should be editable - see CRM-21425.

A patch has been written (but not yet accepted) to make this an editable option. You can apply the patch manually.

If this is important functionality for you, it may also be worthwhile to join the conversation at the link above, and (if you know how) review the patch so it can be accepted.
> 2 votes

# Answer
It is expected in as much as Inbound Email is an Activity that occurred purely as a result of the incoming email, hence is Completed, and also since it is something that came in from external source is not expected to be editable so it remains a record of what came in.

ps I checked on a site and on it there is no option to Edit when the Inbound Email is on the Activity Tab or on the Case.
> 1 votes

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


title: Photos on the members profile

text:
# Question
Title: Photos on the members profile
Can you please let me know how can I add photos on the member's profiles? I can not find it in the database.

# Answer
I'm assuming you're asking how to add the contact image field to a CiviCRM profile?

As that field exists for all contact type, you need to select "Contact" first. The field is then called "Image Url"

This will upload an image onto the contact's record.
> 2 votes

---
Tags: civireport
---


# Question
Title: Can someone help me understand smart group caching so I can prevent these deadlocks?
I know that the Civi devs have been struggling with this issue so I am not complaining or asking for it to be fixed - I just want to understand how it works, so that I can work aroud it.

I am constantly getting complaints from users that data is missing from their dashboard, and when I look in the logs it is invariably due to deadlocks in `civicrm_acl_contact_cache`. The logs show that these deadlocks happen when the system is trying to `INSERT` into that table. Only rarely is it trying to delete. This is the opposite to what Eileen says here, i.e. that flushing the cache is more problematic than building: https://civicrm.org/blog/eileen/478-group-contact-cache-deadlocks-improvement

Users have reports on their dashboards that rely on smart groups for their filters. For this reason I set the smart group cache timeout to 0, so that when, for example, someone completes an activity (and the target contact goes into a different smart group as a result) the resulting change is immediately visible. Otherwise users will worry that the change they have made has "not saved" or "not worked".

I followed Eileen;s advice (in the blog post I link to above) and turned off opportunistic caching. But I found I did not have to run the cache flush as a scheduled job either - everything seems to work without it, presumably because the cache timeout is zero.

It has not helped with the deadlocks, though.

Is a timeout of 0 simply not supported?

I think I would be able to deal with this much better if I understood how the ACL cache relates to the smart group cache. Does the smart group timeout affect both? When does the ACL cache get flushed / filled? Do I have control over that? If someone could explain this paragraph from Eileen's blog it would help:

> If your smart group cache time out is every 5 minutes and your cron only runs every 10 minutes your cache will be 15 minutes old most of the time. I would expect you would want to run the cron every minute (& possibly reduce your time out by a minute).

I am confused about two aspects of this: 1. She is talking about a cron job that flushes the caches, but that paragraph seems to relate to building them 2. It makes sense that the ACL cache build will depend on the smart group cache. So yes, if the smart group cache is old, and the ACL cache gets built, it will have old data in it. But that assumes that the cron setting is about the ACL cache, not the smart groups. Yet the setting that turns off the opportunistic caching pertains to smart groups, and it is that setting that she says we can replace with the cron.

How can there be a difference between when the cache is flushed and when it is built, anyway? Surely refilling the cache means first you flush it, then you fill it. They cannot be separate

And for one last extremely confusing thing: I turned off the cron job. Why is the ACL cache still trying to update?

# Answer
> 1 votes
For me, the only way to deal with this problem was to remove as many smart groups as I could from the system. In the process I also rewrote all the dashlet reports I could into Drupal views. There are a few dashlets left that are CiviCRM reports and still rely on smart group. I believe that people who use these reports still have problems with data "disappearing" which are the effect of deadlocks. But they are so used to it that they don't bother me about it any more!

# Answer
> 1 votes
I cant answer everything but I think I can help clarify a few things;

> How can there be a difference between when the cache is flushed and when it is built, anyway? Surely refilling the cache means first you flush it, then you fill it. They cannot be separate

The answer to this lies in the state of the cache, there are in fact two states;

1. Current - does not need clearing or rebuilding
2. Invalid - this is either empty (as an operation flushed it or expired due to time/cron)

Important bit of information is that an action may chose to flush the cache without rebuilding it - as its not needed by that action but the action would affect it. A good example is a new contact being created - the ACL may be affected but in the create action the cache only needs to be flushed so that the ACL action can then build it.

> And for one last extremely confusing thing: I turned off the cron job. Why is the ACL cache still trying to update?

All caching has a expiration time, regardless of the cron if that time expires the next action will try to rebuild the cache. The idea of the cron is to carry out that action offline therefore reducing the time taken on the user action.

I'd like to work through the issue with you so please do keep this conversation going - we have some large customers running ACL without major cache issues so it should be a good case to establish exactly whats going wrong.

Perhaps you could share some numbers i.e. How many ACL groups/rules, smart groups, size of contacts etc. All of these factors will play in important part of the diagnosis.

# Answer
> 1 votes
We have a very similar setup, with the smart group cache timeout set to 0. We also get a lot of deadlocks, but ours are with civicrm\_group\_contact\_cache. They're a mixture of delete, insert, insert ignore, and create temporary table.

Like you I can't quite understand what's happening, or why it results in a deadlock (why doesn't it just queue?). And I'm very interested in seeing other answers here! But I've recently had some luck hacking around the problem by adding some try...catch loops around the SQL queries in question. On ours it now waits a second, then retries the query - and does this up to 10 times. I expect proper programmers will react in horror, but nonetheless this has solved 99% of our deadlocks.

So the original line in Contact/BAO/GroupContactCache.php was:

```
CRM_Core_DAO::executeQuery($query, $params);

```

and we made it into:

```
    $attempts = 0;
    while ($attempts < 10) {
        try {
            CRM_Core_DAO::executeQuery($query, $params);
        } catch ( \Exception $e ) {
            if ( $attempts < 10 ) {
                sleep( 1 );
                $attempts += 1;
                continue;
            } else {
                throw $e;
            }
        }
        break;
    }

```

I had to do this with 4 queries in Contact/BAO/GroupContactCache.php. You need at least PHP5.5, I think.

I put in some logging, and I can see that it almost always works on the second try.

It's not elegant, and obviously the actual problem is elsewhere. But at least it bypasses it while we figure out the underlying issue. Maybe something similar would work for the ACL cache.

# Answer
> 0 votes
We have over 60,000 contacts and dozens of smart groups and were seeing a MySQL deadlock with smart group cache processes. I changed the CiviCRM cronjob to run every 30 minutes (previously and for other reasons) and edited the scheduled job in CiviCRM for smart group caching so that the parameter of the job is `limit=20` which allows only 20 smart groups to be cached per cron run. After killing the last batch of stuck processes in MySQL I haven't seen this problem pop up.

---
Tags: drupal, 4.7, smartgroups, acl, caching
---


# Question
Title: Edits not being saved for custom fields on relationships
When editing a relationship with custom fields and changing a value, the value does not get saved.

When creating a new relationship however, values entered into the custom field at that point are saved.

I have tested it with all extensions disabled.

I have created a new set of custom fields on a different relationship type and this also has the problem.

We are running version 4.7.17 and this was a problem in the previous version too.

# Answer
> 1 votes
This was a bug in said version, but is now fixed.

---
Tags: custom-fields, relationships
---


# Question
Title: Custom fields in tabs are not editable since upgrade to 4.7.1
After upgrading to 4.7.1, when trying to edit custom fields in tabs, the edit popup opens and you can enter data (and it does client-side validation) but the data is not saved.

Moving the set of custom fields to `inline` rather than `tab` is a successful workaround.

I couldn't reproduce it on demo, but I could on my dev site which has no extensions in common so I think it is unlikely to be due to an extension. I noticed demo is running 4.7.2 ... is this issue known to be fixed in 4.7.2? If so I'll just wait for the release and work around in the meantime.

# Answer
This turned out to be a bug in said version and is now fixed.
> 2 votes

---
Tags: custom-fields, 4.7
---


# Question
Title: Install CiviCRM Buildkit on windows xampp
how to install buildkit cvcrm on windows? I've set up xampp, drupal 7.x and civicrm 5.2.x

i just have no clue what to do with the buildkit zip file which I've downloaded from here https://github.com/civicrm/civicrm-buildkit

please advice

thanks

# Answer
> 2 votes
You can't, I'm afraid. It doesn't work on Windows.

From https://docs.civicrm.org/dev/en/latest/tools/buildkit/ :

---
Tags: drupal, civicrm-buildkit, install, windows
---


# Question
Title: how to trigger a Drupal rule on CiviMember Roles Sync?
We want to trigger a Drupal rule to display a message "Your membership has expired" when a user logs on.

We have CiviMember Roles Sync set to "Synchronize whenever a user logs in or logs out. This action is performed only on the user logging in or out."

It happily removes the role "Current Member" when the user logs in, but the user is not informed of this...... We have D7, CiviCRM 4.6.26, Drupal Rules module, civicrm\_rules. I've messed about with many Rules settings, but can't get the rule to trigger on User login.

Do you know what I'm missing? Thanks

# Answer
In case anyone needs this we ended up doing this with a simple drupal rule -

Event = Content is viewed

Conditions = AND user has role authenticated user, NOT user has role current member

Action = Show a message "your membership has expired", repeat message = false
> 2 votes

# Answer
Rather than using a Rule, you could achieve this just by using Views to create a block that shows Membership status, and if you want, limit it to only show for Roles that are expired, etc.

I understand I am not answering the OP of 'how to do this via Rules' but am trying to answer a more generic question "how can i show a user their membership is expired"

You may find a downloadable view that already does this in our Treasure Trove eg this one
> 1 votes

---
Tags: drupal, civimember, roles, drupal-rules
---


# Question
Title: DB Error: connect failed when trying to call Job.execute using cli.php?
I've set up a new CiviCRM install on a new Drupal install and I'm trying to configure Cron using the instructions at https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/.

I'm a complete newbie at both CiviCRM and Drupal, and both the cv and Drush methods look like they need extra tools installed, so I've gone with the cli.php method.

I'm logged in to my host using SSH and using the command from the manual (obviously completed with the paths, domain, and credentials for my site):

```
$ /path/to/php /path/to/civcrm/bin/cli.php \
  -s example.org \
  -u myusername \
  -p mypassword \
  -e Job \
  -a execute

```

That returns a bunch of HTML, obviously designed to be shown in a browser not a terminal, in which the only recognisable error message is 'DB Error: connect failed'.

Can anyone tell me what I'm doing wrong?

**Edit:** OK, so I've tested getting the password wrong and that gets the same error, so I guess it's possible that I have a credentials problem of some kind. But I'm using the username and password of a Drupal administrator user that works just fine logging into the CMS via a browser.

The only other thing I can think is that I think my file installation and my database are on different servers. But I filled in all those details when installing Drupal/CiviCRM and I don't see any errors in the GUI. Do I need to manually edit a script somewhere?

**Further Edit:** Still without joy, I gave up on the cli.php method and tried the HTTP method documented on the same page above. Trying to open the following URL in a browser results in exactly the same error, though obviously presented properly instead of raw HTML.

```
http://<siteurl>/sites/all/modules/civicrm/bin/cron.php?name=<username>&pass=<password>&key=<sitekey>

```

Can that narrow down the source of the problem at all?

**Yet Further Edit:** Looking in the logs I see the following:

```
[code] => -24
[message] => DB Error: connect failed
[mode] => 16
[debug_info] =>  [nativecode=Access denied for user '<drupal_database_user>'@'<database_ip>' (using password: YES)]
[type] => DB_Error
[user_info] =>  [nativecode=Access denied for user '<drupal_database_user>'@'<database_ip>' (using password: YES)]
[to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [nativecode=Access denied for user '<drupal_database_user>'@'<database_ip>' (using password: YES)]"]

```

I was surprised to see that it seems to be trying to connect with the user I had set up for the Drupal database, rather than the user for the CiviCRM database. That user originally only had Select access to the CiviCRM database. I've now given both users full access to both databases (which instinctively feels like a non-ideal setup?), but I'm still getting the same error.

# Answer
> 2 votes
And after all that, it looks like it was a password error after all, just not the password I thought.

cli.php is retrieving the Drupal MySQL username and password from CIVICRM\_UF\_DSN in civicrm.settings.php as Jon G suggested. The instructions in that file say 'If any of these contain a single quote or backslash, escape those characters with a backslash: \\' and \\, respectively.' My password contained a double quote, and whichever script had generated that file put a backslash before the double quote: \\". Taking the slash out seems to let the command run fine.

# Answer
> 3 votes
First, you can view the error with greater detail if you enable "Debug and Backtrace", or view the CiviCRM log. The troubleshooting documentation will tell you how to do both.

Second, I would assume that "connect failed" is a MySQL error. Is it possible that you have two `civicrm.settings.php` files in your path, one with the wrong MySQL password?

Finally - yes, `drush` and `cv` are additional tools to install. However, if you're administering Drupal/CiviCRM through SSH, these tools are amazing timesavers. Configuring cron with cv or drush is 10 times easier than what you're doing here, even if you factor in the overhead of installing drush or cv. Drush in particular will give you a number of other command-line superpowers - you'll be glad you installed it.

# Answer
> 2 votes
I was also going to add that there are alternatives, e.g. CiviHosting offer this method which can be done via the hosting control panel https://civihosting.com/blog/how-to-make-a-cron-job-for-civicrm/

And then you can also use an extension to use the Drupal cron to trigger the CiviCRM cron: https://civicrm.org/extensions/civicrm-cron

Not quite as satisfying as figuring it out via the SSH route but if you've tried several times and to no avail, this might just get it going for you.

---
Tags: drupal, installation, cron, scheduled-job
---


# Question
Title: Is CiviCRM right for managing volunteers on clinical trials
We need to keeping volunteers happy and engaged in trials. We would need segment our volunteers based on preferences for type of trials they want to participate in, whether they agreed to participate in a trial, rejected it or dropped out of a trial, whether they have completed all/some regular online tests.

That is the basics of the project.

# Answer
> 1 votes
I am afraid the information you are giving is far too limited to give a true answer if CiviCRM is right.

At the same time I am fairly convinced CiviCRM in combination with probably a Drupal website would support the kind of thing you are roughly sketching. But I recommend you do a prototype project first to establish what CiviCRM + website can do out of the box, what it can not do without customization and how important that is for you etc.

And probably contact a CiviCRM partner in your region to help you with that important first step. You can find an expert in your region here: https://civicrm.org/partners-contributors

# Answer
> 1 votes
I see you tagged this as both civimember and civivolunteer. I don't think that either Component would be required based on your initial description.

You could also conceive as a specific trail as an 'event' and hence anyone who signs up for that trail gets attached to the event. Then you can track if they participate, reject, drop out etc by different 'participant types' on the event. It seems like a reasonable match.

From your description the remaining areas should be able to be managed via custom fields on the Contact alongside custom fields on Activities. If you are using Drupal then you can use webforms to make the UI easier for everyone.

Happy to discuss further offline if you want more of a walk-through on how this might work

---
Tags: civimember, relationships, civivolunteer, community
---


title: Payment Processor for UK

text:
# Question
Title: Payment Processor for UK
Which UK payment processors are most recommended to use with CiviCRM? (aside from PayPal)?

# Answer
Sage Pay is a tried and tested UK payment processor that works well with CiviCRM -

https://github.com/circleinteractive/uk.co.circleinteractive.payment.sagepay
> 1 votes

# Answer
Stripe is also tried & tested in the UK and personally I'd recommend it - the extension is here. I particularly like Stripe's website which has been designed around taking online payments.
> 1 votes

---
Tags: payment-processor, payment
---


title: CiviRules Issue with Smart Groups

text:
# Question
Title: CiviRules Issue with Smart Groups
I am trying to use CiviRules to give a membership to contacts automatically when a contribution is added. I have a Membership smart group to filter members and non-members but getting an error when the rule is running when a contribution is entered. See attachments. Any help would be greatly appreciated. Drupal version 7.59, CiviCRM version 5.3 and CiviRules version 2.1

# Answer
It is an error to do with the menu configuration. It should definitely not be there it will not stop CiviRules from executing your action. So the error lies somewhere else.
> 1 votes

---
Tags: civicontribute, contacts, civireport, smartgroups, civirules
---


# Question
Title: Creating new wordpress user using civicrm memberships.?
I am new to civicrm and trying to integrating it with wordpress . Can anyone tell me how can i create user using civicrm . or when somebody sign up for a membership (trough civicrm) a new gets created in wp.

also once 'CONFIRM CONTRIBUTION' IS CLICKED(membership signup). page goes no where . it was suppose to goto to 'thankyou ' page which was set in 'contribution page'

# Answer
> 0 votes
To create a WordPress user with membership signup can be achieved with the below workflow -

Create a profile with fields that you wish to collect during your membership signup process (Primary email address is mandetory) -

In the advanced settings section of your profile you have an option called "WordPress user account registration option?"

CiviCRM help text for this option -

*If you are using this profile as a contact signup form, using it in an online contribution page OR an event registration page, anonymous users will be given the option to create a WordPress User Account as part of completing the form. In addition, you must include a Primary Email Address field in the profile.*

Once you have created a profile you need to create a CiviCRM contribution page that offers membership and attach the new profile that you created.

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

The contribution page will now offer the account creation option when a user is not logged in -

---
Tags: wordpress
---