# Question
Title: Why if you remove a regular fee from the list on an event does it not get removed from the price set in the database?
If I set up an event and use the regular fees section rather than setting up a price set then it stores this information in a price set.  If I remove a value from this table then it stays in the database. If I know the price set id then I can find these fields via the UI  Why does the system keep this other value? Having these other fields causes confusion when creating views because as far as a basic user can tell there is only one fee and there is no reason for them to expect there to be other ones hiding.

# Answer
> 1 votes
Disabling of price field is actually helpful in case you need it in future and it is not shown anywhere else except price field browse page.

Eg:

* Configure an event with regular priceset(is\_quick\_config = 1) with three field options.
* Remove two of them (backend - civi disables it).
* Now, a user creates a new priceset from `Manage Price Set` page and configure on this event. At this point, your regular priceset is not lost. Its value of `is_quick_config` is changed to zero, hence it will be now shown on the list of PriceSet page.

So, it provides a flexibility of again choosing the original priceset for your event. You can also delete unwanted field options of it from `civicrm/admin/price/field/option?action=browse&reset=1&sid={set_id}&fid={field_id}` just like normal pricesets, if it is not used by any other event.

---
Tags: civievent, price-sets
---


# Question
Title: Events 'missing' after upgrade to 4.7.19
On a civi 4.7.19 / joomla 3.70 installation I have problems accessing events after the 4.7.19 ugrade (events worked OK on 4.7.18/3.7.0). I have current events displaying on the front page via the civievent module that can't be 'seen' in the event dashboard (no current events showing) or in Manage Events (only some old events show here). If I 'Search All', I get a 'None Found' message even though there is also a message saying 'Event 1-50 of 224'. When I try plugging the ID of a current event into the edit URL for one of these old events I get the error 'You do not have permission to access this page'. In case it's important, I have a 'Performance warning: Missing indices' alert on the status page, but the 'Update Indices' button does not seem to achieve anything as it comes back after confirming an update with the same Missing indices alert.

# Answer
I'm seeing this too. Interestingly, if I click the "Last" link, i.e. to jump to the oldest events, I can see the first 20 or so oldest events. And these events can be edited. But none of the more recent events can be listed or edited.

I reproduced this on the demo site @ dmaster.demo.civicrm.org/civicrm/event/manage/… - to reproduce, requires having more than 25 events.

A fix is to add `'options' => array('limit' => 0),` to the civicrm\_api3() calls in CRM/Event/BAO/Event.php - the bug is caused by the default limit of 25 in API calls.
> 2 votes

# Answer
There is now an open issue and fix for this: https://issues.civicrm.org/jira/browse/CRM-20549
> 4 votes

# Answer
The problem is solved now. There are a few commits made made on the file so I thought of giving here the quick way instead of following all the thread.

To solve it, go to https://github.com/civicrm/civicrm-core/pull/10325/files and click on View to download the whole raw file as there are other modifications made to the file Event.php in CRM/Event/BAO/ since the release 4.1.9.

Make a copy of Event.php and change the whole file on your site.

Tested and it works.

Thanks to the whole team who worked on and solved the problem.
> 3 votes

# Answer
I too am experiencing this. Events are shown on the front end but in the back end, none are listed. I did notice, however, the alphabet link across the top appears to link to events, however, the same result occurs where no events are actually displayed.
> 0 votes

# Answer
Some additional information on the issue. (Using Joomla 3.6.5 and civicrm 4.7.19)

The manage events doesn't show any event and displays the message None found (see below). The events are working well on the front end.

We checked the api interface and this one is working as well.

If you create a report for events, you can find them as well in the drop down list of the filters.

It looks like the issue is only limited to the Manage Events page and not spread in other areas.

Hope it helps narrowing down the issue.
> 0 votes

---
Tags: civievent, upgrade
---


title: Civievent - i cant add any event

text:
# Question
Title: Civievent - i cant add any event
I try to add an event in CiviEvent (with Superadmin role ), but I can not. After saving the first form, when Civi tries to go to https://staroflife.pl/civicrm/event/manage/location?action=update&reset=1&id=46 it displays the following error:

```
 $backTrace =
 #0 /home/sol/domains/staroflife.pl/public_html/sites/all/modules/civicrm/CRM/Core/Error.php(378): CRM_Core_Error::backtrace("backTrace", TRUE)
 #1 /home/sol/domains/staroflife.pl/public_html/sites/all/modules/civicrm/CRM/Event/Form/ManageEvent.php(128): CRM_Core_Error::fatal("Nie masz      uprawnień dostępu do tej strony.")
 #2 /home/sol/domains/staroflife.pl/     public_html/sites/all/modules/civicrm/CRM/Event/Form/ManageEvent/Location.php(74):      CRM_Event_Form_ManageEvent->preProc     ess()
 #3 /home/sol/domains/staroflife.pl/     public     _html/sites/all/modules/civicrm/CRM/Core/Form.php(543): CRM_Event_Form_Manage     Event_Location->     preProcess()
 #4 /home/sol/     domains/staroflife.pl/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
 #5 /home/sol/     domains/staroflife.pl/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203):      CRM_Core_Quic     kForm_Action_Display->perform(Object(CRM_Event_Form_ManageEvent_Location), "display")
 #6 /home/sol/     domains/staroflife.pl/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Pa     ge.php(103): HTML_Q     uickForm_Controller->     handle(Object     (CRM_Event_Form_ManageEvent_Location), "display")
 #7 /home/sol/     domains/staroflife.pl/public_html/sites/all/module     s/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
 #8 /home/sol/     domains/staroflife.pl/public_html/sites/all/module     s/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
 #9 /home/sol/     domains/staroflife.pl/public_html/sites/all/module     s/civicrm/CRM/Core/Invoke.php(283): CRM_Utils_Wrapper->     run("CRM_Even     t_Form_ManageEvent_Location", "Lokalizacja wydarze     nia", (Array:0))
 #10 /home/sol     /domains/staroflife.pl/public_html/sites/all/modul     es/civicrm/CRM/Co     re/Invoke.php(84): CRM_Core_Invoke::ru     nItem((Array:14))
 #11 /home/sol     /domains/staroflife.pl/public_html/sites/all/modul     es/civicrm/CRM/Co     re/Invoke.php(52): CRM_Core_Invoke::_i     nvoke((Array:4))
 #12 /home/sol     /domains/staroflife.pl/public_html/sites/all/modul     es/civicrm/drupal     /civicrm.module(448): CRM_Core_Invoke:     :invoke((Array:4))
 #13 /home/sol     /domains/staroflife.pl/public_html/includes/menu.i     nc(527): civicrm_invoke("event", "manage", "location")
 #14 /home/sol/domains/staroflife.pl/public_html/index.php(21): menu_execute_active_handler()
 #15 {main}

```

I see the event in the database after this error, but I cannot see it in the dashboard. Before this problem, I add two events without any trouble.

I tried the following: clean Drupal and CiviCRM cache, log in with another login, check ACL in CiviCRM. But it did not work :(

Civicrm version:4.7.19, Drupal: 7.51 "Nie masz uprawnień dostępu do tej strony." means You do not have permission to access this page. :)

**EDIT: The problem occurs when the ID is higher or equal to 30. I tried: recover old civicrm version (from backup after update) and i have this problem too.**

# Answer
I found issue and how to fix it. I change files in: CRM/event/BAO/event.php

https://github.com/civicrm/civicrm-core/pull/10325/files
> 0 votes

---
Tags: civievent, permissions, acl
---


title: Header Issues On Wordpress Installation

text:
# Question
Title: Header Issues On Wordpress Installation
I am getting the following errors when doing various tasks in and around CiviCRM only

```
Warning: Cannot modify header information - headers already sent by (output started at .../public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1) in .../public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 912

```

When hitting save on things like clearing cache and updating paths. If I just hit refresh the page loads right up, but won't on the original button press.

and

```
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at .../public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1) in .../public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php on line 127

```

When running cron jobs. I know these are probably related, but would really love to get them fixed as the last one is blocking cron from running via url.

Wordpress Version: 4.7.4 CiviCRM Version: 4.7.19

# Answer
> 0 votes
I am not sure WHAT was different, but I just went back and reloaded the System.php file again, and it is working now.

---
Tags: wordpress, error, cron-job, cron
---


title: How do I set up recurring donations?

text:
# Question
Title: How do I set up recurring donations?
I'd like to be able to set up recurring monthly gift donations. Is this possible with my CRM? Currently, we can accept one time gifts but can't seem to figure out how to take automatic monthly gifts.

# Answer
> 2 votes
In what part of the world are you located? If it is in Europe you might need the CiviSEPA extension as well :-)

# Answer
> 1 votes
On any Contributions Page -\> Contribution Amounts -\> check the box labeled Recurring Contributions.

The details of how this will work depend on your Payment Processor.

---
Tags: payment
---


# Question
Title: Views : SQLSTATE[42S02]: Base table or view not found (concerning a Custom Value Table)
I want to create a View based upon civi\_participants, including Participant Custom Fields.

I can Add the custom fields, but I get the following message :

*SQLSTATE\[42S02\]: Base table or view not found: 1146 Table 'bapaparoisse\_drup\_275.dr\_civicrm\_value\_infos\_parents\_participants\_11' doesn't exist*

... and the displayed view is empty.

(Running Civi 4.7.16 / Drupal 7.54 / Views 3.16)

# Answer
> 4 votes
This error usually means .... "Drupal doesn't know the table exists" ... which either means

1/ you have your civicrm tables in a different database and need to update the list of tables that you entered in settings.php so that drupal can connect to it

2/ the fields have been created, but no data has been stored yet (i may be wrong but i think the table for the data is created the first time a record is saved that contains data that needs storing in the table)

---
Tags: civievent, custom-fields, drupal-views
---


# Question
Title: "Expected one Contribution but found 25"
After upgrading from CiviCRM 4.6.24 to CiviCRM 4.7.18 on Drupal (7.52) we are getting the error "Expected one Contribution but found 25" whenever registering for an event with an event page.

