# Question
Title: Is it possible to allow the person submitting a webform with CiviCRM to decide whether an activity is created or now?
Is it possible to expose a field on the webform to the person submitting the form to allow them to decide if the activity is created?

There are some situations where we would want the person submitting the form to decide if they would like to create a follow up activity,

Thanks

# Answer
> 4 votes
The following steps should do it (requires version 4.10+ of the webform-civicrm integration module):

1. Make the "Activity Type" field "User Select"
2. Customize that field to remove all options except for "None" and the activity type you want.
3. Optionally rename the field on the webform "Create Activity"
4. Optionally rename the option labels to "Yes" and "No"

---
Tags: webform-civicrm
---


title: Paypal Standards IPN ERROR

text:
# Question
Title: Paypal Standards IPN ERROR
I'm having some problems with Paypal Standards. I was originally getting an error #40710 that my return URL was no good, so I disabled Auto return in paypal. Now I am getting this error: Sending a relative URL to PayPalIPN is erroneous. Please make your resource URL (in Administer » System Settings » Resource URLs ) complete. I even disabled the IPN feature in paypal but still get the error and unable to make a donation through paypal.

How do I get Auto Return and IPN features working?

# Answer
Did you check your resource url setting? If so, what is it?

It needs to be a complete url, as explained in the help for that field:

http://mysite.mydomain.com/sites/all/modules/civicrm/
> 2 votes

---
Tags: paypal
---


title: Sum of recurring contributions

text:
# Question
Title: Sum of recurring contributions
I volunteer for a NGO and we try to accomplish the following: we want to aggregate the sum of all current recurring contributions (of type=X) over all members. It doesn't matter what status they have (paid, pending...) but one member should only be counted once. **It's a snapshot with the result of one single value of all the recurring contributions, so to say.**

I looked through the available reports in the dashboard and went through the different API methods. It seems like it would be possible to get all contacts through the API and then loop over their contributions (complexity!) to aggregate the sum, but I thought there would be a nicer way?!

Any recommendations on how to accomplish this? Any hint is appreciated, thanks!

# Answer
Turns out we were implementing recurring payments in our own way not using the standard in CiviCRM. Custom fields were involved, so in the end I decided to write a custom SQL query to sum all the relevant values.

Maybe the summary fields module would be something people are also looking for to solve similar problems: https://github.com/progressivetech/net.ourpowerbase.sumfields

Thanks to Eileen for the hint with the contribution search, would have worked if we actually used those recurring contributions :)
> 0 votes

# Answer
In terms of an aggregation of actual contributions - in the contribution search (version 4.5+) it's possible to use recurring contribution dates in your criteria. The contribution search results page includes a total & count.

That doesn't really answer your 'one membership should only be counted once' though. I'm not sure I understand that requirement. It seems like you only want to count one payment per person? If you only searched within a particular time period perhaps you would exclude the others?
> 2 votes

---
Tags: civicontribute, contributions, recurring-contributions
---


# Question
Title: Is there a way to send an email about security updates?
In Drupal there is an option to have an email sent periodically when there are updates (in general, or only security updates) available:

I know CiviCRM already checks for updates and obviously has some pretty complex email functionality.

Have they been tied together in a similar way -- for example, to allow an email address or group to receive an email if a security release is ready?

# Answer
1. There is a security notification civicrm group that you can subscribe to on civicrm.org

https://civicrm.org/advisory/subscribe

2. Security updates and notifications have not been tied as yet. Definitely this would be a good addition to the project
> 6 votes

# Answer
Note that a lot of work has happened on CRM-13823 that would facilitate this, primarily a rewrite of the System.check API. That work will land in 4.7 - it's not merged in core, but can be found here.

If you want the functionality you're describing now, and you run Nagios/Icinga, consider installing CiviMonitor.
> 3 votes

# Answer
Note that in 4.6 the in-app notifications have already been improved to display security updates as different from normal updates, and seperate display preferences for both.
> 3 votes

---
Tags: security, admin
---


# Question
Title: Hook to change the Success message after CiviCRM submits a form?
I'm writing an extension implementing hook\_civicrm\_post to move contributions from individual to household if the individual is part of a household. However, I'd like the form to either redirect to the HOUSEHOLD summary or to display something about the household in the Successfully saved status message popup so the user doesn't think the contribution entry failed.

Any ideas how I can do either of those things from the extension?

# Answer
> 3 votes
You can redirect using the

```
CRM_Utils_System::redirect($urlyouwant)

```

and use

```
CRM_Utils_System::url

```

to build the url itself.

you can as well display pop up messages using CRM.alert() or CRM.status()

That page describes the options or how to call them from php too: http://wiki.civicrm.org/confluence/display/CRMDOC/Notifications+and+Confirmations

