# Question
Title: Create a Login page for wordpress users to access civicrm but not wordpress functionality
We have installed CiviCRM on Wordpress and I'd like to create a login page for all users of the CRM.

I've created all employees as users in Wordpress and contacts in CiviCRM.

How do I create a login page so they are immediately taken to CiviCRM and cannot see or access the Wordpress backend? Right now they all logging to Wordpress (not CIviCRM) and have to click the CiviCRM module in the left Wordpress menu.

In the demos on Drupal users cannot see the backend.

This topic is not covered int he documentation that I can see.

# Answer
> 1 votes
There are many plugins that do front-end login forms. I have been using Login with Ajax This will create a front end form and allow redirects. You can also leverage the login widget in the Members Plugin and pair that with Peter's Login redirect

# Answer
> 0 votes
Given that all login would have to be done through Wordpress as CivicRM does not hold any of the login information it self (e.g. password). I would advise you to look for or build a wordpress plugin that does this for you.

Regards

Seamus

# Answer
> 0 votes
You also can https://www.role-editor.com/ plugin to give you a more detailed control of what your users have access to when they login. This along with the CiviCRM ACL manager, should also get you the results you want. They will still login to the WP dashboard and need to click on CiviCRM on the left. But you can limit how much they can see of the WP dashboard.

---
Tags: wordpress
---


# Question
Title: Show full county name rather than the abbreviated form
Appreciate it's a US-bias, but can't find a way to stop the abbreviation of County, eg Essex becomes ESS.

What have I missed?

# Answer
In Administer \> Localization \> Address Settings, you can change the mailing label format to use `{contact.state_province_name}` instead of `{contact.state_province}`.

It is not currently ready, but the localization (translation) system of CiviCRM does have support to define better defaults based on the locale. Work is being tracked in: https://lab.civicrm.org/development-team/translations/issues/1
> 7 votes

---
Tags: addresses
---


title: How do I delete a contribution

text:
# Question
Title: How do I delete a contribution
If I have entered a contribution in duplicate, how can I delete one of them? I do not know what to try before asking my question.

# Answer
> 5 votes
Go into CiviCRM admin\>Contributions\>Find Contributions to find the relevant contribution(s). When the search is complete, on the very right hand side of the Find Contributions screen and in the relevant row, you will see the word "Delete". All you then need to do is click on "delete" and the contribution will be deleted.

Alternatively, if you are viewing a contact record, choose the "Contribution" tab where the contact's contributions will be listed. The "Delete" button is on the right hand side.

# Answer
> 1 votes
You can also delete multiple contributions from the search results (Contributions\>Find Contributions) by checking the checkbox to the left and select 'Delete Contributions' from the action menu.

---
Tags: contributions
---


# Question
Title: Why can Search results not be removed from mailing recipients?
When doing a contact search and using the action "Send email", a new draft mailing is created and a hidden group is assigned as recipients to the draft mailing. It is is displayed as "Search results" and has a different color.

If I click on the cross to remove it from the recipients, I get a message *"This mailing was generated based on search results. The search results cannot be removed."*. Why is that? I looked at the code where this restriction is enforced, but couldn't see anything that would suggest why search results cannot be deleted.

# Answer
I suspect this was an intended outcome ie, you do a search, you find your contacts, you use "Email - send/schedule via civimail" and that locks in the recipients.

If at that point you decide your search was incorrect, then you need to start over.
> 1 votes

---
Tags: search-results, mailing
---


# Question
Title: How to troubleshoot the wordpress issue when the site is migrated from one host to another?
My original website name was www.xxx.com. However, I am not using that anymore. I am now using raspberry pi as a web server. After migrating to new database and domain - www.xxx.blogsite.xyz, I see that my website is not getting launched. I don't even see the dashboard for myself. How can I debug or troubleshoot this. I see that my apache is running fine. Also, I have tried restarting it. I can't access myphpadmin using public address or hostname. However, I can use myphpadmin using local IP address. Is something wrong with my dynamic dns setting?

# Answer
> 1 votes
Have you reviewed the "Moving an Existing Installation to a New Server or Location" here:

https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location

?

---
Tags: wordpress
---


title: Create fakefile warning

text:
# Question
Title: Create fakefile warning
I have seen this warning on a couple of sites.

Warning: file\_put\_contents(.../sites/default/civicrm/ext/delete-this-DEbcrmuyt7): failed to open stream: Permission denied in CRM\_Utils\_File::createFakeFile() (line 306 of /.../sites/all/modules/civicrm/CRM/Utils/File.php).

On one site this warning then came up when we tried to delete a Price Set but were unable to do so.

# Answer
> 1 votes
We have provided a fix for this at https://github.com/civicrm/civicrm-core/pull/10677

---
Tags: extension
---


# Question
Title: Import override for latitude and longitude
I'm in the process of importing latitude and longitude information for contacts. This process is straightforward but I don't see an option to upload an option to turn on 'Override automatic geocoding'. What's the best way to turn on this option for all of these contacts? Thanks.