I have tested logged in, not logged in, with and without price sets.

The transactions receiving this error are being created in CiviCRM and not using an API call like with Webform.

I am running Apache 2.4.25 with PHP 5.6.30.

The error details that I have in Drupal Watchdog is too long to post.

# Answer
> 1 votes
It does look like the API is called in the background anyway. That would make sense as it is the preferred way to communicate with the database. It does look like the API action 'getsingle' is used and it is receiving more than one. Can you explain a little more on which point you are getting the error?

# Answer
> 1 votes
I am not sure how this happened but *Partially paid* and *Pending refund* where added with the values of 1 and 2 respectfully. These were duplicating the completed statuses like you can see in this image.

\[

I have also updated the JIRA ticket https://issues.civicrm.org/jira/browse/CRM-20523.

---
Tags: civievent, civicontribute, 4.7
---


# Question
Title: Why isn't our Profile displaying on our Joomla webpage?
Set up profile, check. Set up relevant menu item as "CiviCRM" then "Profile Search", check. In the "Options" tab have selected the relevant profile.

So why is the page only displaying the placeholder text from the original K2 article?

# Answer
> 1 votes
This has kind of been stated before, but you need to make sure that what you are exposing to Joomla is viewable by all unless you are requiring people to log in first before they can see the content (such as with a members area). You may want to elaborate on what your end goal is, because a profile search may require higher permissions than a profile view. If you are looking for just a general directory listing, you may not need a search.

# Answer
> 0 votes
Perhaps, because you did not set the correct ACL-setting for this page?

# Answer
> 0 votes
Are you requiring user login to view menu item? Is ACL setup to view menu item contents, i.e. with civi or are you planning to do public search? I have done this especially for geographic search, works like a charm but there is a bit to do for ACL first. If you need help, ask away.

---
Tags: joomla
---


# Question
Title: CiviCRM_API3_Exception: "Authorization failed to join onto StateProvince api in parameter loc_block_id.address_id.state_province_id.name"
We are using CiviCRM with Drupal 7.54 and we just upgraded to CiviCRM 4.7.19. After the upgrade, when I go to an event (Event-\>Manage Events-\>\[some event\]-\>location) with a user who has 'access CiviEvent' permissions and try to go to the location tab I receive this error:

```
CiviCRM_API3_Exception: "Authorization failed to join onto StateProvince api in parameter loc_block_id.address_id.state_province_id.name"

#0 sites/all/modules/civicrm/CRM/Event/BAO/Event.php(1889): civicrm_api3("Event", "get", (Array:5))
#1 sites/all/modules/civicrm/CRM/Event/Form/ManageEvent/Location.php(172): CRM_Event_BAO_Event::getLocationEvents()
#2 sites/all/modules/civicrm/CRM/Core/Form.php(564): CRM_Event_Form_ManageEvent_Location->buildQuickForm()
#3 sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#4 sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Event_Form_ManageEvent_Location), "display")
#5 sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_ManageEvent_Location), "display")
#6 sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#7 sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#8 sites/all/modules/civicrm/CRM/Core/Invoke.php(283): CRM_Utils_Wrapper->run("CRM_Event_Form_ManageEvent_Location", "Event Location", (Array:0))
#9 sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#10 sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#11 sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#12 includes/menu.inc(527): civicrm_invoke("event", "manage", "location")
#13 index.php(20): menu_execute_active_handler()
#14 {main}

```

We upgraded from 4.7.15 so one of the upgrades implemented a permission check for

CRM\_Event\_BAO\_Event::getLocationEvents()

Located in CRM/Event/BAO/Event.php

```
 $events = array();
    $ret = array(
      'loc_block_id',
      'loc_block_id.address_id.name',
      'loc_block_id.address_id.street_address',
      'loc_block_id.address_id.supplemental_address_1',
      'loc_block_id.address_id.supplemental_address_2',
      'loc_block_id.address_id.supplemental_address_3',
      'loc_block_id.address_id.city',
      'loc_block_id.address_id.state_province_id.name',
    );

    $result = civicrm_api3('Event', 'get', array(
      'check_permissions' => TRUE,
      'return' => $ret,
      'loc_block_id.address_id' => array('IS NOT NULL' => 1),
      'options' => array(
        'limit' => 0,
      ),
    ));
```

Now I am able to access the tab with the permission 'administer CiviCRM' but not with just 'access CiviEvent'. This is problematic because many of my CiviEvent users can't complete their event postings.

When I comment out the this field

```
'loc_block_id.address_id.state_province_id.name'
```

in the return array ($ret) it passes permissions. I'm wondering if something is wrong with the join in the API, or if there's a permission I need to set somewhere.

Also when I go to the API explorer and reproduce the API call above, I receive the same error.

I'm wondering if this is a bug in core or maybe something on my end. Any help to find a way around this permission failure would awesome.

Thanks!

# Answer
> 2 votes
The problem lies with the API permission to the StateProvince entity. Civi event users do not have access to this entity via the API. (I'm not sure why this is)

To fix this I created a custom drupal module with the civi hook: mymodule\_civicrm\_alterAPIPermissions

```
mymodule_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) {

$permissions['state_province'] = array(
    'get' => array(
      'access CiviCRM',
      'access CiviEvent',
      'edit all events',
    ),
  );
}

```

Which gives CiviEvent users access to this entity via the API.

---
Tags: civievent, issues
---


title: How to use CIVIHR for wordpress

text:
# Question
Title: How to use CIVIHR for wordpress
I am working on CIVI CRM on wordpress. I need to make HR module in CIVI CRM. Can anyone tell me how to integrate CIVIHR extension in CIVI CRM.?

# Answer
There are installation instructions on the CiviHR github page.
> 1 votes

# Answer
The installation instructions reference Drush - the Drupal command line tool. I would inquire of the developer before even trying this on WordPress.

Create a Github account and ask the question there as any issue.
> 1 votes

---
Tags: wordpress, installation, civihr
---


title: passing JSON objects to drush cvapi

text:
# Question
Title: passing JSON objects to drush cvapi
I'm building API extension that takes complex objects as parameters.

The API exporer does a brilliant job at parsing the objects, but drush less so.

Commands I am trying are:

```
`drush @contact cvapi Contact.getclif sequential=1 return="id" clif={"type":"raw","params":{"5":1,"6":1}} length=5`

`drush @contact cvapi Contact.getclif sequential=1 return="id" clif='{"type":"raw","params":{"5":1,"6":1}}' length=5`

```

Both fail to json\_decode the object and my API method receives a JSON string.

I could decode the string in my API - but that feels a little hacky...

Am I doing something wrong?

# Answer
the drush api command needs to be made "json aware" it seems indeed. It shouldn't be too complicated, want to give it a go and patch it?
> 1 votes

# Answer
Here is how to pass an array to drush `echo '{"retrieval_parameters":{"jobId":97727336,"filePath":"Raw Recipient Data Export May 15 2017 22-07-43 PM 674.zip"}}'
| drush cvapi Omnirecipients.get --in=json`
> 7 votes

---
Tags: api, drush
---


# Question
Title: Bugreport: Impossible to create more than 25 events
I tried to create events. For the first 25 events it worked fine, after 25 events, I got an access denied error instead of the event configuration page:

> "Entschuldigung, eine Bereitstellung ist uns gerade nicht möglich. Sie haben nicht die notwendigen Berechtigungen, um diese Seite aufzurufen."

The event is created in the database table civicrm\_event but not shown in the event overview in civicrm. If I delete some rows in the sql database civicrm\_event, I can create events again up to 25.

I turned on the debug mode. I think, this query is the problem:

> CRM\_Core\_DAO: CONNECT: Checking for database specific ini ('') : database\_ in options CRM\_Core\_DAO: QUERY: SELECT a.id as `id`, a.title as `title` FROM civicrm\_event a LIMIT 25 OFFSET 0
>
> CRM\_Core\_DAO: query: QUERY DONE IN 0.000273 seconds. Result is 25 rows by 2 columns.

So the resultset has only the first 25 rows and the created event isn't in the resultset.

I use civicrm 4.7.19 with drupal 7.54

# Answer
> 4 votes
I would recommend you apply the patch here https://github.com/civicrm/civicrm-core/pull/10325 There is a default limit on API calls to 25 records which is what your probably hitting here

Seamus

---
Tags: civievent, issues
---


# Question
Title: How to configure authorize.net payment processor to use another currency
Authorize.net itself boosts it supports multiple currencies: https://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Authorize-Net-Expansion-into-Canada-the-United-Kingdom-and/ba-p/33690

The list of payment processors shows a 'blank' when it comes to regional support for the Authorize.net payment processor: https://wiki.civicrm.org/confluence/display/CRMDOC/Payment+Processors

Elsewhere on stackexchange, someone explains how to support other currencies https://stackoverflow.com/questions/16014643/does-authorize-net-support-different-currency-types/16031041#16031041

Could that apply to CiviCRM too ? Is it just not implemented yet ?

Somehow, we always use US$. The message above says

> If you’re not sending the currency code, or if you’re using any of our other Authorize.Net APIs, no changes are required at this time. The currency code for those APIs will automatically default to the currency associated with the merchant’s processor.

What does that mean - could we change the option to euro at the merchant interface ?

# Answer
It sounds like the API call and/or payment form in CiviCRM would need modification to handle say, USD -OR- Euros -OR- GBP, is that right? Seeing that no further answers were given since Feb 2017. And in Authorize, the payments might have to go to different accounts?
> 1 votes

# Answer
Have you tried to change your default currency in Civi to see if that fixes your problem? It is under Administer \> Localization
> 0 votes

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


title: AJAX API permissions

text:
# Question
Title: AJAX API permissions
We are using REST urls to pull data direct from Civi reports into Excel for analysis purposes. Within Civi the users are restricted via granular ACLs to specific groups of contacts.

WP role permission "Edit all contacts" is off for users.

WP role permission "CiviCRM:access AJAX API" - is on for users and the user has their own API key generated.

However when we extract the data via the rest url, it gives the error "API permission check failed for ReportTemplate/getrows call; insufficient permission: requires administer CiviCRM"

REST url looks as follows:

XXXXX/wp-content/plugins/civicrm/civicrm/extern/rest.php?entity=ReportTemplate&action=getrows&instance\_id=94&options\[limit\]=500&api\_key=PXXXXXXXXXXX3X&key=074cXXXXXXXXXXX259&json=1

We can get around the "requires administer CiviCRM" by adding a block to civicrm/CRM/Core/DAO/permissions.php as follows:

```
$permissions['report_template'] = array(
    'getrows' => array(
      'access CiviCRM',
      'access AJAX API',
    ),
  );

```

But that doesn’t respect the ACL group permissions – is there any way to limit it to just the data the user should normally be able to see? We are stuck with all records or no records.

# Answer
I believe there is currently a bug. I have submitted a bug report:

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

When I ran into my issue, I was told:

"If you need a quick fix that doesn't involve granting more permissions than users ought to have, take a look at https://docs.civicrm.org/dev/en/master/hooks/hook\_civicrm\_alterAPIPermissions/."
> 2 votes

---
Tags: api, permissions, ajax, rest
---


# Question
Title: Why is it important to define new Entities for new types of data?
The Developer Guide includes detailed instructions on declaring a new entity which begins with this:

> If you want your extension to store data in the database, then you will need to create a new entity.

The steps include:

1. create XML schema
2. create DAO
3. create BAO
4. create SQL to create/drop your table
5. create Api

I must confess that I have stowed new data in a more lightweight way on several extensions - e.g. I've created an API Entity that handles the SQL itself, skipping the creation of XML, DAO and BAO.

**I am sure there are good reasons for the detailed set of steps but it's not clear to me what benefits they bring?**

In black-box thinking, an extension that needs to use a new table needs to be able to create the table, provide an Api for using it, delete the table on uninstall. Are there cases, e.g. a table for a very extension-specific use case, when it is sensible to avoid the overhead of all the extra boilerplate code (schema, DAO, BAO)?

# Answer
> If you want your extension to store data in the database, then you will need to create a new entity.

IMHO, this line miscommunicates a little. The value of `generate:entity` comes when you want to define an entirely new entity with a full CRUD functionality in APIv3. There are times when you'd do this. But if that's not the goal, then there are certainly other ways to store data which may be simpler, e.g.

* You can often store data using a core entity (like `Activity` or `Contact`), possible with custom fields.
* You might create a bare SQL table and generate the SQL code in your own way.

IMHO, the docs for `generate:entity` should not negate the value of these other approaches.
> 2 votes

# Answer
The benefit of going through the pain of DAO and co is not obvious for me neither, and I have to confess skipping them and doing it the same way as you did.

One key reason would be to benefit from all the security that the DAO handles by default: are you sure your extension is done properly and you properly escape all the SQL?

On other reason might be documentation: it might be easier to find which fields exist/are mandatory based on the schema/BAO. Eg. on the API explorer, are all the fields for your extension properly shown and do they have their description?

I know that some work was done to use a more modern SQL abstraction than the one we have, but I don't think it is something that we could use in extensions. Would be super useful IMO.
> 3 votes

# Answer
I'm guessing that if it wasn't so painful (e.g. if there was a CLI command or similar that created the boilerplate and so on) then you would just follow the guidance and not question the reasons.

I have skipped them in the past, esp. for more trivial extensions, but went to the effort recently, on a more complex extension.

Not having to worry as much about security (as Xavier mentioned) is one reason. Allowing exposure to BAO level hooks like https://docs.civicrm.org/dev/en/master/hooks/hook\_civicrm\_pre/ might be another (though I haven't thought too much about this reason).

Following CiviCRMs conventions is possibly another. Though having said that. I do agree with the sentiment of the question and we should be trying to work out which conventions are useful and which aren't.
> 2 votes

# Answer
Another reason to have full-blown entities that make use of core-like DAOs is that you inherit a bunch of API magic, like the ability to do API joins across tables, the use of get options, etc.
> 1 votes

---
Tags: extension, developer
---


# Question
Title: CiviCRM Log shows error invoking Payment Form
Periodically I seem to have the following error on my CiviCRM site. I have never actually seen the error and have had a hard time tracking it down. I would be interested if anyone could point me to steps I need to take to reproduce the error (get the civicrm\_invoke(payment, form) method to fire so that I might see what is happening. It seems odd that line #2 shows a null value for the name. I only have one processor\_id installed (Stripe). Any pointers for tracking down further what is happening here would be appreciated.

```
May 12 08:19:43  [info] $backTrace = #0 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Error.php(378): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/isi/sites/all/modules/civicrm/CRM/Utils/Type.php(476): CRM_Core_Error::fatal("processor_id (value: ) is not of the type Integer")
#2 /var/www/isi/sites/all/modules/civicrm/CRM/Utils/Request.php(110): CRM_Utils_Type::validate("", "Integer", TRUE, "processor_id")
#3 /var/www/isi/sites/all/modules/civicrm/CRM/Financial/Form/Payment.php(55): CRM_Utils_Request::retrieve("processor_id", "Integer", NULL, TRUE)
#4 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Form.php(549): CRM_Financial_Form_Payment->preProcess()
#5 /var/www/isi/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#6 /var/www/isi/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Financial_Form_Payment), "display")
#7 /var/www/isi/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Financial_Form_Payment), "display")
#8 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#9 /var/www/isi/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#10 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Financial_Form_Payment", NULL, NULL)
#11 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#12 /var/www/isi/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#13 /var/www/isi/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#14 [internal function](): civicrm_invoke("payment", "form")
#15 /var/www/isi/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#16 /var/www/isi/index.php(21): menu_execute_active_handler()
#17 {main}

```

# Answer
It looks like it's getting an error when loading the payment-processor specific part of a contribution form, via AJAX. It should be getting the payment processor id as part of the ajax call, but it's not. That suggests it might be on an old contribution page that had a payment processor configured as an option that is no longer available.

If you can look at your web server access logs and find the corresponding contribution page you might identify the problem. It's even possible that you wouldn't actually see an error on your form, it would only show up in your console.
> 3 votes

---
Tags: drupal
---


# Question
Title: Upgrading from 4.7.18 to 4.7.19 breaks soap
I recently upgraded from 4.7.18 to 4.7.19 (under Drupal 7.54) and now CiviSMTP (as well as my browser) gets Drupal's "Page not found" page when trying to get to my soap.php file.

`Page not found
The requested page "/sites/all/modules/civicrm/extern/soap.php" could not be found.`

I've confirmed the file is in place, I'm using the default Drupal .htaccess file, file permissions seem to be at their defaults (AFAIK), and I'm out of ideas. My cron jobs are also not running, but I figure there's a common cause.

# Answer
> 3 votes
It turns out it was civicrm file permissions (in sites/all) conflicting with my server's PHP access settings.

My server dictates that if any part of a path is group writable, php file access will be denied. So I (well, my hired support person because I got desperate) went and set the directories involved to permission 755, and the file to permission 644 (civicrm/extern/soap.php).

My secondary problems with cron (civicrm/bin/cron.php) and not being able to browse for images in civimail (civicrm/packages/kcfinder/\*) were fixed by following the same logic.

I'm still not sure why this was triggered by an upgrade from 4.7.18 to 4.7.19. I must have made a misstep during file copying.

---
Tags: civimail, soap
---


# Question
Title: Editing a label in "new individual" form
I want to edit a field called "source" in the new Individual form. I want to change the name of the field. where can I change it?

# Answer
You can use the word replacements feature, if you want to replace the word everywhere.

Or if you're just using that field for a different purpose, create a new custom field instead.
> 4 votes

# Answer
Try some CSS:

```
label[for=contact_source]
{
    /* ...definitions here... */
}

```

You can use the ::after to add arbitrary text, as per, e.g. https://css-tricks.com/almanac/selectors/a/after-and-before/
> 3 votes

# Answer
You already had many answers how to. I will make a recommendation: create a custom field rather than manipulate a core CiviCRM field? It will be easier to maintain if fields change in updates of CiviCRM.
> 2 votes

---
Tags: contacts, webform-civicrm, forms, contact-view, quickform
---


# Question
Title: Are contents of ConfigAndLog directory safe to delete?
I am looking at our CiviCRM install on disk and I notice that `files/civicrm/ConfigAndLog` is taking up nearly 9GB with all files from 2014-2015.

Looking at them they are just plain text files which sort of look like query results. Most are in the format `CiviCRM.<32character_string>.log.YYYYMMDDhhmm` some are just `CiviCRM.<32character_string>.log`

Is it safe to `rm` these files or do they serve a purpose?

# Answer
The main use of those logs files is to help diagnose problems in CiviCRM. You're unlikely to want to review problems from a few years ago so you can delete them. The one without the datestamp is the current one and that should have the most recent timestamp.

However 9GB is a lot of log output! It would be worth looking at the recent ones to see if there are current issues that need attention.
> 7 votes

---
Tags: logs
---


title: Dietary requirements in CIVI event

text:
# Question
Title: Dietary requirements in CIVI event
I'm looking for the dietary requirements in Civi Event an I can't locate the option. Please could you help?

Thanks,

Adam

# Answer
> 3 votes
You would have to add a custom field. You could add the custom field at the level of participant, where you would save the dietary requirement for that specific person at that specific event.

Alternative is to keep it at Individual level where you would record the dietary requirements of the person at any event.

Do you know how to create custom fields in CiviCRM?

# Answer
> 1 votes
That's not something built-in. However, it's quite easy to add using custom fields.

---
Tags: civievent, custom-fields
---


# Question
Title: Profile - Organisation Details but add employee/voluntter
I am creating a profile for Organisations to complete on our website and it seems straighforward. Until it gets to finding how to add employees/volunteers as part of the profile.

How do I get an organisation to enter these details?

Thanks

# Answer
> 3 votes
For WordPress you will need to use Caldera Forms to achieve what you are looking to do. Here is a link to the documentation:

https://docs.civicrm.org/user/en/latest/website-integration/integrating-with-wordpress/#caldera-forms-civicrm

Here is a link to the Caldera Forms CiviCRM integration on Git Hub:

https://github.com/mecachisenros/caldera-forms-civicrm

Hope this helps

---
Tags: profile
---


# Question
Title: WordPress - Problems trying to go back to CiviCRM 4.7.17 from 4.7.19
I've been having problems trying to get CiviCRM 4.7.19 working. So I thought I'd try going back to CiviCRM 4.7.17, which I had managed to get working pretty well on another site. I deactivated and deleted CiviCRM 4.7.19, deleted and recreated the MySQL database, and uploaded, extracted and activated CiviCRM 4.7.17.

When I go to Settings on the WordPress dashboard, I don't see "CiviCRM Installer".

When I try http://\<my\_wordpress\_home\>/wp-admin/options-general.php?page=civicrm-install

I get "Sorry, you are not allowed to access this page." (Even though I am logged in as a WordPress administrator in another tab.)

I'm pretty new to CiviCRM and not sure where to go from here. Thanks for any tips you can provide.

WordPress 4.7.4 running on Linux.

http://connectionpracticecoach.com

# Answer
The civicrm directory under wp-content/uploads was not deleted when I deleted CiviCRM through the WordPress plugins interface. I deleted that manually using cPanel, and the install went normally.
> 1 votes

# Answer
If you unpacked the zip file in /wp-content/plugins as user root and that whole directory tree is owned by www-data or a similar user, that would be the problem.

Try ls -l one level back in the directory, see what username owns the files. If it's www-data, this incantation would fix it:

chmod -R www-data ./plugins
chgrp -R www-data ./plugins
> 0 votes

---
Tags: wordpress, installation, 4.7
---


# Question
Title: Do compiled templates (in templates_c) contain URL data, or get corrupted?
I use price-sets with events, where users enter the number of seats/tickets wanted. Lately, and randomly, users get tickets added that they didn't order (e.g., they enter '1' at price\_1 and after confirmation, they have '10' at price\_2 in addition to '1' at price\_1. Since it is random (and I haven't been able to reproduce it myself) I thought it was a browser/memory sort of problem. And, I understand that if BASEURL is not set correctly throught the session (Controller) can error out. I don't know if this is due to session timeouts. I have cleared cache, checked configuration of paths, directories and all that. If a template were 'corrupted' could that cause it? And can I safely clear/refresh all the compiled templates under templates\_c? Civicrm 4.5 (will be updating soon ISA)

# Answer
> 1 votes
To answer the last part, yes you can safely delete the contents of `/sites/default/files/civicrm/templates_c/`. That is a recommended step in the upgrade process

---
Tags: civievent
---


# Question
Title: Case Manager not updating correctly (CiviCRM 4.7.21)
When I added some case roles and set the case manager to one of these roles it doesn't appear to update on the case summary screen.

1. Set up case http://dmaster.demo.civicrm.org/civicrm/a/#/caseType
2. Add role
3. Set manager
4. View the case summary

No matter which case role I set the case manager to, it still shows as Case Coordinator is (Case Manager) in the first column of the table shown.

I think this is a bug, but if it is, has anyone else come across this?

# Answer
> 4 votes
We have found that this is a bug.

If you're a developer the function which isn't working properly is in: - CRM/Case/XMLProcessor/Process.php Line 199 was checking whether $relationshipTypeXML-\>manager was set, as opposed to whether $relationshipTypeXML-\>manager == 1

---
Tags: civicase, roles
---


# Question
Title: Questions for using civi as part of a election campaign
So we are looking at CiviCRM to help run my campaign. We have been using votebuilder which is very good but it has some drawbacks as well. one of the big drawbacks is that you can not see people outside of your district.

So i have downloaded the files for all of the voters in PA. I have some questions

1. Have other people loaded these types of files into Civi before and if so a. How do you keep track of things like if the person is a dem or rep or other b. How do you keep track of the times in which they have voted c. How do you keep track of the multiple districts that they live in d. How can you search on all of the above so that you can find all of one party who has voted in the primary and general of x year and is in District Y
2. I saw a note back in 2014 that they were working on the ability to "cut turf" does anyone know if that was completed, and if so do I need to download anything else
3. If you can cut turf is it done visually? So on a map and i can draw on the map to cut the turf? if so is there a demo somewhere
4. Is there a way to print by street (or turf) odd and even street numbers?
5. If you can not cut turf, is there a way to create a list of people then go out and meet with those people, then somehow pull the same list up and quickly enter data?
6. If you do go out and lets assume you are giving out pampletts, where would you store the information like ... not home..took pamplet...agreed to have lawn sign..agreed to volunteer..so that we keep track of that as part of a date related item..so when we run for office again we can look back see who did it last time and then capture if they will do it again this time
7. Becuase the campaign has a limited life, can this be hosted on a shared server at godaddy or hostgator or something that is inexpensive. I need to keep the costs down but I never want to lose the data

thanks for your help. Mark

# Answer
> 4 votes
> So i have downloaded the files for all of the voters in PA. I have some questions
>
> Have other people loaded these types of files into Civi before and if so a. How do you keep track of things like if the person is a dem or rep or other b. How do you keep track of the times in which they have voted c. How do you keep track of the multiple districts that they live in d. How can you search on all of the above so that you can find all of one party who has voted in the primary and general of x year and is in District Y

Yes, political parties import voter data into CiviCRM. There's a CiviCRM partner whose main clients are Libertarian parties, and Rick Santorum ran his 2012 presidential campaign on CiviCRM. One of my clients is a political party.

You'd use custom fields to store that data; you can use multi-value custom fields to store multiple districts. The Electoral API extension will create some of those fields - and automatically look up which district they live in (Federal and State only, but it wouldn't cost much to have someone add municipal-level). Searches work like any other search. You might need to get a little clever with smart groups to get "voted in primary" and "voted in general election", but it's certainly doable.

> I saw a note back in 2014 that they were working on the ability to "cut turf" does anyone know if that was completed, and if so do I need to download anything else
>
> If you can cut turf is it done visually? So on a map and i can draw on the map to cut the turf? if so is there a demo somewhere

Nope, sorry.

> Is there a way to print by street (or turf) odd and even street numbers?

Yes, the Walk List Report.

> If you can not cut turf, is there a way to create a list of people then go out and meet with those people, then somehow pull the same list up and quickly enter data?

Yes, there are several ways to do this, depending on your needs.

> If you do go out and lets assume you are giving out pampletts, where would you store the information like ... not home..took pamplet...agreed to have lawn sign..agreed to volunteer..so that we keep track of that as part of a date related item..so when we run for office again we can look back see who did it last time and then capture if they will do it again this time

You'd capture that as an activity type, and add custom fields as necessary to that activity type.

> Becuase the campaign has a limited life, can this be hosted on a shared server at godaddy or hostgator or something that is inexpensive. I need to keep the costs down but I never want to lose the data

I would NOT use shared hosting for a database that holds the entire voting population of PA. Get a Linode or similar for $10/month.

All this said - I'll answer a meta-question. ANY campaign organizing tool is going to cost you time and money. CiviCRM is "free" - but if you want to run an *effective* campaign, you'll need to be willing to spend money.

# Answer
> 1 votes
Jon has done a great job but SE likes lots of answers ;-). Mark there is a pretty strong community within CiviCRM that works with political campaigns, both for the candidates and for pure 'political change the world' style campaigns. There are many crossovers. Our work has mainly been at the national or federal level, and the odd US-state level. Therefore we haven't had the opportunity to really focus on what a single standalone candidate might need that might differ to what the big orgs need.

