# Question
Title: ER diagram for the latest Civicrm , Foreign key in Structure, test cases/plans
1. Where can I get the ER diagram for the latest CiviCRM? I need it for internal reporting purposes in our organization.
2. I am able to download the Table structure from phpMyAdmin. However, it does not give details about foreign key references. Can I get it automated? Or I have to manually get it done?
3. Is there any Test plans/ Cases written, which I can catch hold off?

# Answer
2) You can use a tool like SchemaSpy to extract the structure of the database, have the foreign key displayed in a table or on a schema and navigate easily between related tables.

You can see an example (and use) of SchemaSpy doc generated for CiviCRM 4.7 https://doc.symbiotic.coop/dev/civicrm/v47/schema/index.html

EDIT: For those interested, there is a more recent version of SchemaSpy - see with latest CiviCRM database : https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html
> 4 votes

# Answer
I will answer your questions #1 and #2. (I'm not sure what you mean by #3. If #3 is sufficiently unrelated to #1 and #2, I would suggest creating a *separate* question for it)

## Why an ER (Entity Relationship) diagram might *not* be helpful

As a visual learner, I too looked for an ER diagram when first trying to understand the CiviCRM database schema. I was eventually able to *generate* such a diagram with a special tool, but in the end, my attempts to learn from this diagram were a fantastic waste of time.

In my opinion, CiviCRM's schema is just *too big* to make any sort of diagram useful. There are too many tables. (Currently over 150, and more when you add custom fields!) At this scale, a diagram becomes a rat's nest of confusion.

## Other ways to learn about CiviCRM's schema

### Using MySQL workbench

MySQL workbench is an awesome tool that has helped me tremedously in understanding CiviCRM's schema. It's similar to phpMyAdmin, but IMHO *way* better. It's a desktop application. You can use it to connect to a remote server like your live CiviCRM site, but for purposes of learning I'd recommend that you install MySQL locally and load a *copy* of your live CiviCRM database onto your local computer. Then you inspect this local database with MySQL workbench and it will be both faster and safer than looking at the live one.

A typical workflow would be:

1. Look at the list of tables in the database. The table name generally gives you a good idea of the type of data it stores.
2. Pick one table and look closer. Let's look at `civicrm_country` (a relatively simple example) by opening the "Table inspector" for that table.

* We can look at the list of columns in the table.

    We can see that columns have *comments* which explain (to some extent) the meaning of the data stored in the columns.

    From the column names (and comments), we can also get *some* idea of the relationships between tables. For example, we can see that each `country` has an associated `address_format`. Cool!
    * We can look at the foreign keys which are relevant to this table.

    Here, we get an even more comprehensive picture because, not only do we see tables referenced by `civicrm_country`, we see tables *which reference* `civicrm_country`. So we can see that each `country` has *multiple* `state_province`s.

### Using other tools (e.g. phpMyAdmin)

While MySQL Workbench is the *best* tool I've found for inspecting the CiviCRM data structure, other tools (such as phpMyAdmin) offer lots of the same functionality.

Specifically, looking at the names of the columns in each table goes a long way towards understanding the relationships between tables. For the most part, the following patterns hold true:

* Every table has an `id` column as a primary (and thus unique) key.
* Columns which reference other tables are named (usually) with the table name + `_id`. For example when you see a column called `address_format_id`, you can be relatively sure that it references `civicrm_address_format.id`
* Many-to-many relationships use "join tables" as intermediary tables. For example, a `contact` can have *many* `activity` records, and an `activity` can have *many* `contact` records. So the table `civicrm_activity_contact` is used as the glue because it has foreign keys to both.
* In some places CiviCRM defines schema using a construct called pseudoconstants which produces some slightly more complex logic
    + Lots of columns reference `civicrm_option_values` when they just need a simple (and user-configurable) list of options. For example, look at `civicrm_contribution` which has a column called `payment_instrument_id`. You'll notice there's no table called `civicrm_payment_instrument`. So in this case the `payment_instrument_id` column actually references the `value` column in `civicrm_option_values` (but only for records in `civicrm_option_values` with the appropriate `option_group_id`.) Here there is no foreign key, so referential integrity is managed at the application layer, not the database layer.
    + Some tables use "dynamic foreign keys". For example, look at `civicrm_note` which has columns `entity_id` and `entity_table`. This is because a `note` can be attached to different entities (e.g. `contact`, `contribution`, etc). So *two* columns are used to indicate what the note references. Here again, the *application layer* is responsible for ensuring referential integrity, so you won't find any foreign keys.
> 7 votes

# Answer
We strongly discourage interacting directly with tables and fields in the database. Instead it is much safer to access data via the API, which has a convenient explorer.

For those doing core work, and sometimes for extension developers who wish to extend functionality, an ERD is a useful idea. I don't think we have created a set recently due to the problems mentioned in @Sean Madsen's answer. Still, it would be good documentation to have. It's been more successful in the past to limit each diagram to a set of more tightly coupled tables, like the contact, email, location, address tables, or the financial tables. I've put it on my To Do list to create one for the financial tables, and will update this answer if/when I get to that.
> 2 votes

---
Tags: developer, mysql, documentation, testing
---


title: How to pair up event participants?

text:
# Question
Title: How to pair up event participants?
My event has a structure of all participants pairing up in study couples (2 or 3 people together). I know I can create a relationship for each one, but I need to see the pairs very clearly in the event participant list. How can I show the list of participants grouped by pairs, or even have each 2 (or more) coupled participants highlighted in different colors?

# Answer
> 2 votes
You can get somewhat close to your desired functionality by putting the contacts in a smart group and displaying them within the relationship report.

1. Use the advanced search to display all contacts within the event (by adjusting the search fields within ("Events").
2. Add all the contacts to a new smart group.
3. Create a new report to show relationships (Administer \> CiviReport \> Create new report from template \> Relationship report).
4. In "Filters", set "Group" to your smart group.
5. Adjust other report settings as necessary.

But I suspect the end result will still not be 100% satisfying. Groups of three might not display well enough for you.

# Answer
> 0 votes
I would recommend creating a custom report for this. It will require some PHP coding, but will give you the level of control you seek.

---
Tags: civievent
---


# Question
Title: How to exclude contacts who already received a mailing?
As part of my online events, all participants should receive various mailings throughout the event. The problem is that I have people who keep registering to the event, and then they should receive the emails that the others had already received so far. How can I re-send a mailing to all participants of an event, excluding all the participants who had already received that mailing in the past?

# Answer
> 5 votes
When composing your mailing use the "Recipients" field to exclude recipients of one or more past mailings. Here's a screenshot of this in action:

Specifically, you would choose one group to *include* (which can be a smart group based on the event), and several *mailings* to exclude.

---
Tags: civievent, civimail
---


title: Uploading contacts to new group

text:
# Question
Title: Uploading contacts to new group
Is it possible to import a list of contacts (name and email address only) from a google spreadsheet to the database and start a new email group containing only those addresses?

Thanks

# Answer
Absolutely - when you import Contacts -\> you can specify during the last step whether or not you'd like to add these Contacts you are importing to a Group (or Create a new one). Make sure to go to the Manage Group screen to and Edit your Group to make sure it has is a Mailing list group; Then you can CiviMail the Contacts in that Group.
> 3 votes

---
Tags: email
---


# Question
Title: Viewing a Personal Campaign Page before approval
We've recently started using the PCP feature, and all of our supporters' PCPs must be approved. However, I haven't found a way to view/edit the PCP they have created *before* approval, which seems important. When Managing PCPs, unapproved pages are greyed out, and clicking on Edit takes me to the public contribution page with the error that the PCP isn't available.

Is there something I'm missing? Shouldn't admins be able to view before approval?

Joomla 3.7.5, Civi 4.7.21

# Answer
> 2 votes
You *should* be able to view the page before approving it. (I just tried this on CiviCRM 4.7.24 by disabling a page and then viewing it. It worked for me.)

My guess is that your user does not have the necessary permissions to view unapproved PCPs. From looking here, it appears that **you need the "Administer CiviCRM" permission**. If you're using Drupal, you can grant this permission by visiting `/admin/people/permissions`. Steps vary on other CMS platforms.

---
Tags: personal-campaign-pages
---


title: Add eCommerce to CiviCRM 4.7 on Drupal

text:
# Question
Title: Add eCommerce to CiviCRM 4.7 on Drupal
We take Contributions and Event registrations via our website, and I'm hoping to add a simple eCommerce facility for resources we sell.

Just wondering what options might exist for adding this facility. We would want eCommerce customers to become CiviCRM contacts, but we're open to whether this happens at the front-end or via a back-end function (we're not anticipating large volumes of sales).

Our current toolset includes: CiviCRM 4.7, Drupal 7, CiviCRM Webforms, Entity Forms.

# Answer
> 4 votes
There are many options/ways to go about doing this! One option would be to add Drupal Commerce module to your toolset. I use it for a number of projects - when I don't really have the need to track what users purchase in Civi**CRM** (e.g. school cafeteria order details (which child has which meal/drink every single day) and reservations for research institute with/without GPS rentals etc).

The integration you want depends on your needs (cliche...) - but the easiest - no code required one is to string together: Commerce, Commerce\_\[your\_payment\_processor\], Webform, Commerce Webform, Webform CiviCRM, CiviCRM.

Commerce Webform will let you add Commerce Product Sku-s to your webform - and then these get pushed into the Commerce Cart for checkout; Once checked out -\> Commerce Webform has a Rule that then goes back to the webform and mark skus-\>paid;

Webform CiviCRM will let you pull in info from a specific logged in Existing Contact - relationships etc.

Voila - here's a screenshot of a specific Order in a User's Orders tab: Drink options are Drupal Commerce SKUs; Student info -\> is pulled in from CiviCRM (relationship child of logged in existing Contact);

```
user/2/orders/32659

```

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


title: Scheduled Jobs no longer running

text:
# Question
Title: Scheduled Jobs no longer running
Up until recently, the cron job I had set up was running correctly and the Scheduled Jobs were being run. However, since I upgraded (currently running 4.7.21) I am now getting an error message that the cron job isn't running. I made no changes to the cron job. BUT when I check the log, it says the job has been run although it doesn't appear that the task was done. I have Joomla 3.7.4.