# Answer
> 4 votes
Xavier's answer is generally right but because you are in the context of a form I advise *don't* use the function `CRM_Utils_System::redirect` because that is a rather blunt instrument, and breaks pop-ups and other ajax-based forms (which don't follow the normal round-trip webpage lifecycle). Instead from your hook you can call `CRM_Core_Session::singleton()->pushUserContext($urlYouWant);` and the form controller will take care of doing the actual redirect or other appropriate action.

So from your hook you'd do:

```
$url = CRM_Utils_System::url('civicrm/my/path', 'argumet=1');
CRM_Core_Session::singleton()->pushUserContext($url);
CRM_Core_Session::setStatus(ts('Your foo has been barred'), ts('Saved'), 'success');

```

---
Tags: extension, hooks, redirect
---


title: How to find contacts with no group?

text:
# Question
Title: How to find contacts with no group?
I want to do some spring cleanup and see who in my individual contacts aren't in any group, is there an easy way to do it?

# Answer
> 4 votes
The easiest is probably to install the extension I just created, thanks to Nicholai magic sql suggestion:

https://civicrm.org/extensions/lonesome-find-contacts-without-group

Otherwise, the clunkier way I found is to use the custom search exclude/include and select every group in the exclude fields.

It works, with two issues still \- it does include organisations (that are often without a group) \- it's a bit of a pita to select all groups when you have more than a handful

# Answer
> 9 votes
The best solution would be to use search builder like so:

However as Laryn noted there was a bug preventing this from working. I've filed an issue for this, and worked up a fix that hopefully will make it into the next release.

# Answer
> 5 votes
This is a workaround, but it will get what you need with minimal effort. Use the Import Contacts feature. On the first screen, choose Update. Instead of a CSV file as the source, use the SQL query option like so:

```
SELECT
    c.ID AS InternalContactID
FROM
    c9.civicrm_contact c
WHERE
    c.contact_type = 'Individual'
    AND NOT EXISTS (
        SELECT 1 FROM
        c9.civicrm_group_contact c2
        WHERE c2.contact_id = c.id)
    AND NOT EXISTS ( -- don't forget to check smart groups
        SELECT 1 FROM
        c9.civicrm_group_contact_cache c3
        WHERE c3.contact_id = c.id);

```

Map the field if it isn't already, and continue to the next screen. Here, you can add the contacts to a group or assign a tag. Click Import Now and you have a "No Group" group that your users can work with.

This technique with Import gives us a full-featured Search Builder for the SQL-savvy.

---
Tags: search, custom-search
---


# Question
Title: How do I correct the fault causing "file_exists(): open_basedir restriction in effect"
Warning: file\_exists(): open\_basedir restriction in effect. File(/usr/share/doc/php-tcpdf/examples/images/) is not within the allowed path(s): (/nhldata/631/106631/data/web:/usr/local/php55/share/pear:/var/tmp/php:/tmp:/usr/local/php55/lib64) in /nhldata/631/106631/data/web/predigerforum/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/packages/tcpdf/tcpdf\_autoconfig.php on line 96

I got this message when I initially installed too. The only workaround seemed to be to insert "@" before the file\_exists calls in the referenced PHP files...

There must be some kind of configuration error or permissioning problem that I could not find?

I'm running civiCRM 4.6.2 under the latest Wordpress

# Answer
Take a look under Administer/System Settings/Directories. It sounds like your directory for Images may be incorrect, or not yet defined.
> 3 votes

---
Tags: wordpress
---


# Question
Title: Can hook_civicrm_links create links beside rows of a contact's Events tab?
I've looked at CRM/Event/Selector/Search.php to see it creating the View/Edit/Delete links, but am just unsure how to make this work. Can someone advise what the appropriate $objectName and $op should be? I'd like to do something like this:

```
function testmodule_civicrm_links( $op, $objectName, $objectId, &$links, &$mask, &$values ) {

  switch ($objectName) {
    case ???:  //Event or Contact perhaps?

      switch ($op) {
        case ???:  //a participant selector perhaps?

            $links[] = array(
                'name' => ts('Send Invoice'),
                'title' => ts('Send Invoice'),
                'url' => 'civicrm/activity/email/add',
                'qs' => 'action=add&reset=1&cid=%%cid%%&selectedChild=activity&atype=3&pid=%%id%%'
              );
          break;
      }
  }
}

```

Where %%id%% comes in from the context of that row in the grid. If I can't get there with a hook, would it be prudent to extend CRM\_Event\_Selector\_Search and override the links function with my own?

# Answer
> 1 votes
$op = 'participant.selector.row'; $objectName = 'Participant';

The hook is called from CRM\_Core\_Action::formLink

search for the above string in CRM/Event/Selector/Search.php, and the last couple of arguments gives the needed values which is then passed on to the hook

---
Tags: hooks, developer, links
---


title: Token not evaluating in CiviMail

text:
# Question
Title: Token not evaluating in CiviMail
I have a token for a custom field in my email template, but its not being replaced with the value when the email is sent.

What's wrong? How can I fix it?

# Answer
> 3 votes
If you can produce a test for the email, and the token is replaced by the field value, then you might have a permission issue.

It might be buried deeply, but see which role your Cron user has. Be sure the "CiviCRM - access all custom data" is on for your Cron user.

---
Tags: civimail, custom-fields, tokens
---


# Question
Title: Error importing custom date fields when the day of month is above 12
Am new at this. I have created custom fields called Date Left and Date Reinstated in the dd/mm/yyyy format. When I try to import the data, days bigger than 12 are shown as errors, and up to 12 come in, but as mm/dd/yyyy. We have already imported into built-in date fields successfully using dd/mm/yyyy. Am using CiviCRM 4.6.2 on Joomla!3.4.1.

# Answer
> 1 votes
In the CiviCRM engine the usuall date format is YYYYmmdd hhmm. You could try that date format. You could leave out the hhmm part.

Explenation of the format \- YYYY = year in four digits (2014) \- mm (months in 2 digits, 01 for january) \- dd (day of month in 2 digits e.g. 21)

---
Tags: civimember, joomla, date-preferences
---


title: How do I use Views with CiviCRM?

text:
# Question
Title: How do I use Views with CiviCRM?
Can someone tell me what I need to use Views with CiviCRM? Is it the regular Drupal Views module with another module that provides integration?

Also, how would I use Views to display a count of how many people are registered for each of my events?

# Answer
> 2 votes
Also note that if you are using custom fields in your views you have to check the permission Access all custom data. For all people using views. If drupal cache is cleared the views are rebuild based upon the role the user who is clearing the cache, meaning that the custom field permission will be checked against that user.

# Answer
> 12 votes
It is the regular Drupal Views module, but if you have Drupal and CiviCRM in separate databases, you have to edit your settings file to let Views know where to find the CiviCRM data. (Coleman notes in addition: *"if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db."*) You can find the information you need to add to settings.php at **Administer \> System Settings \> CMS Database Integration**.

The wiki page has a pretty good tutorial on how to get Views working.

Then you can use default Views functionality on CiviCRM data -- for example:

* set up a View for CiviCRM Participants,
* turn on Views aggregation,
* add the Event Title field (Aggregation settings: Group together)
* add the Participant ID field (Aggregation settings: Count)

# Answer
> 3 votes
CiviCRM ships with a bundled module for Views 3 integration, all you have to do is turn it on.

If you are using a separate db for Civi, you'll also need to follow the instructions at **Administer \> System Settings \> CMS Database Integration**. Note that if your drupal sql user and civicrm sql user are different then you need to grant SELECT privileges to the drupal one for the civi db.

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


# Question
Title: Need to create a SepaMandate for street walkers?
Business logic: Customer sends out street walkers who recruit recurring donors on the streets with forms in their hands (or on their tablets). They need to create SEPA mandate reference numbers in advance. Customer has implemented the basic CiviSepa and CiviBanking extensions. I am going to add this functionality to the CiviSepa extension (see https://github.com/Project60/org.project60.sepa/issues/271)

To generate these required Sepa mandate reference codes I thought I could use the API SepaMandate with the create action. This API requires an entity table and id, which I do not have yet. Should I still use the API or should I set up a separate table for the generated references and use those to create a mandate once the recurring contribution is added?

# Answer
> To generate these required Sepa mandate reference codes I thought I could use the API SepaMandate with the create action. This API requires an entity table and id, which I do not have yet.

There's currently two API calls for creating a SEPA mandate: `SepaMandate.create` and `SepaMandate.createfull`. The first one requires indeed a contribution/recurring\_contribution to exist, the second one will create both in one go. Both of them take a `reference` parameter with an externally generated mandate reference number. If this is not set, a new reference number will be generated. Does that answer your question?
> 3 votes

---
Tags: api, civisepa, recurring-contributions
---


# Question
Title: Error in civix generate:api "You cannot change the session module's ini settings at this time"
When attempting to run this:

```
civix generate:api Invoice Create

```

It creates an /api/v3/Invoice folder but doesn't create any files. Instead I get the following:

> Warning: ini\_set(): A session is active. You cannot change the session module's ini settings at this time in /home/ubuntu/civix/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php line 56

Civix works for me otherwise; I can create extensions, pages, etc. Any suggestions?

# Answer
Hit this one last month, and created a bug for it: https://issues.civicrm.org/jira/browse/CRM-16218

Are you using WordPress, by any chance?
> 2 votes

# Answer
As a workaround, you can create manually the Create.php file that contains civicrm\_api3\_invoice\_create()

Check the api/v3 folder in the core for examples (eg. the email one)

As for civix, do you have the latest version? if it's the case, fill a bug on github
> 2 votes

---
Tags: civix
---


# Question
Title: Can we enable deleting/modifying incoming emails?
the activities of type incoming emails seems to be hardcoded to not have the edit or delete button, even for admin.

Some of my users need to be able to delete it (eg. if it's a spam email) or edit it (if it's mangled somehow). Is there an option?

Would it make sense to write an extension to allow it? It isn't an issue of permission, as if you alter the url, you can still delete them

X+

# Answer
> 0 votes
Yes, that should be fine. I think the original reasons behind not including it were some combination of:

a. It was for the CiviCase folks, where we did not want to delete anything

b. It was used internally, so spam was not an issue

---
Tags: activities
---


# Question
Title: How to view CiviCRM Event Participants Custom Participant Fields?
We have an event and need to track any special dietary needs for attendees. I have created a custom field 'Dietary Needs' for event participants. This works as expected.

HOWEVER, the only way that I can view the dietary needs is by viewing the event registration for a single individual. I need a way to view the attendees in a list along with any participant custom fields.

What is the best way to do this? Search views do not seem to work with participant fields (Participant can not be used as a Result Column for profile searches).

# Answer
Check the settings of your custom field and ensure that "Is this field searchable?" is checked.

Overall it sounds like you're looking for a list or basic report. Run the Attendee List and you can add your custom field from the Columns section (but only if you've made it searchable).
> 0 votes

# Answer
I was able to do this using the Event Participant Report (List) and selecting my custom field for display.
> 1 votes

---
Tags: civievent, profile, custom-fields, search
---


# Question
Title: Can I have more than 4 Vacancies appear on the Dashboard in CiviHR?
Using CiviHR, can I set the Vacancy Dashboard to show more than 4 Open Vacancies?

# Answer
> 1 votes
Not currently. I peeked into CRM\_HRRecruitment\_BAO\_HRVacancy:getVacanciesByStatus(). It's hard-coded to return the four most recently created vacancies.

---
Tags: civicase, 4.5, civihr, drupal-7
---


# Question
Title: Can CiviCRM's internal contact ID be exposed in reports?
Can CiviCRM's internal contact ID be exposed in reports?

It doesn't look as though we can select it in the display columns listing for an activity report. (CiviCRM 4.5.8)

# Answer
That's because the Activity report specifically hides the field in question.

Use one of the many methods of customization (PHP override directory, extension, etc.) to edit `CRM/Report/Form/Activity.php`.

There's a separate column for the Source, Assignee, and Target contact IDs - find the stanza that looks like:

```
      'contact_target_id' =>
      array(
        'name' => 'id',
        'alias' => 'civicrm_contact_target',
        'dbAlias' => "civicrm_contact_target.id",
        'no_display' => TRUE,
        'default' => TRUE,
        'required' => TRUE,
      ),

```

Change it to be this:

```
        'contact_target_id' => array(
          'name' => 'id',
          'alias' => 'civicrm_contact_target',
          'dbAlias' => "civicrm_contact_target.id",
          'title' => "Target ID",
          'default' => TRUE,
        ),

```

Do that for the other two contacts and you're good.

Note that this may cause you to get a bunch of notices that alterDisplay isn't working correctly - this is changing the names of some variables that are used to turn contact names into links. You can ignore those notices if that functionality's not important - if it is, you may want to continue tweaking this a bit!
> 3 votes

---
Tags: civireport
---


# Question
Title: Can CiviCRM work by itself (e.g. without Drupal)?
I have CiviCRM connected with Drupal to sync users and other information. I am planning to make a new website to replace Drupal, perhaps without having it connected to CiviCRM.

Can CiviCRM work by itself? Can I "disconnect" it from Drupal and have it run alone?

# Answer
> 7 votes
There is a paid service you can use for this, if you wish to go that route: CiviDesk offers a hosted standalone version of CiviCRM you can subscribe to. Nicolas from CiviDesk has expressed interest in other people using standalone Civi, so you may want to talk to him. You can download the code for standalone Civi here, but of course this isn't supported by the core team.

# Answer
> 6 votes
It used to be possible (using openid as a login system). There is a member of the community that is (or was until a recent version) using it.

However, consider this unsupported, so you might be fighting on your own with bugs no one will be able to help you with.

I'm often in your case for clients, what I do is a minimal drupal that only does deal with theme and login that lives on a separate subdomain than the main site.

# Answer
> 2 votes
As Lisbeth points out, CiviDesk maintains a standalone version - but this isn't supported by the core team. Nevertheless, Nicolas from CiviDesk has expressed interest in other people using standalone Civi, so you may want to talk to him. Download a copy here.

# Answer
> 1 votes
I don't think that is possible. You can, however, run Civi with a CMS separately from your main website. For instance, if www.example.com is your (non-Drupal) website, you could still run Civi on a minimal Drupal at http://civicrm.example.com/ or http://www.example.com/mycrmsubdirectory/ .

# Answer
> 0 votes
Sure. You could use Wordpress or Joomla.

CiviCRM requires a CMS. The standalonde version was discontinued some years back.

---
Tags: drupal
---


# Question
Title: what is the cause number of succes imported contact not same with number of found contact in system
i have imported contacts.the number is 12124 , but when i searh them ( find contacts ), there only 12123

what is the cause number of succes imported contact not same with number of found contact in system i attached screenshot

civicrm 4.4.11 drupal 7.32

thanks and best regards

# Answer
> 3 votes
You have 1 duplicate record. Note that the import counter indicates "created or modified" contacts. If you change the dedupe settings for the import you'll get a different result for the number of contacts in your database, but the number of records "created or modified" will be the same.

# Answer
> 0 votes
It is just a wild guess, but it might be that the counter in the importer simply counts the number of lines processed, and that the first line is the column header line? Should be easy to find out with a trial with 5 lines?

---
Tags: drupal
---


# Question
Title: "Connection Refused" error when trying to create a new contact
I'm running Civi 4.5.2 on Drupal 7. When I try to create a new organisation, I get a "Connection refused error" with this backtrace. Any ideas what is wrong?

```
backTrace
#0 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Error.php(191): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(PEAR_Error))
#2 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("Connection refused", 111, 16, (Array:2), NULL)
#4 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/Net/Socket.php(156): PEAR->raiseError("Connection refused", 111)
#5 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/HTTP/Request.php(737): Net_Socket->connect("maps.googleapis.com", 80, NULL, NULL, NULL)
#6 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Utils/Geocode/Google.php(128): HTTP_Request->sendRequest()
#7 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Address.php(394): CRM_Utils_Geocode_Google::format((Array:22))
#8 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Address.php(151): CRM_Core_BAO_Address::fixAddress((Array:22))
#9 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Address.php(128): CRM_Core_BAO_Address::add((Array:22), TRUE)
#10 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Location.php(71): CRM_Core_BAO_Address::create((Array:36), TRUE, NULL)
#11 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(358): CRM_Core_BAO_Location::create((Array:36), TRUE)
#12 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php(975): CRM_Contact_BAO_Contact::create((Array:36), TRUE, FALSE, TRUE)
#13 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Form.php(328): CRM_Contact_Form_Contact->postProcess()
#14 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(158): CRM_Core_Form->mainProcess()
#15 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php(129): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contact_Form_Contact), "upload")
#16 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contact_Form_Contact), "upload")
#17 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "upload")
#18 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("upload")
#19 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()
#20 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(304): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1))
#21 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:13))
#22 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#23 /srv/domain.tld/public/htdocs/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:3))
#24 [internal function](): civicrm_invoke("contact", "add")
#25 /srv/domain.tld/public/htdocs/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#26 /srv/domain.tld/public/htdocs/index.php(21): menu_execute_active_handler()
#27 {main}

```

# Answer
The issue seems to be with the automatic address geocoding (finding the latitude and longitude using google maps api)

It's probably that your server has a firewall that restrict it to connect to other websites. You should disable the geocoding feature or let the server connect to google maps api server

You'll have a few other features that require the server to connect to external sites (eg. most of the payment processors), it's probably worthwhile opening up more the security, or at least keep in mind when you have a problem that it might be the issue
> 1 votes

---
Tags: 4.5
---


# Question
Title: Uploading from CSV with first and last name in the came column
I am uploading lots of CSV files and using addressee and addressee custom it will skip the first and last name and leave me to do it manually.

edit: while renaming i realized I derped and addressee is something else.

Is there anyway to get first and last names separated from one column

# Answer
If you are using excel / libre office / google sheets, you might want to use the built in spread sheet functionality to split the name column into two columns

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20split%20a%20name%20column%20in%20excel

Might be a lot easier and faster to do so locally.
> 3 votes

# Answer
You mean you want to re-generate first and last name from the addressee column? I assume you want to do this with an SQL query or with a script? If so, yes you can (but you have to be carefull as you are editing directly in the DB and such....). The table is civicrm\_contact and the columns are: first\_name, last\_name and addressee\_display. Otherwise I would recommend removing the contacts and starting over I am afraid...
> 1 votes

---
Tags: contacts
---


# Question
Title: CiviMail and unsubscribing from smart group
Using CiviCRM **4.5.8**: It is my understanding that when an email recipient unsubscribes from a message sent (via CiviMail) to a smart group, then that person will be detached from that smart group and will receive no further messages sent to that same smart group. For some reason this is not working for me.

Example: I have GroupA defined as the parent of Subgroup1 and Subgroup1. GroupA itself has no members (a listing of GroupA shows each member with a status of "smart"). All three are defined as mailing groups, and a mailing to GroupA goes to all members of Supgroup1 and Subgroup2, as desired. Each outgoing message contains this HTML code:

```
To unsubscribe from this mailing list, click <a href="{action.unsubscribe}">here</a>.

```

When a recipient in Subgroup2 clicks on this link they send an email message to a system-generated address, which is processed (normally, apparently) by the CiviBounces cron script. In return they get this odd message:

```
You have been un-subscribed from the following groups: {unsubscribe.group}.

```

That "{unsubscribe.group}" above is exactly what they see. Normally I'd expect to see "GroupA" (or perhaps "Subgroup2") here, but it's just the raw token name.

The cron job doesn't pitch an error, and the recipient's database record remains unchanged. Without manual intervention they will get subsequent messages to GroupA, which does not endear them to my organization.

What would cause this behavior (and how to set things right)?

# Answer
> 1 votes
It looks like your smarties aren't being replaced when the message is being sent. The link should have a url to your civi something along this line:

http://www.yourcivi/civicrm/mailing/unsubscribe?reset=1&jid=516&qid=102338&h=b0636ed456c5e1f5.

(That is assuming the link you reported is from an actual message that someone received and not what you have in the template or footer in civi.)

Do you have smarties enabled in your civicrm.settings.php file?

define( 'CIVICRM\_MAIL\_SMARTY', 1 );

See http://wiki.civicrm.org/confluence/display/CRMDOC/Smarty+in+mail+templates

---
Tags: civimail, groups
---


title: Disabling system workflow messages

text:
# Question
Title: Disabling system workflow messages
I'm trying to disable a particular system workflow message from being sent out - "Events - Pending Registration Expiration Notice". I've had a look in the event configuration and have found nothing that would indicate being able to disable this message per event. Is there another place that this can be disabled?

# Answer
Use the hook *civicrm\_alterMailParams*.

Inspect the $params that are passed in, and if you don't want the message sent, set $params\['abortMailSend'\] to '1' (or any non-empty value).

See lines 71-77 of CRM/Utils/Mail.php to see how this is processed by CiviCRM. This doesn't work for CiviMails but works for other emails sent by CiviCRM.
> 3 votes

---
Tags: system-workflow-messages
---


# Question
Title: Is there a way to find contacts who have multiple active or expired memberships?
Due to some import errors over the past few months, we have some members who are showing with multiple memberships. Some are of the same type and some are not. The way our memberships work, no individual should ever have more than one active membership (except in very rare circumstances).

I need a search that will help me find contacts with more than one membership.

# Answer
> 4 votes
Alternately if you don't have sql access and are good with Excel you can do the following:

1. Export all the memberships with Find membership. It will give you one row for each membership a person has. You probably only need to export one or two field names, like sort name. (if you need more details on how to do this ask)
2. Open the giant list in Excel (if it didn't automatically)
3. Sort by sort name or display name
4. Under data in Excel add subtotals, use count and change in name
5. Collapse one level of what is shown so all you see is name and the subtotal
6. Sort descending by subtotal
7. Delete the bottom of the list where the count is 1

# Answer
> 5 votes
If you have sql access you can run this query.

```
SELECT c.display_name,
       count(*)
FROM   civicrm_contact c
JOIN   civicrm_membership m
ON     c.id = m.contact_id
WHERE  m.contact_id = c.id
GROUP BY 1
HAVING count(*) > 1

```

If you only want active memberships then add the following line between the where line and the group by line

```
AND now() between start_date and end_date

```

You didn't ask for this but if you want people with multiples of the same current membership type then you can use this code:

```
SELECT c.id,
       c.display_name,
       mt.name,
       count(*)
from   civicrm_contact c,
       civicrm_membership_type mt,
       civicrm_membership m
where  m.contact_id = c.id
and    m.membership_type_id = mt.id
and    now() between m.start_date and m.end_date -- current only
group by 1,2,3
having count(*) > 1
order by 3,1

```

---
Tags: civimember
---


# Question
Title: CiviCRM cron job not processing scheduled jobs
CiviCRM 4.6.0

I have tried setting up the cron job to process the mailing scheduled job using both the php cli method and the URL with wget.

In the first case, I can get the cli.php to run from the command line and the mail queue is processed but when I try to run the same job from cron, it fails with an invalid username and/or password error. The username and password are exactly as specified when run from the command line (copied and pasted).

With the URL method, I cannot get the job to process the queue either from the command line or from the cron job. The mail remains in the queue.

The cron jobs are being set up in the CPanel.

# Answer
> 1 votes
Are you on drupal for the CMS? in that case, using the drush option is easier to set up than the cli.php in my experience (you don't have to give credentials, and in general, deals better with the authentication of the cron user)

# Answer
> 1 votes
I used the example for "Using the shell (CLI PHP) via Crontab" and got that to work so this can be closed.

I really don't know what else I can say. I used the sample script for "Using the shell (CLI PHP) via Crontab", set up the parameters correctly and it worked

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


# Question
Title: When importing memberships, I get "Error: Invalid value for field(s) : Start Date; End date"
I hope someone can answer this! I've tried 30 various date formats, rearranged columns, and every time I do a membership import it fAils. No errors are presented, I'm just returned to "Upload Data (step 1 of 4)" from step 3... I never see step 4 (summary). In "plugins/files/civicrm/upload" folder I see a file "sqlImport.errors" which shows an error not recognizing the date formate for the membership start and end

But I've tried every format and none work. :(.

Each time one membership record (1 row) imports, and then if fails! Every time.

The first 2,5 lines of sqlImport.errors says:

Line Number","Reason","External Identifier (match to contact)","Membership Type Id","Email (match to contact)","Membership Start Date","Membership Expiration Date" "2","Invalid value for field(s) : Start Date; End date","33","Adult","wfsdfoks@telus.net","06/01/2013","06/01/2014" "3","Invalid value for field(s) : Start Date; End date","34","Youth","helsdfng@rebalasdftouch.com","06/01/2013","06/01/2015"

I've tried different formats of dates (yyyy-mm-dd, mm/dd/yy, mm/dd/yyyy, dd/mm/yyyy) and selected the appropriate format from Step 1 in the import page.

Every time it's the same: \- I get to Step 3, and click "Submit" \- 1 (one, only) row get imported (correctly) and then \- I'm taken back to Step 1 - No error, complaint, nothing.

In my server's error log I see:

...client denied by server configuration: /home/civicthe/public\_html/wp-content/plugins/files/civicrm/custom/delete-this-OcxGgONTcR ... client denied by server configuration: /home/civicthe/public\_html/wp-content/plugins/files/civicrm/upload/delete-this-Zj1bvAyuTv ...client denied by server configuration: /home/civicthe/public\_html/wp-content/plugins/files/civicrm/ConfigAndLog/CiviCRM.fee2178658acc8deae2211eadc328c3b.log

FYI, after each fail (1 row imports) I delete the top row from the .csv file and try again, and again 1 row imports, so it can't be the .csv file.

Can anyone help? This is driving me bonkers. Why does it fail if the next time I run the

# Answer
> 1 votes
Are you using WPSec or some other security related wordpress plugins? Check:

https://wordpress.org/support/topic/plugin-better-wp-security-client-denied-by-server-configuration

Seems like:

a. CiviCRM is trying to write something to the log file

b. The security plugin traps that and redirects you back to step 1

try disabling the plugins and see if that helps

# Answer
> 0 votes
What you pasted is hard to read, but I **think** there is an issue of mixing of column and semi-column. At least it's a problem I've already experienced: the separator isn't correct and so it concatenates too many columns as if it were a single one

What column separator have you selected?

**Administer \> Localization \> Language, currency, location**

(Import / Export Field Separator)

Check that it matches your csv (edit it under notepad to be sure)

---
Tags: civimember, import
---


# Question
Title: Where to hire CiviCRM consultants or developers
Is there a directory of CiviCRM companies or freelancers to make CiviCRM features that we need?

# Answer
You may want to have a look at CiviCRM's Partners and contributors page. For special requirements, it would be helpful if you specify a bit more in detail, what you are looking for. Also, this CiviCRM forum may be of interest: Professional CiviCRM Services

Regards Fabian
> 5 votes

---
Tags: developer
---


title: payment subscriptions

text:
# Question
Title: payment subscriptions
I have to set CiviCRM to collect subscriptions for next year.

1. The membership fee is 190,00(childs) and € 225.00(adults).
2. if a child has a brother, the brother has a discount of 5%
3. Who pays can divide the payment: 90.00 € by 01/07/2015 and the remaining by 12/01/2015
4. Who pays for it all at once has a discount of 5%.

I can set these payments CiviCRM? How? Thank you.

# Answer
> 1 votes
There are several parts to your question, so I'll try to address them separately.

* Part 1 you can handle with price sets.
* Part 2 can be handled with the CiviDiscount extension, if the requirement is that both children are registered at once. If they can be registered separately, you'll need a hook that checks for the relationship.
* Part 3 is the tricky part - what you're looking for is called "front-end partial payments". This has been written as custom code by Back Office Thinking - and there's a group of developers gathering funding to build something like this in core. However, there's no way to do this today without custom code.
* Part 4 you can also handle with a price set.

---
Tags: civicontribute
---


# Question
Title: Is there a URL that can open a contact search?
I'd like to know if it's possible to craft a URL that performs a Contacts search – Something akin to typing a name into the search box in the navigation menu. For a non-functional example of what I mean, to search for "joe":

http://www.mysite.org/drupal/civicrm/?search=joe

The goal would be to have this URL result in the same page that results when I manually type "joe" into the search box in the navigation menu, and hit "enter".

I'm trying to develop a script in my operating system (at our organization, Mac OS and we all use apple iphones that I can use Workflow to make scripts for) that allows me to select text, like "joe", right-click it to open a menu, select the script that I've titled "CiviCRM Lookup", and then a browser window opens, and enters a url that includes "joe". I can do all the above, except figure out what kind of URL would execute such a search in CiviCRM!

I'm using Civi 4.6.2 and Drupal 7.

# Answer
> 4 votes
You can do this via full text search which gives you slightly different results than contact, but might meet your needs. If you are logged in to the demo server,check:

http://d45.demo.civicrm.org/civicrm/contact/search/custom?csid=15&reset=1&text=joe&table=Contact&force=1

---
Tags: drupal, search, urls
---


title: Linking spouse relationship information

text:
# Question
Title: Linking spouse relationship information
I am very new to this, and am a user and work for a charity and have very little experience in this field and would really appreciate some advice! I want to print labels to post invitations to all our donors who we do not have an email address for. So I made a search with email address "empty" and postal address "not empty". However, if we have an email address for a husband, the mail label will still print for the wife as she has her own separate record. Does anyone know how to avoid this? I have tried editing the criteria for the search but you can't seem to search on relationships. Thanks so much Louise

# Answer
> 1 votes
Two things:

* if you want to only send one e-mail to a couple in a relationship who prefer to share an e-mail - whether husband/wife, married LGBT couples etc - create a new Household and add both to it, add the shared e-mail address to the Household and search Contacts in that household without an e-mail address but a postal address - like this in Search Builder -

Household Name IS NOT EMPTY ...AND... Email IS EMPTY '' ...AND... Contact Type - 'Household' .

* I would prefer to have an e-mail for each of a husband and a wife, each of two married partners of any gender, etc - I have my wife and I in Civi with our own separate e-mails and we are also linked to the same Household. Sending to both e-mails or just a shared e-mail for a contribution ask depends of course on the couple's preference.

# Answer
> 1 votes
1. Use the search builder to find contacts where email is null. Add the results to a smart group called **No emails**
2. Go to Advanced search
3. In Basic Criteria, set *Group(s)* to **No emails**
4. In Address, set Street Address to **%**
5. In Relationships, set *Relationship Type* to **Spouse/Partner** and *Target Contact(s) in Group* to **No emails**

# Answer
> 0 votes
Could you try with the Relations tab in Advanced Search? If you select Advanced Search, you can click the tab Relations open and you can then search on any contacts that have an active relation to their spouse? That does not immediately solve your problem but you could separate the problematic cases from the other ones?

# Answer
> 0 votes
What you are looking for is a common denominator, something a particular group has in common in order to include or exclude them.

One method: If you use the Membership feature and you want only one mailing to go to one spouse, then you can include in your address search the field in the Advanced Search\> Memberships\> Primary Member? choose "Yes" to arrive at one address for the two related contacts. You can then mark this group (tag, activity, etc.) in order to know which ones received the postal mailing.

---
Tags: search, relationships
---


# Question
Title: Can I use a catchall address if my mail host doesn't support VERP?
Our hosting provider does not seem to be able to support VERP on Exim. Is it possible to use a catchall address instead of relying on VERP for bounce processing and forwarding replies

# Answer
> 2 votes
Yes, you can use a catchall mailbox to capture VERP bounces, and CiviCRM will be able to identify VERP data from this.

CiviCRM has two return paths if you enable Reply Tracking, and unless you somehow used separate domains, you won't have two catchall mailboxes. So using a catchall will probably limit your functionality somewhat here.

You could potentially get CiviCRM to poll first for bounces, move unrecognised emails to a "holding" folder in IMAP, then poll that folder for replies on a second pass ... But it is probably easier to just switch to a mail service which supports VERP, since such mailboxes are widely available ... you'd likely save some effort.

See also How does Civimail reply tracking and forwarding work?

Exim can support VERP routing, even if your mail provider may not be willing to provide this.

---
Tags: civimail
---


# Question
Title: Scheduled Reminders for 'on behalf of' Memberships
As far as my testing shows, setting up Scheduled Reminder for an Organisational membership is not resulting in a Reminder also going to the 'permissioned employee'. Can anyone confirm steps that do result in the Reminder going to both the Org and their 'contact person'. As I understand it, it is really the latter - getting the Reminder to the 'contact person' - that matters if we want to send out checksums.

# Answer
It seems that the Memberships must be INHERITED by the permissioned employee as well.
> 3 votes

---
Tags: civimember, scheduled-reminders
---


# Question
Title: How long should a CiviCRM / Drupal upgrade take?
We are running an outdated version of Civicrm (4.2.7) on Drupal 7 and working on upgrading to the newest version of Civi, 4.6x. We have been quoted a full forty hours by a consulting company for the completion of the project, but as the database is designed to be upgraded, this seems excessive.

If you have experience in upgrades and could offer thoughts on how long it should take as well as likelihood of errors, it will greatly help our planning. We have some custom fields, including some forms directly linked with our website, but not an excessive amount.

Thanks!

# Answer
> 4 votes
Based only what you have said so far 40 hours is excessive and 4 hours is more reasonable. But some further discovery or prior knowledge of the kind of customizations you have in your site *might* make 40 hours a reasonable quote. For example, needing to upgrade a few extensions so they are available for 4.6 and do some advanced theming might require 40 hours.

Our upgrade process involves:

1. Reviewing the standard native CiviCRM extensions and CMS modules/plugins used and ensuring they are available for the new CiviCRM version,
2. Finding and analyzing the native CiviCRM extension built just for the site as well as the custom CMS modules/plugins developed just for the site - they may need adjustment, perhaps significant,
3. Reviewing whether there is custom code and / or templates overriding CiviCRM or even using jQuery to adjust the DOM - this is often where some developer time is required during an upgrade,
4. Reviewing the theme for CiviCRM customizations and noting they will need to be checked post-upgrade - the more extensive the more risk of breakage during the upgrade,
5. On Drupal sites, checking for tweaks and customizations within the views using CiviCRM, or any non-views blocks etc that pull in CiviCRM data,
6. On multilingual or non-English sites, checking for the availability of translations for CiviCRM, native extensions, and CMs modules/plugins,
7. On a complex upgrade this is where we would provide the scope and estimate to the client.

In terms of the actual upgrade process, it involves:

8. Backing up the site and restoring it locally,
9. Running the upgrade process,
10. Addressing issues identified in 1 to 6 above,
11. QA of result,
12. Usually deploying site to staging for signoff by other JMA staff and client (skipped for simple upgrades)
13. After signoff, upgrading production site, usually by taking it offline during night in primary site timezones, doing the upgrade, deploying the changes from 9 to 11 above, and putting it back online.

To summarize the factors affecting the cost of upgrades:

1. In browser CiviCRM configuration changes like creating custom fields and profiles don't require extra work to upgrade.
2. More references to pages in CiviCRM from the CMS don't create extra work on upgrades.
3. The use of each additional native extension from the CiviCRM extensions directory and standard downloaded CMS module/plugin that interacts with CiviCRM slightly increases the risk of extra work.
4. The more code in extensions, modules/plugins, themes and especially custom PHP and Smarty template override files developed just for this site the more likely that developer time will be needed, and that more of it will be needed.

# Answer
> 3 votes
First question is what version of CiviCRM you are actually running, I understand your Drupal version is 4.2.7. Or is your CiviCRM version 4.2.7? If the latter is the case I do not think this is terribly outdated :-)

A standard upgrade of a standard CiviCRM install without any customization should not take that much, we would estimate that we normally assume an average of 4 hours. Without customization we do not often run into errors. In a quote we would probably say that we would need between 2-8 hours and we would bill the actual hours spent.

If you do have customization it really depends on how much customization you have, if it was developed in a structured way following community guidelines etc. In those cases we will probably say we want to take a look before we can give a quote. Also, the risk of errors occuring would be far greater than.

Does this help?

# Answer
> 2 votes
There are really two parts to this process, and your consultant may be combining them into a single step.

The upgrade itself (making backups, downloading code, running the script) can be quick ... or if your installation is not standard and someone has been mucking around in the database, this can suddenly balloon from minutes to hours. This technical portion might take as little as 20 minutes on one of my sites, but I recently moved one client from 4.2.6 to 4.5.8 and problems with the database made that a 5 hour project.

After the upgrade is applied, there is testing. How much testing depends on how many features you use and how many customizations you have in place. If you have any custom templates or php code, each and every screen needs to be tested - and that time can add up very quickly.

Thus forty hours seems like a lot, but it might be justified.

# Answer
> 2 votes
4.2 is not heinously old - but the older the DB the more risk of something that won't upgrade smoothly. I have hit databases where they describe an error on upgrade but once I look at it I discover the whole database has at some point in the past been converted to myIsam engine and requires serious recovery.

I would be nervous about saying I could upgrade an unknown database in 4 hours as sometimes just getting the right site access can take that long!

---
Tags: drupal, upgrade
---


# Question
Title: 4.6.2 on Joomla: Entering Contribution under single contact times out
What log information is best to post for this issue? When I manually enter a contribution under the Contribution tab of a contact's record, the process times out with a blank white screen. When I enter it as a "New Contribution" under the Contributions menu item, it works flawlessly.

I did test this in the Demo Joomla and it does work. My database has over 30k contacts.

I am not knowledgeable of the process flow so I am probably wrong about this but could the problem be a contact\_id search issue since with a "New Contribution" a search of the contact is required/retrieved first rather than the process having to go out and search for the contact under the in-record process?

# Answer
> 1 votes
To debug a PHP timeout issue, locate your PHP error log and check the last line or last few lines.

This should reveal what code is exhausting your allocated time - and also the time you're hosting environment allows.

Add that information to your question and the community may be able to better identify the underlying issue.

---
Tags: civicontribute, joomla, contributions, 4.6.2
---


# Question
Title: How to add extra date in contribution template? or best way to do it?
We have 10 Financial Types and different online contribution based on those. I need to add an extra date field in contribution such as "Date of sponsorship".

I have already created 10 different custom field for that, just because we need to identify that date for different financial types separately. Then to add them into the contribution pages I need to create 10 different profile as well!!

Is there a way to make "Date of sponsorship" field as a common field like contribution note? or Receive date or What would be the best approach?

# Answer
Creating 10 "duplicate" fields is often a sign that there is something sub-optimal on the data modelling. As you start to realise, having the "wrong" data model is creating tons of problems further down the line, it's often better to come back to the root problem and try to fix it directly

Could you clarify your need?
> 3 votes

# Answer
When defining the custom fieldset, you aren't restricted to 1 or All for the financial type. If you Ctrl+click, you can select all 10 of your financial types where the field should be available. Now you can create the custom field once, and it will be available for all 10 of those financial types. If more financial types are added that require the field, you can update the settings on the fieldset to include them; you aren't locked into the initial ones that you choose.

When you say that you need to "identify it separately", that sounds like something to be solved on the reporting side, not the data capture side.
> 2 votes

# Answer
Yes its best to delete all field and just have only one custom field which is linked with all financial type

also regarding "contribution Note" if this is a custom field and if it is visible only in view contribution - just edit the custom field (setting) and you can find a flag called "View Only?" undo the selection - then it will be available for Edit too
> 0 votes

---
Tags: civicontribute, profile, custom-fields, best-practice
---


# Question
Title: Just installed Webform CiviCRM and cannot see the CiviCRM tab on webforms
I must be missing something very basic here. Install went fine. Supporting modules are all installed and enabled. All the permissions I know to check have been checked. However, the CiviCRM tab is not displayed on the webform edit page. The link suggesting I click on the tab is there but no tab.

I'm on Drupal 7.35 and Civi 4.6.2.

# Answer
Clear Drupal's cache from your browser (not via Drush).
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: Civimail reuse link returns to CiviCRM home page
CiviCRM 4.6.0 and Joomla

I'm trying to reuse a send mailing but when I click on the link it does not create a copy but returns to the CiviCRM home page. I have tried with several different malings.

# Answer
This is a known bug, fixed in 4.6.1+: https://issues.civicrm.org/jira/browse/CRM-16238
> 1 votes

---
Tags: civimail
---


# Question
Title: How to enable "Contribution note" field while recording Contribution in the backend?
"Contribution Note" field seems only available thru Profile. Although it looks like a civicrm core component. I did not create this using custom fields. How Can I enable it as part of other contribution related record.

Once used this field on Online contribution page, it appears in view contribution like this

# Answer
Thanks Erik, I have found it. Its the contribution.tpl By removing "collapse" from the Additional/honoree/Premium block, it worked.

Before

```
<div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}"

```

After

```
<div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}{/if}"

```
> 1 votes

# Answer
This is a default field already related with contribution

when creating a contribution just look for "Additional Details" profile where you can find "Notes" add a value to it you will get the same result

Also you can find the field values in the DB table called "civicrm\_note"
> 3 votes

# Answer
If I want to change some values on a template I will create my own template like this:

```
<div id='expert-cases'>
  <div class='crm-summary-row expert-cases'>
    <div class='crm-label'>{ts}Main Activities{/ts}</div>
    <div class='crm-content'>{$countExpertCases}</div>
  </div>
</div>
{literal}
  <script type='text/javascript'>
    cj("#tagLink").parent().parent().prepend(cj("#expert-cases").html());
  </script>
{/literal}

```

in this example I add a field to the template and use jQuery to move it to the right spot. Yours is even simpler, you need to change the class. Adding the template to the form is then

```
CRM_Core_Region::instance('page-body')->add(array(
      'template' => 'CRM/Threepeas/Page/ExpertCases.tpl'));

```

in the right spot. In you case probably in the buildForm hook of the Contribution page.
> 2 votes

# Answer
You can not uncollapse in the UI as far as I know. You can the css class? Default will be

```
crm-accordion-wrapper crm-ajax-accordion crm-AdditionalDetail-accordion collapsed

```

If you leave out the 'collapsed' it is uncollapsed.
> 0 votes

---
Tags: civicontribute, profile
---


# Question
Title: Confusing CiviMail unsubscription confirmation screen
This is picking up on a topic from the old forum having to do with unsubscribe confirmation. (This feature is present in CiviCRM 4.6.2 as well as 4.5.8.) I agree that having to enter one's email address is an additional annoyance to someone who is probably already annoyed.

What happens next in the process is also confusing. Once the unsubscribing user enters their email address and clicks "unsubscribe" a highlighted confirmation message appears near the top of the screen, but the original highlighted "are you sure?" message and confirmation entry form still appear just below, as if the user is being asked to confirm again. As a workaround, I'm using only {action.unsubscribe} and avoiding {action.unsubscribeURL}.

I understand that at present there is no way to override the "enter your email address to confirm" process. But is there any way to show the now-confirmed user a simple "you've been removed" message without repeating the original confirmation template contents? Perhaps a second template displayed at the end of the process?

If someone could give me a hint about where to start looking in the code, I'd be willing to have a go at displaying a simple post-confirmation message and submitting a patch.

# Answer
Most of the code for the actual unsubscribe process is located here:

CRM/Mailing/Form/Unsubscribe.php

Would be good to:

a. Create a site wide CiviMail setting so an admin can disable the email confirmation process.

b. Use this site wide setting to determine the behavior of the code, the new behavior or the 4.4 and prior behavior. The 4.4 code is here:

CRM/Mailing/Page/Unsubscribe.php
> 2 votes

# Answer
*Caveat: This simple hack works fine when a user is unsubscribing from one or more regular groups. It has no effect when there is a smart group in the mix.*

Avoiding the confusing re-display of the confirmation dialog turned out to be pretty easy. Around line 129-130 in "public function postProcess()" in CRM/Mailing/Form/Unsubscribe.php add this code:

```
$groupExist = NULL;

```

Put it just before this line:

```
CRM_Core_Session::setStatus($statusMsg, '', 'success');

```

With this fix, when the user correctly enters their email address and clicks "Unsubscribe" they get a confirmation message only.

I may be missing something more complex here, but I'm thinking the absence of this single line in the original code may have just been an oversight.

Avoiding the whole email address entry confirmation is also straightforward, and involves removing (or skipping over) a few lines of code in the same php file and the templates/CRM/Mailing/Form/Unsubscribe.tpl template file.

The best solution is to control this behavior with a system-wide option, as Donald Lobo suggests. More study needed on my part.

Addendum: I also suggest that the text "Please Confirm your" be removed from the page title heading (also set in CRM/Mailing/Form/Unsubscribe.php) so that it simplified to "Unsubscribe from Mailing/Group". This still works for the confirmation request phase and makes more sense in the context of a "You have been unsubscribed" confirmation.
> 1 votes

---
Tags: civimail
---


# Question
Title: Scheduled reminders based on a custom field on an activity
I know that in CiviCRM 4.6, the ability to send scheduled reminders to people based on a custom field (e.g. marriage date) was added. However, I'm unsure if it's possible to send a scheduled reminder based on the custom field of an ACTIVITY. I couldn't figure out how, if so.

The use case is to have a custom activity field labeled, "Remind me on X date", which is similar to functionality present in Raiser's Edge.

# Answer
Unfortunately, the custom date field feature is only for dates on the contact record, not activities. Doing activities would take a change in core--it would be comparable to the work to do the contact date fields. It would be a great feature, though!
> 1 votes

---
Tags: custom-fields, activities, scheduled-reminders
---


title: Participant Custom Data not saving

text:
# Question
Title: Participant Custom Data not saving
I have created custom fields for a site. All of them work except those connected to Participants. When data is entered into the backend, data will not save, and no error is issued. The fields also won't show up to be added to profiles.

I have upgraded from 4.5.8 to 4.6.2, had no effect. Also I rebuilt the database schema and the problem persists. There is no custom code. The site is using Drupal 6 on CiviHosting. I have tested it on the demo site and on other civicrm installs.

Is there anything else worth trying or worth looking into?

# Answer
> 2 votes
Can you double check and see that the custom group is extending Participants and not Events? The two are different entities, but a fair number of users have made this mistake in the past.

A few other thoughts:

* Can you also elaborate on where it does not work for participants?
* Can you try the same sequence of steps on our demo servers and see if you can reproduce it there

---
Tags: custom-fields
---


title: CiviCRM Wordpress Optimization

text:
# Question
Title: CiviCRM Wordpress Optimization
Keep banging my head against this and can't seem to get anywhere. I've got a dev site up on Centos 6.6 using KVM, with 4 cores and 8 GB of RAM allocated and PHP 5.3.3. I'm testing a large import via the web interface import. When I do, I've noticed that the box never uses more than 25% CPU and only has one thread for Apache. That 25% CPU usage all sits on one CPU core, effectively maxing it out. The worrisome thing is, I also can't open another instance of WordPress while this is running. That means that one user could lock out the whole box with a large report or mass deletion! (BTW, same thing happens on mass deletion of the 35,000 records, so it's not just the web import script.)

BTW: The host server isn't that busy and is nowhere near maxed out. Also, other tasks show that there is no bottle-necks in the usual places like CPU, network, or disk usage.

Things I've tried:

* Upping php.ini memory\_limit - No changes
* Changing a thousand parameters in MySQL, mainly memory - No changes
* Upping max children in php.ini - No changes
* Adding FastCGI+PHP-FPM - No changes
* Adding WP-Super Cache - No changes
* Adding Memcached - No changes
* Upping file descriptors - No changes
* Adding Max Memory line to wp-config - No changes Who knows what else I've forgotten I've tried

Anybody have any ideas here?

# Answer
> 3 votes
Have you tried running mod\_php as opposed to fastcgi mode?

In the past when we've had this with our servers our first point of call is to determine which part of the stack is limited to 1 core. Our experience has been that its normally mysql. Could you load up mysql with a few concurrent large DB operations and see if it uses multiple cores? This should then good you a direction to head in i.e. which part of the LAMP stack is being limited.

---
Tags: wordpress, best-practice, debugging
---


# Question
Title: How can I give anonymous users access to a new page?
I've made an extension (using civix) that includes a page that's designed to be public facing. But I think the default permissions are blocking all anonymous users. How can I give people access to it, if they don't access-civicrm permissions?

# Answer
> 3 votes
In your menu xml file the permission for a path defaults to "access CiviCRM" if not otherwise specified.

To specify it as completely open, use `<access_callback>1</access_callback>`

Here's an example: CRM/Core/xml/Menu/Misc.xml

---
Tags: permissions
---


# Question
Title: Is sandbox the way to try out certain extensions now (instead of Cividemo)?
CiviDiscount isn't among the extensions configurable in demo, is that b/c 1) it isn't stable enough now (4.6), or 2) there's another way to test it, besides installing it locally (e.g sandbox)? A second question - there's code in CiviEvent registration relating to some other form of discount, is that functional code and if so, how is it configurable?

