# Question
Title: Contribution import fails for all records with error "No matching Contact found"
I successfully imported contributions from csv files, up to 4.6.3. Now when I try to import using the same saved mapping, in Joomla with 4.6.6, every record fails with the error

```
No matching Contact found for (person@example.com )

```

Is anyone else having trouble under 4.6.6? My field mappings look correct, and the contact email addresses do exist as contacts in the database.

# Answer
The only change to the file CRM/Contribution/Import/Parser/Contribution.php between 4.6.0 and 4.6.6 is the addition at line 263 of:

```
$params['contact_type'] = 'Contribution';

```

Commenting this out seems to fix my problem. My contribution imports are based on matching the individual contact by email address, so I'm guessing that this line broke things by forcing a lookup by contribution ID.

Should I file a bug report?
> 1 votes

---
Tags: civicontribute, joomla, import, issues
---


# Question
Title: When importing memberships into 4.6.8, what does ""The membership cannot be saved because the status cannot be calculated" mean?
I am attempting to import and *update* existing memberships into 4.6.8, using the same steps that have worked successfully previously, but I'm getting an error.

* I have created a .csv file with (existing) Membership ID, (new) Start Date, (new) End Date, and Membership Type. For Membership Type I had used the text Monthly Sustaining Membership successfully in the past. I switched to import Membership Type ID of 2 after my first import error. I believe Membership Type ID (not the text value) is now required.
* On attempted import, I get the error "CiviCRM has detected invalid data and/or formatting errors in 40 records. These records have not been imported. You can Download Errors. You may then correct them, and import the new file with the corrected data."
* I download the errors. The reason for the error for each record is "The membership cannot be saved because the status cannot be calculated." I have not received this error with previous successful imports.
* The Start date for the updated membership is the same as the End date for the previous monthly membership, not a problem with past imports.

I don't want to simply import these as new memberships, I want to update the existing memberships.

Any help appreciated. Thanks so much.

# Answer
This error is part of `CRM_Member_BAO_Membership`. It's triggered when there's no membership status that fits the dates in question, and so this error depends on the day you do an import!

For instance, if your memberships statuses are: Start Date to End Date = Current End Date to (End Date + 1 month) = Grace (End Date + 1 Month) to Any = Expired

What happens if you import a membership with a start date of 10/25/2015 on 9/22/2015? It's before the Start Date, so none of the statuses match. This causes this error.

If you're getting this error and this is definitely not the case, replicate the problem on the demo server, you may have found a bug.
> 5 votes

# Answer
\[Bangs head on desk\]. Aargh. So, upon further scrutiny, in fact the Start Date for the memberships I was attempting to import was 9/1/2025. Once I corrected the import file with a Start Date of 9/1/2015, then the import worked fine. Thanks Jon for the explanation above which made me go back and take a look at my import file.
> 4 votes

---
Tags: civimember, import
---


# Question
Title: "Log Volunteer Hours" form required permissions?
I've installed the CiviVolunteer extension on CiviCRM 4.6.6 on Drupal 7. I can create an event, enable volunteer management, assign volunteers, etc., from both the site's administrator account and from accounts part of the more permission-limited "staff" roll. As the site administrator I can also use the "Log Volunteer Hours" form without issue. However, when I try to use this form as a "staff" user, the form comes up and is populated, but the spinning "loading" triangle never goes away, and my cursor turns into an hourglass over the form. According to the browser console, when I run the page (and the form) as a "staff" user, there is an uncaught TypeError related to the jQuery "each" function (specifically, it is being supplied with an undefined object); this doesn't happen when run as the site administrator.

What permissions does a user have to have to be able to use the Log Volunteer Hours form?

# Answer
> 1 votes
CiviVolunteer's "Log Volunteer Hours" dialogue relies on API permissions that appear to be missing (which is why it works for users with "Administer CiviCRM", since they have full API access). I've filed a bug report here: https://issues.civicrm.org/jira/browse/VOL-138

---
Tags: permissions, civivolunteer
---


# Question
Title: Where is the $_params field of the CRM_Contribute_Form_ContributionBase class set?
I'm trying to debug a contribution page and I see that one of the contribution parameters is not set properly. I would like to see where exactly this parameter is being set so I can understand why it is not getting the proper value.

I've been looking inside the CRM\_Contribute\_Form\_ContributionBase class and trying to figure out where its $\_params variable is being set. But I have had no success.

What I've done so far (note: I'm referring to the code for 4.6.8):
1) Determined that one of the parameters in my payment processor (Stripe) is not being correctly set, and this is the cause of the error that I am getting ("Stripe.js token was not passed! Report this message to the site administrator.").
2) Saw that the contribution parameters are being passed to my payment proc.
3) Therefore, go one level up. The class CRM\_Contribute\_BAO\_Contribution\_Utils is calling the doDirectPayment() method of my payment proc. And it is passing the parameters. This calling happens in the processConfirm() method. But the processConfirm() method is itself passed the contribution params.
4) So, one level up. Now we find ourselves in CRM\_Contribute\_Form\_Contribution\_Confirm-\>postProcess(). So where does this postProcess() method get the contribution params from? It gets them from $this-\>\_params (line 1037). But the CRM\_Contribute\_Form\_Contribution\_Confirm class does not have such a field. Then let's go to its parent.
5) The parent is CRM\_Contribute\_Form\_ContributionBase. It has a $\_params field. But I have not been able to ascertain where that field is set. I only saw that later on some parameters are added, however the params that I'm interested in were already set.

P.S. If someone has any tips or resources on how to more efficiently debug situations like these, please let me know. Finding out the above took me hours. I found it quite difficult to follow these parameters that are being passed around mountains of code, and most of all I could not get to the source (i.e. where they are first being set).

# Answer
> 1 votes
I highly recommend setting up an IDE with debugger so you can easily step through the code while it is executing. Yes it's a little bit of work to install and learn to use those tools, but *worth it!*

My IDE tells me that the $\_params variable is an array declared in CRM\_Contribute\_Form\_ContributionBase but mostly populated during CRM\_Contribute\_Form\_Contribution\_Confirm::preProcess().

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


# Question
Title: Why are message templates not appearing when I email a contact?
I upgraded a client system from 4.4.12 to 4.5.8 at the weekend and now message templates are not appearing when a user creates an email (regular or bulk). You can pick a template but nothing appears. In Administer/CiviMail/Message Templates all the templates are there, and can be edited & saved. My other upgrades to 4.5.8 have not shown this problem so I am puzzled - I've cleared the Drupal caches and CiviCRM caches.

# Answer
> 1 votes
This sounds like a javascript problem. You could either troubleshoot it yourself or just upgrade to the latest version of CiviCRM which has a rewritten CiviMail interface anyway and so the problem is unlikely to be in the new version.

# Answer
> 0 votes
It sounds like a javascript problem. Use your browser development console to to check for a jQuery error on the page due to a theme / block / other module conflict problem.

# Answer
> 0 votes
I found an answer for my issue: the Pogstone Module (drupal) was in direct conflict. Removing that module has fixed the issue.

---
Tags: civimail
---


title: Whitescreen (500 error) with Civimail

text:
# Question
Title: Whitescreen (500 error) with Civimail
As best I can tell, the menu link for a new mailing:

https://mysite.org/civicrm/mailing/send?reset=1 Redirects to https://mysite.org/civicrm/a/#/mailing/new

But this fails as a white screen.

The console tells me: Failed to load resource: the server responded with a status of 500 (Internal Server Error) GET https://mysite.org/civicrm/a/ 500 (Internal Server Error)

Any ideas what's causing this? The same problem is true for A/B mailings.

# Answer
Please see How do I debug CiviCRM when I hit a blank page / white screen / fatal error? which has instructions for debugging PHP when you run into a blank screen.
> 1 votes

---
Tags: civimail, wsod
---


# Question
Title: "Sold out" error message when registering event with PayPal payment (event is not full though)
I'd be grateful for any pointers regarding an issue with event registration, using PayPal Pro, when paying with a PayPal account (paying with a credit card, also using PayPal Pro processor works just fine).

The **user experience**: fill out event registration info, click the PayPal button, log into PayPal and submit the payment, back on the confirmation page click on Continue.

The **result**: user gets the following error messages (which are incorrect as the event is not sold out):

> Unfortunately some of your options have now sold out for one or more participants. You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish. Sold out: Please note that the options which are marked or selected are sold out for participant being viewed.

System: Joomla 3.4.1 CiviCRM 4.6.2

Any ideas on what I could check on? Thanks a million, P

# Answer
The error is because the max participant limit is reached for the price option.

You probably need to check the Max Participant limit in your Price set/field
> 2 votes

# Answer
The bug was fixed by Yashodha of the core team in 4.6.9:
https://issues.civicrm.org/jira/browse/CRM-17015

In the mean time, there is a 3 line patch that you can apply:
https://github.com/civicrm/civicrm-core/pull/6720/files
> 2 votes

---
Tags: civievent, civimember, payment-processor, paypal
---


# Question
Title: CiviCase: Accordions not toggle ("Roles" "Activities"). Menu Options ("Add Activity" etc.) not "auto-trigger," Admin menus at top of screen not open
CiviCRM 4.6.8; Drupal 7.39

Everything seems normal when I go to the dashboard initially. I click "Manage" to open a previous case. On the case management page that follows, pretty much all menus and accordions are non-responsive.

Screenshot:

I recently created and installed a new Drupal Theme, but it all worked fine in the development and test environments, and the issue persists whether I'm in the new theme or the old theme (where it worked fine). However... I went back to my dev and test environments and it's failing now. What the hey? I tried clearing caches (CiviCRM and browser) and the issue persists.

# Answer
All my problems stemmed from one module I installed to make adjusting the new theme easier: SwitchTheme. After installing the new theme, I installed SwitchTheme 7.x-1.x-dev on all environments. I was so caught up in theme-tweaking that when I spotted this CiviCase error, I'd forgotten about SwitchTheme. Additionally, it's such a tiny, minor module, I really hadn't expected it to have such a big impact on site behavior.

Disabling SwitchTheme 7.x-1.x-dev in Drupal's Modules page immediately resolved the issue.
> 1 votes

---
Tags: civicase, menu
---


# Question
Title: Problem with online registration after moving to new URL
I recently replaced my multisite Wordpress site with a new one that I built on a subdomain. The new one is a simple, one domain site. Everything is working properly, including the Civicrm that I was using with my old site except for the online registration for CiviEvent.