# Answer
You could take a look at the API csv extension. The field is called manual\_geo\_code and is available via the API (updated based on Jon's comment)
> 1 votes

---
Tags: import, geocoding
---


title: Running Cron scheduled jobs - Wordpress

text:
# Question
Title: Running Cron scheduled jobs - Wordpress
Not a question so much as an answer. After installing Civi 4.7.6 under WP, I tried running all scheduled jobs using: easyCron, Cron (through CPanel) with wp-cli, cron.php, and from commandline curl, php...wp-cli, php...cron.php. Finally I was successful running all jobs using URL 'https://mysite.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?user=adminuser&password=mypwd&key=sitekeyfromcivicrmsettings I had to move civicrm.settings.php to wp-content/plugins/civicrm - the install had placed it under wp-content/plugins/uploads/civicrm. Some errors I got when trying to run as an actual cron job (putting it into crontab) referred to 'not finding default/civicrm.settings..' which sounds to me like a Drupal-oriented message, since that's where Drupal civicrm.settings.php go but not Wordpress. HTH someone else.

# Answer
> 1 votes
I had verified by running php -v (after shelling in) that (cli) was supposedly enabled but I could not submit a cron job using wp-cli. I tried using curl, but got "Protocol http or https not supported or disabled in libcurl". I didn't fare well with easyCron - I felt uneasy supplying my pswd there; but after seeing jobs tagged with 200 ('succeeded') in logs, my installation didn't reflect that. One important bit of information - this site isn't live yet, so I am pointing to it via my Hosts file. But I have to verify that stuff works BEFORE go-live.
So, from where I stand, using the URL method seemed to be the one workable method. (also, I could run it locally and debug it!)

---
Tags: wordpress, cron
---


# Question
Title: Update 4.7.22 : Operation failed: Update Indices DB Error: already exists
I'm just update to civicrm 4.7.22 on Drupal 7.56.

After the update, I received a system status warning "Performance warning: Missing indices".

I click to Update Indices and have these error: "Operation failed: Update Indices DB Error: already exists"

In the Drupal log, I have the message:

"$Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> exceptionHandler ) \[code\] =\> -5 \[message\] =\> DB Error: already exists \[mode\] =\> 16 \[debug\_info\] =\> CREATE UNIQUE INDEX UI\_case\_contact\_id ON civicrm\_case\_contact (case\_id, contact\_id) \[nativecode=1061 \** Duplicate key name 'UI\_case\_contact\_id'\] \[type\] =\> DB\_Error \[user\_info\] =\> CREATE UNIQUE INDEX UI\_case\_contact\_id ON civicrm\_case\_contact (case\_id, contact\_id) \[nativecode=1061 \** Duplicate key name 'UI\_case\_contact\_id'\] \[to\_string\] =\> \[db\_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM\_Core\_Error::exceptionHandler prefix="" info="CREATE UNIQUE INDEX UI\_case\_contact\_id ON civicrm\_case\_contact (case\_id, contact\_id) \[nativecode=1061 \** Duplicate key name 'UI\_case\_contact\_id'\]"\] )"

Do I need to solve this issue? And how can I?

Thanks.

# Answer
> 1 votes
There are a couple of posts on this issue. The one that worked easiest for me is the artfulrobot answer in How to find and/or fix missing indices?. You can execute steps 3-5 runing SQL commands either at the command line or in phpMyAdmin. Although the post was for drupal, it worked for me on our wordpress instance.

---
Tags: error, database, upgrade
---


# Question
Title: How to build reports or Views based on who the Manager is
We need some summary reports of Count of open Cases by Case Manager.

Maybe overlooking something but not spotting these.

Just getting to grips with how Case Manager is identified. Seems to initially be the person who 'creates' the case, until that gets reset at which point an Activity of Type "Assign Case Role" is created and the Manager is the assignee, status Completed.

But if the Manager is changed, it just adds another one. So trying to report eg in Views, by grabbing the Activity of that type/status gives multiple results.

Wondering which way to go around this.

Keen to hear ideas for flexible approaches that might be useful to others.

Seems I had forgotten about using the Case Manager Relationship as an option!

# Answer
> 2 votes
As for how to do aggregation on custom Views fields, I can speak to that. This answer doesn't provide how to decide what is an open case or having a case manager...I'll leave you to that, but here's how you can aggregate it once you get there!

This can be done with a custom Views field handler + Views Aggregator Plus module.

The Views custom field handler must be specially constructed. Below is an example from one of my projects. I've removed some logic from this example...The key is that you calculate and set the values to the rows in the post\_execute() method, with a property name that starts with "field\_", with a \['raw'\] array index value. If you do that then the Views Aggregator Plus module will "see" the data and be able to manipulate it.

In this example I calculate the number of enrollments to courses for each user, and set that value. The View lists users, and includes this field, and is then summed via the php aggregation. You can do something similar, and then use get a count. In your case you would probably return 1 if the row (case) is open with a manager, and not set it or set it null if it is closed or not having a manager.

Views Aggregator Plus enables PHP based aggregation to views as opposed to SQL based aggregation which is default with Views.

```
class tincan_course_product_handler_user_total_enrollments_field  extends views_handler_field {
  function construct() {
    parent::construct();
  }

  function query() {
    $this->ensure_my_table();
    $this->add_additional_fields();
  }

  function post_execute(&$values)
  {
    foreach($values as $index => $value) {
      if(!empty($value->uid)) {
        $uid = $value->uid;
      }
      elseif (!empty($value->users_civicrm_uf_match_uid)) {
        $uid = $value->users_civicrm_uf_match_uid;
      }
      $total_courses = NULL;
      if(!empty($uid)) {
        $user = user_load($uid);

        $total_courses = tincan_course_product_get_users_get_total_default_product_count($user);

      }
      $values[$index]->field_total_enrolled_courses['raw'] = $total_courses;
    }
  }

  function render($values) {
    return !empty($values->field_total_enrolled_courses['raw']) ? $values->field_total_enrolled_courses['raw'] : 0;
  }
}

```

Views Aggregator Plus works similarly to standard Aggregation, but you must use the provided Format, "Table with aggregation options" provided by the module.

# Answer
> 0 votes
One thought would be to add a field to CiviCase and use post\_hook and triggers (?) to update this any time a change of Manager is done.

---
Tags: civicase, drupal-views, reports
---


# Question
Title: DeDupe errors when Individuals have Membership (by relationship)
I have borrowed the title from this unanswered forum post by Laryn: DeDupe errors when Individuals have Membership (by relationship).

Just encountered the same error on a Civi 4.6.9 / Drupal 7 site. Laryn, did you get anywhere with this? Or can anyone shed any light? It appears that CRM\_Member\_BAO\_Membership::createRelatedMemberships(), via some intermediate function calls, tried to insert a civicrm\_membership record without specifying membership\_type\_id: our error & backtrace is very similar to Laryn's:

\[debug\_info\] =\> INSERT INTO civicrm\_membership (contact\_id , status\_id , owner\_membership\_id ) VALUES ( 15835 , 2 , 21422 ) \[nativecode=1452 \** Cannot add or update a child row: a foreign key constraint fails (`my_civicrm`.`civicrm_membership`, CONSTRAINT `FK_civicrm_membership_membership_type_id` FOREIGN KEY (`membership_type_id`) REFERENCES `civicrm_membership_type` (`id`) ON DELETE CASCA)\]

Excerpt from backtrace:

```
#10 .../civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_membership (contact_id , status_id , owner_membership_id ...")
#11 .../civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
#12 .../civicrm/CRM/Member/BAO/Membership.php(102): CRM_Core_DAO->save()
#13 .../civicrm/CRM/Member/BAO/Membership.php(310): CRM_Member_BAO_Membership::add((Array:6), (Array:0))
#14 .../civicrm/CRM/Member/BAO/Membership.php(1941): CRM_Member_BAO_Membership::create((Array:6), (Array:0))
#15 .../civicrm/CRM/Dedupe/Merger.php(1655): CRM_Member_BAO_Membership::createRelatedMemberships((Array:4), Object(CRM_Member_DAO_Membership))
#16 .../civicrm/CRM/Dedupe/Merger.php(512): CRM_Dedupe_Merger::addMembershipToRealtedContacts(6428)
#17 .../civicrm/CRM/Dedupe/Merger.php(1349): CRM_Dedupe_Merger::moveContactBelongings("6428", "36044")
#18 .../civicrm/CRM/Dedupe/Merger.php(660): CRM_Dedupe_Merger::moveAllBelongings("6428", "36044", (Array:6))
#19 .../civicrm/CRM/Dedupe/Merger.php(596): CRM_Dedupe_Merger::merge((Array:75), (Array:3), "safe", TRUE, TRUE)
#20 .../civicrm/CRM/Contact/Page/DedupeFind.php(97): CRM_Dedupe_Merger::batchMerge("11", "48", "safe", TRUE, TRUE)
#21 .../civicrm/CRM/Core/Invoke.php(312): CRM_Contact_Page_DedupeFind->run((Array:3), NULL)

```

# Answer
We have had a similar problem - https://gist.githubusercontent.com/deepak-srivastava/e3a440023621cd4ecbde3904f9b27d2c/raw/7d2e854aa4ad7a8f00d87581dca729623d5ba687/bto-membership-by-relationship-error.log

Seems like method createRelatedMemberships(&$params, &$dao, $reset = FALSE) in loop sometimes resets $params. The while loop at the end of the function seems to be the cause. Don't see why anything from queue should reset it.

Have developed a patch - https://github.com/deepak-srivastava/civicrm-core/commit/96fba9b2533b45d9baaef8b0f7ea43bc85ae0ee9

Seems to be working so far. We 'll test it a bit more, and if ok submit a PR to core. Meanwhile would you be able to confirm if the patch works for you?
> 2 votes

---
Tags: civimember, duplicate-contacts
---


title: inner join using api3 chaining

text:
# Question
Title: inner join using api3 chaining
I am trying to use api3 to get all participants to an event of a certain type. In SQL I would use an inner join for this, using api chaining I do:

```
  $result = civicrm_api3('Participant', 'get', array(
  'sequential' => 1,
  'api.Event.get' => array('event_type_id' => $type_id),
));

```

However this results in all event participants, to every type of event, being returned. The ones who haven't participated in an event of the type get no events tacked to them. Is there a way in the API to filter these participants out?

# Answer
> 1 votes
Normally you could handle this with an API Join rather than an API Chain but unfortunately the Participant API is one of the four quirky entities that don't support this.

APIv4 is under heavy development right now, and one of the primary goals is to standardize these four entities to eliminate this limitation of APIv3. You may want to test APIv4 to see if it meets your needs yet.

---
Tags: api
---


title: Cloning a site in WPEngine

text:
# Question
Title: Cloning a site in WPEngine
I'm running CiviCRM on WPEngine. It works real fast and seems to be working well otherwise. No error logs occur on production side. The staging environment does not work, I get a 500 error when I try to access Civi there.

I also tried to clone the install and create a testing area but that also gives the same issue.

I am getting this error.

Does anyone know how this would be resolved? Thanks!

\[Thu Jul 27 14:02:29.745288 2017\] \[:error\] \[pid 26200\] \[client 88.87.189.26:25979\] PHP Fatal error: require\_once(): Failed opening required 'CRM/Core/ClassLoader.php' (include\_path='.:/nas/content/live/lpiacrm/wp-content/plugins/civicrm/civicrm/:/nas/content/live/lpiacrm/wp-content/plugins/civicrm/civicrm//packages:.:/usr/share/php') in /nas/content/live/lpiacrmtest/wp-content/uploads/civicrm/civicrm.settings.php on line 467, referer: https://lpiacrmtest.wpengine.com/wp-admin/

# Answer
> 1 votes
Your error message has a path with the word "live" in it (`/nas/content/live/etc`) which suggests that the `civicrm_root` value hasn't been changed on the test site.

`civicrm.settings.php` is the equivalent of `wp-config.php` \- you need a separate version of this file for your live and test sites. Please review your test site's `civicrm.settings.php` \- not just to fix the `civicrm_root` but also the database settings, base URL, etc.

---
Tags: wordpress, error
---


title: CiviCRM backup query

text:
# Question
Title: CiviCRM backup query
I want to make a weekly/fortnight backup of CiviCRM running on Wordpress. Two things I need to do:

1. Backup on same machine
2. Replicate the database on another machine.

Looking for simple steps to achieve both

OS : Windows , Separate databases for Wordpress and CiviCRM

# Answer
> 1 votes
This question is impossible to answer definitively without knowing more about, say, your operating system, whether you have command line access, whether your WP and Civi databases are separate or one, etc. I'll answer for what works for me.

On a Linux machine, I would use `backupninja` to first back up MySQL using `mysqldump`. My backupninja configurations are public.

Second, I configure a backupninja job using `rsync`, `rdiff-backup`, or `borgbackup` to back up the WordPress root (e.g. `/var/www/mysite`) along with the MySQL dump. All three of those utilities can back up either locally or remotely.

If you prefer shell scripts to backupninja, AGH Strategies posts their backup script on Github.

---
Tags: database, settings, backups
---


# Question
Title: Will recurring contributions be recorded for memberships not hosted by CiviCRM?
I'm in the process of moving our legacy memberships over to our new Civi install. We needed to get our membership drive going so we just used vanilla PayPal recurring donation buttons. I've set up Stripe on this new install since they offer $15k of free transactions.

I created membership types to correspond to what we had set up on PayPal. For example,

### Foo Membership

* Financial Type: Member Dues
* Minimum Fee: $5
* Auto-renew Option: Auto-renew Required
* Membership Type Duration Unit: 1 Month
* Membership Type Plan: Rolling

I've entered all the dues paying members with accurate start dates and even imported their dues history as a contribution import.

Will Civi keep recording contributions for these individuals even though the payments are all being done offsite? Or will I need to import/record them each month or get all the legacy members switched over to Stripe?

# Answer
> 4 votes
Civi will not record contributions for PayPal recurring contributions that aren't set up through CiviCRM.

Broadly speaking, there are two types of payment processors when it comes to recurring contributions - those that rely on webhooks and those that rely on tokens. Most webhook-based processors call the webhook the IPN ("Instant Payment Notification") address.

With IPN processors (like Stripe/PayPal), when you create a recurring donation, CiviCRM sends some info to the processor (amount, how often to charge, the CiviCRM contact ID, the recurring payment ID, etc.).

When the payments are processed on PayPal's end, the *processor* will push some data to a URL that Civi has set up explicitly for the purpose (the "IPN URL"). So Civi won't create payments until PayPal says, "Hey, we processed this and it succeeded or failed". PayPal relies on the info that Civi sent to PayPal when the payment was created to send data back to Civi - so non-Civi recurring donations won't work, because, e.g., PayPal doesn't know the contact ID to send in its IPN.

So one option is to record the payments manually each month. The other is to investigate whether you can shoehorn the Offline Recurring Payment extension to fit your needs. Note, however, that the extension isn't tested on modern versions of Civi and is for a slightly different use case - so unless you are (or have access to) a coder, this might not be a good choice.

---
Tags: civicontribute, civimember
---


# Question
Title: Issue with custom report that shows all users registered for event in last 2 years but not this year
I am using Drupal 7 and CiviCRM 4.6.28.

I am trying to create a report that will display all of the users who registered for an event in 2015 and 2016, but not yet in 2017. I have the report working to the point of displaying all who registered in 2015, 16, and 17. I am not sure how to go about removing those who have not registered in 2017. The idea I've been trying is to create an array of contact\_ids that are registered in 2017, and then use that array in the WHERE clause, to only select rows that do not contain that contact\_id. It is still displaying users who have registered in 2017, though.

I am running this query in the where() function in the report php file.

Here are the contents of the where() function:

```
$sql = "SELECT {$this->_aliases['civicrm_participant']}.contact_id,
{$this->_aliases['civicrm_participant']}.register_date
FROM civicrm_participant {$this->_aliases['civicrm_participant']}";

$dao = CRM_Core_DAO::executeQuery($sql);
$i = 0;
$registered = array();

while($dao->fetch()) {
    if (strpos($dao->civicrm_participant_register_date, '2017') !== false )
    {
        $registered[$i] = $dao->civicrm_participant_contact_id;
        $i++;
    }
 }

$this->_where = "WHERE ({$this->_aliases['civicrm_event']}.title = 'SF Open
Studios 2017'
OR {$this->_aliases['civicrm_event']}.title = 'SF Open Studios 2016'
OR {$this->_aliases['civicrm_event']}.title = 'SF Open Studios 2015')
AND {$this->_aliases['civicrm_participant']}.contact_id
NOT IN ( '" . implode($registered, "', '") . "' )";
}

```

# Answer
> 1 votes
I have accomplished similar results to what you are looking for by doing the following.

* I created a smart group for all those who have registered for the current event (2017)
* I then used the participant report filters to include all registrants from the previous events (2015 & 2016)
* I then added a filter to exclude any members of the smart group for the current event.

I do all this using the report filters on the standard participant report but you could probably apply similar filters to a custom report. I also use the current event registrant smart group to exclude folks who have already registered from promotional mailings. It comes in handy.

Hope this helps.

# Answer
> 0 votes
Another approach would be to use the excellent Summary Fields extension which gives you the "Date of the last attended event field", and you should then be able to use relative date filters to get what you required, or an include/exclude group.

# Answer
> 0 votes
An alternative solution might be to use Drupal Views instead of Report : Views provides easy filtering features.

---
Tags: php, reports, custom-reports
---


# Question
Title: angularjs: example from docs.civicrm.org does not work
I did the exact steps listed in `https://docs.civicrm.org/dev/en/latest/framework/angular/quickstart/` on my drupal7-civicrm4.6 installation. Calling the url `my_site.com/?q=civicrm/a/#/about/me` displays nothing.

Any ideas what the problem could be? It should not be about caching, as I executed `drush cc all` and cleared the cache from the CiviCRM GUI.

# Answer
> 1 votes
As I mentioned in the comments you should be sure to enable your extensions such as with `cv ext:enable <extension name>`

Check what warnings you're getting in the console. I was getting warnings about the injector but after clearing the cache (`drush cc civicrm`) and setting the right file permissions on the files in my extension these went away and I could view the page.

I was still getting errors about a missing CSS file, but I think this is a bug where these angular modules don't respect the variable extensions directory (my extensions are separate from the application files)

---
Tags: drupal
---


title: Thank-you Sent same as Recieved Date

text:
# Question
Title: Thank-you Sent same as Recieved Date
I'm hoping someone can help me with this issue I'm having. All contributions on the Dashboard and Find Contributions screen have the exact same date and time for the Received date and Thank-you Sent date. Attached is a screen shot. The top has a Thank-you Sent date of June 18th, 2017 12:00 AM and the second does not have a Thank-you Send date set. I am currently running the site on Amazon AWS Linux with Drupal 7.55 and CiviCRM version 4.7.20. I am getting the "missing indices on some tables" performance warning and try to Update them but it errors out in the logs.

How do you fix this? I looked at the CiviCRM demo and the same issue is happening. Is this a bug? or is it just me? This is a screenshot of the html on the Contribution Dashboard page, the second receive is suppose to be Thank you date.

# Answer
> 3 votes
There is an open issue related to your question https://issues.civicrm.org/jira/browse/CRM-20894. It also happens to me with a recent upgraded CiviCRM from 4.8 to 4.7.22 and it can also be replicated in dmaster.

**\[EDIT\]**

Seems it's already solved here https://issues.civicrm.org/jira/browse/CRM-20773

# Answer
> 2 votes
Scott, it sounds like 2 issues; the receipt date(s), and 'missing indices'. Did you/all send a 'thank you' email? The default setting is to reset the receipt date (checkbox). Re: the missing indices - for which tables? You can find how to see which ones are 'missing' by looking in another stack exchange item (How to find and/or fix missing indices?). The one for civicrm\_case\_contact is a bug - look in your database first, that table probably is set up correctly. Alternatively you can choose to 'hide'

---
Tags: civicontribute, civireport, core
---


title: Is it possible to copy a profile?

text:
# Question
Title: Is it possible to copy a profile?
I created a 'Membership Info' profile but now realise that, because I have diferent membership types with different qualifications, the information I need to collect will not be completely the same. Can I copy the existing profile and edit the copies to make a different version for each membership type? (Instead of recreating the whole thing from scratch each time).

# Answer
Yes you can copy a Profile: when on the screen that lists the profiles on your site -\> on the very right -\> click more -\> and select Copy Profile
> 1 votes

# Answer
It is possible to Copy Profiles for profiles that are used for Contacts (and possibly other entities). It is not currently possible to do this for Profiles using Membership fields.

I don't know why and thought I had asked one of the Fuzion team to take a look at this so it may be on a list to fix, or in JIRA, but not spotting it just now.
> 1 votes

---
Tags: custom-fields, profile, joomla
---


# Question
Title: Paypal IPN no longer updating contributions
Contributions that are made via Paypal are no longer being updated from pending to complete. This happened suddenly on multiple sites. Is anyone else experiencing this? I cannot find any errors in any logs. Any clue how to approach debugging this?

I am using CiviCRM 4.6.25 + Drupal 7.5x hosted by Pantheon

# Answer
I'm not using this system, but I may have an explanation. We use a custom coded donation system that expects PayPal to report back to us when there is a transaction. On 7/26/17, 7/27, and 7/29 so far there have been no such transactions, on 7/28 we only received too. The problem is confirmed to be a PayPal issue, and after fighting with them for 2 hours got a trouble ticket opened. Log into PayPal and check your activity, then go to IPN (Instant Payment Notification Logs): https://www.paypal.com/us/cgi-bin/webscr?cmd=\_display-ipns-history If there is a problem communication with your site, it will show transactions that failed. In my case, it clearly shows that PayPal is simply missing transaction entries under IPN that show up on the regular activity log.
> 1 votes

---
Tags: ipn
---


# Question
Title: Multi-client capability und data storage
One important question: Is your software solution able to deal with multi-clients, e.g. that data can be separated between different clients (companies) und security can be setup for this requirement? How is this requirement implemented in your software system? (Sites?)

And where is all your data being stored: in a database (e.g. Oracle)? und where is the database located? (Europe, States, .....)

Regrads, Jörg

# Answer
> 2 votes
A big difference between CiviCRM and proprietary SAAS offerings is that you decide where to host the system, hence your second question is not applicable.

In terms of the first question, this is possible via 'multi-site' or other ACL approaches, but the question back to you is 'why not just have separate civicrm instances for each client?'.

You can also achieve a nice multi-site outcome using the Related Permissions extension that Fuzion created.

---
Tags: database, acl, evaluating-civicrm
---


title: CiviCRM for animal rescue charity

text:
# Question
Title: CiviCRM for animal rescue charity
CiviCRM newbie here. I am interested in whether CiviCRM and Wordpress could be used to manage an Animal rescue and rehousing charity. In addition to tracking all the usual stuff like donations, events, volunteers, etc., they would need to manage:

* Details of each rescued Animal and all relevant details such as location (foster home or adopted home, kennels, etc.), medical info, statistics, etc.
* Lists of available foster homes
* Adoption applications

Ideally, a solution that could list available animals on Public Wordpress Website, from the backend.

Is CiviCRM something that could handle this scenario, without too much additional development?

Thank you.

# Answer
Look into CiviCase for planning and tracking each animal's adoption appointments, vet visits, groomings, etc.

CiviEvent has integrated location/venue components that might be useful in organizing your fostering and other volunteer activities.

CiviContribute would be my first choice in setting up adoption applications, complete with payment tracking and reporting.

Short answer, yes: it can be done with CiviCRM on a WordPress site. Might even find the BuddyPress plugin useful in tandem with Civi to energize social communication and networking among volunteers and related animal advocates.

Good luck Mark!
> 6 votes

# Answer
While it is not currently possible to create new top level contact types, alongside Individuals, Households and Organisations, there is nothing stopping you having a sub-type of eg Organisations that you call Animals, or sub-types of Individuals called Cat, Dog, etc (thx Coleman).

Having set up the sub-type you can then add Custom Fields to that, eg Animal type (cat, dog, alligator etc).

You can also add custom fields for eg Date Arrived, Date adopted, etc.

You can also create custom Relationship Types so eg Adopter is, Adopted by.

You can then use Profiles to display listings of Animails etc.

In terms of what WordPress offers, it has less options than Drupal, and there might be somethings that I or other drupal users would then say 'ah but you could do that more easily with drupal'. But if that becomes a significant issue for you then you can have Drupal in front of CiviCRM, and theme it to match your WP site, but that is undoubtedly adding extra effort.
> 5 votes

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


# Question
Title: Unable to delete Price Field from Price Set used for Contributions
Initially I had a warning that the Price Set was in use, with a useful link to the page in question.

I then removed the Price Set from the Contribution page in question, but I am now getting the same message ie

> Unable to delete the 'xxx' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration.

# Answer
> 4 votes
Price sets relating to any **contribution record**(apart from contribution pages) also need to be deleted before removing any fields from the priceset.

Since Contribution need this field information to show them on viewing those contribution record, it doesn't let us to delete the fields or pricesets related to them.

To know what contribution or membership record are related to pricesets - execute this query -

```
SELECT DISTINCT cli.entity_table, cli.entity_id
FROM      civicrm_line_item cli
LEFT JOIN civicrm_price_field cpf ON cli.price_field_id = cpf.id
WHERE     cpf.price_set_id = <your_price_set_id>

```

---
Tags: price-sets
---


# Question
Title: Different Result in Code Than API Explorer
I am trying to get data out of the API and when I look at it in API explorer I find what I am looking for but the data is incomplete in my module.

For example, I am using civicrm\_post($op, $objectName, $objectId, &$objectRef) and I know this is working because I have if ($objectName != "Case" || $op != "create") and my code in the if is firing.

```
    civicrm_initialize();
$result = civicrm_api3('Case', 'get', array(
          'sequential' => 1,
          'id' => $objectId,
          ));

```

Here is the result from the API call in my module:

```
Array

```

( \[is\_error\] =\> 0 \[version\] =\> 3 \[count\] =\> 1 \[id\] =\> 352 \[values\] =\> Array ( \[0\] =\> Array ( \[id\] =\> 352 \[case\_type\_id\] =\> 5 \[subject\] =\> Test Case Subject \[start\_date\] =\> 2017-07-24 \[status\_id\] =\> 4 \[is\_deleted\] =\> 0 \[contact\_id\] =\> Array ( )

```
                [client_id] => Array
                    (
                    )

                [contacts] => Array
                    (
                    )

                [activities] => Array
                    (
                    )

            )

    )

```

)

Here is the result from the API Explorer:

```
{

"is_error": 0,
"version": 3,
"count": 1,
"id": 352,
"values": [
    {
        "id": "352",
        "case_type_id": "5",
        "subject": "Test Case Subject",
        "start_date": "2017-07-24",
        "status_id": "4",
        "is_deleted": "0",
        "custom_70": "IL",
        "custom_72": "Peoria County",
        "custom_76": "1",
        "custom_78": "2",
        "custom_92": "Farmers",
        "custom_100": "1500943386-26151211",
        "custom_95": "Test",
        "custom_96": [
            "1"
        ],
        "custom_97": [
            "1"
        ],
        "custom_98": [
            "1"
        ],
        "custom_99": [
            "1"
        ],
        "contact_id": {
            "1": "9025"
        },
        "client_id": {
            "1": "9025"
        },
        "contacts": [
            {
                "contact_id": "9025",
                "sort_name": "Applications , Test",
                "display_name": "Test Applications",
                "email": "test@aplications.com",
                "phone": "",
                "birth_date": "1919-04-04",
                "role": "Client"
            }
        ],
        "activities": [
            "21781",
            "21782"
        ]
    }
]

```

}

Any help is appreciated.

Thanks, Josh

# Answer
At the point hook\_post is called the timeline (activities) hasn't been created and the association with the client (CaseContact object) hasn't either.

See https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/Form/Case.php and https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/Form/Activity/OpenCase.php
> 2 votes

# Answer
So that is it clear for others in the future ErikH has the answer above in the comments.

That is the reason I asked if it was at exactly the same point in the process :-) The Case transaction is completed right at the end and before that most stuff is not in the database yet! Cost me quite a bit of headache in the past.....:-) – ErikH - CiviCooP Jul 26 at 6:36
> 1 votes