# Answer
> 3 votes
To try out extensions, I recommend setting up CiviCRM Buildkit. CiviCRM Buildkit makes the task of spinning up CiviCRM test instances (in multiple flavours) much easier, then you can try any extension you like on it - and have a more complete environment to test in.

# Answer
> 1 votes
In general, the answer is yes. If you want to try CiviCRM with some additional extensions you will have to create your sandbox. And as Chris mentioned, CiviCRM BuildKit is a great help.

# Answer
> 1 votes
To answer the question about CiviDiscount. It has now been updated to work with 4.6 though I understand a couple of issues that were problems also in earlier versions are not yet fixed but might be by next week. Version 3 is now listed here as compatible with 4.6 https://civicrm.org/extensions/cividiscount Still worth doing testing on a dev site though ;-)

---
Tags: civievent
---


# Question
Title: Why aren't donation receipts being emailed to customer?
I'm having issues with emails being sent for new donations (membership signups actually).

I've tested each mail server type and I can send bulk emails, and test emails. I'm using PayPal as my processor and that seems to be working fine.

My contributions are being marked complete, and new contact/memberships are being created. It seems the only problem is the member isn't getting sent a receipt email.

I noticed this q: Online receipt not being send to donors which sounds similar but I think I've tested that it isn't a paypal problem.