CiviCRM on Drupal using Activities, Views, Webforms, sometimes Views Bulk Operations etc can deliver a great suite of canvassing, data record and other tools to help get the 'elect me' message out and machine rolling. As Jon says, it can be finessed to meet your needs. Politics is done very differently in different places.

In Aus they need thousands of volunteers pushing the 'vote us' message on election day. In NZ it is almost forbidden to promote the party/candidate on the day.

But at the heart of these systems you need to know \- who will vote \- who might vote and what might persuade them to vote \- who said they would vote and did they actually get their arses down to the polling booth yet \- who can help (whether they will vote or not) \- not to mention some dollars to help fund the campaign.

And yes CiviCRM will deliver all of this.

There has been some (currently not shared/shareable work done on turf-cutting, not sure what the estimate is for getting that 'out there' but won't be very near future)

There has been work done to improve walk-listing so you can output one-side of the road type lists. And yes you can take a device with you to record outcomes of those door-knocks as you go, or pull the info off the sheets at the end of the night and input or import.

Jon has answered the more specific questions, and as he says with some custom fields on custom Activities you can do pretty much what you like.

# Answer
> 0 votes
I am the US client of Peter Davis (Fuzion). We maintain the voter information for 800,000+ voters in our county. The voter files provided by our board of election seems similar to what you get in PA.

---
Tags: civicontribute, civireport, civivolunteer, civicampaign
---


# Question
Title: How to build a Real Size Drupal+Civi Test Configuration?
I have installed a Drupal+Civi test site, with same software level as my production site (Drupal 7.54 / Civi 4.7.16).

To be able to make real size tests, I want to have identical DBs on each site.

So, I have copied both prod DBs (Drupal and Civi) into my test DBs (using phpmyadmin / Copy structure and data + DROP TABLE).

Tables now seem identical (statistically : I have no real comparison tool)

I have updated settings.php with the same table "prefix"

But when I open the test site, I get an error : "Fatal error: Call to undefined function webform\_menu\_to\_arg() in /home/bapaparoisse/www/dev/includes/menu.inc on line 824".

I must have missed something, but what ?

Any suggestion is welcome

# Answer
Your error doesn't indicate a problem with your database - and it does sound like you've copied them correctly. This error indicates that you have a missing file in your file system. Is the webform module missing on your test site? Or perhaps the test site's webform module isn't the same version?

You should also clear your Drupal cache on the test site.
> 1 votes

---
Tags: installation, testing
---


# Question
Title: How can I pass CiviCRM first name and last name fields to Drupal API user_save
I am calling the Drupal API "user\_save" to create a brand new Drupal user. This does create a new Drupal user. But this user does not have the CiviCRM first name or last name fields set. How can I pass first name and last name to the Drupal API "user\_save"?

I investigated how CiviCRM handles passing the firstname and last name when someone registers online (which includes a profile that collects first name and last name). CiviCRM only has a mechanism to deal with this situation when someone is online, not using the API, per code in the CiviCRM core file /sites/all/modules/civicrm/drupal/civicrm\_user.inc

This issue causes problems with my CiviCRM dedup rule, which is set to check for first name, last name and email. Since for any Drupal user created via the API does not pass the first name or last name, a new CiviCRM contact is created as well. (In addition to the Drupal user)

In my scenario I have a civicrm contact called "testfirst", "testlast", "test@test.com" in the backoffice. I create a Drupal user for this contact (using the API user\_save). This contact does get associated with the new Drupal user. However, there is also a brand new contact with the email address "test@test.com" but no other data. This brand new contact is getting created because the unsupervised dedup rule is checking for all 3 fields (first name, last name, and email).

# Answer
> 1 votes
The `user_save()` function can't take CiviCRM data. CiviCRM injects a profile into the user creation page when you create a user through the UI.

To handle your scenario, you'll want to:

* Call `user_save()`. It will return a user object, including the UID.
* Call the CiviCRM `UFMatch.get` API to get the corresponding Civi contact ID.
* Call `Contact.create` on the contact ID to insert the first/last name.

# Answer
> 0 votes
Would it not work to change the dedupe rule to just check for email? Do you have multiple contacts with the same email address and different names?

---
Tags: drupal, duplicate-contacts
---


# Question
Title: Settings don't display when tabs are clicked on an existing CiviReport
Based on the doc found here (at the bottom): https://docs.civicrm.org/user/en/4.7/reporting/set-up , it should be possible to edit existing reports (like adding email settings). Currently not even copying a report makes it editable, so everytime a new report needs to be created if you want to permanently change a setting (email in my case, to automatically send report results). So my question: how do I edit an existing report?

Edit: screenshot added Edit: second screenshot added

# Answer
It sounds like you're missing the "Administer Reports" permission.

* Go to CiviCRM's \**Administer menu » Users and Permissions » Permissions (Access Control).
* Select the first option ("CMS Access Control", where "CMS" is the name of your CMS).
* Assign the "CiviReport: administer Reports" permission to a role you have.
* Save the permission.

It's also worth replicating a problem on the demo site (demo.civicrm.org) if this doesn't resolve your issue. That way you can edit your question knowing if the problem you're experiencing is specific to your site, or to CiviCRM in general.
> 0 votes

---
Tags: civireport
---


# Question
Title: How to use CiviCRM Webform to process CiviCRM fields at each step rather than on submit?
Use case:

A multi step CiviCRM Drupal web form where I want any CiviCRM fields and CiviCRM activities to be updated in CiviCRM as each step is completed rather than only at the end of the completed form.

This enables 2 things:

1. Data in an uncompleted form is still captured in CiviCRM.
2. Progress through the form can be tracked via CiviCRM activities so that CiviCRM smart groups can be created to mail/remind specific users to complete the rest of the form.

Is this possible? If not, would others be interested in it?

# Answer
I've done this a couple of times now using a custom drupal module and hooks. You can get data into civicrm using the api.
> 1 votes

# Answer
You might be able to achieve the required by daisy-chaining a number of separate webforms (using webform checksum to pass the same contact id through each form). You would need to change the 'submit' button to be eg 'next page' - and going backwards might be hard but not impossible - but it would allow for Activities etc to be triggered at each step.
> 0 votes

---
Tags: webform-civicrm, activities
---


# Question
Title: Is there a way to set a cap (maximum participant) number within the price set field?
I was hoping to find out if there was a way to set a cap on the price set field rather than the event. For our summer camp, we have a morning and afternoon session that you register for under the same event, but can pay which session you want. We were wanting to set a cap on both the morning and afternoon session. Since they aren't their own event, I didn't know if this was possible.

# Answer
> 5 votes
Yes. In your Price Field Option on a checkbox field type you should see 'max participants' field so you can limit how many can sign up to any option. Just make it a $0 item if you need to have it as a 'free' option within a paid event.

---
Tags: civievent
---


# Question
Title: Cannot access System Status or Find Contacts after upgrade 4.7.19 on Wordpress
I am getting a 500 Internal Server Error when trying to access my System Status screen (the warning in footer is "System Status: Error"). I get a 500 error when I try to access some of the Search functions as well: (Find Contacts / Advanced Search etc).

Wordpress 4.7.5, CiviCRM 4.7.19.

I had Debugging/Backtrace turned on, and ran into this:

```
#0 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(187): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#4 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, NULL, NULL, "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", "DB_Error", TRUE)
#6 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", "DB_Error", TRUE)
#9 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'civicrm_custom_group.is_public' in 'field list'")
#10 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#12 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2446): DB_common->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#13 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#14 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(357): DB_DataObject->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#15 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1307): CRM_Core_DAO->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", TRUE)
#16 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php(537): CRM_Core_DAO::executeQuery("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", (Array:0))
#17 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(64): CRM_Core_BAO_CustomGroup::getTree("Individual", Object(CRM_Contact_Page_View_Summary), "2", NULL, "")
#18 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php(87): CRM_Contact_Page_View_Summary->preProcess()
#19 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(310): CRM_Contact_Page_View_Summary->run((Array:3), NULL)
#20 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:14))
#21 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#22 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:3))
#23 [internal function](): CiviCRM_For_WordPress->invoke("")
#24 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array((Array:2), (Array:1))
#25 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters("", (Array:1))
#26 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#27 /home/59460-47919.cloudwaysapps.com/nzgxzrukdb/public_html/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
#28 {main}

```

# Answer
It would appear this was an extension conflict. Thanks, Aidan!
> 1 votes

# Answer
That looks to suggest you haven't run the database upgrade part yet, you would need to go to http:///wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1 and run the database upgrades

Seamus
> 1 votes

---
Tags: 4.7
---


# Question
Title: Enabling 'New Organisation' button for Current Employer field in View Contact
We recently upgraded to CiviCRM 4.7.19 on Drupal 7.52 and for some reason the New Organization button isn't appearing when searching for an unknown organization for a contact's current employer. I can add an organization via CiviCRM \> Contacts \> New Organisation but our backoffice staff liked being able to add from the person contact page. I've checked the console and there are no errors flagged and isn't a CSS thing as the element holding the button exists but just doesn't have the button markup e.g. instead of:

```
<div class="crm-entityref-links"> <a class="crm-add-entity crm-hover-button" href="/civicrm/profile/create?reset=1&context=dialog&gid=5"><i class="crm-i fa-building"></i> New Organization</a></div>

```

the page only has:

```
<div class="crm-entityref-links"></div>

```

I've checked permissions and as far as I can tell everything is set ok. Is there a setting I'm missing?

**Update**

Looking at our l10n-js file I can see that the `contactCreate` object is not being populated:

```
CRM.config.entityRef = $.extend({}, {"contactCreate":[]...

```

Digging into the code I can see this is supposed to be created in Core/Resources.php (line 685):

```
'contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks()

```

Looking at CRM/Core/BAO/UFGroup.php I can see the `getCreateLinks()` function calls

```
public static function getCreateLinks($profiles = '', $appendProfiles = array()) {
    // Default to contact profiles
    if (!$profiles) {
      $profiles = array('new_individual', 'new_organization', 'new_household');
    }
    $profiles = (array) $profiles;
    $toGet = array_merge($profiles, (array) $appendProfiles);
    $retrieved = civicrm_api3('uf_group', 'get', array(
      'name' => array('IN' => $toGet),
      'is_active' => 1,
    ));

```

Running a similar API call on our install:

```
$result = civicrm_api3('UFGroup', 'get', array(
  'sequential' => 1,
  'name' => array('IN' => array("new_individual", "new_organization")),
));

```

I get no results, the reason is because the name is actually `new_organization_5` not `new_organization` Still don't know how to fix

# Answer
> 2 votes
As you discovered, the system expects to have 3 reserved profiles: "new\_individual", "new\_organization" and "new\_household". If you accidentally deleted or renamed those profiles (machine "name" field not the user-facing title) I suggest naming them back, or else creating new ones with those names.

---
Tags: contacts, relationships
---


# Question
Title: CiviVolunteer - Log Hours (requires not zero value)
The Log Hours feature of the CiviVolunteer extension lists the lists all the available and scheduled volunteers within a volunteer project. We have scheduled the volunteers out several weeks and would like to record the hours for the completed days (past days). However, it is requiring us to enter a value greater than zero for all volunteers listed, even those who are schedule in the future. The Actual Duration field is required. Do we need to wait until all the volunteer roles are completed before we enter the actual hours?

Drupal - 7.54 CiviCRM - 4.7.17 CiviVolunteer Extention - 4.6-2.2.1

# Answer
You're not doing anything wrong -- that's just the way the form was designed.

I think it's time this form got an overhaul. Conditional validation would be helpful in this case as well as some others. As an example, I seem to recall someone else pointed out that if you mark a volunteer as a no-show, you still have to enter a non-zero value for the actual duration. Clearly, that's nonsensical.

Full disclosure: CiviVolunteer is primarily maintained by a small development shop of which I am a part. Unfortunately we are not in a position to do unfunded work, but we'd be happy to improve this feature with funding or to help whatever developers you might have at your disposal, provided they contribute the improvements back to the project.
> 1 votes

---
Tags: civivolunteer
---


# Question
Title: Issues with the Default Email address for bounces - authentication
CiviCRM 4.7.19 / Drupal 7.54

I am stuggeling with the setup of the default mail account in CiviCRM (... /civicrm/admin/mailSettings?reset=1)

I have setup a IMAP mail account for processing bounced email. Receiving email in this mail account works using my mail client using information below.

* Mail account info:

Email address: bounces@mydomain.org

Username: bounces@mydomain.org (ISP requires that the full email address be used for the username)

Password: mypass

Server: mail.mydomain.org

Protocol: IMAP

SSL: is activated

.

* CiviCRM (CiviMAIL) settings:

Name: Bounce processing

Server: mail.mydomain.org

Username: bounces \<\<\<\<--- should be full email addres: bounces@mydomain.org

Password: mypass

Local part:

Email domain: mydomain.org

Return address:

Protocol: IMAP

Source:

Use SSL: checked

Used for: processing bounces

.

Results Cron Job -

Entiteit: job Actie: fetch\_bounces Summary Finished execution of Fetch Bounces with result: Mislukt, Error message: A fatal error was triggered: Kan geen verbinding maken met Mailstore voor bounces@mail.mydomain.org Foutmelding:

An error occured while sending or re (...) Details

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

Full message: Finished execution of Fetch Bounces with result: Mislukt, Error message: A fatal error was triggered: Kan geen verbinding maken met Mailstore voor bounces@mail.mydomain.org Foutmelding:

An error occured while sending or receiving mail. Failed to connect to the server: mail.mbrainingcentrum.com:993.

.

When I use the full email adress as username I get errors referring to: bounces@mydomain.org@mail.mydomain.org

Looks to me that CiviCRM(CiviMAIL) has a bug regarding concatenatig proper parts.

Any solution?

Many thanks in advance !

Best regards, Ton

# Answer
CiviMail doesn't concatenate the username to the servername, it just takes whatever you provide and tries to connect using those credentials.

But my guess is that the issue is unrelated to the username, since your error message is:

```
Failed to connect to the server: mail.mbrainingcentrum.com:993.

```

I'd guess that you've more likely got a firewall issue, or an SSL issue on your server.

You can test by manually trying to connect to your mail server, using e.g. the instructions here: https://technet.microsoft.com/en-us/library/aa995718(v=exchg.65).aspx

\[As per comment below - another thing to check is that the server is connecting to the correct machine, e.g. if it has a local dns setting that is wrong.\]
> 1 votes

---
Tags: civimail
---


# Question
Title: How does this work with an existing website?
How does this work with an existing website? Or do we create a new website via a host like wordpress?

# Answer
> 4 votes
As Jon says, CiviCRM is installed on top of WordPress, Drupal/Backdrop or Joomla, so if your main website uses one of those you have the option to add Civi to it.

Alternatively, you can leave the main website as is and install CiviCRM and one of the CMS's on a separate site. Then for example, your main website has the write up of your event and includes a link for booking that goes to the Civi site to do the event booking and payment.

# Answer
> 1 votes
CiviCRM started life as a Drupal module, and even though it grew out of that to become "CMS agnostic", early on there was a decision not to try and include all the things a CMS does. So it relies on the CMS for a few things, most importantly for user authentication.

Here's some advice on choosing your CMS to wrap around CiviCRM:

https://docs.civicrm.org/user/en/4.7/website-integration/choosing-your-cms/

From a conceptual point of view, I prefer to think of CiviCRM as an independent 'service' that has integration modules with different CMS to actually be able to access it. In fact, although you'll need a primary CMS to 'contain' CiviCRM, you can also access CiviCRM (using the REST interface) from multiple CMSs.

# Answer
> 0 votes
CiviCRM can be installed as a WordPress plugin, a Drupal/Backdrop module, or a Joomla extension.

---
Tags: installation
---


title: CiviVolunteer - View Volunteer Roster

text:
# Question
Title: CiviVolunteer - View Volunteer Roster
The View Volunteer Roster for a CiviVolunteer Project indicates it should only be displaying the Assignments for the current day and future days. However, it lists the assignments which are in the past. How do we eliminate the past assignments?

In addition, the "Back to Manage Volunteer Projects" button at the bottom of the window does not work.

Drupal - 7.54 CiviCRM - 4.7.17 CiviVolunteer Extention - 4.6-2.2.1

# Answer
> 1 votes
I think I have seen this before when the volunteer opportunity has no end date. When creating the opportunity, did you select "Open-Ended" for the "Schedule Type?"

---
Tags: civivolunteer
---


title: PlaySMS gateway

text:
# Question
Title: PlaySMS gateway
I've just created my own sms gateway using a Huawei E303 dongle and a cheap GSM sim card and I forsee great possibilities if a CIVI extension can be developed for this. Its based on the OS PlaySMS gateway. PlaySMS itself has an api and can be configured to use many other 3rd party gateways including clickatell and Twillio as well as DIY setups using GSM sim and a dongle. Can all be put on a rasp pi.

I think it would be great if Civi had functionality to use PlaySMS as an SMS provider. It would mean dedicated outgoing and incoming sms functionality available via a cheap sim service. I'd be happy to provide documentation on building the rasp pi setup and configuring playsms, and using the playsms api. https://github.com/antonraharja/playSMS/blob/master/documents/development/WEBSERVICES.md

I'd need support with the CIVI side of things, getting an extension written etc. How to develop this as a MIH? anyone interested in helping?

# Answer
This might be a good starting point: https://github.com/nditech/org.ndi.sms.telerivet

That's a pretty simple provider so you could probably more or less just plug in the PlaySMS library instead of the telerivet one.
> 1 votes

---
Tags: extension, sms
---


# Question
Title: Error Linking Drupal user to edit their Civi CRM profile
I'm attempting to provide a link for members to edit their CiviCRM profile page. I'm using the following code: civicrm/profile/edit?reset=1&gid=N.

When member clicks on the link they received the following error message:

Sorry but we are not able to provide this at the moment. is not of the type Positive

The following is what is found in the log:

```
#0 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Error.php(374): CRM_Core_Error::backtrace()
#1 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Utils/Type.php(358): CRM_Core_Error::fatal(" is not of the type Positive")
#2 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php(298): CRM_Utils_Type::escape(NULL, "Positive")
#3 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Profile/Form.php(309): CRM_Core_BAO_UFGroup::getFields(NULL, FALSE, NULL, NULL, NULL, FALSE, NULL, FALSE, NULL, 1)
#4 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Profile/Form/Edit.php(122): CRM_Profile_Form->preProcess()
#5 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Form.php(543): CRM_Profile_Form_Edit->preProcess()
#6 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#7 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Profile_Form_Edit), "display")
#8 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Profile_Form_Edit), "display")
#9 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#10 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Profile/Page/Router.php(108): CRM_Core_Controller->run()
#11 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Profile_Page_Router->run((Array:3), NULL)
#12 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#13 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#14 /Users/executivedirector/Desktop/BAH/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:3))
#15 [internal function](): civicrm_invoke("profile", "edit")
#16 /Users/executivedirector/Desktop/BAH/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#17 /Users/executivedirector/Desktop/BAH/index.php(21): menu_execute_active_handler()
#18 {main}

```

Any ideas?

# Answer
> 1 votes
To expose a profile to Drupal Users/Members for updating in Drupal - you have a number of options - including out of the box - the Profile Name and Address on /user - when your Members have a Drupal account and are logged in:

hit Hello 'Name' to get to /user Name and Address is a CiviCRM Profile -\> hit Edit to update it

Name and Address profile appears here because in it's Profile setting is has View/Edit Drupal User Account checked.

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


# Question
Title: Sparkpost Cividesk integration - processing of bounces
I have installed the Cividesk Sparkpost extension and am able to send mass mailings with CiviMail via my Sparkpost account (REST API).

However, CiviCRM apparently doesn't process bounces. Would I have to configure something else, besides the SparkPost extension?

Any Cron Job to run?

Many thanks Ton

# Answer
Start here for background reading: https://wiki.civicrm.org/confluence/display/CRMDOC/Bounce+Handling

I found all I had to do was to just follow the Documentation: https://docs.civicrm.org/sparkpost/en/latest/install/

**Update** Bounces are processed through a callback (no need for an email account dedicated to bounce processing), but CiviCRM only processes bounces for CiviMail-originated emails. CiviDesk is planning to extend bounce processing to transactional emails in the future as well.
> 1 votes

# Answer
All you need to do is follow the documentation, as suggested by Karin.

When you save the API key in the setup screen, the extension will make API calls to SparkPost and create a callback. Whenever a bounce occurs, SparkPost triggers this callback and CiviCRM can then process the bounce event accordingly.

As also indicated in the documentation, only CiviMail bounces are currently processed.

The cron job processes bounces produced when you have a return loop (ie. setup a specific SMTP mailbox to collect bounces) - it is not needed in the case of SparkPost as callbacks are much more reliable and efficient.
> 1 votes

---
Tags: civimail, rest, sparkpost
---


# Question
Title: Outbound mail fails after upgrading to 4.7.1
I recently upgraded my site to 4.7.1. Outbound SMTP does not work. Even though I use the correct credentials, I get errors and email does not send. I restored my site back to 4.6, and all is good.

Tried testing on your sandbox, but 4.7 is not available yet.

# Answer
> 6 votes
From what I understand, this can be because the server you contact has a self-signed certificate (see this question for a workaround), or because the PEAR SMTP package version used by CiviCRM does not support TLS. Civi uses 1.6.1, but support was added in 1.7.1.

In our case (php7, CiviCRM 4.7), we are able to work around this by forcing SSL connection rather than TLS. In the Outbound mail settings 1) put `ssl://` in front of the mail server name 2) change the port to something appropriate. Usually to 465\**