---
Tags: api, civicase
---


title: creating scheduled api using civix

text:
# Question
Title: creating scheduled api using civix
I am using civix to create a scheduled task with

```
civix generate:api --schedule Daily chiroContact assignAnimatorCourseResponsibleLabel

```

The files get created correctly, and the new api possibility is shown in the api explorer, however when I try and test it the result is

```
    {

"error_code": "not-found",
"entity": "ChiroContact",
"action": "assignanimatorcourseresponsiblelabel",
"is_error": 1,
"error_message": "API (ChiroContact, assignanimatorcourseresponsiblelabel) does not exist (join the API team and implement it!)"

```

}

The sheduled task also doesn appear in the list of sheduled tasks in the system settings. Am I doing something wrong in creating this task?

# Answer
> 1 votes
I think your action is way too long and possibly separated into a few words in your function name? Can you check?

---
Tags: scheduled-job, civix
---


# Question
Title: Why does the civicrm upgrade stop after each step of the upgrade eg at 4.7.19 then again at 4.7.20
Not used to seeing this but one site just stopped at each step of the journey.

# Answer
> 3 votes
As per the code, retry and skip seems to be shown with the value set for debug. Note `Enable Debugging` if it is turned on/off on `Administer-> System Settings -> Debugging and Error Handling`.