When I tell the system to store the emails in the db, no email is being created, telling me the issue is within CiviCRM.

Any ideas? Much appreciated.

# Answer
> 3 votes
This seems to be a known, critical, and unresolved bug with WordPress and PayPal since 4.5.4. It has been reported as issue 16181, Email reciepts for contributions being marked as sent but are not sending, and therein is noted as related or a duplicate to 15629, Paypal IPN not working on Wordpress the first time, which is also referenced in the other Civi.SE question.

Kurund suggests testing patch 5647 to see if it resolves the problem.

---

**Update**: Both Issue 15629 and Issue 16181 are marked as resolved as of 4.6.3.

---
Tags: wordpress, civicontribute, civimember, email, receipts
---


title: Import from one db to another fails

text:
# Question
Title: Import from one db to another fails
I exported all the civi tables from one database and saved as a sql file, including a droptable statement. I then tried to import the data into a fresh site with brand new civi installation. The import fails with a foreign key constraint failure. When that failed I tried to import a sql file with data only, no structure, no drop table. Also failed with

1st SQL query (with structure & data):

```
-- --------------------------------------------------------
--
-- Table structure for table `civicrm_action_mapping`
--
DROP TABLE IF EXISTS `civicrm_action_mapping` ;

MySQL said: Documentation
#1217 - Cannot delete or update a parent row: a foreign key constraint fails

```