# Answer
> 2 votes
Same error with CiviCRM 4.7.4, Drupal :

> authentication failure \[SMTP: STARTTLS failed (code: 220, response: 2.0.0 continue)\].

Using mail() allows us to send mails, but with the local SMTP server.

Downgrading to PHP5.5 resolves this problem. With PHP5.6 the problem is in packages/Net/SMTP.php when calling `$this->_socket->enableCrypto()`

This is due to php 5.6 : https://civicrm.stackexchange.com/a/10966

# Answer
> 0 votes
Seems there is some work in progress to attach this on CRM-18408 SMTP connection via SSL and TLS in PHP 5.6

---
Tags: smtp
---


title: SMTP connection failing problem

text:
# Question
Title: SMTP connection failing problem
Just want to throw this question here so the answers can be easily found by people who met similar problems.

Problem came up when we were trying to test some new mailing services with CiviCRM 4.7, we kept getting "connection refused" errors and other similar messages with different protocols and ports entered in outbound mail settings.

The environment we have: Ubuntu 14.04, php 5.6, Drupal 7.3.x, CiviCRM 4.7.x.

# Answer
> 15 votes
PHP5.6 has enabled peer verification by default from 5.6.x. The most likely cause of this issue is that **the SMTP server's SSL cert does not validate against the certs available to the hosting environment**.