The Error message is System Status: Warning Performance warning: Missing indices Cron Not Running Remote Profiles Enabled

The log says Entity: Job Action: process\_membership Summary Finished execution of Update Membership Statuses with result: Success (Processed 159 membership records. Updated 0 records.)

Details Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}

Full message: Finished execution of Update Membership Statuses with result: Success (Processed 159 membership records. Updated 0 records.)

The cron is -

```
curl -s 'https://ashguild.ca/home/administrator/components/com_civicrm/civicrm/bin/cron.php?name=weaverfran&pass=#####&key=#####’

```

# Answer
> 0 votes
Based on your comments, I was able to use https://www.epochconverter.com/ and see that cron was last run at 5am (GMT) on August 30th. You submitted that comment around 10:30pm GMT. That strongly suggests your cron is a) working correctly, but b) isn't running at least hourly. This causes the "Cron not running" warning. It's possibly also the cause of the scheduled job not working correctly, though not definitively.

Please update your cron settings to run at least hourly (I recommend every 15 minutes if you use CiviMail). Once that's done, either a) please let us know if it solved your problem, or b) edit your question to reflect the updated situation.

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


# Question
Title: Civievents - warning when user registers for event (CiviCRM 4.7.23)
My CiviCRM version is: 4.7.23, Drupal: 7.56, PHP: 7.0 I have trouble with CiviEVENT. When participant fill and sendregistration form for event (when he doesnt exist in database) in CiviCRM i see this error:

> Notice: Undefined index: contact\_sub\_type w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2010 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
>
> > Warning: in\_array() expects parameter 2 to be array, null given w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2011 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
> >
> > > Notice: Undefined index: contact\_sub\_type w CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (linia 2013 z /home/sol/domains/staroflife.hekko24.pl/public\_html/dev/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).

CiviCRM did not show this error before updating CiviCRM. I will add that the participant registered to the event is automatically entered as a "Uczestnik (eng. participant)" contact subtype, configured as a contact.

The contact created in the database has a properly assigned contact type, but this annoying error appears.

You can reproduce the error trying to subscribe to the event at: dev.staroflife.hekko24.pl (developer and testing environment) 1. Select one of the events at the bottom of the page and click "register now" 2. Enter your data in the form 3. As a payment option select "płacę z dotpay" 4. In the payment test environment, select any method, accept, and click the payment solution as Accept. 5. When you return to CiviCRM you should see this error.

This same error i see in production version :(.

# Answer
You mention that you see this error on the production version as well. This indicates that your production site is displaying errors, which is a PHP misconfiguration. There are many similar questions on Stack Overflow on setting PHP error reporting, but the best reference is the error reporting page of the PHP manual.

This doesn't solve the underlying issue, but it will hide the messages in production.
> 0 votes

---
Tags: civievent, drupal, sub-types
---


title: Membership imports

text:
# Question
Title: Membership imports
Can I import membership contact and membership details all in one upload without my contact already existing? Or does my contact need to already be a contact for me to upload membership specifics - and it takes two uploads not one.

Plus, I have a field called Membership Organisation which when importing my data gives a reason of ' invalid; membership type (which is a separate field).

# Answer
> 1 votes
Unfortunately, the built-in CiviCRM import can't do contacts and memberships together. You need to do two uploads. Worse still, if they're paid memberships, you have to do three uploads - though folks have written extensions to address this (see other questions here and here. No one has made a general "works for everyone" extension though.

---
Tags: civimember, contacts, custom-fields, duplicate-contacts, data-import
---


# Question
Title: Is there a token for the email used in a CiviMail mailing?
I'd like to include text in my mailings like:

> This email was sent to \[contact.the\_email\_used\_by\_mailing\] ...

I am aware that I can use `[contact.email]` to bring in the *primary* email, but what if the bulk email is different? That could confuse a recipient so a thing that was meant to improve trust did the opposite.

Is there either

1. A token to pluck out the same email as CiviMail would have chosen (i.e. the bulk mail one, or failing that the primary one)?
2. A token to insert whatever email CiviMail is using (although this is only relevant to one off test emails, so is probably less useful)

Otherwise I'll write an extension that provides this.

# Answer
> 1 votes
This token doesn't exist as a CiviCRM token. However, if you're using Smarty rendering for CiviMail then you can use the Smarty tokens,which wil include the email address.

While Smarty rendering will add overhead to CiviMail, so does rendering non-contact tokens. I'm not sure which way will be faster - or if that matters to you.

---
Tags: civimail, tokens
---


# Question
Title: Keeping track of sessions attended for one to one program "package"
I do one-to-one consultations with clients and have a wellness "package" where a client can buy few consults/ massage treatments as a package to save money. This is not a group situation. So what is the best way to store that information and keep track of how many sessions this person has used and what kind? consult? massage? how many? If there are many packages sold to different clients, will they be different campaigns for different persons? or events? dates are not typically fixed in advance but are set up as we go. Also if a person buys another package at a different time, how do I store this information? Thanks in advance for your valuable input.

# Answer
You could create activity types for Packages & Consultations. When a package is purchased create an activity in the contact record. As they use their consultations record them as activities. You can then run Activity reports (or search) filtered on those activity types.

Hope this helps.
> 1 votes

# Answer
I would go down the Activity route but consider doing a single Activity for the 'package' with a custom field to record how many treatments, and another field that you would update each time they have a treatment

If you were then using Drupal I could see a way that you could use a webform (from a link in a view display) that would allow you to just 'click a button' so that you increment the 'number used' by one (thinking the webform 'calc' field but it may be called something else, but i recall we helped get this working with civi components in webform)
> 0 votes

---
Tags: wordpress
---


title: Translating CiviEvent Public pages

text:
# Question
Title: Translating CiviEvent Public pages
I'm busy translating user facing parts of CiviCRM to a local language.

I've changed some of the text on the Event page. I.e. Register, Event Fee Fields. But some of the reminders like when a user is already registered still shows up in English.

I've used PoEdit to edit translation files but none of these fields are included. Only back-end fields are included in the translation file.

Here are examples of fields I'd like to translate:

* "It looks like you are already registered for this event. If you want to change your registration, or you feel that you've gotten this message in error, please contact the site administrator. You can also register another participant."
* Continue Button
* "Please verify the information below. Click the Go Back button below if you need to make changes. Otherwise, click the Continue button below to complete your registration."
* "Your registration will not be submitted until you click the Continue button. Please click the button one time only. If you need to change any details, click the Go Back button below to return to the previous screen."
* "An email with event details has been sent to ..."
* When
* Location
* First Name
* Last Name
* Your Registration Info
* Participant Info
* Event Information

# Answer
> 2 votes
All those strings should be in transifex (and compiled in the .mo files). Please keep in mind that the string might contains HTML and what you see as one big paragraph on the screen might be in fact be a concatenation of several strings.

For example, your first example is in fact 2 separate strings in transifex (and the second one contains HTML) :

```
    $statusMessage = ts("It looks like you are already registered for this event. If you want to change your registration, or you feel that you've gotten this message in error, please contact the site administrator.") . ' ' . ts('You can also <a href="%1">register another participant</a>.', array(1 => $registerUrl));

```

You can find those string (for fr\_CA) here :

If after looking in transifex, you can't find the strings, it might be three different problems :

1. there is a missing `ts` (translation function) in the code, meaning there is bug that should be mentioned in the issue tracker (gitlab)
2. the string is a new one or has been changed and transifex is not yet up-to-date
3. there is bug with the string extractor

Once you have updated the string in transifex, you need to extract po files and compile them or wait for the automated process to compile them for you (once a day) -\> http://download.civicrm.org/civicrm-l10n-core/mo/fr\_CA/civicrm.mo (replace fr\_CA by your locale)

# Answer
> 0 votes
It Seems the best way to solve this is to create a custom template using Smarty. The trick is not getting these overwritten everytime you upgrade.

I've read you can actually put your template files in a custom directory which sounds a bit safer. This would require a comparison for changes in syntax during each upgrade.

Override CiviEvent Templates in Wordpress

Missing CiviEvent Translations

According to enter link description here this is a legacy way of doing things. And changes to templates should be incorporated into a Extension. Creating Extensions.

**So the correct answer is create an Extension to style or add custom translations**

---
Tags: civievent, i18n
---


# Question
Title: How do I proceed to make CiviCRM bilingual
Both English and French are enabled under **Languages Options**.

However, I have yet to see the green buttons several posts have mentioned.

For the email greeting, I had attempted to use the solution proposed by a German user. In French one uses Cher and Chère, but this does not work.

```
{capture assign=l}{contact.preferred_language}
{/capture}{capture assign=g}{contact.gender}{/capture}
{if $l="fr_CA"}
   {if $g="Female"}Chère{else}Cher{/if}
{else}Dear{/if}
{contact.first_name} {contact.last_name}

```

All I get is Network Error.

# Answer
`Languages options` allow you to limit the preferred language for your contacts. It's not related to multilingual setting.

To enable multilingual, you need to go to :

* menu Administer -\> Localization -\> Language, Currency, Locations
* go to the latest section "Multiple Languages Support", check the box "Enable Multiple Languages" (this will change the structure of your database so do a backup first) and Save
* go to this page again, and you should see a "Add Language" with a dropdown list : choose one and Save

Now you should be in multilingual mode and should see the green/grey buttons where applicable.

Concerning "email greeting", i think you need to enable smarty in this context. Try to add in your civicrm\_settings.php (see also https://wiki.civicrm.org/confluence/display/CRMDOC/Smarty+in+mail+templates) :

```
define( 'CIVICRM_MAIL_SMARTY', 1 );

```
> 3 votes

---
Tags: wordpress, 4.7, i18n
---


# Question
Title: Update script fails: database already upgraded
Trying to update from Wordpress CiviCRM 4.7.11 \> 4.7.23. Update script does not work. Keep getting the same message:

"Sorry but we are not able to provide this at the moment. Your database has already been upgraded to CiviCRM 4.7.11"

I did everything exactly as described: stayed logged in during the process, removed the complete civicrm plugin, installed the new version, removed cache files, cleared browser cache etc.

Does anybody know what the problem is? I know there must be old files somewhere. But where?

# Answer
> 0 votes
Oké, thanks for your help. The issue indeed had to do with the test-version in the subdirectory. I am new to CiviCRM and didn't know that you had a seperate settings-file in which you have to configure the database settings. I thought that changing the wordpress settings would be enough. What went wrong is that I changed the wordpress settings, but CiviCRM was still configured for the production database.

# Answer
> 1 votes
Please check related question and answer on this link: How do I deal with "Your database has already been upgraded" error?

Also see documentation on upgrading CiviCRM for Wordpress on the following link: https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress

It is also recommended to use the CiviCRM stackExchange search to check if a similar question has already been asked before posting a new question.

---
Tags: wordpress, upgrade
---


# Question
Title: How can I make civibuild use "Seven" as the default Drupal theme instead of "Bartik"?
Every time I run `civibuild create` or `civibuild reinstall` to create a local Drupal/CiviCRM development site, I find myself running `drush vset theme_default seven` afterwards so that I get the "Seven" theme instead of "Bartik" (which I find makes CiviCRM easier to use on smaller screens). This step is easy, but I find myself running `civibuild` frequently enough that I'd like to avoid the extra step in order to make my workflow more efficient.

Is there a way I can configure my local buildkit installation to run this `drush` command after running `civibuild`? Or some other way to set the default theme?

# Answer
Two options: 1) edit your own buildkit script or 2) prepare a PR for buildkit and convonce Tim seven is a lot more useful than Bartik; I'll second that!

A third could be a config option; 3) PR a change to buildit where the theme you like become a config option when running `amp config`
> 1 votes