Need to confirm this on another upgrade I do, but for now, it seems retry and skip would show up if debugging is enabled and the upgrade would progress only after Retry button is clicked. So for continuous upgrade, one should have `debug` set to `No`?

---
Tags: upgrade
---


# Question
Title: Contributions for Membership completed, but Membership remains as Pending
A client has found that a number of memberships are still set to Pending even though the Payment is complete. Payments were made online. Membership is not in Override.

Client does have a multisite but this has been in place for a long time, and these issues are sporadic.

Here are some entries from db

https://gist.github.com/petednz/7151675e9b1d7715a163

# Answer
I encountered the same issue on my CiviCRM installation. This is related to contributions status name which changed after being translated (in French at least), which prevented CiviCRM from finding the right membership status (the `Completed` status was translated to `Complété` which wasn’t correctly tested in this code).

A bug was reported to the developers by Sunil Pawar (CRM-20881), and a patch that solves this issue was submitted on GitHub.

This patch wasn’t included in the core repository yet, but in my case, the patch works fine.

Olivier;
> 1 votes

---
Tags: civicontribute, civimember, pending
---


title: Membership Page - Contributions page

text:
# Question
Title: Membership Page - Contributions page
I am currently attempting to make a membership page. I keep getting this pop-up "you need to enable Separate Membership Payment when online contribution page is configured for bo- Membership y Recurring Contribution" when attempting to check off the different membership types offered. How do I fix this?

Thank You,

# Answer
It pretty much means what it says and you should see a checkbox on the Membership tab to enable this.

Or it may mean that you are trying to offer 'auto renew' for Memberships but are incorrectly trying to achieve this via 'recurring contribution'.

I can't tell without know what your requirements are.
> 1 votes

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


# Question
Title: CiviBuild - wp-demo install error with postdrop
I am trying to use civibuild for installing a wp-demo instance on my local machine. I am using XAMPP on macOS Sierra.

The download successfully completed:

`civibuild download "civiwpbuild" --civi-ver "master" --type "wp-demo"`

But while running install:

`civibuild install "civiwpbuild" --url "http://localhost:4000" --admin-pass "XXXXXXXXXX"`

It gets stuck with:

`postdrop: warning: mail_queue_enter: create file maildrop/29895.24374: No such file or directory`

Any suggestion please.

# Answer
> 1 votes
Just found the fix that my `postfix` was not running.

I had to do a `sudo postfix start` which resulted in a number of warnings with final output

`postfix/postfix-script: starting the Postfix mail system`

After this I retried running the civibuild install

`civibuild install "civiwpbuild" --url "http://localhost:4000" --admin-pass "XXXXXXXXXX"`

and it worked.

More details on postdrop: http://www.postfix.org/postdrop.1.html

---
Tags: civibuild
---


title: Can I change Event Types in bulk?

text:
# Question
Title: Can I change Event Types in bulk?
Can I batch change more than one event type at once? I want them all to be the new, same type. Do I have to go into each event configuration separately to change the event type?

# Answer
If the events are all part of a repeating event series, then you should be able to change them by changing one, and selecting the option to change all related events.

Otherwise, I'm afraid there's no built-in way to bulk change event types. If you know what you're doing with the API Explorer or MySQL, you can bulk change the event type on the back end - there's no real harm unless you have custom fields tied to the old event type, in which case they might show up unexpectedly on a report.
> 2 votes

# Answer
I've found the CSV import from the Fuzion team very helpful: https://github.com/eileenmcnaughton/nz.co.fuzion.csvimport/blob/master/README.

At least this allows you to import events... I've not actually used it to bulk change a field in existing events, but I 'think' it might be possible.

You would need to export the events in question, and in Drupal I use Views to do that. From that export you can make a csv with the correct field(s) and data, and on import create a field map to put the new data into the correct place.
> 0 votes

---
Tags: civievent, batches
---


# Question
Title: Where in the database is the Date Added for Group records?
I'm trying to help a friend. A slew of his contact records got added to groups that they don't belong in. It happened on July 19th. I thought the civicrm\_group\_contact table would have a timestamp column, but I don't see one. Where is this Date Added stored (see below)? Is there a way to select these group records and delete them? Thanks...

# Answer
That information is contained in the table civicrm\_subscription\_history

To remove them from those regular groups you would need to remove them from both the civicrm\_subscription\_history table and the civicrm\_group\_contact table

Seamus
> 3 votes

---
Tags: groups
---


# Question
Title: Recommended way to deal with delete action in a page?
When developing extensions I have always followed this path when I had a page listing stuff (for example books) and an action link to delete the book:

1. Create the page and add a link to the form `CRM_Utils_System::url(/ "civicrm/myext/form/myform", "action=delete&reset=1", TRUE)`
2. In the form, pick up the delete action in the preProcess method like so:

`if ($this->_action == CRM_Core_ACTION::DELETE) {
//do my stuff
$url = CRM_Utils_System::url("civicrm/myext/page/mypage", "reset=1", TRUE);
CRM_Utils_System::redirect($url);
}`

I understood that I should not use the CRM\_Util\_System::redirect() but should use the `CRM_Core_Session::singleton->pushUserContext($url)` instead. But what is then the recommended way to ignore the rest of my form processing so that the controller returns to the userContext (being my page)?

# Answer
**The way I did it**

In my most recent extension with a fair amount of CRUD happening via the UI, I used a different form at a specific URL (civicrm/sms/conversation/confirmdelete) for deleting. This gave the user the chance to see what they were deleting and confirm it.

I then set the context in preProcess of that form, deleted the entity in postProcess, and let the controller handle redirection.

```
$this->context = CRM_Utils_System::url('civicrm/sms/conversation/view', "id={$this->conversationId}");
$this->controller->_destination = $this->context;
$session->pushUserContext($this->context);

```

IIRC, it was setting `$this->controller->_destination = $this->context;` that enabled the magic to happen in postProcess, and mean that I didn't have to add any calls to `CRM_Utils_System::redirect()`.

FWIW I generalised this form to allow it to delete any of the entities that my extension was creating.

See the form here: https://github.com/3sd/civicrm-sms-conversation/blob/master/CRM/SmsConversation/Form/ConfirmDelete.php

**Is this the CiviCRM way?**

Since I wasn't sure how 'CiviCRM' this method was, I just had a quick look at how we handle deleting *contacts* and *membership types*.

***Contacts***

For contacts, the URLs look as follows: civicrm/contact/view/delete?&reset=1&delete=1&cid=2 which maps to CRM\_Contact\_Form\_Task\_Delete, i.e. a special form, just for deleting contacts, which (although I haven't looked in details) seems to be a bit like what I did.

***Membership types***

civicrm/admin/member/membershipType/add?action=delete&id=1 maps to CRM\_Member\_Form\_MembershipType. Looking at the class and its associated template

**preProcess** sets an appropriate context (this is where you would put your URL to your 'page listing stuff', I think).

```
$url = CRM_Utils_System::url('civicrm/admin/member/membershipType', 'reset=1');
$session->pushUserContext($url);

```

It also assigns the action to the template

```
$this->assign('action', $this->_action);

```

**buildForm** checks to see if this is a delete action, and if so, just returns, since it doesn't need to add any form elements

```
if ($this->_action & CRM_Core_Action::DELETE) {
  return;
}

```

**postProcess** does a similar check

```
public function postProcess() {
  if ($this->_action & CRM_Core_Action::DELETE) {
    try {
      CRM_Member_BAO_MembershipType::del($this->_id);
    }
...

```

And the template has a similar if else

```
{if $action eq 8}
  <div class="messages status no-popup">
    {ts}WARNING: Deleting this option will result in the loss of all membership records of this type.{/ts} {ts}This may mean the loss of a substantial amount of data, and the action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
  </div>
  <div> {include file="CRM/common/formButtons.tpl"}</div>
{else}

```

**So what is the right way?**

No comment :) You decide.
> 3 votes