So, on PHP5.6+, an SMTP connection via SSL and TLS will fail in CiviCRM ***if the certificates are not peer verified***. This is an issue either with the SMTP provider or your hosting environment's CA chain.

It is recommended instead to **resolve the underlying issues with your hosting/SMTP service**, but if you want to connect to a server with a self signed certificate (for example) you can patch CiviCRM to bypass this verification.

Change in packages/Net/SMTP.php

line `$this->_socket_options = $socket_options;`

to `$this->_socket_options = array('ssl' => array('verify_peer_name' => false));`

Updated: I have updated the comment here since the summary in the ref link has also been updated to include:

> While not recommended in general, it is possible to disable peer certificate verification for a request by setting the verify\_peer context option to FALSE, and to disable peer name validation by setting the verify\_peer\_name context option to FALSE.

The above works around the problem with SMTP failure however it is better to ensure the server is set up with valid SSL certificate and configurations.

# Answer
> 7 votes
I had to go this far...

```
$this->_socket_options = array('ssl' => array('verify_peer'=>false,'verify_peer_name'=>false,'allow_self_signed'=>true));

```

# Answer
> 6 votes
If you are connecting to well known third party mail provider, then it's highly likely that they have their certificates set up properly and ***you shouldn't need to disable peer verification***.

Check two things:

1. As it mentions on the *Settings - Outbound Mail* form, 'if the server uses SSL, add "ssl://" to the beginning of the server name'.
2. Check what port you are using: "The most common SMTP port possibilities are 25, 465, and 587".

And if the above does not resolve the issue, verify that the hosting environment's CA chain is up to date, since that will also trigger this problem.

*Note: In the case of Mandrill, even though the https://mandrillapp.com/settings page specified port 587, ssl only worked on port 465 (as explainined in this mandrill knowledge base article).*

# Answer
> 0 votes
Seems there is some work in progress to attach this on CRM-18408 SMTP connection via SSL and TLS in PHP 5.6

---
Tags: smtp
---


title: Word replacement error

text:
# Question
Title: Word replacement error
I have a problem in word replacements as well. It is not getting replaced in all places. Tried replacing "contributions" with "donations". the change is not getting reflected in CiviReport, while in other places it has changed

# Answer
> 1 votes
The word replacement feature will only replace words that are part of the CiviCRM interface, and not words that are in your 'configuration'. This may not be at all obvious, but the key is that those occurrences of "Contribution" in the reports section are actually pre-configured report instances. So you can change them by going in and editing the reports (or rather, the report instances) themselves, via the web interface.

I should also say that you're probably working too hard to make it look 'right'. Although you may only use CiviContribute for donations now, you may end up wanting to use it for event registration in the future, for example.