---
Tags: developer, civicrm-buildkit, civibuild
---


title: Assigning User Roles not processing

text:
# Question
Title: Assigning User Roles not processing
I created a user role and operations. I tried assigning a group (access based) to the user role in the assignment section. It does not stick. I'm not sure what I am doing wrong. The role is set up as well as the operations. The group has the correct access checked off. Advice? Working on Drupal 7 and on the last 4.7 CiviCRM.

# Answer
> 0 votes
This is a known bug in CiviCRM 4.7.23 - CRM-21076.

If you feel comfortable editing the PHP files, you just need to add one line to apply the fix.

Otherwise, hold tight for CiviCRM 4.7.24, which is scheduled for September 6th, 2017.

---
Tags: acl, roles
---


title: Webform CiviCRM - add to group option

text:
# Question
Title: Webform CiviCRM - add to group option
We all know the Drupal Webform CiviCRM auto add to group option.

But how do we allow a user to select which groups they get added to?

Specifically I'd like them to opt in/out to a newsletter.

Thanks!

# Answer
> 4 votes
Make it a -user select- and then if you want to narrow down the options -\> switch the element configuration to static (live is default). When static you can not only decide whixh Groups a user can select - you can also order them - and relabel them.

---
Tags: webform-civicrm
---


title: New Organization Button Missing

text:
# Question
Title: New Organization Button Missing
On CiviCRM 4.7.22 Drupal 7, I'm missing the "New Organization" button under Current Employer. I can't seem to find figure out whether this is a settings problem or not. A previous version of CiviCRM had it.

And I haven't made any changes to the contact types or relationships.

I also checked the reserved profiles. No changes on "new\_organization".

# Answer
> 3 votes
Ran into this upgrading to 4.7.22

For some reason (which I have not investigated) the reserved profiles for *New Individual*, *New Organization*, etc got their profile ID appended to their "name".

If you query the UFGroup entity in the API explorer like this:

```
$result = civicrm_api3('UFGroup', 'get', array(
  'sequential' => 1,
  'title' => "New Organization",
));

```

You should have a result like:

```
{
    "id": "5",
    "is_active": "1",
    "group_type": "Organization,Contact",
    "title": "New Organization",
    "add_captcha": "0",
    "is_map": "0",
    "is_edit_link": "0",
    "is_uf_link": "0",
    "is_update_dupe": "0",
    "is_cms_user": "0",
    "is_reserved": "1",
    "name": "new_organization_5", // note the appended ID, 'new_organization' should be the value here
    "is_proximity_search": "0",
    "is_error": 0
}

```

Digging here, here and here found that when the method to get the profile links is called with no params, the profiles names are hardcoded to the default `'new_individual', 'new_organization', 'new_household'`

To fix it you'll need to revert back the profile "name" either via the API explorer:

```
$result = civicrm_api3('UFGroup', 'create', array(
    'sequential' => 1,
    'id' => 5,
    "is_active": "1",
    "group_type": "Organization,Contact",
    "title": "New Organization",
    "add_captcha": "0",
    "is_map": "0",
    "is_edit_link": "0",
    "is_uf_link": "0",
    "is_update_dupe": "0",
    "is_cms_user": "0",
    "is_reserved": "1",
    "name": "new_organization",
    "is_proximity_search": "0",
));

```

Or if you have access to and you feel more comfortable, querying the database directly:

```
update civicrm_uf_group set name="new_organization" where id=5;

```

Hope that helps.

---
Tags: contacts, organization
---


# Question
Title: Autofiling email activities via EmailProcessor to ORGANIZATION
I'm successfully using the Autofiling email activities via EmailProcessor feature for Individuals.

However, when I try to automatically associate to an Organization with an email address the email is not attached as an activity. Instead CiviCRM creates a NEW Individual with the email contents attached as an Activity.

Is there a way to have CiviCRM's Email Processor look at Individuals AND Organizations for the Autofiling of email activities?

# Answer
> 2 votes
There's a way to do it by implementing a PHP override or (not advised) hacking CiviCRM core.

The logic behind only filing emails on individuals is that organizations don't actually send emails. That said - you surely know your needs better than I do.

The file in question is `<civiroot>/CRM/Utils/Mail/Incoming.php`. Around line 461 is a function called `getContactID`. Change line 462 from this:

```
$dao = CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Individual');

```

to this:

```
$dao = CRM_Contact_BAO_Contact::matchContactOnEmail($email);

```

If you hack core directly, you'll have to make this change every time you upgrade. You can also do a PHP override, which is somewhat better - but you'll still need to occasionally compare the file to see if any other changes have crept in.

# Answer
> 2 votes
Jon's answer should work but also adding that you could use hook\_emailProcessorContact (https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_emailProcessorContact/)

There is an example of how to use it in here: https://github.com/civicrm/civicrm-drupal/blob/7.x-master/civitest.module.sample

The way it's used in that sample is intended to allow you to tag contacts so that you could have either a "domain" org contact for a given domain (i.e. say you have an org who's email is info@xyz.com, then all emails from @xyz.com get filed on that org), or a "catch-all" contact for a given domain (i.e. if the email matches an individual then file it there, otherwise file it on the tagged org).

But it could be modified slightly to meet your need and just always override if an org contact with the given email exists.

---
Tags: activities
---


# Question
Title: Insert tokens for related contacts in CiviMail
Is it possible to insert tokens for related contacts into a CiviMail message? For example the mailing is going to John Smith but we would like to include his spouses name and address? Spouse is the related contact 'Spouse of'.

# Answer
> 2 votes
The Related Tokens extension is currently in development and aims to provide this functionality.

---
Tags: civimail, tokens
---


# Question
Title: Membership form that also allows for just a donation to be made
The membership form https://www.colongwilderness.org.au/join-donate-membership has the option to select a membership or 'none' and make a donation.

If just a donation is chosen then the form submits and says that the payment was successful but no payment is recorded either with the gateway or with CiviCRM.

This is what the form looks like

If you choose

1. Membership - none -
2. Additional Donation $5

The submitted form says that the payment has been submitted to eway, but there is no record with eway or record of the contribution.

The Contribution p9age does not have 'membership required'.

The price set doesn't have anything as required. If the value to be submitted is $0 then the credit card form is not displayed correctly.

This is what the price set looks like

CiviCRM 4.7.22.

# Answer
Do the following :

* menu Contribution -\> Manage Contributions Pages
* configure -\> Memberships Settings
* at the bottom, there should be a checkbox "Separate Membership Payment".

Confirm that it is checked or not. In doubt, don't check this box because i think not all gateway support it. You can at least give it a try.
> 0 votes

---
Tags: civimember, payment-processor, forms, donations
---