2nd SQL Query (data only)

```
-- Dumping data for table `civicrm_acl_entity_role`
--
INSERT INTO `civicrm_acl_entity_role` ( `id` , `acl_role_id` , `entity_table` , `entity_id` , `is_active` )
VALUES ( 1, 3, 'civicrm_group', 1, 1 ) , ( 2, 1, 'civicrm_group', 15, 1 ) , ( 3, 4, 'civicrm_group', 2, 1 ) , ( 4, 2, 'civicrm_group', 2, 1 ) ;

MySQL said: Documentation
#1062 - Duplicate entry '1' for key 'PRIMARY'

```

Any help is appreciated. Kate

# Answer
> 3 votes
You can add this to the top of your .sql file, then try loading it again.

```
SET FOREIGN_KEY_CHECKS = 0;

```

This will permit MySQL to load the data while ignoring the foreign key checks.

Since CiviCRM uses foreign key checks, this is a good idea only if the checks throw errors when loading the DB but not when using CiviCRM afterwards.

Alternatively, to ensure foreign key integrity and handle existing tables not wanting to be deleted, prefix your .sql with

```
DROP DATABASE nameofdb;
CREATE DATABASE nameofdb;

```

(where *nameofdb* is your actual DB name of course).

# Answer
> 0 votes
1. You might want to ensure that the DB you are importing into is a brand new db (rather than a brand new civi install which will install data into the db)
2. If you cannot do the above, there is a script in sql/civicrm\_drop.mysql which you can run on mysql shell to drop all civicrm standard tables. This script will not drop any custom tables created