# Answer
> 0 votes
I see you've tagged your question with webform\_civicrm - Just adding a note that word replacments in civicrm will not work with webform.

---
Tags: webform-civicrm, civireport, administer
---


title: Is CiviCRM resource intensive?

text:
# Question
Title: Is CiviCRM resource intensive?
I need to plan requirements for multiple instances of CiviCRM as a Drupal module.

My goal is to "more or less" know how many sites would I be able to put in a single application server (with dedicated database server) with 4 cores CPU and 16 GB memory.

# Answer
It's tempting to discard this question as being too vague to give an accurate answer to, but capacity planning is a real and difficult challenge.

Is CiviCRM resource intensive? That depends what you compare it with - compared to a static site, yes.

A CiviCRM site with a few users occasionally looking up a contact needs far fewer resources than one with hundreds of users using it all day long for complex reports.

Are your multiple sites likely to have similar workloads? Will the sites be used concurrently? What virtualisation/containerisation are you using? What memory requirements are there besides Civi? What other resources might be contended - like network bandwidth or storage?

You could look at the specs offered by the various CiviCRM hosting providers and see what configurations they have arrived at based on their experience of hosting a large number of mixed sites. If you search this site you will find a few recommendations of 2GB for a VPS.

There are some critical limits, eg if the php memory limit is too low then processes abort, but mostly things "go slow" rather than fail if you try to put "too much" on a server so determining how many sites you can put on your box involves understanding acceptable performance.

In practice, you probably just need to try it and see. Monitor your resource utilisation and perceived performance and see what effect adding another site has.

Alternatively, use a hosting provider and pay them to figure it out :-)
> 6 votes

# Answer
@Aidan is right - there is no one number for how many sites - not even a 'more or less' number :-)

Some of our projects are on one dedicated server that hosts a couple dozen of them; they are all Drupal (and most with CiviCRM).

Another project though -\> it has its own two dedicated servers: one for web and one for the database/mysql!
> 2 votes

# Answer
**Are you specs 16 GB RAM and 4 CPU cores for a VPS or the specs of a co-located bare metal server?**

Expect about 20 to 30% performance degradation if you go with a VPS, and if you have a choice in VPS virtualization technology, opt for KVM (e.g. Linode) over XEN (AWS), you'll get faster disk I/O for usually less cost and the same stability.

**Are you planning on creating a VMs (e.g. KVMs) for each of the sites or putting all sites on the same bare metal server?**

See the first question, if you're already using a VPS, it's not recommended to run a Virtualization stack inside an already virtualized VPS, but if you're getting a bare metal server, I would highly recommend using a virtualization layer to ease the management, e.g. you might want to reboot only one site, but keep all others online, that's impossible to do if you put them all without virtualization on the same bare metal server. Similar issues hold true if you needed some special PHP version or hold back one site that falls behind e.g. still uses Drupal 6 while the rest of them are already on Drupal 7 as the CMS.

**What do mean by dedicated database server, are you using an external service like Amazon RDS as a dedicated database backend, or do you plan to host the database on an entirely separate server while the webserver is the machine for which you've provided the specs, or do you plan to virtualize the database server as dedicated VM inside the bare metal host?**

A good rule of thumb is for a fairly average CiviCRM database of about 40k records with 5 staff members needing backend access, a 2GB RAM allocation is quite sufficient per site which can include both the webserver and database server inside the same VM if the disk has fast I/O (e.g. SSD drive.) When virtualizing the database server as a separate dedicated database VM, think about allocating at least 1 GB per about 50k records for each instance of CiviCRM, and about 1.5 GB as the base minimum for each web front-end VM.
> 0 votes

---
Tags: evaluating-civicrm, performance
---


# Question
Title: How to deal with problem data when importing CSV
My first time trying to import CSV data into CiviCRM. The data looks something like the below (changed to not reveal actual names etc). The lines in bold are not importing.

I am guessing that in first failure (**Allan Nori**) the city (**Boise /Hiroshima**) and the country (**United States / Japan**) are causing the problem. In the second, probably the state/province (**British Columbia (BC)**). And in the third, the state/province (**Maryland & District of Columbia (DC)**).

For the middle one, I guess I can just eliminate the part in parenthesis (**(BC)**), although it might be nice if the contact would also come up on searches for **BC**.

I'm not sure about the best way to handle the other two. In the first case, the person lives part of the year in Boise, Idaho, and part of the year in Hiroshima, Japan. In the other, Chevy Chase is actually in Maryland, but the person also wants to come up on searches for **District of Columbia** (or **DC**).

Any advice on the best way to handle such situations would be appreciated.