# Question
Title: Rotate SMS providers to get around 200 messages per day limit?
According to this twilio page (https://twilio.radicalskills.com/projects/messaging-in-production/1.html#long-or-short-code) - if you send more than 200 SMS messages per day while using a "long code" you can have your account suspended or filtered.

Has anyone worked on an extension to rotate between multiple accounts to avoid hitting this 200 contact limit?

# Answer
> 2 votes
That is a total hack, and is therefore the wrong solution to the problem.

If they have these limits it's for a reason. Ultimately Twilio may be the wrong provider for you, or you're on the wrong plan with them.

Suggestion: research other providers.

# Answer
> 1 votes
I've posted a ticket upstream and submitted a patch:

https://issues.civicrm.org/jira/browse/CRM-21138

---
Tags: sms
---


# Question
Title: CiviCRM >> Administer CiviCRM >> Profiles is blank
When I go to CiviCRM \>\> Administer CiviCRM \>\> Profiles it is blank. How do I correct this?

I am running CivCRM 4.7.22 on Joomla 3.6.4. I have cleared caches and rebuilt the menu. There are no javascript errors in console. I can add profiles when I edit contribution pages. I can edit and create profiles when setting up contribution pages. I need to go to CiviCRM \>\> Administer CiviCRM \>\> Profiles because according to my research that is where the settings are to add reCaptcha to profiles.

UPDATE: There are not any errors (404 or otherwise) in the Network tab of the browser dev tools. Below is an image of what I mean by blank.

# Answer
The fix was to manually delete the templates\_c directory. Apparently, there were directories that the Debug mode delete method was not able to delete. Some of those directories just happened to be the ones that contained the corrupted joomla.tpl compiled template and possibly other corrupted compiled templates were involved. Also, there seemed to be an issue with Smarty overwriting the compiled template when I changed the normal/uncompiled joomla.tpl code. Everything works now.
> 0 votes

# Answer
That's a headscratcher for sure. Here are some things to try:

* Review the log at ConfigAndLog just after you load the Profiles page.
* I've seen this happen when your Resource URLs and directories aren't set properly. Check both: **Administer » System Settings » Resource URLS** and **Administer » System Settings » Directories**.
* Check the HTML to see which div is missing compared to the demo site. Knowing that will help someone who wants to look in the source code.
* You said you cleared caches - I assume that include removing `templates_c`. If not, please delete that. Also check the permissions on `templates_c` to make sure this isn't a permission error on the compiled template.
> 0 votes

---
Tags: profile, joomla, administer
---


# Question
Title: What tpl or php file calls/loads CRM/UF/Page/Group.tpl for the Profiles page?
I trying to debug my civicrm backend Profiles page on Joomla. Could someone backtrace the templates/CRM/UF/Page/Group.tpl when the the Profiles page is loaded? I believe the Profiles page loads the templates/CRM/UF/Page/Group.tpl

For some reason, my setup does not load the templates/CRM/UF/Page/Group.tpl and I am unable to find the tpl or php page that is suppose to load the Group.tpl.

# Answer
> 1 votes
For the Profiles page, the templates/CRM/common/joomla.tpl template loads the Group.tpl file. Since the production website was malfunctioning, I had to install a local copy in order to adequately debug.

---
Tags: profile, joomla, templates, debugging
---


# Question
Title: Paypal IPN URL is giving error Failure: Missing Parameter
Hi we are using Drupal and civicrm 4.7.14. Our client is having issues with renewing membership payments that go through on paypal (website payment standard - ID = PayPal\_Standard) but are showing as Pending (incomplete) status in civicrm, I looked at this article https://wiki.civicrm.org/confluence/display/CRMDOC/PayPal+Website+Payments+Standard+and+Recurring+Contributions and noticed that the IPN and return URL was not set up in paypal. But after setting up as per the guidance ( URL http://www.herdsa.org.au/civicrm/payment/ipn/2) and return URL www.hersda.org.au we received the following emails from Paypal Please check your server that handles PayPal Instant Payment Notification (IPN) messages. Messages sent to the following URL(s) are not being received:

http://www.herdsa.org.au

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information.

Once you or your service provider fix this problem, you or your service provider can resend the failed messages from the IPN History page. If this problem continues, PayPal may disable the IPN feature for your account.

Thank you for your prompt attention to this issue.

Sincerely,

PayPal

Please check your server that handles PayPal Instant Payment Notification (IPN) messages. Messages sent to the following URL(s) are not being received:

http://www.herdsa.org.au/civicrm/payment/ipn/2

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information.

Once you or your service provider fix this problem, you or your service provider can resend the failed messages from the IPN History page. If this problem continues, PayPal may disable the IPN feature for your account.

Thank you for your prompt attention to this issue.

Sincerely,

PayPal

When we checked the URL it says http://www.herdsa.org.au/civicrm/payment/ipn/2 says:

Failure: Missing Parameter

module

Any help on this would be greatly appreciated. Thank you

# Answer
The "payment processor ID" is an integer, not a string - this may be your issue. Go to **Administer menu » System Settings » Payment Processor**. Next to the PayPal Standard processor you're working on, click the **Edit** link. You should get a new page with a URL that looks like this:

`http://dmaster.localhost/civicrm/admin/paymentProcessor?action=update&id=5&reset=1`

Note the parameter near the end `&id=5`. Whatever number is showing there (instead of "5") is your payment processor ID. Change the "2" at the end of the pingback URL to match your payment processor ID.
> 1 votes

---
Tags: paypal, ipn
---


# Question
Title: How can I reset a user password for a PCP owner?
A donor/owner of a PCP has lost her password. How can I help her?

# Answer
The precise steps to reset a user's password will depend on which CMS platform you are using (i.e. Drupal, WordPress, or Joomla). The CMS — not CiviCRM — manages user logins and passwords.

Nevertheless, the first step is usually to find the user's contact record in CiviCRM and click on the link to the user's associated CMS record as shown below.

Once you've reached the page for the CMS record, resetting the password will hopefully be intuitive. If it's not, then I'd suggest searching the web for something like "Reset Drupal user's password" (or similar, for other CMS platforms).

If you don't see a "User ID", as is shown in the screenshot above, then it can be a bit tricky. Most likely there will a *different* (duplicate) contact record in CiviCRM which *will* have an associated CMS record.
> 1 votes

---
Tags: civicontribute, contributions, contribution-page, personal-campaign-pages
---


# Question
Title: After upgrade to 4.7.23., icons do not show (Civicrm on WordPress) (SOLVED)
As you can see in the picture below, icons do not show. They are missing on all pages, also on buttons. This does not change after emptying cache and rebuilding the menu. I've also checked the resource URL, and it seems to be correct. Do you have any idea, what might be the problem?

Thanks a lot in advance and best regards!!

# Answer
> 2 votes
Following my comment - You need to provide **existing** path in the resource url and directories page. Click the help icon to see the values of diferent global variables that you can make use of(`civicrm.files`, etc).

You can override these values in civicrm.setting.php file according to your paths. More info at https://civicrm.stackexchange.com/a/19498/245

---
Tags: wordpress, upgrade, javascript, css
---


# Question
Title: Wordpress Civi install keeps puking with "canary" and simplexml_load_file() error
WP: 4.8.1 CIVI: 4.7.23 PHP 7.0.22ubuntu0.16.04.1 Ubuntu 16.04.3 LTS

Installation proceeds and then the CiviCrm page 500s.

```
[Sun Sep 03 17:24:57.841003 2017] [:error] [pid 2943] [client 24.1.98.245:49332] PHP Fatal error:  Uncaught Error: Call to undefined function simplexml_load_file() in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php:116

Stack trace:
#0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(95): CRM_Core_Menu::read('/var/www/html/w...', Array)
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(175): CRM_Core_Menu::xmlItems(true)
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(283): CRM_Core_Menu::items(true)
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(372): CRM_Core_Menu::store()
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/api/v3/System.php(49): CRM_Core_Invoke::rebuildMenuAndCaches(1, 1)
#5 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_system_flush(Array)
#6 /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(169): Civi\\API\\Provider\\MagicFunctionProvider->invoke(Array)
#7 /var/www/html/wp-content/plugins/civicrm/civicrm/ in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php on line 116, referer: http://mackenzie.southsidescout.com/wp-admin/admin.php?page=civicrm-install

[Sun Sep 03 17:25:10.472533 2017] [:error] [pid 2944] [client 24.1.98.245:49338] PHP Fatal error:  Uncaught CRM_Core_Exception: [0: Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA.

thrown in /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/InstallationCanary.php on line 53

[Sun Sep 03 17:25:21.322206 2017] [:error] [pid 13881] [client 24.1.98.245:49342] PHP Fatal error:  Uncaught CRM_Core_Exception: [0: Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA.

thrown in /var/www/html/wp-content/plugins/civicrm/civicrm/Civi/Core/InstallationCanary.php on line 53, referer: http://mackenzie.southsidescout.com/wp-admin/

```

Any thoughts? Permissions appear clean

# Answer
> 4 votes
It turned out that PHP did not have simplexml\_load\_file() installed. I ran

apt-get install php7.0-simplexml

Restarted apache and hosed the install in /plugins as well as its database, started over and now it has installed.

---
Tags: wordpress, install
---


# Question
Title: Community centre crm: courses, attendance, reporting
We're trying various different CRMs and systems, looking for a best fit before customisation. As well as CiviCRM, we're looking at Zoho and some others. Please could I ask you opinion on CiviCRM's compatibility with the brief spec below?

Thanks!

---

We run a local community centre charity. We host numerous groups, from a weekly basketball club to youth support community outreach.

Briefly, as a starting point, we’d like to:

* make adding a new group and setting up sessions very easy for end users
* make adding a new user and allocating them to existing groups very easy for end users
* track all user details
* track the number of times they come to their sessions (‘check in’)
    + Staff to do this securely on hand-held devices
* optional notes per user in each session, as part of the session’s record
* tag each group with up to seven of the "key objectives"
* report on the above

# Answer
> 1 votes
There are a number of approaches that could be taken for some of your questions, and without doing a detail 'spec' it would be hard to give a definitive answer. Also some CiviCRM concepts and terminology may not quite fit with your descriptions.

In general, having built civicrm implementations for a number of clients in the educational sphere with needs for both 'attendance' and 'achievements' I would expect CiviCRM to be able to cover the vast majority of your requirements without needing significant additional development work.

In saying the above there is a presumption on my part that the CMS is going to be Drupal, as the combination of CiviCRM and Drupal Views and Webforms give you tools that CiviCRM by itself struggles to deliver.

Your concept of 'group' may not necessarily match with Civi Groups, in that you may be able to do what you want without setting up a group for each situation you may be thinking of. But yes, setting up Groups is easy, as is adding folk to groups, or making the groups 'smart' so folk get added based on some characteristic (saved search)

Sessions could either be mapped to Events or may in some cases make sense to use just Activities. Tracking the number of sessions can be done using custom fields on Participant records or on Activities

Notes, and user details are all out of the box.

Key Objectives, may be something to re-purpose Campaigns for.

---
Tags: civireport, registration, evaluating-civicrm
---


# Question
Title: How can Members download their own Membership Certificate/Card in Drupal 7?
This is a request I get quite often. Below is my favourite solution for it.

# Answer
No custom code required! If you're on Drupal Views integration, which ships with CiviCRM - all that's required here are Drupal modules Views, Views PDF and installation of two libraries for the PDF generation: tcpdf and fpdi;

**Here are the steps:**

1. **First we will create a Membership tab** in your Drupal `/user` screen where we will display the relevant Membership details pulled from CiviCRM:

**To create this Membership Tab:**

**a) setup your CiviCRM - Drupal CMS integration** by following the instructions here: Administer -\> System Settings -\> CMS Database Integration direct link: `civicrm/admin/setting/uf?reset=1` This makes the CiviCRM tables available in your Drupal Views.

**b) on the Drupal side** \- enable Drupal Views; and Create a new View - key elements are Relationships -\> connecting CiviCRM Contact w/ Drupal user ID and Contextual Filter -\> so we can create a path `user/%/membership` and the Menu item: Tab: `Membership`

**c) here is a complete Views configuration for the Page:**