---
Tags: extension, developer, forms, redirect
---


title: “MySQL support not included in PHP”

text:
# Question
Title: “MySQL support not included in PHP”
I have drupal running perfectly; with mysql support. But CiviCRM still giving me this error - “MySQL support not included in PHP.”

My PHP version is 5.6.31, as indicated in the screenshot below.

# Answer
> 3 votes
Your drupal may be using a different mysql driver. CiviCRM recently migrated to requiring mysqli. See https://civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli for more details.

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


title: Embed Contribution Page Error

text:
# Question
Title: Embed Contribution Page Error
D7.56 Civi4.7.22

I'm attempting to embed the bulk of a contribution page inside a block shown in a view. The view shows multiple of these blocks.

I copied them by using inspect to get the HTML underneath.

This works fine at first, however intermittently I experience the following error when clicking the button:

"Your browser session has expired and we are unable to complete your form submission. We have returned you to the initial step so you can complete and resubmit the form. If you experience continued difficulties, please contact us for assistance."

How can I circumvent this? I suppose that the HTML needs to be regenerated, not copy and pasted. How can I do this?

# Answer
> 2 votes
John

My immediate thinking is that you will probably need to do some form of iframing on the block. The reason for that is that i don't think i can think of a way to have proper session keys and static html copied across. The session key is generated when the first step of the form is loaded. You may also need to look at a drupal module like themekey if you need to switch themes to make the iframe look nicer in the block

Seamus

---
Tags: contributions
---


# Question
Title: Adding validation: cannot use $this in formRule() of Form
I am using CiviCRM 4.7.22 with Drupal 7 on Windows. I have a basic question. In the `formRule()` function inside the `MembershipRenewal.php` containing Membership Renewal Form if I use $this as below

```
$this->assign('endDate', CRM_Utils_Date::customFormat(CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_id, 'end_date')));

```

I get a PHP error:

```
PHP Fatal error: Using $this when not in object context in ...\MembershipRenewal.php on line xxx

```

Although this code works in `preProcess()` and `buildQuickForm()` without any issues. If its part of the same class then why the issue.

What is the alternative for me get the value of `end_date` or `join_date` in `formRule()` to perform some validition. In general, how do I get any value which is NOT part of a form in `formRule()`.

# Answer
> 2 votes
If you take a look at the `formRule()` method, you will notice that it is static:

```
public static function formRule($params) {
...

```

When methods are invoked statically, you don't have access to $this. There is a similar construct to `$this->`, which is `self::` (see http://php.net/manual/en/language.oop5.static.php) for more info, but I don't think it will help in your case as assign is expecting a form object to work with.

If you want to add validation to a form, you probably want to use the `addRules()` method. You can define a custom function (callback) that will accept the values submitted into the form and expects you to return an array of errors.

```
/**
* If your form requires special validation, add one or more callbacks here
*/
function addRules() {
  $this->addFormRule(array('CRM_Example_Form', 'myRules'));
}
/**
* Here's our custom validation callback
*/
static function myRules($values) {
  $errors = array();
  if ($values['foo'] != 'abc') {
    $errors['foo'] = ts('You entered the wrong text!');
  }
  return empty($errors) ? TRUE : $errors;
}

```

see https://wiki.civicrm.org/confluence/display/CRMDOC/QuickForm+Reference for more details.

Another method I have used is

```
public function validate() {
  $this->setElementError(); // <-- more details here...
  return parent::validate();
}

```

See https://pear.php.net/manual/en/package.html.html-quickform.html-quickform.setelementerror.php for more info, though I think the above method is a little off piste.

Though having said that, the correct method really depends on why you are modifying the MembershipRenewal.php form.

If you are ***making a modification for your local site***, you should really create an extension and use the https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_validateForm/ hook.

If you are looking to make ***a more generic improvement and submit it to core***, then the approach described above is the way to go, but you'll want to discuss your planned modifications with others before doing too much work somewhere like https://chat.civicrm.org/civicrm/channels/dev.

# Answer
> 0 votes
First of all, I get the idea that you are actually modifying CiviCRM core code in your installation? If so, I would sincerely advise you NOT to do this but create an extension to customize what you need.

AFAIK formRule will be a static function, so will indeed not recognize your `$this`.

---
Tags: civimember, forms, quickform
---