---
Tags: import, sql
---


# Question
Title: Profile creation workflow message, where is it located?
I would like to modify format and content of profile creation notification email message. Which template is it?

# Answer
**Administer -\> CiviMail -\> Message Templates -\> System Workflow Messages tab -\> Profiles - Admin Notification**

Looks like it, although personally I haven't tried this before.
> 1 votes

# Answer
Administer -\> Communications -\> Message Templates -\> system Workflow Messages

This is straight forward look for the Workflow title and edit your message template - will work
> 1 votes

---
Tags: profile, system-workflow-messages
---


# Question
Title: Is there a way to add a custom field to the Inbound SMS activity type?
I'm working on a Drupal site that includes a view showing unanswered SMS messages. The view shows activities of the Inbound SMS type that have not been revised or deleted, plus a custom PHP filter that restricts it to inbound SMS activities from contacts who don't have an outbound SMS activity with a later date.

The client would to be able to mark off messages that they don't need to answer, and have those no longer show up in the list - basically a way of marking them as read and not in need of a reply. I tried to add a custom field for this to the Inbound SMS activity type - but it doesn't show up as an option! When I choose activities under the "used for" dropdown on the form for creating a custom field, it brings up a second list of specific activity type, but Inbound SMS isn't on it.

Does anyone know if there's any way to get this activity type to show a custom field? Or failing that, any other ideas for how to provide this functionality (a checkbox for marking SMS messages as read, which can then be used as a filter for the view)?

# Answer
> 4 votes
How about adding another activity status? Like "Unread" or "Read".

Depending on how skilled you are, maybe it is possible to have inbound sms set to "Unread" as default. Then your staff could change it to "completed" when they have read it.

If not, you could add the activity status "Read" and then change the status from "Completed" to "Read".

In both ways, you could have a report showing only the default activity status, and after they have changed the status, it diseappers from the report.

# Answer
> 2 votes
For the benefit of anyone else who wants to add custom fields to an activity type that isn't in the list: You could create the custom group using the API, either using the explorer or drush. For example:

```
drush cvapi CustomGroup.create extends=Activity extends_entity_column_value=46 title="SMS testing"

```

where 46 is the activity type ID of Inbound SMS on my system.

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


# Question
Title: How to avoid duplicates when donated using different email address or spelling mistake on names?
Its very often happening for my donors, that they donate first with an email and then next time with another. or some spelling mistake on name or email address. Civicrm then creates duplicates of that person. Although I can merge those 2 contacts, how can we avoid/reduce this kind of instances?

# Answer
> 4 votes
That is a difficult area. It touches on'the safest system is the one without users' :-) You can not avoid users making typos as far as I know, you will need to have a regular deduplication process in place. Here is the process we are discussing at one of my projects:

* we want the data in the system asap, so we accept everything but all new contacts go in a separate group
* we have a daily process for one of the employees, looking for dedupes on a daily basis (with a fairly strict rule first and a more fuzzy one second) and taking corrective action whenever required. If new contact is fine it is removed from the group. I hope it helps :-)

# Answer
> 2 votes
If you have repeat donors, you can include the option (or requirement) to create an account in the Advanced section of the Profile you use on the Contribution page (at least with Drupal):

This provides the benefit of allowing them to log in and have the forms prefilled to avoid typos, and also gives them the benefit of having access to a Contact Dashboard with their donation history on it.

If you are sending emails that they are responding to with donations, you can also use Checksum links through CiviMail to send them to the form with their information prefilled. From the book:

> A particularly useful token is the checksum. The checksum allows you to give people links to contribution forms, profiles, petitions, and event registration forms that are prefilled with information that is already in their contact record. The image \[below\] shows an example of this.
>
> Only contact fields and actions can be inserted in your email as tokens. Related records, such as the name of the event for which the contacts have pending enrollments, cannot be included. However, you could provide a link to the person's contact dashboard so that they can review their registration details for themselves (once logged in), or you could use a checksum token to allow access to a profile through which they can modify their information without having to log in.
>
> Go to this page for further details on using the checksum token: http://wiki.civicrm.org/confluence/display/CRMDOC/Tokens.

# Answer
> 1 votes
This is a Universal problem - issues with typo do happen always

Easier way to avoid this issue is by providing a username and password by this way you force the user to login which will avoid duplication. Also, you can provide rules which will allow the user to access limited pages

---
Tags: civicontribute
---


# Question
Title: Where/How does CiviCRM track sent reminder notices?
CiviCRM can send reminders for memberships, activities, etc. I noticed that if I create an activity and send a reminder email (by forcing the scheduled job to run) that the activity won't generate another email even if the parameters (within 0 hours of completion) are still valid.

Where/How does CiviCRM track a sent reminder so it doesn't send another?

# Answer
> 5 votes
Info on sent reminders is stored in civicrm\_action\_log table.

https://issues.civicrm.org/jira/browse/CRM-15728 may help you understand how it works.

# Answer
> 2 votes
While this may be an obstacle for you right now, the fact that the scheduled reminders system doesn't send out reminders after the first one is definitely a good thing. If you have the job for sending scheduled reminders set to hourly (my preferred method, since it avoids the possibility that reminders only ever go out late at night, making them unreliable for reminding someone about something tomorrow), you don't want everyone to get a reminder every hour.

If you want to remind someone multiple times per activity, you have two options:

* If you want the same message to go out, and the interval should be the same (every couple of days or something), enable repetition.
* If you want to vary the message or have a custom schedule (one month out, one week out, and then one day before, for example), just set up multiple reminders. The system limits the reminders to once *per reminder* so other reminders set for the same activity won't interfere with each other.

---
Tags: scheduled-reminders
---


# Question
Title: Is there a way to get a stand-alone Tell a Friend page?
We are trying to send an email to recent donors asking them to tell a friend about a current campaign. I know TAF pages exist as part of the donation page flow, but do they exist outside of that at all, or is there an easy way to make one?

# Answer
> 2 votes
Tell-a-friend has been implemented for donation (including membership), participant, and pledge pages.

I'm not quite sure how you want to use them. If you have a technology provider in-house or a CiviCRM consultant they could look over and adapt the Smarty template code at https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Friend/Form/Friend.tpl. See also the related php code at https://github.com/civicrm/civicrm-core/blob/master/CRM/Friend/Form/Friend.php, as well as the template at https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Friend/Friend.tpl and its similarly matching php code.

# Answer
> 2 votes
If you are on the Drupal platform I think this would be quite easy to set up using Webform and Webform CiviCRM. What you would do is create a webform with the number of contacts that you want to allow your supporter to contact on it. You can then configure the webform to send emails to each of the collected emails (or use Drupal Rules for this purpose). You can send out a link to this webform via CiviMail and use a Checksum token to auto populate the webform with the original contact details.

Ps. to make this a bit nicer you could have a condition on the webform to show hide extra contacts depending on the number of friends to email.