**2. Hitting the Download Membership Certificate link produces:**

**To create this Certificate (a PDF download):**

**a) you need to download and install module: Views PDF** -\> which requires libraries: tcpdf and fpdi -\> put them in a `/libraries folder` that is accessible by your site - either `sites/default/libraries` or `sites/all/libraries`.

**b) when installed -\> add a new display in your View -\> of type PDF Page.** I've selected PDF fields -\> in Settings you can: upload and select a background template of your choice; you can also specify an offset X and Y for each of the CiviCRM variables to position them exactly where you want them!

**c) In your PDF Page View -\> Note the path:**

**d) Now that you've made the PDF Page display:** add a Field on your `user/%/membership` page -\> Custom text -\> e.g. Download Membership Certificate. Hit Rewrite Results -\> select Output this field as a link as follows:
> 17 votes

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


# Question
Title: Event participants registrations expires for participants that decide to pay later with cash
We offer event registration where the participant can register and pay later with cash. However when participants choose to register and pay later, thus on participant status "Pending payment later", CiviCRM simply expires their registration after 24 hours. We are running version 4.6.20 on Drupal 7. Any ideas why this is happening and how I can solve it? In the meantime I have set the "waiting list" to zero should in case this is triggering the expiration of the registered participants. This setting was previously set to 24 hours. It will be weird if the Event waiting list is automatically expiring registered participants who are in status "Pending Payment Later. I need your brilliant brains. Thx.

# Answer
This is a configurable option in the event settings. Go to **Events menu » Manage Events**, click **Configure menu » Online Registration** next to the event in question, and put a "0" in the "Pending participant expiration (hours)" box to disable this. See screenshot:
> 2 votes

---
Tags: paylater, online-registration
---


title: Best Way to Print Case Activities

text:
# Question
Title: Best Way to Print Case Activities
I've been thinking about different ways to create a report that displays case notes (in other words, case activities). These are the two options I've considered, but with some limitations. How do you, or organizations you work with, tackle this problem?

The options include:

**1. CiviReport** \- Use the "Activity Details" report and set the filter: Include Case Activities to "Yes."

* Limitation: Cannot filter case activities by "Case Type." This will be important because one may only want to see case activities by a certain team.
* Printing: Generally, "Print Report" is clean. "Print to PDF" may need some CSS work to display case notes that are really long in length.

**2. Drupal Views** \- Create a View with the CiviCRM Activities. Use filter to expose criterias (e.g., Case Type, etc).

* Limitation: None other than printing.
* Printing: Some clients may have 800+ case notes. Currently, I do not believe there is a way to print multiple pages.

# Answer
Ad your Views solution: use Views PDF for the printing; it can do multiple pages; it can print on a template (if you require letterhead/stationary look);

For a how-to - check my notes here on how to generate a Membership Certificate: How can Members download their own Membership Certificate/Card?
> 1 votes

# Answer
This may or may not meet your requirements, but it's worth noting that there are 2 built-in "print case activities" options currently in CiviCase. You can click the "Print Report" button from the manage case screen, which will print all activities in the main timeline, or you can get finer control from the "Activity Audit" menu which lets you select a timeline and gives you further redaction options before printing.
> 1 votes

# Answer
Another possibility if there's nothing in Civi that meets your requirement is to use a reporting tool like Reportico. If you are OK with using SQL then this should do it. It's open source and well supported. Their website is Reportico.org
> 1 votes

---
Tags: civireport, civicase, reports
---


# Question
Title: CiviMail: Can only write new mailing in debug mode (SOLVED)
I've got the problem, that after an upgrade to the newest CiviCRM version (4.7.23) on WordPress, I can only create a new mass mailing when debug mode is enabled. When it is disabled, CiviCRM gives me an empty page after clicking on new mailing. It does not even say "Initializing...". However, the menu still works fine (doesn't freeze or so).

I've checked the resource URL and the directories, they are correct (I would say). Although I had to leave the Custom PHP Directory field empty, because I simply don't know what to put in there.

The JavaScript console gives me nine errors if I'm not in debug mode:

What might be pointing to the problem here is, that CiviCRM is located at 'netzwerk-n.org/crm' not 'netzwerk-n.org'. But as I said, the directories in the setting.php and also in CiviCRM itself look correct to me (they refer to 'netzwerk-n.org/crm').

I've also checked my permissions, but I'm an admin so there shouldn't be problems, I guess.

When I enable debugging, I can write new mails. However, in debug mode, CiviCRM doesn't seem to actually send/deliver mails. So it's of no use to me.

I'd love to here some of your ideas on that topic.

Best regards Jannis

\[Edit: Just recognized, that also the system status page does not load when debugging is disabled.\]

# Answer
At some point I recognized that it's not only the new mailing page that doesn't load when I disable debugging, but also the system status page wouldn't. So I thought, both things might have something in common. And it turned out, that they do, as they both angular pages (I don't really know what that means, but well that seems to connect them). With that knowledge I knew what I had to search for and I found another post that solved the problem: https://civicrm.stackexchange.com/a/19373/4484

To put it in my own words: If you've got the same problem, you've got to make sure that the path for uploading pictures is the same as the one CiviCRM will look for pictures. The solution to my problem was to replace the former with the path of the latter (in my case: `[civicrm.files]/persist/contribute/`).
> 1 votes

# Answer
1. Cross-origin refers to accessing resources on a different domain. It's curious that URLs you reference are actually different domains -- `www.netzwerk-n.org` vs `netzwerk-n.org`. You might want to check which of those appear in (a) the URL bar (b) the `Resource URLs` (esp under "?" help button) and (c) the outputted HTML documents.
2. As an alternative to "Debug" mode, you might try ~~toggling~~ disabling the "Asset Cache" mode. It's on the same screen: `Administer => System Settings => Debugging`, but it has fewer side-effects.
> 3 votes

---
Tags: civimail, upgrade, mailing, debugging, angular
---


# Question
Title: Sync new clients added in civiCRM to mailchimp
I have started to use civiCRM on wordpress recently. I have been using mailchimp for sending newsletter. If I add new client in civiCRM, I want them to be added to mailchimp client newsletter list automatically. One way traffic only at the moment - from civiCRM to mailchimp when I add a client. And second, if someone unsubscribes from newsletter list, how can I automatically (?) update in civiCRM this newsletter list? how can I do this automatically?

Many Thanks

# Answer
> 2 votes
There is an extension that keeps MailChimp and CiviCRM synchronized. You can find it here

This extension allows you to configure groups or smart groups in CiviCRM so that they synchronise (in either direction) with Mailchimp lists.

The extension is compatible with CiviCRM 4.7.x and 5.x.x versions (Extension compatibility with 4.7.x generally implies forward-compatibility with 5.x.x)

---
Tags: email, mailchimp
---


title: How to create a new group?

text:
# Question
Title: How to create a new group?
How do I add a new group to the drop down menu for groups?

I want to add a "Former Board Member" category.

Thanks!

# Answer
> 1 votes
Menu option Contacts/Manage Groups then 'Add group'

---
Tags: groups
---


# Question
Title: Error - search members belonging to a group
No matches found for: Group(s) In Client Mailchimp Newsletter ...AND... Group Status "Added"

I have created a group and was trying to look at the full list of group members but getting above error message. Not sure what is this "status". I was not searching on this

# Answer
Group Status "Added" is included in the search automatically and is what you probably mean by being 'a member of the group'. Group Status can have other values such as "Removed" - meaning that the contact was in the group but is no longer.

The message simply means that there are no contacts currently in the Client Mailchimp Newsletter. Have you tried to add any contacts to that group yet?
> 1 votes

---
Tags: groups, search-results
---


# Question
Title: How to create a Wordpress User Profile when creating a Membership with Civi?
I am using WP 4.8.1 and CiviCRM 4.7.22

I would like to know what steps I need to take to ensure that when someone contributes through a civiCRM contribution page a Wordpress user profile with access to restricted pages is created?

Does this require an extension?

Thank you

# Answer
You can require users (or give the option) to create a WordPress user account in the advanced settings in the settings of the profile used on the membership contribution page.

You will have to check the box 'Anyone can register' in the WordPress general settings. I would also recommend installing a recaptcha plugin for user signups to prevent a large number on user accounts being created by bots.
> 1 votes

# Answer
If you want to populate your CiviCRM database with the data gained from a profile, then I think you would have to set up the profile within CiviCRM by going to /Administer/Customize Data and Screens/Profiles and link the profile you create to your contribution page.

You can synchronise your users in WordPress to contacts in CiviCRM databases by going to Administer/Users and Permissions/Synchronize Users to Contacts. I haven't used it myself but there is also an extension at https://civicrm.org/extensions/civicrm-wordpress-profile-sync to synchronize WordPress user profile in sync with the corresponding fields of a CiviCRM contact. The synchronisation takes place regardless of whether the changes are made in WordPress or CiviCRM.