(By the way, these are not all the columns. I do have email and other data in other columns, but I don't think those are important for this issue.)

# Answer
You should note the exceptions for the contacts with dual residences and manually remove their secondary residence, and only keep their primary residence in the sheet. You can always create their secondary residence address within CiviCRM after the import wizard finishes as a non-primary address.

For State/Province names and Country name mismatches, you can create a simple MySQL query for each country that has an issue to get the exact spelling that CiviCRM expects in the import process

```
use my_civicrm_db_name_here;
select c.id, c.name as country , sp.id as state_province_id, sp.name as state_province_name from civicrm_country as c left join civicrm_state_province as sp on c.id = sp.country_id where c.name = "Canada"

```

For the list of country names you can simply query the civicrm\_country table like so:

```
use my_civicrm_db_name_here;
select id, name, iso_code from civicrm_country

```
> 6 votes

# Answer
First the available countries and states/provinces need to be defined in the Localization settings.

If you cannot do the SQL query, you can see the available values by creating an address manually and seeing the available values.

The import allows state abbreviations for at least the United States. (e.g. Arizona - AZ). I use the abbreviations when I do contact imports (I import a lot of contacts).

The city field is not validated against a list of valid values. So a dual city would work but is not practical. You should clean up the import data and have 2 addresses for those that need them as Young suggested.
> 2 votes

---
Tags: contacts, import, data-import, csv
---


title: Capacity Planning

text:
# Question
Title: Capacity Planning
We would like to propose the utilization of CiviCRM in a big organization. They have 140.000 contacts, that manage more then 1.000.000 activities each year (including mails, contributions, etc), and they need to use ACL for 3 different level: holding, country, organization. Have someone experience about CiviCRM with these figures?

Thanks a lot

# Answer
> 3 votes
There are certainly instances with much larger numbers of contacts than you are describing. We have several in the range of .5-1 million contacts and of course the associated activities etc. And there are others out there much larger than those.

If it performance you are concerned about, rather than the number of rows in tables like \_contact and \_activities, the issues will more likely be around usage of Smart Groups and other query demanding features, especially if nesting of queries is involved.

# Answer
> 2 votes
Several organizations use CiviCRM with similar needs. Wikimedia Foundation and Australian Green Party have very similar requirements, for example.

# Answer
> 1 votes
We have about 1 million contacts now (grown from 50k to 1 million over 3 years) and have millions of activities. We are now using the full CiviMail to replace external email marketing systems which will greatly increase activities. We use complete contribution management and event management, we are now doing much more volunteer management which will also increase activities.

We moved from shared server, to virtual private server, to outsourcing hosting to a Civi service provider because of performance issues and lack of server expertise. If you have the server (or cloud) knowledge you could do it yourself.

We are just beginning to incorporate some complex smart groups and will see if they impact performance.

The organizational structure and ACLs are more complicated and I would recommend getting experienced advice.

# Answer
> 0 votes
It is our experience too that if there are performance problems with our bigger customers they tend to be caused by Smart Groups

---
Tags: database, acl, performance
---


# Question
Title: Custom field data - maintaining uniformity
I want to add Educational information of individuals as custom field set. However I want the data to be entered to be uniform. In our organization, different people will enter data into civiCRM. Some may enter as "B.Tech" or "BTech" or "Btech" etc. How do I ensure same format is used in the database for all degrees?

# Answer
There are two options:

1. Set your custom fields as a (multi) select if possible.
2. Develop an extension that validates the input using a validateForm hook (or in jQuery)
> 2 votes

# Answer
Yes, make the custom field a 'Select" or "Multi-Select".

I am about to convert a data set of custom fields that I initially made all "Text" over to "Select" for the reason you described. In addition, it will enhance the ability to use the Advanced search to allow selecting one or more of the valid values to search in the selection criteria.
> 1 votes

---
Tags: contacts, custom-fields, custom-search, custom-templates
---


# Question
Title: Adding extra information to event registration
We organise a walk with a lunch afterwards. Who registers online for the event must be able to indicate how many people will participate for the walk (number of adults and number of kids up to 12 year) and for the lunch (idem).

I do not see the possibility to add those fields to the online registration form. When i define custom fields for the event, they cannot be added to the registration form. When i add a "walk and lunch profile" to be used for these events, the first to know is the existing field of the person (such as last name...).

# Answer
You will want to make the Custom fields on the Participant record (not on the Event). Then you'll be able to add them into a Profile and add that Profile to the Online Registration section for your Event.
> 5 votes

# Answer
You could have the online registration allow to register multiple participants. You can have a different profile for the initial participant and a separate profile for the additional participants depending on the information you need for each participant.
> 3 votes

# Answer
If you are just needing 'numbers' then you should be able to do this by using a 'number' based field in a Price Set.
> 1 votes

---
Tags: civievent, custom-fields
---


# Question
Title: Why did civicrm_status_pref table not get created during upgrade
we had an upgrade (4.4 \> 4.7) that resulted in drupal log errors telling us DB Error: no such table ... civicrm\_status\_pref though there had been no warnings during upgrade itself

# Answer
We turned logging off and back on, and table was created and several other problems were fixed (eg cron warnings in system status.

Reminder, to self and others, that for upgrading old systems in particular, turning logging off/on can be a help
> 1 votes

---
Tags: upgrade
---


# Question
Title: Transfer of fees from one event to another
How can I transfer an event fee for a contact from one event to another? We have a contact that registered for two different events. She decided after registering that she can not attend both so she wants to apply her registration fee from the event she will not attend to the other.

# Answer
> 2 votes
CiviEvent have a setting called `Allow Self-service cancellation or transfer` option for event which I think might be helpful in this case. To find this, check the Online Registration tab on Event Configuration.

URL - `civicrm/event/manage/registration?reset=1&action=update&id=<event_id>`

With this option enabled a participant gets a unique link in the registration confirmation mail where he/she can transfer the participant to some other contact.

It is included in 4.7 version. Check this for more info.

---
Tags: civievent
---


# Question
Title: Contact SubType check fail in Smarty TPL file
Have strange issue checking contact type in **\templates\CRM\Contact\Form\Contact.tpl**

This code prints **Organization / Society**

```
{$contactType} / {$contactSubType}

```

This code prints **Organization / Society**

```
{if $contactType eq 'Organization'}
   {$contactType} / {$contactSubType}
{/if}

```

But this one prints nothing

```
{if $contactSubType eq 'Society'}
       {$contactType} / {$contactSubType}
{/if}

```

And this one prints nothing

```
{if $contactType eq 'Organization' && $contactSubType eq 'Society'}
       {$contactType} / {$contactSubType}
{/if}

```

Shouldn't it "just" work? Or it's another bit of CiciCRM magic?

# Answer
> 2 votes
(adding as an answer - see comment thread above)

In the DB, contact\_sub\_type uses a special character to split multiple contact types. If this is being carried through to smarty then 'eq' might not produce a match (but the non-HTML character wouldn't be printed to screen). Can smarty check whether the $contactSubType just contains 'Society'?

# Answer
> 1 votes
If isset contact ID ($contactId), you can use API in smarty like this:

```
        {crmAPI var='result' entity='Contact' action='get' id=$contactId}
        {foreach from=$result.values item=contact}
            <div>$contact.contact_type</div>
            {if $contact.contact_type eq 'Organization'}
                {* ... html ....*}
            {/if}
        {/foreach}

```

# Answer
> -1 votes
If you want to hide Contact Details, the best way is explained in this post: How do I edit activity forms?

In my opinion the best way is to create a little extension and add a template with some jQuery code to hide the Contact Details. But you could give the css way a go too?

---
Tags: contacts, smarty
---


# Question
Title: allow anonymous users to view profiles in WordPress?
It has been suggested that I may need to allow anonymous users to view profiles. I am running CiviCRM on a WordPress site.

From what I'm reading here ...

https://wiki.civicrm.org/confluence/display/CRMDOC/Linking+Profiles

... I'm gathering that this may only be possible on Drupal, not WordPress. Is that correct?

If so, is it the case that non-logged-in users on WordPress are automatically allowed to view profiles?

I'm using the profile to create a public directory: 1) Create a number of custom fields 2) Create a profile ("Trainers and Coaches", gid=17) that includes those custom fields, as well as some standard fields like First Name, Last Name, etc. 3) Create a front-end profile view.

This works when I'm logged in to WordPress. (Though I had some questions about inconsistent results when clicking on fields in the profile view.)

When not logged in to WordPress, I get errors.

Using a shortcode: `[civicrm component="profile" gid="17" mode="search" hijack="0"]`

I get:

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

```

(The profile is not disabled and is configured for use with `Standalone Form or Directory` and `Search Views`, so I guess permissions are the remaining option.)

If I use this: `http://mysite.org/trainers-coaches/?page=CiviCRM&q=civicrm/profile&reset=1&force=1&gid=17`

I get:

```
 Sorry but we are not able to provide this at the moment.
We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.<br /><br />Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.<br /><br />Error type: Could not find a valid session key.

```

(Cookies are enabled, I've tried Chrome and Safari in OSX, and Chrome and IE in Windows, with the same results. And the URL defined in WordPress is `http://mysite.org`.)

Any help will be greatly appreciated!

Wordpress 4.7.5 CiviCRM 4.7.17

# Answer
> 3 votes
* Go to CiviCRM's \**Administer menu » Users and Permissions » Permissions (Access Control).
* Click "WordPress Access Control".
* In the "Anonymous User" column, check "CiviCRM: profile view".
* If your profile contains custom fields, check "CiviCRM: access all custom data".
* Press "Save" at the bottom of the page.

Note that this is a quick-and-dirty approach that assumes you're OK with ANY profile being accessible by anonymous users if "Standalone Form or Directory" is checked.

---
Tags: wordpress, profile, permissions
---


# Question
Title: Allow user to cancel a recurring contribution
What I want is for a user to be able to log into a website, click a Cancel Membership button and that cancels the recurring contribution attached to an auto-renew membership thus making the membership expire.

Has anyone been able to do this? Using Drupal 7.54 and CiviCRM 4.7.18

# Answer
If you give your contact access to their Dashboard, then (from memory) they can access and make some limited changes to their recurring payments - ok, not from memory - some screenshots

and
> 2 votes

# Answer
Yes, using the API ContributionRecur with the action create? But not without any coding :-)
> 0 votes

---
Tags: civicontribute, civimember, user-interface
---


# Question
Title: Clicking Fields in Front-end Profile View Gives Inconsistent Results
These issues have existed for a while, but perhaps without resolution?

Front-end Profile View Issues

When you go to view the full profile from a profile-based search, all the fields are clickable but the actions after the click are inconsistent. For example:

Click on a website URL - goes to the website. Click on an email link - goes back to the profile list search results for that email address. Click on a text-type field - adds that to the search criteria.

I would rather have email fields trigger an "emailto:" type action.

And in the specific instance I'm working with, it would probably be best if text type fields were not clickable at all in the full profile.

All profile fields are set to `Expose publicly and for listings`.

Wordpress 4.7.5 CiviCRM 4.7.17

# Answer
When you setup your fields set visibility to "Public Pages". Otherwise in the detailed view the data will show as a link which when clicked will re-run the search based on that value.

Websites are turned into a hyperlink by default.

Hope this helps.
> 3 votes

---
Tags: wordpress, profile, search
---