When someone clicks on a link to register for an event, instead of going to the register page: http://newsite/?page=CiviCRM&q=civicrm/event/register&reset=1&id=numberofevent

it defaults to the info page: http://newsite/?page=CiviCRM&q=civicrm/event/info&reset=1&id=numberofevent

and gives this error message: *Sorry but we are not able to provide this at the moment. You do not have permission to access this page*

Hint: when I go into the Wordpress admin area of the site on a specific browser, I can get the links to take me to the registration page without a problem.

Two more points: When it defaults to the info page with error message, the "/" turns to "%2F"

Also, the same problem occurs for profiles. when I use the "Profile Create Mode" to view the profile, it works on the browser where I am logged in, but on a browser where I am not logged in, I get an error message:

Sorry but we are not able to provide this at the moment. *The requested Profile (gid=numberofprofile) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance.*

# Answer
> 1 votes
Can you make sure that anonymous users have been given the permission to register for events and create/edit profiles.

On install, CiviCRM creates an anonymous user role if one currently does not exist. Ensure you have this role in your WP permissions page.

# Answer
> 1 votes
I forced the creation of the anonymous user role (and granted permissions to the other roles) by adding this at the bottom of civicrm.php:

```
$this->users->set_wp_user_capabilities();

```

I then removed it after reloading a CRM admin page, and found the role created and all the permissions correctly set. This obviously builds off of Lobo's answer.

---
Tags: civievent, wordpress
---


title: Reconnecting CiviCRM DB in Wordpress

text:
# Question
Title: Reconnecting CiviCRM DB in Wordpress
I recently changed from Drupal to Wordpress, and am having some trouble connecting WP to my existing CiviCRM database.

I installed the CiviCRM for Wordpress plugin (and set up a new, empty database for CiviCRM). Then I edited the civicrm.settings.php file to connect to my old CiviCRM database (that I had been using with Drupal). I know the settings are correct, and yet something is wrong. The CiviCRM menu does not appear; the Dashboard appears ugly as if there is no CSS; I cannot access some admin pages (like "Resource URLS") but I can access others (like the Admin Console, by manually typing in the URL, yet as with the Dashboard there is no CSS being applied).

Can someone shed some light on what is happening, and how I can fix it?

# Answer
Try these, in this order:

* Check that the `CIVICRM_UF` value in civicrm.settings.php has been updated to reflect the changed host CMS
* Try visiting `/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/updateConfigBackend&reset=1` to make CiviCRM recognise the shift from Drupal to WordPress
* Clear the contents of your `civicrm_uf_match` table
* Apply instructions from Moving an Existing Installation to a New Server or Location to your situation. (This is a huge list of "tricks", only some will apply to your situation.)
> 3 votes

---
Tags: wordpress, migration
---


# Question
Title: is there an easy local install method for civics and all dependent software
I'm investigating civicrm for a work use at the ngo where I work.

We don't have in-house It team who can help install it. So I'm trying to do so myself.

I have some experience using Ubuntu and basic command line things, but this is proving to complicated for me. The problem is I need to install apache and php and mysql before I can install drupal, and only then can I install civicrm. Each element can have its own issues, which I have to research separately. I'm stuck on about step 2 and know I have at least 8 moresteps to follow. I've spent about 20 hours on it.

I guess this is quite a common situation and maybe there is a simple way to do it. Are all the necessary software elements in a package somewhere so that I can download it one go.?

# Answer
> 3 votes
Two options:

a. Use the bitnami package: https://bitnami.com/stack/civicrm

b. Use a CiviCRM hosting provider: https://civicrm.org/providers/hosting

# Answer
> 0 votes
I would also check out buildkit at https://github.com/civicrm/civicrm-buildkit/blob/master/README.md

---
Tags: drupal, mysql, installation, php
---


# Question
Title: "Mailing" tab won't disappear after disabling CiviMail component
Shouldn't the "Mailing" tab in the navigation disappear when I disable the CiviMail component in the administrator settings?

Because I can still see it, after I disabled the component and I get a access error when I click on a drop down link of the tab.

CiviCRM version:4.6.8CMS version:Drupal 7.39MySQL version:5.0.10PHP version:5.4.7

# Answer
> 2 votes
This appears to be a bug - I was able to reproduce it as well. Normally disabling a component *should* hide the menu items associated with it. If this is important to you, you could try to figure out what's going wrong and submit a pull-request with the code to fix it, or else provide funding to fix it in the paid issue queue. Unfortunately the core team doesn't have capacity to fix non-critical bugs unless someone provides code or funding.

# Answer
> 1 votes
There is a specific admin menu for setting up the display of the menu. It is located under **Administer menu \> Customize Data and Screens \> Display Preferences**.

# Answer
> 0 votes
It might be a cache/session issue.

Did you logout/login after you disabled the component?

X+

# Answer
> 0 votes
This bug also exists with civicrm 4.6.8 inside jooomla 3.4.4.

The suggested solution in setting up Display preferences for contacts does ot change the issue: Mailings is in the civicrm menu while it is de-activated. As a minor point: The error message is ugly, terminates the civicrm component and returns the user to the control-panel of Joomla.

ps: just saw that it is possible to delete the menu-item in another screen: navigation menu.

---
Tags: civimail
---


title: Contribution confirmation page is blank

text:
# Question
Title: Contribution confirmation page is blank
I have created a Member Sign-Up form that goes to a Contribution page with three price sets (one is always hidden with JS, so two appear). Under the Contribution Page's settings, "Use a confirmation page?" is checked. When valid input is submitted, the Confirmation page that comes up next has no visible content. In the HTML a form with the id "Confirm" is shown, but it has only hidden inputs and no submit button.

Does anyone know why this is happening? How can I get a normal confirmation page to appear?

This is testable at http://aplddemo.wpengine.com/sign-up/?type=student

To make this issue even more unusual, after creating a different (test) Contribution page and completing a transaction on that, the original confirmation page began working. My immediate issue is solved, but I'm still curious why this happened and what is to prevent it from happening again.

**UPDATE - September 1**

This issue reappeared. This time I added `ini_set('display_errors', true);` to my plugin, and see errors like the following:

> Warning: include(/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/templates\_c/en\_US//%%3D/3D1/3D13F2BA%%Main.tpl.php): failed to open stream: No such file or directory in /nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1907
>
> Warning: include(): Failed opening '/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/templates\_c/en\_US//%%3D/3D1/3D13F2BA%%Main.tpl.php' for inclusion (include\_path='/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/custom\_ext/com.osseed.eventcalendar-1.1/:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/custom\_ext/ca.bidon.civiexportexcel/:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/custom\_ext/nz.co.fuzion.extendedreport/:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/custom\_ext/co.johnwebster.apld/:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/files/civicrm/custom\_ext/org.civicrm.module.cividiscount/:.:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm/packages:.:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm/:/nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm//packages:.:/usr/sha in /nas/wp/www/cluster-40204/aplddemo/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1907

I thought it might be a caching issue, so I went to Administer \> System Settings \> Cleanup Caches and Update Paths, but clicking the "Cleanup Caches" button doesn't affect the error. The issue changes periodically. Sometimes parts of the form appear, with an error about the missing compiled Smarty template where the price field should be. I haven't been able to connect the change in the error's behavior/message to any other changes on the site. They seem to happen on their own.

# Answer
> 1 votes
After a long investigation, this seems to have been a hosting issue. For whatever reason, the `rename` operation in `civicrm/packages/Smarty/internals/core.write_file.php` was not occurring, possibly because the temporary files were created with 600 permissions. This only occurred when the templates were accessed by a front-end user. Templates accessed through the admin section were able to rename their temporary files.

Our hosting provider was unable to find a solution. We eventually migrated the site to Pantheon.io, and everything appears to be working well there.

---
Tags: wordpress, contribution-page, smarty
---


# Question
Title: Membership not extended to all related contacts
Because a membership type was in use, I wasn't able to edit its relationship properties via the CiviCRM GUI. So I did it in MySQL (by editing membership\_type\_id and membership\_direction fields in civicrm\_membership\_type).

I thought I created all related records the civicrm\_membership table (each contact needs their own, even if the membership is inherited), but I must have missed some or encountered a bug because after doing this edit, I had to go through and Edit then Save some membership records in CiviCRM itself to fix them.

However this didn't work for everybody, and **records with multiple relationships only passed on memberships to one of the two related records.** Again, this may have been the result of an oversight on my part.

# Answer
The solutions below took place inside the CiviCRM GUI:

For most, I had to disable and re-enable all relationships and subsequently edit and save the membership.

In a few cases, even this didn't work. For those records, I also edited the membership and specified a number of allowed related records before saving (I also subsequently went back in and cleared out that number with no ill effects).
> 1 votes

---
Tags: civimember, relationships
---


# Question
Title: How do I get a backup of CiviCRM working on a different server?
If I restore a backup of a site with CiviCRM onto another server it seems that it does not work. Getting it to work is especially troublesome if I restore to a different operating system (Linux -\> MacOSX, e.g.), but also differences in server setup seem to be problematic.

Is there a way that always works?

# Answer
There are multiple "gotchas" when relocating a working CiviCRM install. (CiviCRM's wiki page on Moving an Existing Installation to a New Server or Location is seven pages printed out!) Here's what we watch out for when moving sites.

**Filesystem paths**

CiviCRM stores filesystem paths in various locations in the DB, which can cause a restored DB to not function when loaded in another location.

The simplest way to work around this is to use the facility to Override CiviCRM settings in `civicrm.settings.php` to ensure that all the settings in `$civicrm_setting['Directory Preferences']` are "locked" to values which work in the new environment.

```
global $civicrm_setting;
$civicrm_setting['Directory Preferences']['uploadDir'] = '/path/to/site/sites/default/files/civicrm/upload';
$civicrm_setting['Directory Preferences']['imageUploadDir'] = '/path/to/site/sites/default/files/civicrm/images';
$civicrm_setting['Directory Preferences']['customFileUploadDir'] = '/path/to/site/sites/default/files/civicrm/custom';
$civicrm_setting['Directory Preferences']['extensionsDir'] = '/path/to/site/sites/default/civicrm/extensions';
$civicrm_setting['Directory Preferences']['customTemplateDir'] = '/path/to/site/sites/default/civicrm/custom_tpl';

```

This prevents the settings being changed via the web interface at `civicrm/admin/setting/path` while the settings are overridden in the settings file.

Sometimes Drupal has a variable `civicrm_class_loader` set with a fixed path - it may help to remove this variable.

```
drush vdel civicrm_class_loader

```

I think that I've seen mention of the hardcoded paths issues being addressed in 4.7 cycle, which would be great news IMO.

**Definer in DB dumps**

This is the most common cause of trouble reloading CiviCRM DB dumps.

The cause is that MySQL's default dump behaviour is to include trigger creator information in the dump - which will upset MySQL if you load the dump on a server where the original MySQL user doesn't exist. This looks like this in a MySQL dump:

```
/*!50017 DEFINER=`civicrmuser`@`localhost` */

```

The solution is *really* simple: use the `--skip-triggers` option when making your MySQL export. MySQL will omit the user-specific information, and CiviCRM will sort the triggers out the next time it rebuilds its caches.

If you've already got a large DB dump and don't want to make/transfer a new one just to remove that information, you can also do it using `sed`:

```
sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' dump.sql > new dump.sql

```

I'm not sure if there are plans to address this?

**Permissions**

CiviCRM runs (in UNIX space) as the webserver/php user, and you probably restored the codebase / site files as your system user. In order to permit CiviCRM to function, you likely need to either change the ownership of the CiviCRM-writeable files to the webserver user (eg `chown -R www-data: /path/to/sites/default/files/civicrm`) OR find some other way to ensure that permissions are managed to ensure your user and the webserver user will not conflict.

There's an existing question on this topic: CiviCRM does not have permission to write temp files which covers the merits of various approaches to dealing with CiviCRM's special requirements when it comes to filesystem perms.

The main cause of this issue is the use of a disk cache for `templates_c`. Moving cached HTML to DB (as per Drupal's `cache_*` tables) or to a permissionless store (Redis, memcache etc) would remove this friction, but I'm not sure if / where that is on the roadmap.

**Other considerations**

You may also -

* need to remove the file `ConfigIDS.ini` from your new site. CiviCRM will regenerate this file.
* need to trigger CiviCRM to revisit its idea of which extensions are installed ("Refresh" @ `civicrm/admin/extensions`)
* need to visit `civicrm/admin/setting/updateConfigBackend` to reset CiviCRM's caches and stored paths
> 4 votes

# Answer
This is what I do:

* take a backup (I use Akeeba, since I'm almost always Joomla-based)
* restore it on the new server (Akeeba kickstart, to your aid)
* fixup all configuration files with the following script:

```
#! /bin/sh
#
remotebaseurl=<remote url>
remotewebroot=/var/www
remotesqlhost=localhost
localbaseurl=<local url>
localwebroot=/Library/Webserver/Documents
localsqlhost=127.0.0.1
localsqldb=<sqldb>
localsqluser=<sqluser>
localsqlpassword=<sqlpassword>

# save a backup of configuration files
backup() {
    cp $1 $1.backup
}

backup administrator/components/com_civicrm/civicrm.settings.php
backup administrator/components/com_civicrm/civicrm/civicrm.config.php
backup administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.tpl
backup components/com_civicrm/civicrm.settings.php

# tweak all configuration files
sed -e "s|$remotebaseurl|$localbaseurl|" -i ".bak"   administrator/components/com_civicrm/civicrm.settings.php

sed -e "s|$remotebaseurl|$localbaseurl|" -i ".bak"   components/com_civicrm/civicrm.settings.php

sed -e "s|$remotewebroot/|$localwebroot/|" -i ".bak" administrator/components/com_civicrm/civicrm/civicrm.config.php
sed -e "s|$remotewebroot/|$localwebroot/|" -i ".bak" administrator/components/com_civicrm/civicrm.settings.php
sed -e "s|$remotewebroot/|$localwebroot/|" -i ".bak" administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.tpl
sed -e "s|$remotewebroot/|$localwebroot/|" -i ".bak" components/com_civicrm/civicrm.settings.php
sed -e "s|$remotewebroot/|$localwebroot/|" -i ".bak" media/civicrm/ConfigAndLog/Config.IDS.ini

rm -r media/civicrm/templates_c/*

sed -e "s|mysql://.*\?|mysql://$localsqluser:$localsqlpassword@$localsqlhost/$localsqldb\?|g" -i ".bak"       administrator/components/com_civicrm/civicrm.settings.php
sed -e "s|mysql://.*\?|mysql://$localsqluser:$localsqlpassword@$localsqlhost/$localsqldb\?|g" -i ".bak" components/com_civicrm/civicrm.settings.php

echo "DONE!"

```

Feel free to copy and modify!
> 1 votes

---
Tags: backups, webserver
---


title: Where are recent Warning popups logged?

text:
# Question
Title: Where are recent Warning popups logged?
CiviCRM has certain post-installation checks where you get displayed warnings on your webadmin dashboard, for instance on missing file permissions for directories. But when you click them away they are gone. I informed my Admin about them, but there was no way to tell him the exact content of the warnings.

a) Are past warnings logged somewhere? b) How do we manually check our installations again?

# Answer
> 1 votes
You can manually check the warnings by calling the `System.check` API. There are a couple ways to do this:

* Navigate to `Help => Developer => API Explorer`. Choose `Entity`=`System` and `Action`=`check`.
* If you use Drupal's `drush` or WordPress's `wp-cli`, then you can run `drush cvapi system.check` or `wp civicrm api system.check`.

Using the API Explorer is probably a bit better in this case because it will run the check with you web server's PHP runtime. In some edge-cases, the web and CLI runtimes may be slightly different.

---
Tags: wordpress
---


# Question
Title: Why do some contacts share the same Drupal user?
I've got a bit of a baffling issue and I'm not sure where to begin looking for fixes.

I have begun to notice several instances where I have several contacts that share a single Drupal user account. These are contacts who are clearly not the same person and have no business sharing a single Drupal account.

Edited to add:

* I'm using CiviCRM 4.6.8 and Drupal 7
* None of the contacts share the same email address
* Contacts are not synced via rules
* We have recently opened registrations for 2 very large events. The merge rule we're using is supposed to sync contacts on name and email address
* There is a profile used for site registrations. We collect name, email address, phone number, address, etc.

Any idea what might cause this to happen?

# Answer
> 3 votes
I'm not sure what is causing the contacts to share Drupal accounts, but to detach contacts from Drupal user accounts, you will need access to the civicrm\_uf\_match table in your CiviCRM database.

See the question How to disconnect civi contact record from Drupal user? and the answer I posted there on how to detach contacts.

---
Tags: drupal, contacts
---


title: Dedupe Rule not working

text:
# Question
Title: Dedupe Rule not working
My Dedupe rule is not working at all. I have it set to first name, last name, phone all with a weight of 10 and a weight threshold of 30. It appears like it is not working at all. I have many people that match on all 3 fields that are creating duplicates. This is happening on both contribution pages and event forms. Do I have the rule set up incorrectly or am I missing anything?

# Answer
> 8 votes
Perhaps the best free explanation of CiviCRM's deduplication is from the CiviCRM blog last year (July 31, 2014): Understanding CiviCRM Dedupe Rules

For the whole process, I will let the author speak for themselves as it really is an excellent write up and worth reading in its entirety to understand the deduplication system.

For this question, I suspect the issue comes down to the *usage* of the rule.

Quoting the author of the blog post (from point 2):

> * **Unsupervised rules** are rules that are automatically checked when a user enters contact info into a form on the front end of the site (for example, when registering for an event, making a contribution, etc.). *If a match is found, CiviCRM automatically merges the new contact into the old one, without checking with the user*....
> * **Supervised rules**, on the other hand, are rules that are automatically checked when an admin or staff member enters info into the back end of the site (i.e., the admin interface). *They do not automatically merge the contacts — they just trigger a pop-up suggesting that the contact may be a duplicate*....
> * **General rules** are not triggered automatically at all. They can be run manually from the "Find and Merge Duplicate Contacts" page, or selected to run during a data import, but they do not ever just run on their own....

Rachel, based on your question, it looks as though your rule is setup correctly, but it is most likely set as a *general* rule, not the *unsupervised* rule for individuals. If you change the usage, I think you will find the results you're looking for.

Side note: for perhaps the best paid explanation, Civiteacher.com has excellent videos about CiviCRM deduplication.

# Answer
> 5 votes
You don't say what version of CiviCRM you are on, and you do say this is occurring on both contributions and on event registrations, but I will note here (for those happening onto this related issue) that there is a bug in CiviEvent, versions 4.3.4, 4.4.3, in which the unsupervised matching rule is not used in event registrations. See: https://issues.civicrm.org/jira/browse/CRM-14134

The fix for this is in version 4.5. We are currently examining the fix to see if it can be applied to earlier versions.

---
Tags: civievent, civicontribute, duplicate-contacts
---


title: sharing pledges between contacts

text:
# Question
Title: sharing pledges between contacts
In the user workflow I currently have, parents sign up for tuition payment plans for the program their children are attending. These are processed as pledges with varying numbers of installments, attached to the parent contact. Is there any way for me to assign those pledges to multiple people? For example in a two parent household, I would like both to get reminder emails. I feel like this is somewhat similar to giving soft credits to household members for contributions, but I'm not sure how to do it for pledges as well. Ideas?

# Answer
Unfortunately there is not a way to assign a pledge to multiple contacts.

In the CiviCRM database, the pledge is assigned to a contact, but the individual pledge payment/installment is related to the pledge and not the contact.

Without a customization, this would not be possible. Sorry
> 1 votes

---
Tags: civicontribute, contributions, pledges, civipledge
---


# Question
Title: How to go to Batch Update via Profile in one click?
I have a weekly procedure where I need to batch update Pending Contributions. It requires several manual steps to finally get to Batch Update via profile form:

1. Go to Find Contributions
2. Check Pending / Click Search
3. Check all Contributions radio, in the resultset page
4. Select action "Batch Update..." from dropdown
5. Select profile to use

I know it's not that bad, but I was trying to find a way to add a Menu item, where clicking it opens Batch Update via Profile form, with the profile I want, for all Pending Contributions.

Still think a good/easy way to implement this, any ideas?

# Answer
> 1 votes
Luciano, Unfortunately this can not be added as a menu item because you are working with a search result.

You could create a custom process that can be added to a menu. Something like...create a custom contribution search (that filters by pending) with a hook that displays a profile that you can use to update.

If you need a consultant to do this for you, it is probably not worth it. Sorry....

---
Tags: civicontribute, profile, developer
---


# Question
Title: How do I get wordpress and Civicrm membership synced?
I have tried multiple times to be able to get Wordpress and Civicrm to be able to sync up when members register. When I go to CiviMember Role Synchronize it redirects to the page for my blog.

What can I do to be able to get Civicrm members and Wordpress users to be able to register and login at the same time

Thank you for your help

# Answer
Thank you for your help. Turns out I didn't do the first step to installing Wordpress Civicrm members sync:

> The first step is to Download the Plugin and put it under your sites wp-content\plugins\ directory and rename the folder as "civi\_member\_sync". Then Activate the plugin by going to your WordPress site's Plugin page at http://example.com/wp-admin/plugins.php It will be CiviMember Role Synchronize.

https://github.com/jeevajoy/Wordpress-CiviCRM-Member-Role-Sync
> 3 votes

# Answer
I know this post is old now. However, I struggled with a similar problem too, i wanted the user to become a Wordpress user at the same time they became a member, here are the steps I took to get it working in the end - hopefully this will help someone.

1. Wordpress \> Setting \> General \> Membership \> 'Anyone can register'
must be checked.
2. Create a profile which includes the contacts primary email address this will be their email address in Wordpress too.
3. Add this profile to a contribution page (Contributions \> New Contribution Page) on the 'Profiles' tab (above or below shouldn't matter - I add it at the top). The user should get prompted to enter their email address, username and password, and a Wordpress account will be created on successful submission. They're role will be whatever you have your default role in Wordpress set to.
> 3 votes

# Answer
There is a CiviCRM function to synchronize Users to Contacts. If you gave people WP logins, and their User records match up (primarily, email-wise) then you can run 'Synchronize Users to Contacts' under Users and Permissions. In Civi, Members are Contacts who are in a Group you defined - or are you using 'members' in a more general sense? If these people are added to a Group you can find them under Search/Find Memberships
> 2 votes

# Answer
Where/how are they registering?

via Wordpress registration? CiviCRM form exposed by a widget in WP?

From my understanding, there is a sync function which existing in WP.. and you can specify the Wordpress table to use in the CiviCRM administration area. Any Wordpress logins will then create a CiviCRM contact. I don't know if the reverse sync is true i.e. CiviCRM to Wordpress as a user.

Check the CiviCRM config file points to the right database for CMS users (it should be the second connection string in the file).
> 1 votes

---
Tags: wordpress, civimember
---


# Question
Title: Can anyone tell how SMS Api Extension (v1.3) working in civicrm?
Can anyone tell how SMS Api Extension (v1.3) working in civicrm ?

# Answer
You can try the SMS API with the API explorer. Basically all it does is enable the sending of an SMS (which is in CiviCRM) using an API. But it is hard to answer such a generic question.
> 2 votes

---
Tags: civisms
---


# Question
Title: Registration Pages for individuals and Organisations
How can I create new registration pages for individuals or organisations using the default CiviCRM forms?

# Answer
If you're asking can an organization register for an event using an online CiviCRM registration page, then the answer is no - or not without a customization - the CiviCRM database does allows it.

In general, the online forms for contributions, membership, and registration have built in logic that assumes the user completing the form is an individual user.
> 1 votes

---
Tags: contacts, joomla
---


title: Event Template HELP HE

text:
# Question
Title: Event Template HELP HE
An hour ago I was able to create an event template. Now I have tried to go back and create a new event template and the button to create a template has vanished and I am struggling to locate it. Please could you guide me on how to access it again?

Many thanks,

Laura

# Answer
> 1 votes
It's under **Events menu \> Event Templates**. You'll see the "Add Event Template" button there. You can also edit existing templates from there. See screenshot below.

---
Tags: civievent, templates
---


title: Bug in 4.6.3 and 4.6.8

text:
# Question
Title: Bug in 4.6.3 and 4.6.8
I performed a custom include/exclude search. When the results were returned, I checked the first record and the radio button '1 selected records only' was properly chosen. I selected a second record and it worked as well. I went to the next page and selected a third record and it worked as well.

I then performed the search again. This time, before selecting any records, I sorted by contact type. Again, I was able to select individual records. I then sorted by contact type again (to change the order) and when individual records were selected, the radio button showed '0 selected records only' and the action menu was disabled.

I saw this error in 4.6.3 and updated to 4.6.8 and the bug persists.

If this is not the right forum for bug reports, please direct em to the proper venue.

Thank you.

# Answer
> 1 votes
It sounds like you're experiencing a JavaScript-related bug. This can happen for a lot of different reasons - some of which are tied to your setup (e.g. a conflicting Wordpress/Drupal module) or even your browser settings.

You should be able to troubleshoot this using the Troubleshooting JavaScript in CiviCRM advice. Before doing that, I'd definitely follow choster's advice and test this on the demo site (https://civicrm.org/demo) to help isolate what might be causing the issue!

---
Tags: civicrm-home
---


# Question
Title: What does the CiviCRM Contact Reference Field Drupal module do?
What does the CiviCRM Contact Reference Field Drupal module do? And, if I select On to enable it, the selector changes to orange, rather than green, which I assume means 'proceed with caution if enabling this module'. So I'm not enabling it. Should I?

# Answer
This module functions as a type of Entity Reference field so that you can link Drupal entities back to Contacts in Civi.

In the display settings for your content type, you can specify whether the Civi Contact appears as:

* a plain text name,
* their name linking to the Contact's record or
* a raw Contact ID (CID).

An example of how we use them:

We have a Drupal content type called Event. We want staff to know who is leading the event so we include a CiviCRM Contact Reference field. When the Event node is filled out, we choose the event leader from a Civi-linked autocomplete field. When the node is saved and displayed, the Civi Contact Reference field displays the event leader's or leaders' name(s) so the staff person can just click on the name to go straight to the individual's contact information.
> 5 votes

---
Tags: contacts, contact-view, contact-reference, modules
---


# Question
Title: Why does the html snippet for a profile not include the url of the site for linked Jscript and css files?
When our users create an html snippet for a Profile, it requires a lot of editing to get the references to work. I don't understand why it's written that way.

For reference, here's a snippet of the code for a form that just has first name, last name and email address.

```
<script type="text/javascript">
var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}};
</script>
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-1.11.1.min.js?r=ogWA8">
</script>
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-ui/jquery-ui.min.js?r=ogWA8">
</script>
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/backbone/lodash.compat.min.js?r=ogWA8">
</script>
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js?r=ogWA8">
</script>

```

These snippets are used on different websites than the one where CiviCRM is installed, so the local (non-absolute URL) `src="/sites/all/...` references don't work correctly.

NOTE: The Help text does indicate that this snippet should work on "ANY website":

# Answer
> 3 votes
I found this deep in the recesses of Jira: Standalone Form HTML for Profiles has relative URL. So it was fixed back in 3.0 but must have reverted at some point. As best I can follow, Resources.php builds this via addScriptFile, which calls addScriptUrl, which calls getUrl, which creates the URL by running through the extension manager (CRM/Extension/system.php). I'm not sure of the "correct" place to add the base URL and fix this, but I'm guessing it's in the extension manager system file.

# Answer
> 1 votes
we found that if we changed the references from "src="/sites/all/modules/civicrm \[...\] to a complete url, it would work. An alternative solution seems to be to strip out all references to civicrm and just implement it using a form field.

# Answer
> 1 votes
Check this issue in the bug tracker for some background and possible approaches to resolving this.

---
Tags: profile, form-snippets
---


# Question
Title: A report for monthly newsletter subscription rates? (need advice)
I've been trying to think of a way to create a report to see the total number of subscribers to our newsletter on a monthly basis.

Any ideas? I've hit the wall.

# Answer
You don't provide details on how you are doing these mailings, so I assume you are using the CiviCRM CiviMail function.... Just go to Reports | Mail Summary Report.

It does a nice job of listing, for each mailing (which in your case I would assume is monthly), the number of intended recipients (ie Subscribers), as well as Delivered, Bounced, and Opened. You can add other related metrics to the detail, and filter to the mailings you are interested in.
> 1 votes

# Answer
If you are using Views you might be able to use Aggregation on a field that has the 'month' and then 'count' the subscribers for that 'month' field. Aggregation is in the Advanced section of the View.
> 1 votes

# Answer
I assume your subscribers are part of a group in CiviCRM? And are you creating a CiviCRM report or using Drupal Views? I assume you are creating a CiviCRM report? Then I would look at the Constituent Summary report? And are you creating a report in the UI or adding a template in an extension using PHP?
> 0 votes

---
Tags: groups
---


title: Choosing a VPS solution for CiviCRM

text:
# Question
Title: Choosing a VPS solution for CiviCRM
I'm consistently maxing out my "MySQL Time" on my shared hosting provider (rhymes with MiviMosting), causing both my host and users to get upset. I'm pretty much tripling what I'm allowed to have on the shared setup.

So now I'm looking for a VPS solution but am not sure what specs are ideal for running CiviCRM (the Drupal side goes nearly unused). Currently, I have 1GB disk space, 200MB RAM, and 20GB transfer. I'm well below the limits on disk space and bandwidth so my assumption is that it's the RAM that's holding me back. Are there other important considerations? Recommended hosts?

# Answer
> 6 votes
Most recent installs I have done of CiviCRM seem to behave best with 2gig minimum of memory. 1.5gig should work as a minimum, but memory is cheap so go with 2gig.

We typically use eApps for most of our clients. They have a nice interface to easily adjust your resources up and down as you need: memory, cpu, disk space. Being able to easily raise and lower these resources (and just pay for the days used) is really nice, for those times you are importing or exporting or doing some other resource intensive tasks. They also have a relatively great support desk.

# Answer
> 4 votes
A great resource as you sort out hosting is a talk by Peter Petrik from Skvare at CiviCon Denver: CiviCRM Hosting & Performance Optimizations

For other Civi provider options, see CiviCRM Hosting Providers.

For what it's worth, I would recommend at least 2GB of Ram for a Civi install. We use Media Temple VPS hosting. We started with their 4GB Ram plan and had no troubles with Civi. (We recently upped our plan because of our storage needs). However, a non-profit website/Civi install I helped with has Media Temple's 2GB Ram plan and has not had any trouble with their Civi (albeit, with a much smaller amount of records).

---
Tags: hosting, performance
---


# Question
Title: If I use php to display a count from my database am I causing a security problem?
I would like to count and display on my front page how many people have signed a civi petition. This I have been able to do using php as below. What I am wondering is if I am causing any kind of insecurity in my system - if I can get the data out what is to stop someone else inserting data in?

Sorry this may be a 101 question but I haven't been able to find this out by searching. Thanks! Caroline

```
open php
$sql=("SELECT COUNT(*) FROM civicrm_activity WHERE activity_type_id=32");
$rs = mysql_query($sql);
$result = mysql_fetch_array($rs);
echo "<h1> <b><center>SIGNATURES SO FAR:     $result[0]</center></b> </h1> ";
close php

```

# Answer
I would highly recommend you use the CiviCRM API to access this information.

A php version would look something like this:

```
$result = civicrm_api3('Activity', 'get', array(
  'sequential' => 1,
  'activity_type_id' => "Petition",
  'options' => array('limit' => 1000),
));

```

(Setting limit to be something larger than you would expect to get.)

Which would return the count (in addition to the activities which you can ignore).

```
{
"is_error":0,
"version":3,
"count":1,
"id":1,
"values":[{
    "id":"1",
    "activity_type_id":"9",
.....

```

If you are using version 4.6, in place of the get action, use getcount, which will only return the count... without detail and not requiring the limit.

You can play with the call by going to /civicrm/api/explorer.
> 2 votes

# Answer
you don't have any parameter to the sql command you run, it should be safe.

what you haven't shown that might be a potential problem is how you open the connection to mysql, if you don't do it and let your cms do it, you should be fine, otherwise, be sure you don't risk sharing the connection credentials by accident.

beware that your select counts all the signatures for all the petitions and for all statuses, it might or might not be what you want
> 1 votes

# Answer
As Zach points out, you should be able to do this via Views and use the Aggregation option (in the advanced section) to pull up a count of the number of Activities of type X in time period Y etc.
> 0 votes

# Answer
Not sure about the security risks, not my expertise. But I would expect it to be a liability.
> -1 votes

---
Tags: php, civicampaign
---


# Question
Title: "DB Error: Syntax error" - after using false "find and merge duplicate" rule
I've tested the following steps on the CiviCRM Demo...

...I've mistakenly filled in no fields and that's the message I've got, after I've used the rule.

So, if I cannot delete or edit the rule, how can I solve the problem?? After this, I'm not able to add a new inidividual...

Help, please!

# Answer
> 2 votes
Since you marked it as Reserved you cannot modify or delete it. (It can be gotten rid of by directly modifying the database, but I think that is the only way.)

Your best bet is to ignore it, and create a new rule that you can use. Just don't mark it as Reserved until you are sure that it is defined as you wish.

Note that you can edit the name and usage type, so you could rename it "DO NOT USE" and make it a General rule.

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


# Question
Title: Should CiviMail report show bounces when using the Mandrill extension?
Drupal 7.36 - CiviCRM 4.5.8 - Mandrill Transactional Emails 1.5

The system is correctly putting a hard bounce contact on hold, the soft bounce is not yet on hold. But I am not seeing the bounces reported by Mandrill on the report bounces.

Is this the expected behaviour?

# Answer
> 1 votes
The first thing to check is that both the MTE extension *and* Mandrill are properly configured. For instance, are soft bounces configured to be returned to CiviCRM? See here for instructions on configuration: https://github.com/JMAConsulting/biz.jmaconsulting.mte

I believe bounces are passed on to CiviCRM's standard bounce processing. You may need to check that the bounce reasons and soft bounce thresholds are correctly set (need to do a little mysql magic for that though).

Remember that contacts are not put on hold until the soft bounce threshold is met.

---
Tags: civimail, civireport, mandrill
---


# Question
Title: Set max participants separately for male and female
Is it possible to configure the maximum number of participants at an event separately for male and female attendees?

We are using webform to handle registrations for our summer camps and want to limit registrations to say 25 boys and 25 girls. Is there a way to do this?

# Answer
If you use civicrm forms, you can do it using price sets and creating 2 options : male and female and limiting the amount of people per item.
> 6 votes

# Answer
I would do this by writing a little bit of custom code. It would need to:

* Implement hook\_form\_alter and add a validation callback to the webform
* Look up the event participants using the civicrm api
* Only allow the submission to be completed if there are \< n number of people with the given gender already enrolled.
> 2 votes

# Answer
I will take the comment from petednz and coleman as the answer that there is no easy way to do this 'out-of-the-box' except to create separate events for male and female attendees.
> 2 votes

---
Tags: civievent
---


# Question
Title: Renew Link showing - The page you requested is currently unavailable
The affected renewing members are getting

"Sorry but we are not able to provide this at the moment. The page you requested is currently unavailable. Return to home page."

When attempting to click the Renew Now button from the dashboard.

# Answer
> 1 votes
For this case the originating contribution PageIDs were disabled. Once re-enabled the renewal button worked fine.

---
Tags: wordpress, civimember, error-page
---


# Question
Title: CiviCRM Upgrade from 4.5beta6 to 4.6.8 - CiviCRM Menu is not displaying/functioning
Stepped upgrade from 4.5beta6 to 4.50 stable to 4.60 to 4.68. Was as beautiful and eventless an upgrade process as I've experienced. Congrats and thank you team.

My only QA issue is with the civicrm admin menu. It is busted.

I can confirm menujs script is loading.
I can confirm html for the menu is present.
I can confirm there are no js errors.
I can confirm resource urls are fine.
I have cleared the caches like a maniac.

So all I can think of is some crazy css conflict, but I can't even...

Clicking on a link causes it to expand its LI's but incredibly broken-like.

Any ideas would be incredibly appreciated.

Thank You!

# Answer
> 2 votes
* To rule out a CSS conflict, try changing the CiviCRM admin theme to a "vanilla" theme, like Bartik. If you have the "CiviCRM theme" module enabled (it ships with Civi), you can do this without affecting public-facing pages.
* You can also try a menu rebuild: `<yoursite.org>/civicrm/menu/rebuild?reset=1`

# Answer
> 4 votes
Its a core issue, civicrm/css/navigation.css doesn't gets loaded if drupal already has navigation.css loaded. Check if your custom theme has navigation.css included, this would cause the error for menu not getting displayed

Fix includes in https://issues.civicrm.org/jira/browse/CRM-17234

HTH Pradeep

---
Tags: upgrade, menu
---


title: How to take payment in Civi event

text:
# Question
Title: How to take payment in Civi event
Is it possible to process card payment for an event direct in Civi event without completing a form on the website?

# Answer
About 2/3rds of the way down the page under "register a participant manually". http://book.civicrm.org/user/current/events/everyday-tasks/
> 1 votes

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


title: DB error with profiles

text:
# Question
Title: DB error with profiles
When I use a fill-in (sign-up) profile on a browser where I am logged in, there is no problem filling in the forms and saving. However, when I try the form on another browser where I am not logged in (or on the same browser after I log out), I get this error message: DB error: No such table exists.

The debugging text shows that civicrm\_acl is missing and in fact, when I examine the database, there is no table with that name. This problem did not exist before so I am wondering what happened.

Below is the debugging text:

Sorry but we are not able to provide this at the moment. DB Error: no such table Error Details Database Error Code: Table 'xxxxx\_civicrm.civicrm\_acl' doesn't exist, 1146 Additional Details:

Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -18
[message] => DB Error: no such table
[mode] => 16
[debug_info] =>    SELECT          civicrm_acl.*
                    FROM            civicrm_acl
                    INNER JOIN      civicrm_option_group og
                            ON      og.name = 'acl_role'
                    INNER JOIN      civicrm_option_value ov
                            ON      civicrm_acl.entity_table   = 'civicrm_acl_role'
                            AND     ov.option_group_id  = og.id
                            AND     civicrm_acl.entity_id      = ov.value
                            AND     ov.is_active        = 1
                    INNER JOIN      civicrm_acl_entity_role
                            ON      civicrm_acl_entity_role.acl_role_id = civicrm_acl.entity_id
                            AND     civicrm_acl_entity_role.is_active    = 1
                    INNER JOIN  civicrm_group_contact
                            ON      civicrm_acl_entity_role.entity_id      = civicrm_group_contact.group_id
                            AND     civicrm_acl_entity_role.entity_table   = 'civicrm_group'
                    WHERE       civicrm_acl.entity_table       = 'civicrm_acl_role'
                        AND     civicrm_acl.is_active          = 1
                        AND     civicrm_group_contact.contact_id         = 0
                        AND     civicrm_group_contact.status             = 'Added' [nativecode=1146 ** Table 'xxxxx_civicrm.civicrm_acl' doesn't exist]
[type] => DB_Error
[user_info] =>    SELECT          civicrm_acl.*
                    FROM            civicrm_acl
                    INNER JOIN      civicrm_option_group og
                            ON      og.name = 'acl_role'
                    INNER JOIN      civicrm_option_value ov
                            ON      civicrm_acl.entity_table   = 'civicrm_acl_role'
                            AND     ov.option_group_id  = og.id
                            AND     civicrm_acl.entity_id      = ov.value
                            AND     ov.is_active        = 1
                    INNER JOIN      civicrm_acl_entity_role
                            ON      civicrm_acl_entity_role.acl_role_id = civicrm_acl.entity_id
                            AND     civicrm_acl_entity_role.is_active    = 1
                    INNER JOIN  civicrm_group_contact
                            ON      civicrm_acl_entity_role.entity_id      = civicrm_group_contact.group_id
                            AND     civicrm_acl_entity_role.entity_table   = 'civicrm_group'
                    WHERE       civicrm_acl.entity_table       = 'civicrm_acl_role'
                        AND     civicrm_acl.is_active          = 1
                        AND     civicrm_group_contact.contact_id         = 0
                        AND     civicrm_group_contact.status             = 'Added' [nativecode=1146 ** Table 'xxxxx_civicrm.civicrm_acl' doesn't exist]
[to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="   SELECT          civicrm_acl.*
                    FROM            civicrm_acl
                    INNER JOIN      civicrm_option_group og
                            ON      og.name = 'acl_role'
                    INNER JOIN      civicrm_option_value ov
                            ON      civicrm_acl.entity_table   = 'civicrm_acl_role'
                            AND     ov.option_group_id  = og.id
                            AND     civicrm_acl.entity_id      = ov.value
                            AND     ov.is_active        = 1
                    INNER JOIN      civicrm_acl_entity_role
                            ON      civicrm_acl_entity_role.acl_role_id = civicrm_acl.entity_id
                            AND     civicrm_acl_entity_role.is_active    = 1
                    INNER JOIN  civicrm_group_contact
                            ON      civicrm_acl_entity_role.entity_id      = civicrm_group_contact.group_id
                            AND     civicrm_acl_entity_role.entity_table   = 'civicrm_group'
                    WHERE       civicrm_acl.entity_table       = 'civicrm_acl_role'
                        AND     civicrm_acl.is_active          = 1
                        AND     civicrm_group_contact.contact_id         = 0
                        AND     civicrm_group_contact.status             = 'Added' [nativecode=1146 ** Table 'xxxxx_civicrm.civicrm_acl' doesn't exist]"]

```

)

Return to home page.

> Blockquote

# Answer
I don't how this situation could have arisen, but the solution is to install CiviCRM (your version) on a spare database and then copy over the civicrm\_acl table to the live database.

You may need to drop the four \*acl\* tables and copy all four from the spare database, but as long as in the end, you have all of the required tables, it should work.
> 2 votes

# Answer
My suspicion is that when you are logged in, you are the administrator? If so, my guess is that the ACL process is skipped for admins so the error condition is not hit.

It sounds like you have a bad install which clobbered the civicrm\_acl table, especially if you don't even see it in mysql.

I am not positive if there is an easy way to rectify the problem. Once I confirmed that the table was missing, I would probably do a mysqldump of it from a system that did have it (freshly installed perhaps?) and then apply it. Of course, it also leads me to wonder what other tables are missing.
> 1 votes

---
Tags: profile, database, acl
---


title: Security of REST API keys

text:
# Question
Title: Security of REST API keys
This OWASP document suggests that API keys for REST APIs should be passed as a POST parameter or a cookie. Not a GET parameter, because they can appear in the server logs.

Elsewhere they suggest that the right HTTP verb be used. Writes already have to be a POST request, so maybe read-only calls should still be a GET request (it makes the intent clearer).

As a GET or a POST parameter, the API key will still need to be accessible to client-side JS (assuming that's what your frontend app is written in). It may therefore be vulnerable to XSS.

A cookie can have the HttpOnly flag set so that on any modern browser it will not be accessible to client-side JS (and therefore safer against XSS). It will still be passed back to the server with each request. To set such a cookie, the frontend and backend probably need to be within the same domain.

In CRM\_Utils\_REST (as of 4.4 at least), the api\_key is retrieved from $\_REQUEST, which includes $\_GET and $\_POST. It used to include $\_COOKIE (which would enable cookies to be used for the API key), but that is no longer the default in PHP due to other security concerns.

Is there any accepted best practice for treatment of CiviCRM REST API keys at the client side?

# Answer
> 2 votes
To clarify, they are two ways of accessing the api over the net, the REST interface (that uses the keys) and the ajax one (that is used for the front end js, and doesn't need the keys)

So if it's client js, the authentication is done through the CMS, so via the cookie session. You shouldn't use the keys.

What we recommend is to always use POST when we use the REST, not matter the action, precisely to avoid having the keys in the GET params, so it's not left in the logs and a bit more protected in general

X+

---
Tags: api, security, rest, cookies
---


title: Upgrade from 4.4.19 to 4.4.2 DB error

text:
# Question
Title: Upgrade from 4.4.19 to 4.4.2 DB error
When I try to upgrade CIVICRM 4.4.19 to 4.4.2 I get the following error message: "Your database is marked with an unexpected version number: 4.4.19. The v4.4.2 codebase may not be compatible with your database state."

The site is operating fine in 4.4.19, but I am running into an error I've seen mentioned here with waitlists not working properly on paid events - it's not, and I understand an upgrade is the solution. Any suggestions would be appreciated. This is, BTW, the Drupal version.

Thanks!

# Answer
Version 4.4.19 is the latest LTS version of CiviCRM. The next LTS version will be 4.4.20. V4.4.2 is an old version that came after 4.4.1 and before 4.4.3.

Not surprising CiviCRM is not happy with you trying to downgrade your site.

If you add a link to the question that referred to waitlist error I can have looked at that to see what versions it refers to. It could be talking about the 4.6.X series.
> 2 votes

---
Tags: database, upgrade
---


title: Print PDF Envelope for single contact

text:
# Question
Title: Print PDF Envelope for single contact
I am looking for a way to add an action or link that will automatically print(generate pdf) an envelope for a contact from the summary tab in civicrm. This would bypass the selection of a template. Any thoughts on a module or link i can use?

# Answer
> 3 votes
The only thing that comes to mind is to write an extension to do this. The only way to do it "out of the box" would be to utilize the Print PDF Letter option and utilize a template that would size to an envelope.

---
Tags: pdf, envelope
---


title: Successful deliveries 178%. Why?

text:
# Question
Title: Successful deliveries 178%. Why?
Sometimes I have more than 100% successful deliveries in the mailings. For a 2700 intended recipients I can have 4800 successful deliveries. I wonder why this happens!

This group contains around 2700 "individual" and 2500 "organizations".

Any help? Thanks!!!

# Answer
It sounds like we have an overachiever here!

More seriously, I suspect that you may have found a bug in the count of recipients that occurs when you have the mailing set to email each contact, regardless of whether the email address duplicates another recipient of the mailing.

It wouldn't be surprising if practically all of the organizations had email addresses that were each actually the same as an individual's email address. If you throw them all into one mailing (by your account and samuelsov's math), you'd have 5200 contacts. Remove a few because they have no email, a few where the email is on hold, a few that have do not email, and a few that bounce, and voila--that's 4800 successful deliveries.

If that's the case, I suspect that the handy counter in CiviMail is simply assuming that you're using the CiviMail setting that suppresses repeat mailings to the same address per run.

You can confirm all this by clicking on the details in your mailing report and viewing the list of actual successful deliveries. I suspect that you'll see both contacts and their organizations, many of whom have the same email addresses.
> 3 votes

---
Tags: civimail
---


# Question
Title: Undefined index in civicrm_member_roles_sync
I'm using drupal 7 with CiviCRM 4.4.6.

I'm using CiviMember Roles Sync with below Association Rules:

Rule ID: 3
"CiviMember Membership Type" --\> "Drupal Role": Member (PG) --\> member
Current Codes: New, Current
Expired Codes: Grace, Expired, Pending, Cancelled, Deceased

Rule ID: 4
"CiviMember Membership Type" --\> "Drupal Role": Member (KK) --\> member
Current Codes: New, Current
Expired Codes: Grace, Expired, Pending, Cancelled, Deceased

In setting "Automatic Synchronization Method", I select "Synchronize whenever a user logs in or logs out."

When user login, error appear as below:

> Notice: Undefined index: 4 in \_civicrm\_member\_roles\_sync() (line 541 of /home/warrior/www/beta/sites/all/modules/civicrm/drupal/modules/civicrm\_member\_roles/civicrm\_member\_roles.module).

Here are drupal user roles available on my site:

ID 3: Web Developer
ID 4: Content & Membership
ID 5: member
ID 6: Membership Admin

I tried to change "Automatic Synchronization Method", but the error still appears.
When I change to "Synchronize when membership is updated", error appears after payment made (membership updated).
When I change to "Synchronize when Drupal cron is ran", error appears when I run cron.

Any idea how to solve this error?

# Answer
> 2 votes
What you've found is that the error appears whenever your sync runsTwo things:

1. This is a PHP notice, which is a very low-importance message to receive. Nothing is breaking; this is just something to say that something mildly improper is going on in the code. Notices like this are actually something you should suppress on a production site: in the Drupal menu, go to **Configuration**, then under Development click **Logging and Errors**. Select `none` under Error messages to display. That will make the error quit appearing on screen, but it will still probably appear in your log, so it's worth getting to the bottom of it.
2. It does reflect an actual bug (albeit small) in CiviCRM's code. Basically, this line of code asks whether the item in the `$memberroles` array for a contact's membership's membership type is an array. Well, it's possible that the `$memberroles` array doesn't have an item for that membership type: it's only populated with the membership types for which you've got sync rules set up. Apparently, in your case, at least someone has a membership of a type that doesn't sync with a Drupal role. This is normal and okay; the code just doesn't consider this situation.

Apparently, the problem still exists in the development version of the code. Please log in at issues.civicrm.org and log an issue for this. The fix will take no time, but it's good to have a record of the bug there.

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


# Question
Title: How can I automatically advance to the next member of a filtered group upon webform submission?
I've created a webform for a phone caller to use when calling members of a Civi Group who have already signed a card, to sign the Group members up for follow up activities.

Once the phone caller completes the call, and submits the form, I want a new form to populate with the name of the next Group member to be called.

The "target" contact is an Existing Contact, I have the Form Widget set to Static, under Default Value I have Set default contact from Auto - From Filters, and under Filters I've chosen only the relevant Group.

But the first name in the Group reappears upon Submit.

# Answer
> 3 votes
This is no quick solution (though I suspect there isn't a reliable one), but just as a note for future development--this situation of grabbing the "next call" is precisely why reserving contacts in the phonebank feature exists. I think the real solution (that may be out of your immediate budget and timeframe Joe, but is what would actually tackle the issue) is to have a nice frontend on the phonebank.

Just as I call exposing a profile in create mode for semi-privileged users "intern mode"--for allowing someone to enter contacts without actually giving them full CiviCRM access--a phonebank listing would let someone go down the list of contacts reserved for them and potentially reserve a few more as the caller gets to the end of the list. That would solve this problem in a non-Drupal-centric way, use the nice "reserve" feature to handle the situation in Chris's comment, and provide a complete experience for those running and staffing the phone bank.

---
Tags: webform-civicrm
---


title: onbehalfof organisation sign up problem

text:
# Question
Title: onbehalfof organisation sign up problem
We have a problem that may have started after upgrading from 4.4.11 to 4.4.19 on Drupal - anyway, it's started happening fairly recently.

We have public page that allows for a membership contribution for an individual to register/sign up and create an organisation at the same time (Employer of). Normally there's a contribution in the Organisation and a membership record in the organisation - and a membership by relationship for the individual.

The problem is that the individual membership record is not being created now. (It can be fixed up by admin to create the relevant record).

I've been tracing the code and I think it is a relationship permission problem. If I remove a permission check in CRM\_Contact\_BAO\_Relationship::getRelationship() then the right record is created. However this doesn't seem like a good fix for the problem.

Can anyone think of a change to permissions or onbehalfof around this time which might have this effect.

We do have some custom code in this area - which adds permission is\_permission\_b\_a in CRM\_Contribute\_Form\_Contribution\_Confirm::processOnBehalfOrganization() - I think I've tried removing that .

Thanks, Chris

# Answer
> 1 votes
There was a similar issue reported in https://issues.civicrm.org/jira/browse/CRM-17067 where inherited membership(s) not created due to permission check in getRelationship(). I have submitted the PR in the ticket itself and the reason why the PR is still not merged is because there are some ACL changes going in 4.6.9 and that will fix the remaining issues reported by Dave Jenkin in his last comment.

# Answer
> 0 votes
Assuming you have no custom code that explicitly creates the membership on the individual, your individual's membership is inherited from the organization's membership by the settings on the organization's membership type.

**A change in membership type** granted on the form from one that has inheritance by relationship to one that doesn't could be the culprit.

Likewise, **limiting the number of contacts who can inherit** the membership, also set on the membership type, could result in this. If you have a limit, CiviCRM may not automatically grant the membership.

The permissions on the relationship *should* not make a difference. The paradigm is a trade association: one employee should be allowed to manage the organization record and the other employees, but all of the employees should have the benefits of membership. Membership inheritance is not affected by the permissioning on a relationship in stock CiviCRM.

---
Tags: civimember
---


# Question
Title: Is it possible to view multiple payments on a registration as separate Contributions?
I need to export data regularly for the bookkeeping end of our operations, and when there are participants have have multiple payments on their event registration, their payments show up as follows (in both the Contribution list and in the exported file):

Total Amount = the price of their selection regardless of how much they actually paid

Fees = $0, regardless of if there were fees associated with their transaction

Net Amount = the price of their selection

What I would like is to have the individual transactions associated with their registration show up as individual contributions. As it is, it is very confusing.

Does this need to be a feature request? Is it a bug? Is there a work around for this?

Here are some screenshots of a specific case:

This is the detail of an event registration, with two payments totaling $725.

This, of course, is the payment details.

Here is how this shows up in the list of contributions. It may (or may not) make sense from an accounting perspective to list $785 as the total amount put into an Accounts Payable, but I don't want that level of accounting in my civi installation. I just want to be able to see in the contribution list that this person made two payments, on these dates, in these amounts, not that they promised to make this one payment when they first signed up.

# Answer
> 1 votes
I can understand what you are trying to do - yes this is the way Civi works

**For Accountant Point of View** I guess they will be more interested in the CSV from batch export which will make more sense to them

where you can see Credit account type clearly says

INC (Invoice) - 1000 AR (Amount received)- 10 + 990 =\> 1000

with different nominal codes

If you are not happy with this output then you need to create an extension for each changes - I guess this helps

---
Tags: civievent, contributions, export
---


# Question
Title: Form not being submitted on confirm contribution
I have a contribution campaign to accept donations on a site. Regardless of whether the payment processor is Stripe or Test, when submitting the page on the site with the correct payment deatils in the page just gets rendered again with a blank form, never progressing to the summary page with the "make contribution" button. On the other hand, in the admin dashboard when clicking on Links-\>test drive and then going through the process everything works smoothly and the payment is processed. What can the problem be?

**UPDATE:**

After further investigation using Tamperdata, the request is

**Working**

**Request from Civicrm admin dashboard**

```
Host=101.122.67.45
User-Agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language=en-US,en;q=0.5
Accept-Encoding=gzip, deflate
Referer=http://101.122.67.45/wp-admin/admin.php?page=CiviCRM&q=civicrm/contribute/transact&_qf_Main_display=true&qfKey=85423cf986fdeb631dd7c5e4c0bad81e_5551
Cookie=wordpress_083d326810ec17903325f7b61c4f9088=COOKIE_LOGGED_IN_USER; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_083d326810ec17903325f7b61c4f9088=andrea%7C1437352434%7CHWOTKzfHmQimVC2IUYuT6ebqBLNe3RCP9bkIB8AzoJ9%7Cf9726d5bd3b53f33c9db4f10c108d2bf6978ef9a1022dda7637db30211ca9c8b; wp-settings-1=editor%3Dhtml; wp-settings-time-1=1437179635; PHPSESSID=gn5e13pkq6lfdd5bq7tjpv2e14; __utma=239134727.820967299.1437178983.1437178983.1437178983.1; __utmb=239134727.4.10.1437178983; __utmc=239134727; __utmz=239134727.1437178983.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); displayCookieConsent=y; __utmt=1
Connection=keep-alive
Content-Type=multipart/form-data; boundary=---------------------------1914650991686166477678502416
Content-Length=3146
POSTDATA =------

```

**Response**

```
Status=Found - 302
Date=Sat, 18 Jul 2015 00:37:37 GMT
Server=Apache/2.4.7 (Ubuntu)
X-Powered-By=PHP/5.5.9-1ubuntu4.9
Expires=Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control=no-cache, must-revalidate, max-age=0
Pragma=no-cache
X-Frame-Options=SAMEORIGIN
Set-Cookie=X-Frame-Events_52c2f7692fdc8e76425fe47b80fe421d=%7B%22event%22%3A%22CiviCRM%22%2C%22context%22%3A%22attach_to_post%22%7D
Location=http://101.122.67.45/wp-admin/admin.php?page=CiviCRM&q=civicrm/contribute/transact&_qf_Confirm_display=true&qfKey=85423cf986fdeb631dd7c5e4c0bad81e_5551
Content-Length=0
Keep-Alive=timeout=5, max=100
Connection=Keep-Alive
Content-Type=text/html

```

**Non Working**

**Request from website form**

```
Host=101.122.67.45
User-Agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language=en-US,en;q=0.5
Accept-Encoding=gzip, deflate
Referer=http://101.122.67.45/civicrm/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=1&action=preview
Cookie=wordpress_test_cookie=WP+Cookie+check; PHPSESSID=gn5e13pkq6lfdd5bq7tjpv2e14; __utma=239134727.820967299.1437178983.1437178983.1437178983.1; __utmb=239134727.2.10.1437178983; __utmc=239134727; __utmz=239134727.1437178983.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmt=1; displayCookieConsent=y
Connection=keep-alive
Content-Type=multipart/form-data; boundary=---------------------------12659349391619910645601300712
Content-Length=3137
POSTDATA =-----------------

```

**Response**

```
Status=Found - 302
Date=Sat, 18 Jul 2015 00:28:46 GMT
Server=Apache/2.4.7 (Ubuntu)
X-Powered-By=PHP/5.5.9-1ubuntu4.9
Expires=Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control=no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma=no-cache
X-Pingback=http://101.122.67.45/xmlrpc.php
Location=http://101.122.67.45/civicrm/?page=CiviCRM&q=civicrm/contribute/transact&page=CiviCRM&reset=1&id=1&action=preview
Content-Length=0
Keep-Alive=timeout=5, max=100
Connection=Keep-Alive
Content-Type=text/html; charset=UTF-8

```

For some reason the request from ~~the admin dashboard panel is slightly different than from the web form on the site~~ the public web form fails to set the `qfKey=` parameter resulting in

```
// Get proper entry URL for returning on error.
if (!(array_key_exists('qfKey', $params))) {
  // Probably not called from a civicrm form (e.g. webform) -
  // will return error object to original api caller.
  $params['stripe_error_url'] = $error_url = null;
}

```

Missing the query parameter generates an incorrect response. Why is this parameter not being sent while it exits in the hidden input form on the public site?

# Answer
> 1 votes
To solve this problem I uninstalled all the plugins and left only Civicrm, that made the form to submit correctly. Then I re enabled each plugin one at a time, just the ones I needed and not only disabled but also removed all the other ones. The form now submits correctly.

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


title: Cron Job failure

text:
# Question
Title: Cron Job failure
Since installing a later version of 4.6.x the cron job fails as shown in the attached image. Oddly enough the Bounces Processor continues to function and all of the Scheduled jobs can be run manually successfully.

No changes have been made to the configuration other than upgrading to later releases of CiviCRM.

I am using Drupal 7.39 and CiviCRM 4.6.8.

# Answer
> 1 votes
This issue was fixed in https://issues.civicrm.org/jira/browse/CRM-16584 (4 days ago) and here's the patch https://github.com/civicrm/civicrm-core/pull/6744/files . So please wait for the next 4.6.9 release. Thanks :)

---
Tags: cron
---


# Question
Title: Importing contributions with soft credits fails with spurious email error
I'm trying to import some contributions. Each contribution has a soft credit field which is an email address. I've set the field mapping to Soft Credit / Email / Solicited. All the rows are failing with `Invalid email address(doesn't exist) <email> for Soft Credit. Row was skipped` but there are contacts with those email addresses.

# Answer
This is a bug, covered here on the civibugtracker:

https://issues.civicrm.org/jira/browse/CRM-17163?jql=text%20~%20%22import%20email%20soft%20credit%22
> 1 votes

---
Tags: import, contributions, 4.6
---


# Question
Title: hook for search a household contact with the surname individual field from online contribution page
We are an association of parents of students.

We have a Contribution page for Membership Registration. But we can only add individual and organization fields to this contribution page, no household fields. Is this a CiviCRM bug?

Then we need a hook to search the household contact with the surnames of the individual contact, and if found, link the contribution to that household, and if not found, add new one.

Currently we have to link the individual and household records or create a new household and remove the individual.

How can we configure a contribution page to add and link an individual and a household record properly?

# Answer
If you're in Drupal, I would use Webform with Webform Civicrm Integration to collect more data. It allows you to collect info for multiple contacts as well as to create relationships between them. So for your use case, you could have for example a parent contact, a student contact, and a household contact, while all the relationships such as household member-household and parent-child get created automatically.

If you're in wordpress, I'm not sure what the right plugin is, but I bet there is something similar you could use.
> 1 votes

---
Tags: contacts, contributions
---


title: Change password profile

text:
# Question
Title: Change password profile
I'm running CiviCRM under Wordpress.

I want to create a donor area, where they can change their information. But I can't find way to let them change their password.

Why is not possible to add a "password" field in profiles?

# Answer
You can't put this into a profile afaik. I use Profile Builder to create a separate front-end WP page. Theme My Login works ok too.
> 5 votes

# Answer
CiviCRM does not maintain logins or credentials. It instead opts to let the CMS (WordPress in your case) to manage it all. CiviCRM can maintain the link between a user account on the CMS with a contact in CiviCRM though.

As Andrew West points out, you need to manage the password via WordPress.
> 6 votes

---
Tags: profile, user-account
---


# Question
Title: Security alert - how to manage the download
I am new to the CiviCRM interface, and am trying to build a conference registration form within www.jesuitschoolsnetwork.org. I have repeatedly been notified that there is a needed update due to a security issue. Our site runs on Drupal 7x, and I have downloaded civicrm-4.6.8-drupal.gz, but am not sure what to do with the download.

# Answer
Follow the instructions at http://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7. If you have questions about the documentation, please post a separate question back here.
> 3 votes

---
Tags: upgrade
---


title: Error when upgrading to vs 4.6.8

text:
# Question
Title: Error when upgrading to vs 4.6.8
My work partner and I were trying to upgrade Civi from vs 4.5 to 4.6.8 and got an error that we couldn't figure out. We are using Wordpress. Here's a screen shot of the error message we got: https://docs.google.com/document/d/1XEd5SqrbFbgwzHFBRG1oW3UMZLX\_YtuizroLPLjvViI/edit Can anyone help me with this? We are not even sure what it means (I have to note here that I'm not very knowledgable about code). Even though we got this error I was still able to login to Civi and see all my data, but I'm nervous that something might be wrong that I can't see yet. Any help is much appreciated! Thanks, Lauren

# Answer
That table is involved in reminders, and was introduced in CiviCRM 3.4, so there is a serious issue with your database. I recommend restoring a backup of your site and database (you have those, right?) and trying the upgrade again. Please note the first errors you get, as those are often most useful in diagnosing what is going wrong, rather than later more serious messages.

It would likely be a good idea to verify that the table is in your backup before starting the upgrade.
> 2 votes

---
Tags: upgrade
---


# Question
Title: Receipts in dashboard and annual receipts
I'm running CiviCRM under Wordpress.

I'd like to give donators access to their receipts at any time. Do you know if I can add them in a sort of user dashboard, so they can download them as pdf (same pdf recieved by email) ?

Is there a way to generate annual receipts, with all year contributions ?

Thank you if someone has an idea !

# Answer
> 4 votes
Do these users have their own individual logins to your website? If not, it would be difficult to provide them access to their receipts again. If they do, then some custom code could be written to generate them.

Your annual receipts is a bit more doable. You could schedule an email to be sent to all donors on January 1, that listed their donations, or at least the total amount of donations. There is a CiviCRM extension called Summary Fields what keeps running balances which probably would help here.

(Note that listing the donations in the year might require a small amount of customization.)

---
Tags: receipts
---


# Question
Title: What is required to run CiviCRM on DigitalOcean?
DigitalOcean provides one-click installation of WP, Drupal and CiviCRM. I hope this question can collect experiences with it to help others.

* What additional considerations are there for hosting CiviCRM on DigitalOcean?
* Are there any specific configurations or patches required?
* Is there any functionality which differs from hosting CiviCRM on a "standard" LAMP stack?

# Answer
I setup Drupal and CiviCRM on my Digital Ocean Droplet by hand, but you'll face this issue regardless of how you setup. This answer is sufficiently long and complex that I'm setting up a complete guide on my wiki.

DO does not allow SMTP traffic on their IPv6 network. As a result, PHP applications that normally succeed in sending email will be unreliable, slow or outright fail. CiviCRM is one that can be especially challenging to configure for outbound email at DO. Although the simple mail() function appears to work, I don't think it offers the control or performance you might need. In my case I wanted to use Google Apps for Business to send my email.

The first thing you need to do is to set your hostname to a fully qualified domain name. When you set your hostname to a FQDN, that will cause the DO system to create a PTR record in DNS for your host. Without a PTR record, many major email providers (Comcast/HotMail/Yahoo) will refuse to talk to your host and those messages will disappear into the void (check /var/log/mail.log). CiviCRM will report those messages as 'sent', but the recipient will never get it, not even in spam, because it never left your server.

You must setup an A record for your FQDN at your DNS provider. The PTR record should be automatically setup by Digital Ocean.

```
dig foo.example.com
dig -x foo.example.com

```

Assuming you want to configure CiviCRM to use an external SMTP server such as Google Apps for Business (aka SMTP relay also known as smarthosting) you will suffer connection timeouts. Some apps such as PHPMailer can be made to work with a hack using gethostbyname(), but the configuration for CiviCRM will only allow you to enter the hostname; and no permutation will work. Instead, tell CiviCRM to use 'sendmail'. Meanwhile sendmail is not actually installed. Postfix can be installed as the MTA and you can configure Postfix to send mail to Google. The 'hack' is to also bind Postfix to 0.0.0.0 so that it uses IPv4

With the PTR record in place, and Postfix installed relaying SMTP to your provider over an IPv4 network, and CiviCRM set to use 'sendmail' you can now use your CiviMail.
> 7 votes

# Answer
I've been running several CiviCRM sites on DigitalOcean for the past year and have been quite happy. I've been using Nginx, MariaDB,and PHP-FPM to serve both WordPress and Drupal instances. While I've never used their one-click installations, they should work just fine assuming you're comfortable working in a Linux environment.

As Greg mentions,you may experience problems if you try to send on a server with IPv6 enabled. IPv6 is given priority over IPv4, so if you want to send from a DigitalOcean server you'll want to considering disabling IPv6 or force your MTA to use IPv4. I've gotten around this at times by using Mandrill for my transaction emails.

I've found services like Mandrill and Sendgrid much more convenient than configuring and maintaining my own mail server. The quotas they offer free users are quite generous so most sites are unlikely to burn through it. There's an extension to take advantage of Mandrill's webhooks that is helpful too.

If you opt to serve CiviCRM using a LEMP stack, you should keep in mind that Nginx doesn't use .htaccess so you'll need to adjust your server block(s) accordingly. I'm beginning to compile sample configurations for deploying CiviCRM with Nginx, but this is very much a work in progress.
> 5 votes

---
Tags: hosting, hosting-providers, digitalocean
---


title: localization on wordpress

text:
# Question
Title: localization on wordpress
I'm trying to translate civicrm into french but can't figure out how to do it. I tried to put the l10n and sql folders in wp-content/plugins/civicrm/ and in wp-content/plugins/civicrm/languages. I also tried to put the fr\_FR subfolder directly in these folder and directly the l10n/fr\_FR/LC\_MESSAGES/civicrm.mo file in the same places.
I also tried to chown these files and folders to www-data and to run a chmod 777 on them...
In the admin, only the default english appears, whatever what I try.
I checked the doc but I couldn't find the wordpress documentation (I just found for joomla and drupal). Can you help please?

Thanks a lot!

# Answer
> 3 votes
For Wordpress, make sure you have the following structure of files:

```
plugins/civicrm/civicrm/l10n
plugins/civicrm/civicrm/l10n/fr_FR/LC_MESSAGES/civicrm.mo
plugins/civicrm/civicrm/sql/civicrm_data_fr_FR.sql
etc

```

Reference documentation:
http://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+WordPress

---
Tags: wordpress, localisation
---


title: Payment Gateway return URL

text:
# Question
Title: Payment Gateway return URL
I'm trying to integrate CiviCRM with a payment gateway. I'm using the method notify where user will have to key in credit card detail in payment gateway website.

I have followed CiviCRM guide at

However i'm not clear on the return URL. In the payment gateway configuration I can enter the URL so that after the payment is made, it will redirect the user back to my CiviCRM website. However i'm clueless on the value that I should enter.

**Update**

The payment gateway is senangPay.my (specific to Malaysia, accept visa/mastercard and bank account transfer). The guide for integration is available at http://guide.senangpay.my/manual-integration-api/

The still in progress plugin is available at:

**Update 2 (implemented answer from Chris Burgess)** Added handlePaymentNotification() but it does not seems to work. It does not execute the function. Refer to GitHub I just added redirect URL to thank you page. However when I tried it just return to main page. FYI when payment gateway redirect the user back to CiviCrm page it will redirect to http://civicrm.secretgroup.my/civicrm/payment/ipn?processor\_name=senangpay&status\_id=0&order\_id=144283261515&transaction\_id=14428326334290&msg=Your\_payment\_was\_declined.\_Please\_check\_with\_your\_bank.\_Thank\_you.&hash=07a5b4aa22b086bfe583f97474ca3401&component=event&contactID=39&contributionID=31&contributionTypeID=4&eventID=1&invoiceID=f237d39119b5c7f358127bbf8287e49f&membershipID=&participantID=13&qfKey=2f9e11313ad9d55bec78f759dfdad420\_9895

Thanks!

# Answer
> 1 votes
Where you return the user depends on your gateway's payment workflow. There are a couple of options.

If the user is returned without additional information (the gateway handles payment confirmation via direct comms between your server and theirs), then you can simply return the donor/registrant to the final "thanks" page.

If the user is returned with additional information (the gateway notifies of payment via some additional tokens / parameters in the browser redirect) then you might want to return the user to `civicrm/payment/ipn`, in which case you'll be implementing `handlePaymentNotification()` in your payment method.

If users are redirected back to the IPN you need to consider handling duplicate IPN attempts (browser reload, or IPN from both browser and gateway) by making sure you don't close off the transaction twice. You will probably also want to send an appropriate redirect for browser IPN so that the donor / registrant ends up on the right page eventually.

---
Tags: payment-processor
---


# Question
Title: Creating other relationships for memberships on behalf of an organization
Having trouble with memberships created on behalf of an organization that need a different relationship type than Employee of/Employer. I have a suspicion I'm simply approaching it the wrong way.

We have Individual and Institutional membership types. For Institutional memberships, there is a relationship type set of Designate of/Designator. The contribution form for purchasing Institutional memberships uses its own price set and price options set correctly to create that membership.

Included in this contribution form are the 'On Behalf of Organization' profile and the WordPress user account form.

When a new user purchases an Institutional membership the following get created:

* New Individual contact (Contact A).
* New Organization contact (Contact B).
* A new Institutional membership for the Organization.
* A relationship of Employee of/Employer between Contact A and Contact B.

Missing from these is the Designate relationship so that Contact A also inherits the membership. I'm not sure why this relationship isn't created despite the membership type requiring it.

The solution I'm pursuing now relies on implementing `hook_civicrm_post` in a plugin and doing some lookups with the API based on the membership object to create this relationship after the fact.

However it seems to be that nothing about Contact A (individual) who made the contribution on behalf of Contact B is available beyond the employee/employer relationship - which might exist for any number of other employees that are not the designate. I especially want to avoid this potential issue.

My expectation would be to find this in that particular Contribution object but no dice. Right now I'm thinking either getting Contact A's contact\_id from the pre hook or from the form submission itself.

Is this behaviour a bug or am I missing an obvious setting? If not, surely there is a better way via the API?

# Answer
> 3 votes
I can think of two approaches.

One - instead of `hook_civicrm_post`, use use `hook_civicrm_postProcess`, like you describe, to grab the Contact A id.

Two - use `hook_civicrm_post` on the Membership object rather than the Contribution object. This should get you Contact B's id. You can then use an API `get` to look up the most recently created Relationship for Contact B, which should be Contact A. Then use an API `create` to create your new Relationship.

I'd probably go with option two, personally.

---
Tags: wordpress, civimember, relationships
---