If you wish to restrict certain pages in WordPress (such as the contribution page) to logged in users in WordPress, you could use a WordPress plug-in such as WordPress Action Control (see link here http://brandonwamboldt.ca/plugins/members-only-menu-plugin/. )

A good WordPress plug-in I can recommend for Login and registration is Profile Builder at https://www.cozmoslabs.com/wordpress-profile-builder/. There is a free version and a pro version.

There is some useful information on setting up Profiles in CiviCRM in the CiviCRM User Guide at https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/

Hope this helps
> 0 votes

# Answer
You can use the CiviCRM WordPress Member Sync plugin to achieve this. Set up instructions can be found on the plugin's page.
> 0 votes

---
Tags: wordpress, user
---


# Question
Title: Contacts I created wont come up on search
I have installed Drupal and CiviCRM. I have created a new Drupal role and given the following permission

* CiviCRM: add contacts
* CiviCRM: view my contact
* CiviCRM: edit my contact
* CiviCRM: access CiviCRM (This permission gave me access to use search and advanced search)

I can create contacts. But when I search I don't see the contacts I created. My requirement is, I should be able to see the contacts that I created(not other contacts) when I search.

Is this possible ?

# Answer
> 2 votes
"View my contact" grants the ability to see your own contact record, not other contacts you have created. So as currently constructed, you're able to create new contacts but not view them. You have two options -- grant the View all contacts permission (which would allow the user to see all contacts, not only those they have created), or explore using the advanced ACL features to determine what records can be viewed by the contact (see: https://docs.civicrm.org/user/en/latest/initial-set-up/permissions-and-access-control/#native-civicrm-acls). That may require some additional work to segment contacts into groups based on who created them.

# Answer
> 1 votes
There is a simple way to do this in Drupal by adding the Permissioned Relationship extension, and then use a webform so that when you add a Contact, it creates a relationship between you (as Contact 1) and the folk you are adding. Then when you go in to civicrm you will see all those folk that you have a Permissioned Relationship too.

---
Tags: drupal, contacts, search
---


# Question
Title: CiviEvent 4.7* Wordpress - calculated fees with default values doubled w/WP Plugin
After setting up and configuring Civicrm 4.7.20 w/latest Wordpress (4.8.1 or so) I upgraded to 4.7.21 all seemed to go well. Then I logged in and tried 'test drive' an Event, and 'live' registration. In 'live' mode, the default service fee I set up was doubled. I created a test system locally and turned on debugging, tried Smarty debug and the relevant price set fields all looked correct. In NetBeans I checked the Register form after the setDefaults call, values were correct, but any price I set up with a 'default' was doubled by Calculate.tpl
I know this is very specific and I didn't expect to find a solution on stack exchange.

# Answer
> 2 votes
It turned out that the problem was due to a Wordpress plugin I set up called Inactive Logout (https://wordpress.org/plugins/inactive-logout/) caused the problem. Once I deactivated the plugin all worked well. Moral of the story: beware the smiling WP plugin, the javascript that bites, the session vars that snatch, beware the easy download and shun the frumious extension. On a serious note I think the plugin doubled the logged-in users but have to investigate.

It turned out the problem was caused by a call to wp\_footer in src/inactive-logout-functions.php line 16, commenting-out that line fixed the problem and the inactive logout still works. wp-footer appends data to the /body tag

---
Tags: wordpress, civievent
---


# Question
Title: Transactions with fee amount don't show up properly in batches
I ran into an issue the other day on a client site with how transactions with fees show up in batches. I wanted to be sure it wasn't unique to their instance so I deployed a fresh CiviCRM 4.7.20 instance to test it out. It appears related to this ticket. What happens is that when you enter a transaction with a fee it shows in the batch as two separate transactions. One for the full (not net) amount of the transaction and one for the fee amount. Meaning that the batch total is more than the actual cash received. I've created a short video demonstrating it here. Am I doing something wrong here or is this just a bug?

# Answer
> 1 votes
The current batch total in CiviCRM is confusing as it is summing the amounts for all of the bookkeeping entries in the batch, NOT the total payments received for the contributions included or the total expected revenue from them.

To see this clearly, if you edit a contribution and change most fields this results in reversing and reposting a corrected copy of the transaction. Putting all of the relevant bookkeeping transactions into a batch results in a 'batch total' significantly larger than the contribution, even if you haven't changed the contribution amount.

We're finalizing (Sep 2017) some new functionality in core and extensions that will allow some batches to be used to more easily track batches of payments, and other ones to deal with non-payment bookkeeping entries.

---
Tags: civicontribute, reports, batches
---


# Question
Title: Restrict Membership Payments to Fixed Contribution Amounts in 4.7
Yo yo yo everyone, hello we're doing an upgrade from civi 4.0.5 \>\>\> 4.7 and running into the following issue :

In civicrm older version 4.0.5 we are able to create fixed payment amounts as the only options available on the contribution page e.g. https://sitename.org/civicrm/admin/contribute/amount?reset=1&action=update&id=78

Previously on the live payment (contribution) page in 4.0.5 it would display, in a box, the minimum membership amount, i.e. "(contribute at least $\_____ to be eligible for this membership" plus "Your \_TYPE\__ membership expired on\___expiration date\_____) but at same time we could restrict payment options to solely the "Fixed Contribution Options"

(without compelling the user to add automatically the minimum membership fee to it)

Note : Membership settings are configured as follows

1. Membership Section Enabled? Y
2. Default membership selected Y
3. Require Membership Signup Y
4. Separate Membership Payment N
5. Display Membership Fee Y

In other words , restrict the payment to only use what we configure in the fixed payment options

For the minimum membership amount set in membership type , we just want to display it as previous.

No matter how we play with the settings...we cannot get it back after upgrading to 4.7

Any idea or links as to what changed in civicrm 4.7 and why ?

And .. do we need to custom code to fix?

In Civi 4.0.5:

In Civi 4.7:

# Answer
The screenshots don't match the settings you listed above (e.g. "Additional Payment" is set to "Yes") but assuming the question is, "How can I match the 4.7 screen to the 4.0 screen?" you can add a Price Set for Memberships.

* Go to **Memberships menu » New Price Set**.
* Fill in the required fields. *Used For* should be set to **Membership**.
* On the *New Price Field* screen, set the *Input Field Type* to **Radio**.
* Create as many options as needed, setting the "Membership Type" to the "A" Membership.
* Go to the contribution page in question's *Membership* tab.
* Set the *Membership Price Set* to the set you just created and save.
> 1 votes

---
Tags: civicontribute, civimember
---


# Question
Title: Where do Custom Fields for Contributions appear?
I have created a Set of Custom Fields called "Tracking" to be used for any Contributions. The Custom Fields created in this set are called "Category" and "Job".

However, I can't see these fields anywhere I have looked? Where should they appear?

# Answer
They should appear at the bottom of your contribution form, like so:
> 3 votes

# Answer
They should be displayed if you view or edit a contribution which can be done in various ways. For example pull up a contact who has a contribution, go to the tab "contributions" and click on view for a contribution.

Be aware that if you want to be able to find the contributions via a search you should make the fields searchable.
> 1 votes

---
Tags: custom-fields, contributions
---


# Question
Title: Performance Warning: Missing Indices. Mismatched Index Key
Just upgraded to 4.7.23 and am receiving a Performance Warning: Missing Indices.

The warning states:

*The following tables have an index key with a mismatch in value. Please delete the key indices listed from the below table and then click on 'Update Indices' button.*

Then the following is listed

**Table Name** \- civicrm\_case\_contact

**Key Name** \- UI\_case\_contact\_id

**Fields** \- case\_id, contact\_id

I found the Table in my database with phpMyAdmin. Nested inside are Columns and Indexes. Inside Indexes is what looks like the Key Name of: UI\_case\_contact\_id, and also something labeled: FK\_civicrm\_case\_contact\_id.

Will simply deleting UI\_case\_contact\_id resolve this issue?

Or, do I need to delete the Field: FK\_civicrm\_case\_contact\_id?

Or is there another approach?

My Civi is definitely slower so looking to see resolving this would help.

Attached an image of the Table from PhpMyAdmin

Thanks in advance

Tim

# Answer
I suggest you delete the `UI_case_contact_id` index as suggested by CiviCRM, and then refresh the system status page. It should then present a button which will automatically add missing indexes.
> 2 votes

# Answer
This is hopefully fixed in 4.7.25 - sometime tomorrow it should be downloadable as an rc https://download.civicrm.org/latest
> 1 votes

# Answer
This SQL query fixed it for me (don't know if SET foreign\_key\_checks is needed)

```
SET foreign_key_checks = 0;
CREATE INDEX `foobar` ON `civicrm`.`civicrm_case_contact` (case_id, contact_id);
DROP INDEX `UI_case_contact_id` on `civicrm`.`civicrm_case_contact`;
CREATE UNIQUE INDEX `UI_case_contact_id` ON `civicrm`.`civicrm_case_contact` (case_id, contact_id);
DROP INDEX `foobar` on `civicrm`.`civicrm_case_contact`;
SET foreign_key_checks = 1;

```

Source: https://issues.civicrm.org/jira/browse/CRM-20533?focusedCommentId=105725&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-105725
> 1 votes

---
Tags: upgrade, mysql, performance, indices
---


# Question
Title: How to create a contribution or event report that indicates amount of payment and balance owed
We run CiviCRM 4.7.21. In events, we are able to indicate a registration payment toward the total with the balance owed within each participant's registration page. However, we have not been able to determine how to run a report that indicates partial payment and balance owed. Is there an event or contribution report that can be configured to run a report that shows both the partial payment amount and the balance owed?

# Answer
In the event participant report there is the option to add columns for total paid & balance.
> 3 votes

# Answer
welcome to civicrm stackexchange. I can't answer your question specifically as a quick search for a report that does this didn't turn anything up.

The wiki page for partial payments is here but i don't see anything specifically indicating new reports were created for it but rather that

> Existing search and report filters allow users to filter on Participant and Membership status, and therefore can be used as-is to locate partially paid records. Reports which calculate revenue based on completed contribution summation should continue to provide accurate revenue totals.

There are a couple of additional report solutions that may be worth investigating but I suspect neither have yet accommodated the 'partial payment' issue (which I haven't seen in use personally). The two I am thinking of are
> 1 votes

---
Tags: civievent, civicontribute, civireport
---


title: Issues with recording donation refunds

text:
# Question
Title: Issues with recording donation refunds
If a donor makes a credit card donation that is later reversed/refunded, what is the best way to record this? Just delete the gift? Can you record a negative gift amount to offset the refund?

# Answer
We go to the Contribution \> Edit Contribution, change Contribution Status to Refunded. It is one of the drop-down options for Contribution Status.
> 2 votes

---
Tags: contributions
---


# Question
Title: set minimum or maximum number of tickets a person can buy
New to civiCRM so this might be an obvious one but I haven't found he answer as yet

I need to do 2 things with events:

* cap the number of tickets one given person can buy for an event. For example, set a limit of 2 tickets per transation, even though the event can be attended by 1500 persons.
* Set a minimum number of tickets to be bought. For example, you can buy group tickets if you're in a group of 10 or more. So the minimum number of tickets must be 10 but it can be 11, 12, 13, etc...

Thanks for your help!

Luke

# Answer
> 4 votes
Unfortunately, this isn't functionality that CiviCRM offers "out of the box". If you're a coder (or have access to one, or hire one from https://civicrm.org/providers) then you can add this functionality pretty easily with hook\_civicrm\_validateForm to create some custom validation rules.

---
Tags: civievent
---


title: How do I turn on Detailed Logging?

text:
# Question
Title: How do I turn on Detailed Logging?
The book tells about the advantages of Detailed Logging at length, but I don't see how to turn it on.

Thanks!

# Answer
> 4 votes
Logging can be turned on via Administer \> System Settings \> Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.).

You will find the relevant page on the Drupal demo site here

(NB, i am using the link to the master to give the url longevity)

You will also find explanation in the manual here

# Answer
> 0 votes
Where are the settings for Enabling Details logging? I can't find at xxx/civicrm/admin/setting/misc?reset=1

---
Tags: logging
---


# Question
Title: Include PDF welcome package attachment with email receipt
I am trying to sort out if I can include a PDF attachment for new members with their registration confirmation email. There are several different member types, each would require a different PDF. The content of the PDFs is too long to put directly into the confirmation email. The PDF contains a welcome message and information about events, benefits, and other details for new members.

I can see how to include a PDF receipt in the admin settings but no where to include any other type of PDF. I see the option to set the maximum number of files (documents, images, etc.) which can be attached to emails or activities but I can't find where to configure what files to attach.

Is this possible?

Thanks!

(Using CiviCRM 4.7.24)

# Answer
> 1 votes
You can set up Scheduled Reminders to fire x hours after Membership Start/Join Date - and specify which membership types these relate to.

You should therefore either be able to attach the PDF to these, or, better in many cases, provide a link to the PDF so the attachment isn't part of the email.

---
Tags: email, attachments
---


title: How can I run extension DB updates?

text:
# Question
Title: How can I run extension DB updates?
When I update my civi extension simply by changing the codebase to the most recent version (because the most recent version is not showing up in the config options), my extension is broken.

I updated "nz.co.fuzion.omnipaymultiprocessor" from 1.7 to 2.2

Probably because some database changes required in the new version?

**I'm wondering if there is database update script like the drupal update.php equivalent?**

# Answer
> 7 votes
The equivalent would be any of these:

* Navigate to `civicrm/admin/extensions/upgrade?reset=1`
* Navigate to "System Status" or "Manage Extensions". Those pages will link to the above.
* On CLI, run `cv ext:upgrade-db` (Download `cv` from https://github.com/civicrm/cv)

# Answer
> 1 votes
Try running https://{yoursite}/civicrm/clearcache and then go to Administer-\>System Status. You should be prompted if there are extension db updates. If that does not work try disable/re-enable the extension.

# Answer
> 1 votes
drush cvupdb will run the database upgrade for civi

---
Tags: extension, upgrade
---


# Question
Title: Date of birth -- months only show through September
Is anyone else having problems with date of birth only showing through September? I've found this on two different sites.

How would I go about debugging this?

# Answer
> 4 votes
The choice of months is restricted because the date-picker does not allow future dates to be chosen for the birth date field.

1. First select a year in the past.
2. Then you will see all months available to choose.

---
Tags: dates
---


title: Contact Types Not Updating in Main Menu

text:
# Question
Title: Contact Types Not Updating in Main Menu
When editing or adding Individual and Organization contact types the main menu doesn't update the contact type text. For example the options under Contacts \> Individuals \> are still New Student, New Parent, and New Staff, when they should be New Member, New Intern, and New Staff. When I click on "New Student" it brings me to add a new member page, so it's really just the menu list that is not updating and the pages themselves are fine.

# Answer
> 1 votes
Thanks for reporting this and describing it so clearly. I have reproduced this problem on the latest version of CiviCRM, though in my testing I found the problem to be limited to *editing the label of existing contact types* (adding new contact types work okay in my testing).

## Bug

This looks like a bug to me. I would suggest you take this a step further by filing a bug report. You can use the text you wrote already and even link to this page too.

## Work-around

In the mean time, if you're still in the process of configuring CiviCRM (and haven't yet created contacts with your desired sub-types), you can delete those problematic sub-types and create new sub-types for "Member", "Intern", and "Staff".

---
Tags: contacts, menu
---


# Question
Title: Within an extension how can load a custom `Civi` name-spaced class?
Within my extension I can load classes from CiviCRM's core codebase like this:

```
$foo = new \Civi\Core\AssetBuilder();

```

And I can also load custom classes that I've written in my extension like this:

```
$foo = new CRM_MyExtension_MyClass();

```

Cool.

---

But if I've defined a custom class within my extension using the `Civi` namespace, the following does not work:

```
$foo = new \Civi\MyExtension\MyClass();

```

It fails with this error message:

> Error: Class 'Civi\MyExtension\MyClass' not found in ...

How can I load this custom class from within my extension?

# Answer
Add the following elements to your extension's `info.xml` file to enable PSR-4 autoloading:

```
<classloader>
  <psr4 prefix="Civi\" path="Civi"/>
</classloader>

```

Also see docs on the `<classloader>` element
> 7 votes

---
Tags: developer
---


title: Event RSS Error Code

text:
# Question
Title: Event RSS Error Code
When I click on the RSS icon for my events in Civi, I get the following error.

```
error on line 2 at column 6: XML declaration allowed only at the start of the document

```

From searching, it appears that this happens most commonly when there's added white space in a file.

I've tried editing ./civicrm/templates/CRM/COre/Calendar/Rss.tpl to no avail.

Where else can I look to see if there's added white space? Any other ideas?

Thanks in advance.

Edit:

The RSS links to https://focusdc.org/civicrm/event/ical?reset=1&list=1&rss=1

# Answer
> 0 votes
From your screenshot, I was able to test this same functionality on two test sites (a good general troubleshooting tactic!). The problem does NOT replicate itself there. The issue is specific to your site, or (less likely) reflects a bug in an older version of CiviCRM than the ones I'm testing.

I was able to use your link to see the exact error - and you're correct, the issue is a blank line.

Since you're using Drupal, I would look for a blank line at the end of `settings.php` and `template.php`. I would also try testing whether the problem disappears if you change themes (preferably on a test copy of your site). That will help you isolate whether the problem is in your theme.

---
Tags: civievent
---


# Question
Title: Font-Awesome icons not showing -- missing class=fa?
The Font-Awesome icons are not showing properly. I believe this is because the required class "fa" is missing everywhere where one of the icons is supposed to display. I have tested this by modifying templates/CRM/common/fatal.tpl, adding "fa" in the appropriate place in line 49. Without the fa class the browser shows a blob character; with the fa class the correct icon shows as desired. Quite a number of templates are affected (assuming I am correct).

I'm running CiviCRM 4.7.23 (with no local customization) on Drupal 7.56.

# Answer
> 3 votes
It sounds like you've identified a bug — *and* found a fix. Excellent!

I can confirm this bug by observing the fatal error message displaying a funky character before "Sorry" as shown below.

Here are some next steps that I'd recommend for you here:

1. Report the bug in CiviCRM's issue-tracker, Jira. If you're new to reporting issues, read over these issue-reporting guidelines in our Developer Guide.
2. After reporting the bug, you can choose to stop there and wait for someone else to fix it. *But*, given that this issue has a relatively minor impact, developers will be unlikely to volunteer their time on it unless you offer *funding* to the Core Team or to an independent expert.
3. Since you've already dug into the code yourself, I'd encourage you to work on contributing a fix. Here are some tips:

* Use `git blame` (possibly via GitHub's web-based git blame) on that line of code to see if there are recent commits which are relevant to the issue. Ah ha! In this case we can see that someone recently made a change to "use class crm-i instead of fa".
    * It would be prudent to look deeper into that commit to try and understand it. I haven't gone too deep, but I did notice that the commit also changed the warning at the top of the "Option Groups" page (`/civicrm/admin/options?reset=1`), and that message seems to be displaying okay right now:
    * From the above, I'd recommend considering whether your fix should be limited only to the fatal error page (which might be behaving differently than other pages due to different CSS being included in it)
    * If you're stuck or want input from other developers, hop on Mattermost.

All-in-all, this answer is just intended to be a push in the right direction towards using other tools (i.e. Jira, GitHub, and Mattermost instead of StackExchange) for reporting (and hopefully fixing) this bug. In some ways you're lucky to have found a bug which will (probably) be super easy to fix! Fixing this bug would be a great stepping stone towards improving CiviCRM in bigger ways too!

# Answer
> 1 votes
Sean provided an excellent answer for dealing with the bug on the fatal error page.

Here, I'm just addressing the question of why the `fa` class is missing. You noticed that none of CiviCRM's icons have it.

CiviCRM is different from many systems because it's subject to a wide variety of CMS themes and settings where it's installed. When we went to set up Font Awesome, the icon library used in 4.7, Coleman and I were concerned that there could be a clash between CiviCRM's implementation of Font Awesome and one potentially used by the CMS.

For example, Font Awesome 5 is coming soon, advertising all new icons. While I'd hope that the characters used for each icon would be the same in the new font, there's no guarantee that they would be: the class name is intended to be the identifier. If CiviCRM expected Font Awesome 4 and the CMS used 5, or vice-versa, using the `fa` class could yield inconsitent results. We chose to use `crm-i` instead.

The separate class also gives us more flexibility on custom icons. We can create new icons and tie them to the `crm-i` class along with a specific icon name class, and they'll be treated the same as our off-the-shelf icons. If later versions of Font Awesome include an icon with the same name, we can safely continue as-is without messing up parts of the CMS thst might use that new icon.

---
Tags: 4.7
---


# Question
Title: Changing a recurring contribution with multiple line items
CiviCRM 4.7.22 WordPress 4.8.1 iATSPayments

I am not sure if this should be asked in this exchange or the iATS github.

We have a donor with a recurring donation that was $125 a month, with $50 for Line Item 1, $50 for Line Item 2, and $25 for Line Item 3. Several months ago they wanted to make it $50 for all three funds. So they went into their recurring contribution and edited it to be $150 instead of $125. Since then, it is processing it at $150 but it is not changing the Line Item Table to show $50 for each fund.

I thought that it used to just look at the previous contribution for the Line Item info. So I edited the line item table with $50 for each fund. But it continues to do the next recurring as $50, $50, $25.

I also changed the Invoice Id in the recurring table (see screenshot) to a contribution that I had edited. Thinking that it must look at that invoice id for future recurring details. But it still processes $50, $50, $25.

Any ideas where it refers to for a template to populate recurring Line Items? How can I make this work correctly from here forward?

Can I change the start date to the date of a correct donation? Does it use the first contribution as the template?

# Answer
The 1.6.x branch of the iATS extension is using contribution repeattransaction API -\> to get the details of the contribution and its line items that need to be repeated;

If a recurring contribution has lineItems associated with it - we don't allow updating it in the GUI:

You can (as you noted) update this in the backend -\> however -\> repeattransaction API will continue to use the lineItems associated with the first contribution in a recurring series as the 'template';

Best solution in this case is to start a new recurring series -\> with both the correct total amount and the correct break down; Two ways to do this:

1) ask the donor to initiate a new series on an online contribution page;

2) since you have the iATS customer token -\> you can use phpMyAdmin to set up a new series - and attach the token to this. It's tricky in that you will need to touch a number of tables -\> and possibly bookkeeping entries as well (if you care about those);
> 2 votes

# Answer
I believe the line item info comes from the FIRST recurring contribution, not the most recent one.
> 1 votes

---
Tags: recurring-contributions, iats, line-items
---


title: Search comparing two date fields

text:
# Question
Title: Search comparing two date fields
I would like to be able to create a smart group of contacts who: 1) are participants for an event in the future 2) have passport expiration dates (a custom Individual Contact date field) that are before the End Date of said event

I'm not finding any way to compare the two date fields. I've looked at CiviRules, but that doesn't seem to get me what I need.

Any suggestions?

(Joomla 3.7.5, Civi 4.7.21)

# Answer
> 2 votes
I think it's unlikely you'll be able to perform this search within any of CiviCRM's existing searches.

Fortunately, it's possible to create custom searches. The process requires some coding, but gives you a tremendous amount of power and flexibility.

# Answer
> 0 votes
Agreed that there's no way to do date comparisons like this out of the box. You would have to write a custom search to handle this scenario.

---
Tags: search, dates
---


# Question
Title: Pay Now Button - How do you change button text?
Is there a way to change the "Pay Now" button on contribution pages? The issue is even when the person is selecting to pay by check (Pay Later) the button still says pay now. I want people to click the pay now button be some people find it confusing that you have to hit the pay now button in order for it to send an invoice via email.

# Answer
> 1 votes
Since "Pay Now" is not the default for CiviCRM I would check to see if Word Replacements has been used to rewrite this. Admin \> Customise \> Word Replacements ie ../civicrm/admin/options/wordreplacements?reset=1

If it is not that, then use your browser Inspect option to figure if you have a customised template

---
Tags: civicontribute, paylater
---


# Question
Title: What is purpose of the Tell A Friend "Info Page Link"
When setting up an event, in the Tell A Friend tab there is a Info Page Link. What is the purpose of that link? It does not store that information in the event table so I do not think it is even used.

# Answer
> 3 votes
The tell a friend information is stored in another table called `civicrm_tell_friend`. The help text for the `Info Page Link` says -

> A link to this Event Information page is automatically included in the email sent to friends. If you ALSO want to include a link providing general information about your organization, enter that link here (e.g http://www.example.org/)

So basically its purpose should be to include an additional link(eg your organization) along with the message you send to the contacts from `Tell a Friend` form.

---
Tags: civievent
---


# Question
Title: CiviMail tracking opens stopped working after upgrade to 4.7.x
CiviMail reports track unique opens and total opens, but after upgrading to 4.7 line, suddenly all mailing register 0 opens. I have testing and opened a test email and CiviMail does not register the open.

Has anyone else noticed this or have an idea why this could be happening?

We are on HostGator shared hosting and have the latest version of Drupal and CiviCRM.

Thanks for any ideas.

# Answer
> 1 votes
I've experienced this on a few sites and it turns out the file/directory permissions seem to have changed. I'm not sure if this is in relation to the way 4.7 is packaged, or something on the particular hosts that these sites are on, or what, but I have found that I need to recursively reset permissions after updating, or the tracking doesn't work, click through links don't work, you can't upload images from CiviMail, etc.

From just outside the `civicrm` directory, I do this and it seems to solve it:

```
find civicrm -type d -exec chmod 755 {} ";"

find civicrm -type f -exec chmod 644 {} ";"

```

The first one changes permissions on directories and the second on files.

# Answer
> 0 votes
Check out the source of the email you receive, if should have a:

```
<img src="https://yoursite.org/sites/all/modules/civicrm/extern/open.php?q=91954565" width='1' height='1' alt='' border='0'>

```

at the bottom. copy the url and paste it, you hopefully have an error message or 404/50x error that should point you into the right direction

If you are using nginx/fastcgi, it's probably that you miss a directive to handle that url

If you don't have that img tag at the bottom of your mail, check if you have the track open checkbox properly set.

Finally: test on gmail, since a wee while, they do display external images. Most of the other mail clients don't display external images by default, so they don't tell your civi that the mail is read. X+

---
Tags: civimail, 4.7
---


# Question
Title: Manage Groups - 'Invalid JSON response' error
Environment: CiviCRM 4.7.21 on Drupal 7.x on LAMP stack

Error Message:

```
DataTables warning: table id=DataTables_Table_0 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

```

Bug: On 'Manage Groups' (civicrm/group?reset=1) we do not see any groups upon page load, and see the above error. If we search for groups, they are there.

Question: How do we resolve? This was introduced after upgrade from 4.6 to 4.7

Observations: We have many groups. If I select 'Access Control' then it loads a few groups there. Is the issue that we have too many groups?

If I enable Debugging/Backtrace, and try to update 'Smart Group Counts' I get this:

```
0 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(374): CRM_Core_Error::backtrace()
1 mysite.com/public_html/sites/all/modules/civicrm/CRM/Utils/Type.php(358): CRM_Core_Error::fatal("current is not of the type Integer")
2 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(5609): CRM_Utils_Type::escape("current", "Integer")
3 mysite.com/public_html/sites/all/modules/civicrm/CRM/Member/BAO/Query.php(255): CRM_Contact_BAO_Query::buildClause("civicrm_membership.status_id", "=", "current", "Integer")
4 mysite.com/public_html/sites/all/modules/civicrm/CRM/Member/BAO/Query.php(152): CRM_Member_BAO_Query::whereClauseSingle((Array:5), Object(CRM_Contact_BAO_Query))
5 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Component.php(299): CRM_Member_BAO_Query::where(Object(CRM_Contact_BAO_Query))
6 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(2037): CRM_Core_Component::alterQuery(Object(CRM_Contact_BAO_Query), "where")
7 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(519): CRM_Contact_BAO_Query->whereClause(NULL)
8 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(479): CRM_Contact_BAO_Query->initialize(NULL)
9 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(637): CRM_Contact_BAO_Query->__construct((Array:3), (Array:5), NULL, FALSE, FALSE, 1, TRUE, TRUE, FALSE, NULL, (Array:2))
10 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3089): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
11 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3024): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), NULL, "contact_a", "IN")
12 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(1813): CRM_Contact_BAO_Query->group((Array:5))
13 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(2033): CRM_Contact_BAO_Query->whereClauseSingle((Array:5), NULL)
14 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(519): CRM_Contact_BAO_Query->whereClause(NULL)
15 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(479): CRM_Contact_BAO_Query->initialize(NULL)
16 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(4435): CRM_Contact_BAO_Query->__construct((Array:1), (Array:1), NULL, TRUE, FALSE, 1, TRUE, TRUE, FALSE, NULL, "AND", NULL)
17 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(229): CRM_Contact_BAO_Query::apiQuery((Array:1), (Array:1), NULL, NULL, 0, 0, FALSE)
18 mysite.com/public_html/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(208): CRM_Contact_BAO_GroupContactCache::add((Array:85))
19 mysite.com/public_html/sites/all/modules/civicrm/CRM/Group/Page/Group.php(129): CRM_Contact_BAO_GroupContactCache::loadAll()
20 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(172): CRM_Group_Page_Group->browse(NULL, NULL)
21 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Core_Page_Basic->run((Array:2), NULL)
22 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
23 mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:2))
24 mysite.com/public_html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:2))
25 [internal function](): civicrm_invoke("group")
26 mysite.com/public_html/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:1))
27 mysite.com/public_html/index.php(21): menu_execute_active_handler()
28 {main}

```

# Answer
While I can't tell (as Hans suggests) which smart group is causing the problem here, he's right - there's some smart group that's causing a problem. I couldn't tell you why this is happening, but it's true that deleting and recreating the smart group in question will resolve this.

`current is not of the type integer` is the key to this. You have some smart group where one of the search terms is "membership status = current". That's the one with the problem.

To find the smart group(s) that have this problem, you can run this SQL command:

```
SELECT cg.id, cg.title FROM civicrm_saved_search css JOIN civicrm_group cg ON cg.saved_search_id = css.id WHERE css.form_values LIKE '%status_id%' AND css.form_values LIKE '%current%';

```
> 2 votes

# Answer
I've seen this in case of an older smart group containing deprecated formValues. See https://issues.civicrm.org/jira/browse/CRM-20874.

You can try applying the PR(patch) submitted on that issue and check if it resolves for you.
> 3 votes

# Answer
We had this error because there were some smart groups (we had 4 groups out of 210) that contained wrong mysql code, so the groups overview did not display because civi could not calculate the number of people in these groups.

We could see the first screen of the groups overview after reducing the pager to 10 items because the first wrong group was on the second page then. In your case you know the wrong groups will be mailing groups because filtering them out removes the error.

We solved as follows:

* Take a full backup
* Enable debugging
* Click the link to update the smartgroup counter (/civicrm/group?reset=1&update\_smart\_groups=1) to get the error message on screen with the mysql query below in a collapsed fieldset where you can see which smart group id is blocking
* Get the group\_id out of the sql error message and check which group it is at /civicrm/group?reset=1&action=update&id=GROUPID. Write down this information so you know which smart group needs to be recreated.
* Delete the smart group at /civicrm/group?reset=1&action=delete&id=GROUPID
* Update again the smartgroup counter to see if there are other smart groups wrong and repeat
* Recreate manually the deleted smartgroups
> 3 votes

---
Tags: error, groups
---