# Question
Title: Testing new site (not secure yet); using Search/Contact switches to secure url
Working on a new install (haven't installed CA certified SSL yet), I can browse to http://example...admin...event search ( search participants) or 'advanced search', or 'manage events', or seemingly any other menu items but going to 'search contacts' the url generated has ' search' It is a WP frontend and the baseUrl doesn't specify httpS:// yet.

# Answer
> 1 votes
Three things to try, in this order:

* **Administer menu » System Settings » Resource URLs**. Ensure "Force Secure URLs" is set to "No".
* Clear cache and templates\_c.
* Rebuild the menu: `http://<wordpress_site>/wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1`

---
Tags: wordpress, ssl, civicrm-contact
---


title: CiviCRM membership component

text:
# Question
Title: CiviCRM membership component
I need to develop an extension to extend the CiviCRM membership component so that when a membership is created or renewed a record for the membership “period” is recorded.
The membership period should be connected to a contribution record if a payment is taken for this membership or renewal.
i.e. If a membership commenced on 1 Jan 2014 and each term was 12 months in length, by 1 Jan 2016 the member would be renewing for their 3rd term. The terms would be:

Term/Period 1: 1 Jan 2014 - 31 Dec 2015
Term/Period 2: 1 Jan 2015 - 31 Dec 2016
Term/Period 3: 1 Jan 2016 - 31 Dec 2017

Currently, when a membership is renewed in CiviCRM the “end date” field on the membership itself is extended by the length of the membership as defined in CiviCRM membership type configuration but no record of the actual length of any one period or term is recorded. As such it is not possible to see how many “terms” or “periods” of membership a contact may have had.

Appreciate the help, please. Thank you.

# Answer
This functionality already exists in CiviCRM; however, by default it isn't exposed to the UI. Look in the database at `civicrm_membership_log`.

The main difference between what you're describing and what exists is that the contribution isn't tied directly to the `civicrm_membership_log` record. Instead of an extension, you may want to extend `civicrm_membership_payment` to include a foreign key to the appropriate `civicrm_membership_log` entry.

Alternatively, you can most likely write an extension to correlate contributions and membership periods in the log by date for display in the UI.
> 5 votes

# Answer
Please check this one:

https://civicrm.org/extensions/membership-periods

If you would like to create one, you can use this

https://github.com/devarun/org.civicrm.memberrenewallog

I worked earlier on this but it was not complete, you will need to check everything to start working.

CiviCRM Extensions Developers Guide:

https://docs.civicrm.org/dev/en/master/extensions/civix/
> 4 votes

---
Tags: civimember, extension
---


# Question
Title: My Summary Overlays are bad after upgrading to 4.7
On two separate sites that were upgraded to 4.7, the "Summary Overlay" function seems to have been uglified.

Specifically - in the past, when hovering over the person icon on the left of many contact listings, you would get a nice little black-background pop-up with additional information about the contact.

Now, those popups are filled with what appears to be a collection of many profiles.

There is a reserved Summary Overlay profile, that I would assume is the only one that should display here.

On a new 4.7 install, I am not seeing this issue.

Am I missing some undocumented configuration, or is this a bug?

# Answer
The issue appears to have been caused by some sql that was posted as a solution to a different problem, here https://civicrm.stackexchange.com/a/18547/233.

If you also ran the bad sql, you can fix it by running the sql command:

```
update civicrm_uf_group set name = 'summary_overlay' where name LIKE 'summary_overlay_%';

```

Specifically, the bug arises because that overlay is generated from a snippet with what should be the summary\_overlay profile, but because the name was altered, the overlay is using all available profiles.
> 4 votes

---
Tags: contacts, profile, ui
---


title: Profiles broken after update to 4.7.22?

text:
# Question
Title: Profiles broken after update to 4.7.22?
I have a drupal 7 site and I updated to civicrm 4.7.22 yesterday and today, I cannot add more than six fields to any profile. I've tried everything...adding fields to profiles already in use, adding fields to new profiles ... Nothing works. Error message is "Field not added. The selected field already exists in this profile."

But it doesn't.

It always starts with that error after six fields are entered.

Additionally, during preview, all the fields are scrambled out of order and at least one is always missing.

Anyone else having this issue?

Missy

Edit to add: I just got the same behavior on the demo site at civicrm ... I feel better, but it's not helping me get my work done. HELP

# Answer
> 1 votes
I just tried this on dmaster.demo.civicrm.org

http://dmaster.demo.civicrm.org/civicrm/admin/uf/group/field?reset=1&new=1&gid=17&action=browse

This profile now has more than 6 fields

---
Tags: custom-fields, profile
---


# Question
Title: Change billing date of recurring contribution (PayPal payment processor)
Is it possible to change the billing date for someone's recurring contribution (e.g. monthly donation)?

We're using CiviCRM 4.7 and Joomla 3.7 (if that matters) and the PayPal payment processor. Thought we could ask PayPal to change that but the answer was no.

Thanks much for any pointers.

# Answer
> 1 votes
Short answer: no, so long as you're using PayPal.

Recurring contributions come in two flavours, depending on your payment processor: token-based with the amount and schedule controlled by CiviCRM, or payment processor controlled. Some payment processors will allow either method.

PayPal is only controlled by the processor, so contrary to what you got as an answer, the only way to change the billing date is via PayPal. But if they tell you you can't, then you can't. In general, PayPal is very donor/customer oriented and it tends to put all the power into the hands of the donor/customer, not you the merchant/organization. So it's not usually the best option for large organizations that are used to managing the recurring contributions themselves. You can check out other options here:

https://wiki.civicrm.org/confluence/display/CRMDOC/Payment+Processors

Note that even if you're using a payment-processsor-controlled recurring schedule, there may be an API that lets you change the schedule indirectly via CiviCRM.

---
Tags: civicontribute, payment-processor, recurring-contributions
---


# Question
Title: webform membership : duplicate transaction & receipts and/or submissions
We process membership registration/renewal using several civicrm webforms, and at random, clients will be charged twice (so transactions will be processed twice); receipts will be sent twice, and/or there may be a duplicate webform submission. So both errors happen - about 90% goes well, but from my examples

* 2 registrations have 1 submission with 2 receipts
* 2 registrations have 2 submissions with 1 receipt
* 10 registrations have 2 submissions and 2 receipts ('doubleclick')
* 1 registration has 2 submissions and 3 receipts

I see no pattern. I can't find log messages about this.

It seems to happen with all those forms; on each form, the membership type is selected in the civicrm tab of the webform; the membership fee in the membership subtab is unchecked; the contribution amount om the contribution subtab is unchecked. The underlying payment pages have no amounts configured. So civicrm\_webform should get the amount from the membership type definition in CiviCRM (right ? looks that way).

They are all multistep forms, with the payment section at the end. I'm not caching results between steps, because that can break the payment sections javascript on reload.

We've been going through some updates, and I don't know when this started. Right now the box is shiny and uptodate.

It seems like a timing issue; or forked threads going wild, like communication with the mailserver or payment api. Can that be ?

# Answer
My first thought is (similar to what Pete's suggesting) to try: https://www.drupal.org/project/hide\_submit
> 3 votes

---
Tags: drupal, civimember, webform-civicrm, 4.7
---


# Question
Title: Filtering activities by Source Contact ID
I want to search for people who have an activity created by a specific person. Search Builder lists the 'Source Contact ID' field but doesn't populate the information nor filter things appropriately. Advanced Search produces similar results. Is there a way to find this group of contacts based on activity and who created the activity?

# Answer
Search Builder seems to be broken for this functionality, you may report that as an issue in the issue tracker: https://issues.civicrm.org/.

My understanding is that you want to search within the backend of CiviCRM? Using the API is currently probably the cleanest way of performing the search and adding them at once by using the Activity.get and chaining it with GroupContact.create:

> cv api Activity.get sequential=1 return="target\_contact\_id" source\_contact\_id=11 target\_contact\_id={"IS NOT NULL":1} options={"limit":0} api.GroupContact.create={"group\_id":"5","contact\_id":"$value.target\_contact\_id"}

Alternatively you can use the advanced search and search for all activities that have your desired contact as "Added by" and display results as Activity. You can then tag all those activities with a temporary tag that can be used for activities. In a second advanced search you can search for contacts that have an activity "With" and the temporary tag and add those contacts to a group.

There is also the activity detail report that will let you filter those contacts the easiest way, but I cant see how to get those contacts into a group.
> 2 votes

# Answer
For Drupal users you can build a View that will deliver that information but won't then provide the Actions options available through Search in CiviCRM (though some actions via VBO are possible)

Without knowing the OP's CMS this answer may not be helpful to them but may be an answer for others looking at this issue who are using Drupal
> 0 votes

---
Tags: search-results, search-builder
---


title: How Smart Groups Work

text:
# Question
Title: How Smart Groups Work
What updates a smart group? Is it all based on the cron/scheduled job that runs updating the group members based on specific criteria?

Additionally are hidden smart groups updated when the cron/schedule job runs or are hidden smart groups not included when smart groups are updated?

# Answer
> 6 votes
Smart groups are kind of complicated. If you've got a small install, using the defaults will generally just work, i.e. there will be temporary caching that gets refreshed when necessary.

To answer your first question though, smart groups are updated depending on the timeout configuration and/or the scheduled job, and also depending on urls being loaded.

To answer your second question - if you mean disabled instead of hidden, then the answer is that I don't think they are ever updated. But if you mean when you're looking at the groups of an individual contact - then the smart groups are only calculated when you open the section of the page that displays them.

In other words, there are quite a few clever ways that CiviCRM tries to cache smart group results to avoid long re-calculations.

If you've got performance issues, especially with a larger install, then you'll want to think about the configuration under the Administer -\> Customize Data and Screens -\> Search settings. In there you can set a different default timeout for the smart group cache so that your site isn't constantly recalculating smart groups. You can also set this to a very large number and then use the system job to selectively regenerate the cache as appropriate for each smart group.

BUT, this gets tricky and is often counter-intuitive about the results, you'll find quite a few discussions about optimal settings for this.

The best advice (yes, not your question) is that if you're having issues, e.g. with slowness due to caches being rebuilt, then the first thing to do is to get rid of unused smart groups. A couple of smart groups that include all your contacts (e.g. all individuals) can really take a long time to regenerate for a large number of contacts.

# Answer
> 1 votes
This is not a specific answer to your questions but an option for larger smart groups to improve performance is to use the CiviRules extension to manage group memberships. So when a certain activity happens a contact is added or removed from a standard group.

---
Tags: smartgroups, cron
---


# Question
Title: Security Warning on Dashboard (pantheon / nginx)
Getting Security warning everytime I log into civicrm that my log directory is downloadable. I checked and it is completely viewable on my browser. I realize that there is a solution for nginx enviroments however I am running my site on pantheon and do not have access to any nginx configs. Is there something I can do civi-side to fix this?

# Answer
Pantheon does not support .htaccess files nor custom location directives, which are the common approaches to protecting those files from access on Apache / Nginx.

However, moving your CiviCRM file directories from `sites/default/files/civicrm` to `sites/default/private/civicrm` should resolve this, because Pantheon protects that location out of the box.

See Drupal.org #2195947 - Security warning from Civi re exposed "files" directory for how this is addressed in CiviCRM StarterKit.

You will need to end up with something like this in your civicrm.settings.php, the linked issue above gives the required context needed to ensure `$pantheon_conf` contains appropriate values.

```
  global $civicrm_setting;
  $civicrm_setting['Directory Preferences']['uploadDir'] = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/upload/';
  $civicrm_setting['Directory Preferences']['customFileUploadDir'] = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/custom/';
  $civicrm_setting['Directory Preferences']['imageUploadDir'] = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/persist/contribute/';
  $civicrm_setting['Directory Preferences']['extensionsDir'] = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/all/extensions/';
  $civicrm_setting['URL Preferences']['extensionsURL'] = $base_url . '/sites/all/extensions';

```

See also the relevant CiviCRM security advisory, CIVI-SA-2014-001 Risk of information disclosure. Moving the restricted files outside the webroot entirely would be the ideal solution if/when CiviCRM supports that.
> 5 votes

# Answer
Thanks @Chris Burgess! I went with your recommendation and pushed the edited civi settings file up to pantheon but still got the same warnings. I then went into administer\>system settings\>directory and noticed that the settings where still pointing to the public files. I then sftp'd into sites/default/private and manually created the same directory names that civi was using in the public files. Then in the GUI I added private/ after files/ for all the upload directories.

Since the code didn't do the trick I reverted to prior settings and everything still works. I'm not getting the security warnings anymore.

UPDATE: After @Chris Burgess comment below, we went ahead and added his code mentioned in his answer in civicrm.settings.php. We had to replace the last line with : $civicrm\_setting\['URL Preferences'\]\['userFrameworkResourceURL'\] = $base\_url . '/sites/all/extensions';

Everything looks good now
> 2 votes

# Answer
Pantheon allows you to protect (a limited number of) webpaths, using a pantheon.yml file.

```
protected_web_paths:
  - /example_directory

```

(https://pantheon.io/docs/pantheon-yml/#protected-web-paths)

It is, in effect, a nginx deny.
> 2 votes

---
Tags: security, pantheon
---


# Question
Title: Membership Signup Form - add "Phone Number" field (required)
For this membership signup page:

https://connectionpractice.org/membership/

I want to add "Phone Number" as a required field for people signing up for a membership.

I can't find where I can configure the fields for the payment section.

I tried going to **Contributions \> Manage Contribution Pages**

I do find this page there, and I was hoping to find a tab where I could configure these fields, but I don't see anything like that.

Have also gone to **Administer \> CiviMember** but didn't find anything relevant there.

The payment gateway is Click & Pledge. I also looked at this item there, but don't see a place to configure these fields there either.

WordPress 4.8.1

CiviCRM 4.7.21

Any hints will be most appreciated!

# Answer
> 1 votes
In general, to add a new field, you would create a Custom Field in a Custom Data Set (civicrm/admin/custom/group?reset=1) and then add it to whatever Profile (/civicrm/admin/uf/group?reset=1) you're using for your page (which you'll find by editing the appropriate Contribution Page and looking for the profiles that are included). You can make the field mandatory in the profile.

The Phone Number field is part of Civi's Core functionality, so you just need to add it to the Profile. (Note: it's associated with Contact records).

There's already a lot of good documentation on this. You might want to start here: https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/

Good luck!

# Answer
> 2 votes
To add to Rowan's answer, go to Administer\>Customize data and Screens\>Profiles and choose the profile that is being used in your Contribution Page. On the right hand side of that screen you will see a button called "Fields". On clicking that button you will be taken to a page called Profile Fields where there is another button called "Add Field". Select the type of CiviCRM record and the field you want to include in this Profile ("Phone" is an option under "Contacts" and you can make it required).

Voila! Hope it helps.

---
Tags: wordpress, civimember, forms
---


# Question
Title: Conference Registration with Housing Requirements
I am looking for a way to run registration for a conference next summer. In addition to meetings, interest groups and general sign-up, I need to be able to assign housing and coordinate special needs.

The group that I am working with has/had a registration program that broke. It was proprietary and apparently not fixable. I need to show them a program that works, will be long lasting, and not too expensive. Mainly I am looking for help to setup the program and occasional ongoing support when problems occur.

CiviCRM seems like a good choice, but I am just starting to read through the documentation and try it out. While it mostly makes sense, I know that I need a really simple demo to convince others to use this software.

Thanks for any suggestions and pointers to simple examples.

# Answer
Just wanted to share how a volunteer Admin for one of our projects is handling assets - e.g. Table assignments for Events; Room assignments for Camp; Equipment etc.

Warning: must be abstract thinker - and you'll never look at Tables the same :-)

Let's look at Table assignments for Events - as I have the site open and can pull in some screenshots - to Demo for you how this could work:

**Contact Types**

CiviCRM will let you create Contact sub-types -\> Event Table is a Contact sub-type -\> it's a banquet table;

**Relationships**

CiviCRM will let you define custom Relationship Types between Contacts - so you can define an Has Guest and Is Guest relationship (between Tables and Individuals)

**Table View**

There are three people sitting at this Table at the moment; As you can see we're using yet another relationship to identify that 'Regular' Table host (for a monthly recurring Event).

**Webform CiviCRM**

Since you're on Drupal you can add-on Webform CiviCRM - this is maintained by one of CiviCRM's Core Team members @coleman - with that we can now: a) Email the Regular Table host of the next upcoming Event b) Regular Table host already has a relationship with a Table (we configure webform\_civicrm to automatically load it) c) We also configure webform\_civicrm to also also load the Contacts with whom the Regular Table host has a (normally sits at my table) relationship d) And b/c it's an Event we also want to know if they actually will attend the next Event -\> so we configure webform\_civicrm to also offer the option of Event Registration -\> RSVP