# Answer
> 1 votes
I like Jamie's suggestion of Webform CiviCRM as an avenue to explore. As far as the default TAF functionality, I believe you can send a direct link to the TAF page for your particular Contribution page (assuming TAF is activated) and get people to that page straight from an email, but the caveat is that they need to be logged in to avoid a fatal error. This is because the TAF page needs to get the contact ID of the sender and can't get that from an anonymous page view. *(You could experiment and see if sending the link with a checksum in the URL was enough to make it work, I'm not certain).*

You can test that on the demo server with this link (try it once while not logged in, and then after logging in):

http://d46.demo.civicrm.org/civicrm/friend?reset=1&eid=1&pcomponent=contribute

---
Tags: civicontribute
---


title: Wrong default organisation

text:
# Question
Title: Wrong default organisation
I choosed as default organisation an individual instead an organisation. Can I change this or is there a solution?

Thousand thanks for your help.

Regard, Oliver

# Answer
You can update the default information under **Administer \> Communications \> Organization Address and Contact Info** in the CiviCRM menu.
> 5 votes

---
Tags: default-settings
---


# Question
Title: CiviDiscount does not auto-apply when filtering on contact type
I can't get auto-discount to work. I first tried on my local Civi, and then the demo civi. As a test, I have a coupon configured on the demo site to auto-discount all events for all contacts of type Individual. Ultimately I need to apply a discount to a member type, but that's not working either so I simplified it to discount by contact type. Below is a screen-shot of my coupon settings and the price section of the event.

Link to coupon:
http://d46.demo.civicrm.org/civicrm/event/register?reset=1&id=3 Link to event where coupon should be applying: http://d46.demo.civicrm.org/civicrm/cividiscount/discount/edit?&id=1&reset=1

The event is not auto-discounted.

The ideal answer would point out what's wrong with my configs, and fix it on the demo site to prove that your answer works. Thanks!

# Answer
> 1 votes
This may not a long-term fix, but I found a fix in the CiviDiscount github issue tracker.

The underlying problem: CiviDiscount source will not apply discounts to events with no coupon entered.

The fix: Add exceptions so that CiviDiscount will apply auto-discounts even if no coupon is entered.

Here is a link to the fix, hopefully this fix or a comparable fix will make it into the next version release.

https://github.com/dlobo/org.civicrm.module.cividiscount/pull/98

---
Tags: cividiscount
---


# Question
Title: When running event reports, receive Error: '' is not a valid option for field id
I use wordpress+civicrm and all worked well since the last upgrade. Now the event report always gives the same error: '' is not a valid option for field id. On the bottom the bugs report.

Thanks

```
CiviCRM_API3_Exception: "'' is not a valid option for field id"

#0 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form/Renderer.php(219): civicrm_api3("event", "getlist", (Array:1))
#1 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form/Renderer.php(184): CRM_Core_Form_Renderer::preProcessEntityRef(Object(HTML_QuickForm_text))
#2 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form/Renderer.php(103): CRM_Core_Form_Renderer::updateAttributes(Object(HTML_QuickForm_text), FALSE, NULL)
#3 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Renderer/Array.php(221): CRM_Core_Form_Renderer->_elementToArray(Object(HTML_QuickForm_text), FALSE, NULL)
#4 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/element.php(415): HTML_QuickForm_Renderer_Array->renderElement(Object(HTML_QuickForm_text), FALSE, NULL)
#5 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm.php(1703): HTML_QuickForm_element->accept(Object(CRM_Core_Form_Renderer), FALSE, NULL)
#6 /wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(685): HTML_QuickForm->accept(Object(CRM_Core_Form_Renderer))
#7 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(116): CRM_Core_Form->toSmarty()
#8 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(101): CRM_Core_QuickForm_Action_Display->renderForm(Object(CRM_Report_Form_Event_ParticipantListing))
#9 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Report_Form_Event_ParticipantListing), "display")
#10 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Event_ParticipantListing), "display")
#11 /wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(83): HTML_QuickForm_Page->handle("display")
#12 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Event_ParticipantListing), "submit")
#13 /wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Event_ParticipantListing), "submit")
#14 /wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("submit")
#15 /wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(115): CRM_Core_Controller->run()
#16 /wp-content/plugins/civicrm/civicrm/CRM/Report/Page/Report.php(76): CRM_Utils_Wrapper->run("CRM_Report_Form_Event_ParticipantListing", NULL, NULL)
#17 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Report_Page_Report->run((Array:4), NULL)
#18 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#19 /wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:4))
#20 /wp-content/plugins/civicrm/civicrm.php(1133): CRM_Core_Invoke::invoke((Array:4))
#21 [internal function](): CiviCRM_For_WordPress->invoke("")
#22 /wp-includes/plugin.php(496): call_user_func_array((Array:2), (Array:1))
#23 /wp-admin/admin.php(226): do_action("toplevel_page_CiviCRM")
#24 {main}

```

# Answer
> 3 votes
Found it! This bug is fixed in CRM-16333.

# Answer
> 2 votes
When you updated from (what version to what version?) were there database changes/updates included, and are you sure those ran successfully? From the stack trace and error message it sounds like a query isn't picking up the rows for the report (field 'id' may be event.id, most all civicrm tables have this field as internal identifier). The error seems like it is thrown in Civicrm/api/api.php, method civicrm\_api3 and you're trying to run the report Event Participants List. Hopefully you backed up your database before doing the upgrade as is suggested. Have you tried clearing cache? The reports are compiled and cached, so you might try that first, it is not harmful and may help.

# Answer
> 0 votes
This appears to be the bug described in CRM-16477.

---
Tags: civievent
---


# Question
Title: Upgrading from 4.1.5 database to 4.6.2 failing with constraint violation
Trying to upgrade a 4.1.5 database to 4.2.6. I am getting a constraint violation. See the screenshot.

# Answer
> 1 votes
I recommend you take smaller steps, starting with 4.2. You can download the latest version of 4.2 from sourceforge (the latest in that series is currently 4.2.20).

If that upgrade goes ok, then you could proceed to 4.4 (the current LTS) and then up to 4.6.

Remember to backup your database before upgrading, and if the upgrade fails, restore from the backup before trying again.

# Answer
> 0 votes
You may not care to keep all the log info in your live database so long as you have a backup. If so, run

```
TRUNCATE civicrm_log;

```

on your sql db before running the upgrade.

---
Tags: upgrade
---


# Question
Title: Form to enable existing member to edit selected value in price set
I volunteer for a german NGO and we want to enable our members to easily update their yearly payment. We have the following:

1. A working installation of CiviCRM (v4.5.6)
2. A membership type we're interested in
3. A priceset assigned to this membership type
4. A custom field for the value of the selected price

I try to build the following:

> A simple form, which allows existing members to update their selected price (the custom field) from the given priceset. This requires a valid login, if there is no active session, a login screen should be displayed. The form will be embedded in an iFrame or similar.

I tried working with profiles and contribution pages but to no avail (as it is not setup as a recurring payment but rather a custom field). I found the Webform module and its CiviCRM integration but I'm not sure if that really is what I'm looking for.

Looking forward to any hints! Thanks so much.

# Answer
> 0 votes
I ended up coding a custom solution (Drupal / CiviCRM API) because I ran into many issues with our specific setup.

But I also discovered and learned about CiviCRM-Webform and can recommend it for similar use cases.

---
Tags: civimember, webform-civicrm, forms
---


# Question
Title: How to convert/import participants with partial payments
I've tried importing participants in the standard way, then importing contributions for their event deposits (partial payments), then using API CSV import to connect them via a ParticipantPayment import. However, things don't seem to behave correctly afterward.

Bringing the data directly in via SQL on civicrm\_participants, civicrm\_contributions, and civicrm\_participant\_payments doesn't seem to work either.

What is the correct way to convert in the data so these participants will be connected with their deposits?

# Answer
> 3 votes
In the end, this can't be done with a simple import. We must populate all of the following tables:

* civicrm\_participant
* civicrm\_line\_item
* civicrm\_contribution
* civicrm\_participant\_payment
* civicrm\_financial\_item
* civicrm\_financial\_trxn
* civicrm\_entity\_financial\_trxn

Given that complexity, I created a staging table and brought it all in via SQL scripts.

---
Tags: api, import
---


# Question
Title: Cannot Install CiviEvent-Joomla-Module Extension
I have my resource URLs and directories set up; I downloaded the zip from github, uploaded and unzipped, but when refresh the extensions page, the extension name does not appear, and therefore cannot be installed.

Any ideas?

Joomla 3.x CiviCRM 4.6.2 (and I tried with CiviCRM 4.5 prior to upgrade).

https://github.com/lcdservices/CiviEvent-Joomla-Module

Thanks!

# Answer
Can you clarify the steps you took? If you upload the package to the tmp directory, go to 'Discover' in the extension manager and click on 'Discover' in the upper left. You should then see it in the list on that screen and be able to install it.
> 2 votes

---
Tags: extension, joomla
---


# Question
Title: Upgrade from 4.5.8 to 4.6.2 killed View Contact Tabs
We consult with CiviCRM powered by Drupal. Recently we upgraded one client who has CiviCRM powered by the latest Drupal 6 from 4.5.8 to 4.6.2. After the upgrade, they are unable to click between the various tabs of a CiviContact record. They have tried multiple different browser products from I believe their Windows based computer.

Tabs are as follows on a particular CiviContact record: Summary Contributions 263 Pledges 0 Memberships 0 Activities 61 Events 7 Relationships 0 Groups 41 Notes 2 Tags 5 Change Log 18

Always the lower content area is stuck showing the Summary details. We see no troubles from Mozilla Firefox on Linux, or Google Chrome. I tried Chrome as they say that is their preferred browser.

Some time ago I recall some AJAX code getting broken in a couple of CiviCRM upgrade on Drupal 6. Perhaps that has happened again. Though odd this time it is specific to the operating system of the browser, not a cross-platform break.

Any other suggestions of information I might provide?

I am thankful, Michael

# Answer
> 2 votes
Aaahhhh!!!! I just noticed that this client's Drupal user ID was set to view the site with the default Garland theme whereas my Drupal user ID was set to view the site with the custom theme built for this site. I switched the client's Drupal user ID to use the custom theme, and now AJAX refreshes correctly. So, it appears Drupal Garland theme specific.

# Answer
> 0 votes
I suggest you start by going through the steps for troubleshooting javascript in CiviCRM. If that doesn't fix the problem, please edit the question to report back what data you've gathered from the process.

# Answer
> 0 votes
It could be cached resources in their browser. Ask them to do a force-refresh (ctrl-shift-R in Chrome & FF).

# Answer
> 0 votes
It appears to be specific to this client's computers verses our development computers. I have had success with Mozilla Firefox both in my native Linux, and also a Windows VM.

However the client has attempted to connect from their Windows 7 computer with Google Chrome, Internet Explorer 11, and Mozilla Firefox. The problem is consistent across all these browsers. It appears to be a consistent AJAX issue for this client.

The client installed Mozilla Firefox to debug this issue. Their preferred browser is Google Chrome... so definitely old cached files is not the answer.

---
Tags: drupal, upgrade, ajax
---


# Question
Title: Can distmaker be run off a specific branch
I was using distmaker.sh (https://github.com/civicrm/civicrm-core/blob/master/distmaker/distmaker.sh) to generate tarballs for testing.

I had my local branches all set to 4.6 (core, drupal, joomla and wordpress) however, distmaker switched to the master branch when building the files. I had created a buildkit drupal install and then cloned the joomla and wordpress repos into /sites/all/modules/civicrm/

Is there a setting to build the tarballs off a specific branch?

# Answer
> 3 votes
Check the settings in distmaker.conf, the ones at the end. They specify the git branch to pull from:

```
## Git branch/tag name
DM_REF_CORE=master
DM_REF_DRUPAL=7.x-${DM_REF_CORE}
DM_REF_DRUPAL6=6.x-${DM_REF_CORE}
DM_REF_JOOMLA=${DM_REF_CORE}
DM_REF_WORDPRESS=${DM_REF_CORE}
DM_REF_PACKAGES=${DM_REF_CORE}

```

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


# Question
Title: Default header and footer is not being recognized
CiviCRM 4.6.0

Default headers and footers are not being recognized so, unless I included the required tokens in the body of the email, Civimail will not send a test or schedule the email.

There was a typo in my original post. Version has now been corrected.

# Answer
> 1 votes
You can fix this by upgrading to the latest version of 4.6.

Specifically the issue is https://issues.civicrm.org/jira/browse/CRM-16237

---
Tags: civimail
---


# Question
Title: How to prevent fraud attempts on Contribution pages?
An org I work with is reporting heavy fraudulent use (at least attempts to use -- it seems many are being declined in Auth.net, although some are getting through) of the CiviContribute form, despite the "I'm not a Robot" reCAPTCHA that is in place.

What are other ways to prevent these types of fraudlent attempts besides the Captcha on a profile? (I thought the Captcha would prevent it from even showing up in Authorize.net)

# Answer
How hard this will be depends on how determined the service abuser is to adapt to the defenses you introduce, and how easy a target your site is compared to other sites available to the attacker. If you are seeing a significant level of abuse, this indicates that your site is one of the lower hanging fruit.

Here are a couple of options I've seen have good effect -

**fail2ban** \- We've used fail2ban effectively for assorted spam and abuse prevention. An approach to this looks like:

* Add a custom form validation hook to your contribute form.
* In this hook, `error_log` to some logfile.
* Add a fail2ban *jail* with this logfile which uses iptables to ban addresses that look suspicious.

There is a risk of banning legitimate IPs here, eg a single IP which many supporters sit behind (maybe you are a union and half your members are behind a certain corporation's firewall) or your own head office if they make a large number of transactions. So this is an approach to use with some considerations.

This approach is more effective if you are seeing repeat abuse from the same IP addresses; you can identify this by inspecting your webserver logs for the contributions (grep for POST requests hitting `civicrm/contribute/transact` then group by IP and count requests).

**custom spam checks** \- I've seen form abuse drop off entirely simply by adding an additional required question. You can add this to your form, then use JS in your page to hide the field and populate it. This can be more effective than reCaptcha because reCaptcha is common enough to be worth automating for a botnet, but if your form is one of several they are outsourcing their CC checks to, then you only need to make your form less easy to abuse than others.

This approach is effective against abuse where the attacking engine is less sophisticated than a web browser (ie lacks the JS engine in the browser). It's easy to test out.
> 7 votes

# Answer
You can use the flood control extension posted on the CiviCRM blog here.

There's an even smaller extension that does the same thing, but is Drupal-specific here.
> 3 votes

# Answer
If you are using drupal you can use https://www.drupal.org/project/httpbl. One of it settings are: use on all pages (so, including civicrm contribution pages). It is being used on huge sites, among others drupal.org itself.
> 2 votes

---
Tags: civicontribute, security, authorize.net
---


# Question
Title: Why doesn't API for Contribution Get work with multiple Financial Type ID values?
I have this problem on my Joomla 4.6.2 system, and can reproduce it on the Joomla sandbox. If I use the API Explorer to build a query like:

```
$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "id",
  'contact_id' => 2,
  'financial_type_id' => "Campaign Contribution",
));

```

it works OK. But if I try to specify multiple possible values for financial\_type\_id, such as:

```
$result = civicrm_api3('Contribution', 'get', array(
  'sequential' => 1,
  'return' => "id",
  'contact_id' => 2,
  'financial_type_id' => array("Campaign Contribution", "Donation"),
));

```

it generates a SQL error because it creates an invalid WHERE clause:

```
WHERE  ( civicrm_contribution.is_test = 0 AND civicrm_contribution.financial_type_id 0 )  AND (contact_a.is_deleted = 0)  LIMIT 0, 25

```

The "civicrm\_contribution.financial\_type\_id 0" should instead be something like "civicrm\_contribution.financial\_type\_id IN (1, 2)"

Is this a bug?

# Answer
> 3 votes
Instead of

```
'financial_type_id' => array("Campaign Contribution", "Donation")

```

try

```
'financial_type_id' => array('IN' => array("Campaign Contribution", "Donation"))

```

The API Explorer can generate this code for you if you select the IN operator.

---
Tags: civicontribute, api, contributions
---