**Table Management**

If we want to move Mark -\> to another Table -\> we simply -\> in his Relationship Tab; divorce/delete his relationship with Table 99 and add a new relationship with another Table:

**Housing / Room bookings - can be done just the same**

* create a webform\_civicrm where Contacts register: Contact, Family Members, Relationships -\> and user-select a Relationship option -\> to indicate their preferred Housing (shared, individual, family e.g.)
* add payment to the form if this is a paid registration (or deposit); with token based payment processors you can get Card on File ability (make it a recurring series with two installments; charge deposit now; adjust date and $amount if needed and automatically charge the card for second payment later);
* in CiviCRM - you'll be able to move Contact from having a relationship of type "individual" -\> with a Room called "Individual" -\> to having a relationship of type "individual" with Room called "Individual 04" - just as an example.
* What we can't do just yet - is have a maximum number of Relationships. So right now we occasionally get too many guests at a Table! That still requires eyes from an Admin. It will take some code to add that maximum number of Relationships - I may be able to get into that at some point.
* But everything I've shown here (above) is all out of the Box - if you can manage to wrap your head around Relationships to Tables and Rooms;
> 6 votes

# Answer
The questions about "assign housing and coordinate special needs" would really need more specific requirements to be able to provide a substantive answer.

If 'assign housing' means something like, "provide fields so people can indicate whether they want single rooms, shared rooms, or specify other attendees that they want to share with" then yes I can think of ways of doing this through 'native civi' using Custom Fields on the registration form, or via Drupal's webform\_civicrm with additional forms for people to specify their needs including providing names of other registrants, that could if required create Relationships between them of eg 'roomie'.

In other words, CiviCRM 'can' handle more complex requirements but the effort/expertise to deliver increases.

Additional requirements maybe able to be met with the CiviBooking extension
> 4 votes

# Answer
CiviCRM would be able to accommodate your needs, generally.

You can find a couple of demo sites that are available here. They should have a few dummy events set up that you can look at:

https://civicrm.org/demo

If you need help with specifics, you can feel free to ask specific questions on Stack Exchange. In addition, here is a good list of CiviCRM experts who could help you:

https://civicrm.org/service-providers
> 2 votes

---
Tags: drupal, webform-civicrm, forms, custom-reports, online-registration
---


# Question
Title: How do I make one hyperlink which shows its target page as a modal dialog when clicked?
There are lots of links in CiviCRM which will: (a) open an overlaid modal dialog when clicked, and (b) open the same content in a new page when `Ctrl`+clicked or middle-clicked. This is cool and I want to make one link which does this.

I see here that *pages* can enable this behavior for *all links within the page* by extending `CRM_Core_Page` and setting `public $useLivePageJS = FALSE;`. Neat, but not quite what I want.

I'm building an extension where I want to achieve the same result, but for one link which would live at the top level of the CiviCRM menu. Is there a class I can add somewhere, or a javascript function I can call somehow that will enable this "modal" functionality for one link?

# Answer
> 5 votes
It's quite simple actually. Add the css class `crm-popup` to the link and you're done :)

---
Tags: developer
---


# Question
Title: Making the Event Registration icon larger
How do I make registration icon on an event page larger? Is seems to be a bit small and is it possible to move it around?

# Answer
> 2 votes
You need to start from a basic familiarity with how to style webpages. I suggest googling a few simple tutorials on css.

---
Tags: civievent
---


# Question
Title: ProPublica Congressional API CiviCRM Module
Until 2014 there was active development on the Sunlight Congress API and there was and is a CiviCRM module that uses the Sunlight Congress API to make Congress data available to CiviCRM.

ProPublica has taken over development of the Sunlight Congress API and merged it with it's own Congress API

Is anyone planning to update the CiviCRM Sunlight Congress API module to work with the ProPublica Congress API module so that CiviCRM maintains the ability to link to information about the activities of Congress?

# Answer
> 3 votes
The successor to the Sunlight API Dupal module is the Civi-native Electoral API extension. I wrote documentation back when I was collaborating on the project, but it seems to have been taken down. I will investigate finding a copy and getting it online.

You may also be interested in the CiviCRM for e-advocacy page.

---
Tags: civicrm-entity
---


title: Exporting Contacts Results in DB Error

text:
# Question
Title: Exporting Contacts Results in DB Error
I am trying to export about 2000 contacts (exporting primary fields only) and when I click continue I get this error:

> Sorry but we are not able to provide this at the moment. DB Error: unknown error Return to home page.

Not sure why its occurring and how to find out more info?

Thanks

# Answer
KarinG's answer is correct. To anticipate what you're likely to find - when you do an export, CiviCRM generates a temporary database table. Many servers aren't configured with a large enough space in their `/tmp` directory to store a large database table. Because "all primary fields" is actually a very large number of fields, you're likely overwhelming the temporary space.

I recommend selecting only the fields you need rather than all primary fields, and this issue is likely to go away. Alternatively, increase the size of your `/tmp` folder.
> 2 votes

# Answer
First place to look is in the ConfigAndLog directory - it will contain a number of files. Find the current log file; it will contain more details on the DB Error (if you can't easily find it -\> reproduce your DB error by trying to export again -\> then the DB error will be at the bottom of the current log file).
> 2 votes

---
Tags: contacts, export
---


title: CiviEvent not registering via backend

text:
# Question
Title: CiviEvent not registering via backend
Just updated to Civi 4.7.22, running WP 4.8, \[edited\] now running php7.0 \[/edit\] php 5.5.26

After the upgrade CiviEvent will no longer register contacts for events via the backend. After filling out the details and pressing the ok button, everything greys out - I get a 'processing' but nothing happens.

The green CiviCRM logo isn't turning, the page tab isn't updating, nothing. If I move away from the page I get a warning that things aren't saved (which is correct) but even after 5min it hasn't completed.

I'm about to roll back to CiviCRM4.7.17 which will throw a load of security complaints but at least folks will be able to register for events.

Any thoughts before I roll back? \[added\]With payment recording unchecked

# Answer
Seems like the issue was resolved in the latest 4.7.23 release.
> 1 votes

---
Tags: wordpress, civievent, registration
---


# Question
Title: Registration Form (profile) with selected groups only?
I try to set up a user registration form (for the Front End) using a profile. Within the profile the groups should be listed, but just selected ones, not all. I could not find a switch for this. Is this generally possible just to define the groups to be listed? Thank you for your hints.

# Answer
> 1 votes
Visibility: Public Pages will be listed; Check your group Admin screen at:

```
civicrm/group?reset=1

```

If you're also seeing Groups in your Profile select that are listed as Visibility: User and User Admin Only - do let us know.

**Added**: if you don't want all your Groups that are configured Public Pages to be listed then try this:

* create a custom field
* add the custom field to the profile
* create a smart group - that has your custom field in the search criteria

---
Tags: profile, groups
---


# Question
Title: How can I trigger a selection for a Select2 EntityRef element via javascript?
The CiviCRM EntityRef form element uses a Select2 select box to make lots of CiviCRM forms more awesome. A user can, for example, search for contacts to choose one. Great.

I am building an extension where I would like to take an EntityRef element from a core form and select a use javascript to select a specific entity (or multiple entities in the case of a multi-select). Is there a javascript function I can call in order to trigger such a selection (by passing in the ID of the entity, for example)?

# Answer
> 1 votes
According to this related question, it should be possible to do this via:

```
$('#id-of-select2').select2('val', 'value-to-select');

```

or, if you want to select multiple items in a multiselect:

```
$('#id-of-select2').select2('val', ['value-to-select', 'another-value']);

```

---
Tags: developer, forms, javascript, select2, entityref
---


# Question
Title: joomla privileges: can't grant allow to add contacts
Operating CiviCRM 4.5.6 on current Joomla 3.5.1.

I have set up three groups which should have different access levels to view, edit and add contacts. Have configured them to be in group special as suggested elsewhere and allowed them access to Access Administration Interface in global permissions.

When I try to add allow to the add contacts group this automatically resets to "Not Allowed" after I press save..

It went OK with the other privileges but not with add contacts.

Dumbfounded. Can somebody help? P.S. where are these privileges stored in Joomla anyway? Checked all the tables and found nothing which represented the privileges in any way..

# Answer
Update to the latest Joomla version, which is now 3.7.4. There were problems with the ACL settings for CiviCrm in earlier versions that are solved in the latetst versions of Joomla.
> 1 votes

# Answer
I'm confused what exactly you're trying to do "add contacts" (as in 'create a new contact') or "add contacts to group".
> 0 votes

---
Tags: joomla, permissions
---


title: Civi CRM Expert in Europe wanted

text:
# Question
Title: Civi CRM Expert in Europe wanted
i (Austrian based company) am looking for a CIVI-CRM-Expert in Europe (preferred) for helping with various implementations on a basic level (customizing invoices, create profiles for a kind of portfolio of members...)

Please send your references and rates to gerald.koellersberger@k-con.net

I am looking to hear from you!

Gerald

# Answer
> 5 votes
Please refer to this link https://civicrm.org/partners-contributors to get/contact a CiviCRM expert in your area

---
Tags: civimember, profile, custom-templates, invoice
---


title: Bulk delete activity based on criteria

text:
# Question
Title: Bulk delete activity based on criteria
I want to bulk delete an activity (activity ID 65) across all contacts within one group.

I want anyone outside this group to keep the activity.

Is this possible? The search criteria in find activities is limited.

CIVICRM 4.6.27 - Drupal 7

Thanks, Andy

# Answer
> 6 votes
Try advanced search.

Search for contacts in group "x" with completed activities of type "y"

From search settings=- set "Display results as" to activities.

You should be able to delete the activities from the search results options.

---
Tags: activities
---


# Question
Title: CiviPoints - Basics on how to configure and use this extension
I need some basic guidance on configuring CiviPoints and using it. I have installed already on our Wordpress site. But I don't see any simple guide on how to set it up and use it. Simple example with screenshots would do.

PS: I also installed CiviRules. So an example with CiviRules with CiviPoints would be great.

# Answer
> 0 votes
Response from the developers:

If you want to create a new category of points, this is in the option group "Points Type". Editing option groups can be found somewhere in your admin menus.

A separate points tab will show for each type of points- but only if that contact has previously been granted some points of that type. That can initially be done with the "Grant Points" item in the Actions menu. The points tabs, when visible, also have a "Grant Points" button.

Various permissions are currently required to do stuff with points. The tabs I think require "view all contacts" and granting or deleting require "edit all contacts". With this permission, "Grant Points" appears in the Actions menu. This isn't ideal, perhaps it should check ACLs too but I can't remember how to do this.

---
Tags: civirules, civipoints
---


# Question
Title: Best way to integrate two sites with different security levels
We have a civi install that contains some sensitive data. We also have a public facing website. We would like to integrate them so that you can sign up for events, give donations etc on the website. The first though was to have a single site, but we would rather not have sensitive data sitting behind a public site.

EDIT: Also the less custom code the better. A solution that depends on crafting our own forms and interactions between sites is probably going to take too long both to develop and to fix when it goes wrong

Two ideas that come to mind are:

1. Do a remote integration - is that possible? - so that the public website pulls the data it needs via https or something
2. Have them on same server but different directories (and different Linux users) but both civi installs point to the same database, but as different mysql users. So the website cannot access certain tables.

I am inclined towards 2. Can you see anything that might go wrong with it?

# Answer
Naomi, CiviProxy at the moment deals with mailings and stuff, and whitelists API calls. So if you would want to create a donation page on your public website, you would probably use the API to send data to CiviCRM.

When using CiviProxy your public website would send the API request to CiviProxy. CiviProxy would then check if the API request is allowed, and if so pass it on to CiviCRM.

If you want to build forms that communicate with CiviCRM on a separate server you might also want to take a look at CMRF.

There is a blogpost on a recent sprint about this topic you might want to read.
> 2 votes

# Answer
I would not recommend your approach number 2, though in theory it sounds reasonable. Here's what I'd worry about going wrong:

1. CiviCRM code might be unexpectedly accessing tables that you would not expect it to, generating white screens of death on your public facing site.
2. The two different installs might be setting cached/calculated values differently due to the different urls that they think the install lives at.

But perhaps most signficantly, the tables that you'd need to access publicly are probably the ones that are most sensitive, e.g. the contacts tables and the payment processor table.

So best to spend your energy/money/time securing your main civi install, unless you want to do the custom code things offered in the other answers.

Update: based on your comment below, here's another way to get the outcome you want.

1. Create two separate mysql users as in your option 2 (a "secure" and an "insecure" user), and remove the access to the custom tables for the insecure user.
2. Provide two separate 'pathways' into your install, based on authentication. For example, you could edit the civicrm config file to set the CIVICRM\_DSN differently depending on the ip of the connecting user. If you're using Drupal, I think you might be able to set it differently depending on the permissions of the logged in user.
> 2 votes

# Answer
I am not commenting on the concern you expressed but thought you might be interested in the CiviProxy Extension
> 1 votes

# Answer
Just elaborating on option 2. Where is the sensitive data located? Do you use a set of custom fields? This causes the data to be stored in a separate table, and you can use this strategy. If the data is stored in the standard CiviCRM tables, you must find a MySQL-native mechanism to protect the private data. Maybe the blog offers https://mariadb.com/resources/blog/protect-your-data-row-level-security-mariadb-100 some help? But this is too custom code.
> 1 votes

---
Tags: drupal, mysql, security, integration
---


title: How to enter a new contribution?

text:
# Question
Title: How to enter a new contribution?
How do I enter a new contribution for a donor in CiviCRM? I cannot find the tab to enter a new contribution for an already existing donor.

# Answer
> 3 votes
You can find the link in the contributions menu for adding new contributions against a contact.

By clicking the link you will be redirected to add contribution page, where you will be able to find the contact from the select contact option.

# Answer
> 2 votes
You can find an extensive instruction in the manual https://docs.civicrm.org/user/en/latest/contributions/manual-entry-of-contributions/ .

# Answer
> 2 votes
For an already existing donor -\> from the Donor's record -\> hit the Contributions tab -\> and then hit either the Record Contribution button (if you'd like to record a cash/cheque Contribution) OR the Submit Credit Card button (if you'd like to process/record a credit card Contribution):

---
Tags: contributions
---


# Question
Title: How do I test Online Contribution Receipts?
How do I test the edits I make to online contribution receipts? Is making a test contribution using the online form the only way, or recommended way?

# Answer
I would recommend you only TEST LIVE; Just delete the contribution that you have created afterwards; a $1 LIVE transaction that you can follow all the way though into your Payment Processor - will guarantee you that things are working as expected.

Added: You'll have tokens for total\_amount etc, right? This is how you test it. You can also plug in TEST credentials for your payment Processor in LIVE payment processor config. Then you can test LIVE CiviCRM pathways with fake VISA cards.
> 1 votes

---
Tags: contributions, receipts
---


title: individual contacts: Bulk email?

text:
# Question
Title: individual contacts: Bulk email?
What does it mean if, on an individual contact, I select the 'bulk email?' box when editing their email address?

I want to be sure that all of our contacts can receive our newsletter.

# Answer
> 2 votes
If you set a bulk email address it will be used instead of the primary email address to send your newsletters to. You may even set more than one email adress as bulk email address.

---
Tags: civimail
---


# Question
Title: hey guys, i need some help to add some features to civicrm locally using phpstorm?
the question is how to edit something in contact page and how to debug my code. is there anyway to debug it without install it again to DRUPAL and test my code if its work or not.

# Answer
> 1 votes
start here to start learning about how use to phpstorm and xdebug: https://docs.civicrm.org/dev/en/latest/tools/phpstorm/

---
Tags: drupal, developer, civicrm-buildkit
---


# Question
Title: What are these big MySQL mailing tables for?
Tomorrow, I will again begin the process of updating CiviCRM. I know that as the upgrade process is going through 4.7.8, it upgrades mailing foreign key constraints in `civicrm_mailing_event_queue` and `civicrm_mailing_recipients` tables, which have 2,230,662 and 3,025,260 rows, respectively. This causes this portion of the upgrade to be extremely long, and I had thought it stalled.

1. What exactly are these tables for?
2. How can I trim these tables down a bit? (i.e. is it as simple as deleting old emails that were sent?)
3. What are the ramifications to our constituent records of trimming it?

`Describe civicrm_mailing_event_queue` in mysql:

```
+------------+------------------+------+-----+---------+----------------+
| Field      | Type             | Null | Key | Default | Extra          |
+------------+------------------+------+-----+---------+----------------+
| id         | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| job_id     | int(10) unsigned | NO   | MUL | NULL    |                |
| email_id   | int(10) unsigned | YES  | MUL | NULL    |                |
| contact_id | int(10) unsigned | NO   | MUL | NULL    |                |
| hash       | varchar(255)     | NO   |     | NULL    |                |
| phone_id   | int(10) unsigned | YES  | MUL | NULL    |                |
+------------+------------------+------+-----+---------+----------------+

```

Here's an example of what one of the rows from above is storing:

```
mysql> SELECT * FROM civicrm_mailing_recipients LIMIT 10;
+-----+------------+------------+----------+----------+
| id  | mailing_id | contact_id | email_id | phone_id |
+-----+------------+------------+----------+----------+
| 560 |          7 |          3 |        3 |     NULL |
| 561 |          7 |      14561 |    14561 |     NULL |
| 562 |          7 |      31443 |    31443 |     NULL |
| 563 |          7 |      31481 |    31482 |     NULL |
| 565 |          8 |      14561 |    14561 |     NULL |
| 566 |          8 |      31534 |    31521 |     NULL |
| 569 |         10 |      14561 |    14561 |     NULL |
| 570 |         10 |      39403 |    37916 |     NULL |
| 572 |         11 |      14561 |    14561 |     NULL |
| 573 |         11 |      39403 |    37916 |     NULL |
+-----+------------+------------+----------+----------+

```

`Describe civicrm_mailing_recipients` in mysql:

```
+------------+------------------+------+-----+---------+----------------+
| Field      | Type             | Null | Key | Default | Extra          |
+------------+------------------+------+-----+---------+----------------+
| id         | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| mailing_id | int(10) unsigned | NO   | MUL | NULL    |                |
| contact_id | int(10) unsigned | NO   | MUL | NULL    |                |
| email_id   | int(10) unsigned | YES  | MUL | NULL    |                |
| phone_id   | int(10) unsigned | YES  | MUL | NULL    |                |
+------------+------------------+------+-----+---------+----------------+

```

Here's an example of what one of the rows from above is storing:

```
   mysql> SELECT * FROM civicrm_mailing_event_queue LIMIT 10;
+----+--------+----------+------------+------------------+----------+
| id | job_id | email_id | contact_id | hash             | phone_id |
+----+--------+----------+------------+------------------+----------+
|  8 |      9 |        3 |          3 | fda886fa89xxxxxx |     NULL |
|  9 |      9 |    14561 |      14561 | da71a735ffxxxxxx |     NULL |
| 10 |      9 |    31443 |      31443 | 3256b6d93axxxxxx |     NULL |
| 11 |      9 |    31482 |      31481 | 09c8d6d6ddxxxxxx |     NULL |
| 13 |     11 |    14561 |      14561 | 00e12468baxxxxxx |     NULL |
| 14 |     11 |    31521 |      31534 | 767409eb3fxxxxxx |     NULL |
| 15 |     14 |    14561 |      14561 | f5a36df7a3xxxxxx |     NULL |
| 16 |     14 |    37916 |      39403 | b6fee3b110xxxxxx |     NULL |
| 17 |     16 |    14561 |      14561 | f139097393xxxxxx |     NULL |
| 18 |     16 |    37916 |      39403 | 7a242aa0e5xxxxxx |     NULL |
+----+--------+----------+------------+------------------+----------+

```

Thanks in advance!

# Answer
> 1 votes
`civicrm_mailing_recipients` is used to match mailings to the intended recipients. If you send three mailings to the same group of 5,000 contacts, you'll generate 15,000 records in this table. It's necessary for generating mailing reports.

# Answer
> 1 votes
`civicrm_mailing_event_queue` keeps track of which email addresses a mailing is being sent to (or which phone number a mass SMS is being sent to): stores email id or phone id, contact id, mailing job id and a hash used to validate unsubscribes.

It links to other tables to record various types of events, including: civicrm\_mailing\_event\_bounce to record bounces, civicrm\_mailing\_event\_delivered to record delivery, civicrm\_mailing\_event\_opened, civicrm\_mailing\_event\_reply, civicrm\_mailing\_event\_trackable\_url\_open, civicrm\_mailing\_event\_subscribe, civicrm\_mailing\_event\_unsubscribe to record the corresponding events.

Like `civicrm_mailing_recipients` (described in Jon G's answer) it is used for mailing reports.

---
Tags: civimail, drupal, upgrade, mysql
---