# Question
Title: Create and manage a custon table in an extension: How to
In my extension (it's the first one I'm writing) I have the need to create a new DB table and to manage it (insert, update, delete records). How can I do it? Thanks Marcello

# Answer
Check this section on the wiki: https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addadatabaseupgrader/Installer/uninstaller You will need to add an upgrader to your extension, and from that upgrader you can manage your database file installs. Also, you might want to add a DAO class?
> 3 votes

---
Tags: extension
---


# Question
Title: What's the cause of this "Unexected token" JavaScript error?
Just did a fresh install of CiviCRM 4.6.5 on Drupal 7.38 and the JQuery/Ajax isn't working. I get the following 2 errors in the Chrome Developer Console:

```
Uncaught SyntaxError: Unexpected token <  en_US?r=7WtZJ:1
Uncaught SyntaxError: Unexpected token <  XrTF2AAu:1

```

I have gone through the "Troubleshooting popups, autocompletes, or other javascript problems" document and have verified everything and cleared my Drupal cache.

# Answer
> 1 votes
This an old thread, but I just encountered the same problem. In case anyone else lands here, here's what I found:

The issue was that I had a typo in the domain for the URL settings, which I'd defined in civicrm.settings.php. My super-helpful ISP redirects the request to http://searchassist.verizon.com/main?a-bunch-of-params-including-my-typoed-domain. That URL contains HTML, of course, not JavaScript. When the browser gets back HTML from a script src, it throws a parse error.

---
Tags: ajax
---


# Question
Title: Clearing A Report - Contribution Summary
I clicked on 'Contribution Details' report and it had a general list of names from my last time playing with it. I clicked on a specific name I wanted to do a report for and tweaked the settings to me needs. Now, I want to change just the contact ID for this report with the same settings. However, there does not appear to be a way to change the contact ID or go back to the original list of names. I want to know how I can clear the settings entirely and/or at least change the contact ID. I already checked the filters section and the contact ID is not listed here to change.

Basically, I am trying to print of the donation history for each of our board members, but I cannot seem to do this from their contact page so trying from this report.

# Answer
> 1 votes
What you have written doesn't make sense to me as when I click on a name in the contribution detail report I am taken through to the contact's record not to a somewhere I can tweak report settings.

You also haven't stated what verion of CiviCRM you are using. The report UI changed dramatically in 4.6 so if you are using a version early than that these instruction won't apply.

Those aside, go to **Administer \> Civireport \> Create new Report from template** and select the **contribution details** report. Filter on the name of one of the board members and tweak the settings to show what you want.

Once you are happy with report, open the **title and format** tab to give you new report a name and then go to the **Access** tab to choose where to put in the navigation menu and control access if needed. Then click on the **Create Report** button.

You now have a new report instance where changing the name filter will give you an individual report for each board member.

Aside: CiviCRM likes to use names rather than contact ids to identify contacts, perhaps this was a conscious decision not to reduce people to numbers.

---
Tags: civicontribute, civireport
---


# Question
Title: Problem with CiviCRM configuration (auto_increment) with wordpress (4.x) website
According to the folks at Network Solutions (our website hosts) the plugin (CiviCRM 4.7.4) was installed. They had to do a MySQL upgrade database as part of “routine” updates also. The MySQL upgrade went fine in that it did not crash our website or cause us to have to make any repairs to the info on the site. The configuration of CiviCRM is where the problem lies. According to Network Solutions, there are requirements that the CRM needs that are blocked on the MySQL server as potential security issues. They said an “auto\_increment\_increment” needs to be set to 1. So there is my dilemma. Any suggestions?

# Answer
> 2 votes
Your hosting environment sounds unsuitable for running CiviCRM - CiviCRM does have some additional requirements beyond other PHP/MySQL apps like Wordpress and Drupal.

There are some places in CiviCRM code where it expects the database to increment IDs by 1. Where MySQL is running with eg replication, this will not be the case. There are also places where CiviCRM has checks for such settings, which are mostly to protect you against unexpected outcomes - even if there's no hard requirement for that setting to be the way CiviCRM "wants" it to be.

For your needs, the simple solution is not to address replication or patch CiviCRM, but simply to obtain hosting which is compatible with CiviCRM. Unless you are *heavily* invested in the existing hosting, switching hosts to someone who knows & works with CiviCRM will be a much more straightforward solution than trying to make CiviCRM and that hosting service work together ...

For more technical detail, there's a related question from a site which specifically wanted to use MySQL replication + CiviCRM together - JIRA issues linked there:

---
Tags: wordpress
---


# Question
Title: cms.root.path error after upgrade to 4.7 (Joomla)
I upgraded two installations of CiviCRM 4.6.11 to 4.7 on the same server. Both upgraded fine, but now have the following errors:

1) **Systems Settings --\> CMS Database integration** shows nothing (no paths or fields displayed). Normally I would expect at least a field to enter the Joomla Users Table name.

2) **Systems Settings --\> Directories** shows this error:

```
<div id="crm-container" class="crm-container" lang="en" xml:lang="en"> <style type="text/css" media="screen">
@import url(http://domain.com/administrator/components/com_civicrm/civicrm/css/civicrm.css);
@import url(http://domain.com/administrator/components/com_civicrm/civicrm/bower_components/font-awesome/css/font-awesome.min.css);
</style> <div class="messages status no-popup"> <i class="crm-i fa-exclamation-triangle crm-i-red"></i>
<span class="status-fatal">Sorry but we are not able to provide this at the moment.</span>
<div class="crm-section crm-error-message">Cannot resolve path using "cms.root.path"</div>
<p><a href="http://domain.com/administrator/" title="Main Menu">Return to home page.</a></p>
</div> </div>
<script language="JavaScript"> function toggle( element ) { var parent = element.parentNode; var className = parent.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { parent.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { parent.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } } </script>

```

Anyone else seen anything like this? There are no php errors logged (but some warnings), and the CiviCRM log shows this:

```
$backTrace = #0 ...civicrm/CRM/Core/Error.php(444): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 ...civicrm/CRM/Core/Invoke.php(57): CRM_Core_Error::handleUnhandledException(Object(RuntimeException))
#2 ...civicrm.php(116): CRM_Core_Invoke::invoke((Array:4))
#3 ...civicrm.php(40): civicrm_invoke()
#4 ...CMS_root_directory.../libraries/cms/component/helper.php(392): require_once("...civicrm...")
#5 ...CMS_root_directory.../libraries/cms/component/helper.php(372): JComponentHelper::executeComponent("...CMS_root_directory.../administrator/components/com_civicrm/civicrm...")
#6 ...CMS_root_directory.../libraries/cms/application/administrator.php(98): JComponentHelper::renderComponent("com_civicrm")
#7 ...CMS_root_directory.../libraries/cms/application/administrator.php(152): JApplicationAdministrator->dispatch()
#8 ...CMS_root_directory.../libraries/cms/application/cms.php(252): JApplicationAdministrator->doExecute()
#9 ...CMS_root_directory.../administrator/index.php(47): JApplicationCms->execute()
#10 {main}

```

# Answer
> 7 votes
Thanks to eug for finding the problem (see comments). Eug's solution worked for me:
Edit the file *administrator/components/com\_civicrm/civicrm/templates/CRM/Admin/Form/Setting/Path.hlp* to replace the first crmResPath with crmResURL

Update: problem persists in 4.7.3. Have upgraded the bug report priority to Major.

Update: problem persists in 4.7.4.

Update: problem persists in 4.7.5.

Update: fix prepared for 4.7.6. See above bug report link for PR details.

Update: problem fixed in 4.7.6.

# Answer
> 0 votes
I updated Civicrm to 4.7.6 in a Joomla 3.5.1 site, with "System Status: Ok" reported as a result. However the reported fix was not there: CMS Database integration shows nothing (no paths or fields displayed) only two buttons.

I manually edited the file as in the answer Jern gave, and then the system reported a sync of users. Still no database-name for the Joomla users is displayed: no path or field. I tested the sync operation and it worked okay, so I guess the field is no longer necessary.

And reset it to the startsituation: my edit was not needed after all, see comment Jern below.

---
Tags: joomla, upgrade, error, cms-integration
---


title: Slow to open at first daily use

text:
# Question
Title: Slow to open at first daily use
We have a two domains civicrm setup. On the first domain, everything is normal but on the second one, it takes dozens of seconds to open the dashboad (/civicrm) on the first daily use on every computer.

I can't reproduce the issue if I use a link other that the one that opens the dashboard

Resource URL are absolute.

see below: 5 minutes waiting to display civicrm?reset=1

# Answer
> 7 votes
There are several things happening on the dashboard, so you'll need to dig further into this yourself to find the real underlying issue. Here are some things which could trigger symptoms like what you're describing.

## Database warmup

This is the most common cause of slow dashboards IMO, but it's dependent on your setup; see note re Timeouts below.

Your DB engine keeps frequently used data in memory. When CiviCRM isn't being actively used overnight, that information will be replaced in memory by other data, and will be read from disk. This is slower. (Nightly DB backups frequently push active daily data from memory, as does a changed traffic profile when your staff knock off.)

We have a testing server which hosts multiple WIP databases. It mirrors your description; starting work on Site A will incur a few seconds (or longer) "warm-up" time. This suggests that the server is overloaded (for production use!).

A workaround is to log into the site earlier, before your morning call / coffee brew / whatever. If we know we're working on example.com and example.org today, we can `drush uli` and visit `/civicrm` on both sites before we kick off for the day. Moving a delay can make it disappear :)

The ideal solution is to make more memory available to MySQL. Buying memory is probably cheaper than the (admin, staffing) cost of dealing with insufficient memory. :)

## Timeouts

If reproducible, a specific five minute time as seen in your screenshot suggests you're hitting a timeout. This is compatible with the next answer, provided that you have a slow dashboard report which takes more than five minutes, so you reliably hit that timeout.

* You request the CiviCRM dashboard
* CiviCRM internally requests a report
* Report spins its wheels for (at least) five minutes
* CiviCRM stops waiting and serves you the dashboard minus that report.

Observing a predictable delay (=timeout) *then* a successful response from the server (as opposed to a predictable delay followed by error message from server, or a predictable delay then error message from the browser) indicates that the timeout is happening internally to CiviCRM.

A five minute timeout could be configured at different layers, in your webserver (eg PHP `max_execution_time`, apache `TimeOut`) or in CiviCRM codebase (eg cURL's `CURLOPT_TIMEOUT`). You don't really want to change the timeout, you want to speed up that process so it doesn't hit the timeout!

## Dashboard reports

The dashboard is user-customisable, so the reports you choose to show there will affect the time it takes to display. Because the dashboard contents are delivered as a single page to the admin, you can't see which report is fast or slow. Disabling some reports, or observing the internal requests made from CiviCRM (by watching your weblogs) might allow you to see which reports add the load time to the dashboard.

To identify these dashboard report loads in the webserver logs, look for `POST` requests to `/civicrm/ajax/dashboard` immediately before your `GET` request for `/civicrm/dashboard?reset=1` is completed. Timing on those requests will indicate if they are the delay factor.

Check MySQL activity too - I use `mytop`, which is just MySQL's `SHOW FULL PROCESSLIST` as a command. If you see long-running queries generating reports, you can balance whether to improve the report, remove it from your dashboard, or accept that it's worth the wait.

## Reports using memberships / smart groups

If dashboard reports include smart groups or memberships, remember that memberships get updated daily (by cron), and that smart group caching is only for a limited time. Such reports would need to be regenerated the first time they are run after midnight. CiviCRM includes functionality to schedule report generation, so you could keep your contact DB warmed up (or on the boil!) by scheduling a report to display before you start work, or perhaps by embedding the same dashboard reports on a public screen in your office :)

## URL / webserver configuration

CiviCRM makes internal requests while delivering the dashboard as well. Slow performance here could be indicative of a misconfiguration, eg:

* CiviCRM is unable to communicate with the local site
* CiviCRM is unable to communicate with CiviCRM.org infrastructure
* DNS on the webserver is slow or incorrectly configured

Issues with these *should* trigger warnings on the admin screen which you would likely have mentioned, but it's worth checking that too. These warnings can be disabled, which might work to hide the symptoms.

## Requests to CiviCRM.org

As above - CiviCRM communicates with CiviCRM.org while loading the dashboard. This functionality can be disabled (can't it?), but if doing so was working but slow or slow to return an error, you'd see a delay in rendering the dashboard also.

# Answer
> 2 votes
Thank you for all your suggestions. The culprit was a lousy .htaccess in the civicrm/ConfigAndLog folder. It contained a directive that prevented civi to access logs.

# Answer
> 1 votes
This could be due to cron not running. Have you set up a cron job? If not, the CMS (content management system) may run maintenance tasks when you first access the site in the morning.

If you are using Drupal you can find more information here: Setting up cron.

You will also need to use cron to run scheduled jobs in CiviCRM - see Managing Scheduled Jobs.

---
Tags: dashboard
---


title: 2 separate sites with the same php code

text:
# Question
Title: 2 separate sites with the same php code
Is it possible with Drupal to have two sites, with 2 separate databases, sharing the same PHP code?

For the future need of porting one database to another server, I don't want to use "Multi Site Installation".

# Answer
Yes, you can run several independent Drupal sites off the same codebase. Some instructions are here: https://www.drupal.org/documentation/install/multi-site

Basically, each has its own database and its own `sites/yoursite.org` folder where the settings files and site-specific files go. All use the `sites/all` folder. When you visit via http://yoursite.org, Drupal checks the `sites/yoursite.org` folder for a settings.php file, and if there is no `sites/yoursite.org` folter, it uses `sites/default`. (There's a more nuanced pecking order of folders, but this is the gist.)

For CiviCRM, it works the same: you put civicrm.settings.php in `sites/yoursite.org`, and the module lives in `sites/all/modules`. Your database is independent of the other sites; the only thing shared is the module code.

However, there is a reason why many people don't set up their sites this way: there's not much benefit to having a single copy of the modules (the files aren't that big), but you can do things on one site that inadvertently cause problems on one of the others. As an example, if you upgrade one site's CiviCRM, you're replacing the files used by all of your sites, requiring you to run the upgrade script on all of them.
> 3 votes

---
Tags: database, multisite
---


# Question
Title: Using buildkit on MAMP but hitting "Fatal error: Call to a member function getDriver() on null"
I am trying to install buildkit on a Mac with MAMP, but am hitting this wall:

> **Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58**

What am I missing?

I have been following the buildkit readme and have gone through this thread about setting up with MAMP but am not sure where I went wrong because I get the error when I actually try to use it.

```
MacOSX:dmaster.localhost user$ civibuild create dmaster
[[Download dmaster (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
Already downloaded dmaster
[[Install dmaster/default (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
[[Execute /Users/user/buildkit/app/config/drupal-demo/install.sh]]
++ source /Users/user/buildkit/app/config/drupal-demo/install.sh
+++ amp_install
+++ _amp_install_cms
+++ echo '[[Setup MySQL and HTTP for CMS]]'
[[Setup MySQL and HTTP for CMS]]
+++ cvutil_assertvars _amp_install_cms CMS_ROOT SITE_NAME SITE_ID TMPDIR
+++ _cvutil_assertvars_back=ehxB
+++ set +x
++++ mktemp.php ampvar
+++ local amp_vars_file_path=/Users/user/buildkit/app/tmp/ampvar3Oj48j
+++ local amp_name=cmsdefault
+++ '[' default == default ']'
+++ amp_name=cms
+++ '[' -n http://dmaster.dev ']'
+++ amp create -f --root=/Users/user/buildkit/build/dmaster --name=cms --prefix=CMS_ --url=http://dmaster.dev --output-file=/Users/user/buildkit/app/tmp/ampvar3Oj48j --perm=admin
PHP Fatal error:  Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58

Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58

```

# Answer
> 5 votes
This may indicate that either:

* The PHP runtime is missing the PDO or MySQL extensions. This may help: https://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP (At time of writing, I'd avoid PHP 5.6 for CLI dev -- GenCode may have issues with it.)
* The DB settings haven't been configured (e.g. the step for running `amp config` was skipped).
* An incompatible or incorrect value was used in the DB settings.

For reference, I believe these are the settings for use with a typical MAMP. (Note: The line is long.)

```
amp config:set --db_type=mysql_dsn --mysql_dsn='mysql://root:root@127.0.0.1:3306' --httpd_type=apache --httpd_restart_command='/Applications/MAMP/Library/bin/apachectl graceful' --hosts_type=file  --perm_type=osxAcl --perm_user=www

```

However, if you didn't run `amp config` before, it's still good to run it to see more complete instructions (esp. regarding `httpd.conf`).

---
Tags: civicrm-buildkit, mamp
---


# Question
Title: Why can't all admins see all components?
I have Civicampiagn installed and activated, and I can see it, but I have added a second admin and that account cannot see the link, nor can they see the campaign option on the add activity page.

What am I missing? Kind regards~

# Answer
> 0 votes
When you enable CiviCampaign you may need to visit your Permissions and give the CiviCampaign permission to the required roles.

---
Tags: civicampaign
---


# Question
Title: How do I deal with "Your database has already been upgraded" error?
While upgrading my civicrm wordpress from 4.6.8 to 4.6.15 i get the error

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

Does anyone know how to correct this?

I am trying to upgrade CiviCRM on WordPress from 4.6.8 to 4.6.15.

# Answer
> 1 votes
It sounds like you are trying to run the update script before you have downloaded and installed the 4.6.15 version files. Can you double check this?

# Answer
> 1 votes
You can get this error if you download the new codebase but do not (sufficiently) remove the old codebase I believe. renaming the old folder does not necessarily suffice.

---
Tags: wordpress, upgrade
---


# Question
Title: page not found errors for javascript following upgrade to 4.6.13 from 4.6.10
Civicrm version is on Drupal 7. Drupal was upgraded first to version 7.4.3. Paths for javascript and css files are not found.

Any ideas of how to fix this?

# Answer
> 1 votes
Have you ensured that CiviCRM paths are set correctly? In the Civi menubar go to *Administer -\> System Settings -\> Directories* and ensure it matches what's in *Administer -\> System Settings -\> Resource URLs*

---
Tags: upgrade
---


title: Why can't I access option groups?

text:
# Question
Title: Why can't I access option groups?
Drupal 7 Civicrm 4.74

Receiving this error:

API permission check failed for Case/getcount call; insufficient permission: require Array

CiviCRM\_API3\_Exception: "API permission check failed for Case/getcount call; insufficient permission: require Array"

```
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Case/BAO/Case.php(1914): civicrm_api3("Case", "getcount", (Array:1))
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(294): CRM_Case_BAO_Case::caseCount(NULL, FALSE)
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(251): CRM_Core_Page_Basic->action(Object(CRM_Core_BAO_OptionGroup), 10, (Array:7), (Array:4), 1)
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Admin/Page/Options.php(232): CRM_Core_Page_Basic->browse()
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(172): CRM_Admin_Page_Options->browse(NULL, NULL)
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Admin/Page/Options.php(224): CRM_Core_Page_Basic->run()
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Options->run((Array:3), NULL)
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
/var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
[internal function](): civicrm_invoke("admin", "options")
/var/www/vhosts/example.com/httpdocs/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
/var/www/vhosts/example.com/httpdocs/index.php(21): menu_execute_active_handler()
{main}
 Sorry but we are not able to provide this at the moment.
API permission check failed for Case/getcount call; insufficient permission: require Array
Return to home page.

```

# Answer
> 1 votes
This was a bug in CiviCRM 4.7 which has now been fixed. See https://issues.civicrm.org/jira/browse/CRM-18456

# Answer
> 1 votes
OK, I ended up getting into a rabbit hole and spending more time than expected here!

There's a short workaround for you, if you're not trying to edit CiviCase-related option groups: Comment out CRM/Core/Page/Basic.php line 294, which reads:

```
$caseCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);

```

For the in-depth fix, I've opened a new bug on issues.civicrm.org here.

---
Tags: error, admin, settings, option
---


title: Changing Browser Title in Tab

text:
# Question
Title: Changing Browser Title in Tab
We've created a contributions tab in CiviCRM and made the page live. However, when you're on that live page and filling the form out, the title of the website up in the browser tab says "CiviCRM -- \[Our Domain\]"

Is there any way to change or mask that language so users aren't confused that may have left our site?

# Answer
As Chris comments, it's weird that it's showing this. But you could always use a *template*.extra.tpl file to set the page title by Javascript.

1. Create a directory, if you haven't already, for template customisations. Then tell CiviCRM about it at Administer » System Settings » Directories which is at `/civicrm/admin/setting/path?reset=1`
2. Find the template name of the form that's being used from the comments in the page source of the page(s) you need to change. e.g. for *all* contribution pages its `CRM/Contribute/Form/Contribution/Main.tpl`.
3. Create the same directory structure in your custom templates directory and then place a file called `Main.extra.tpl` (using the example form name from (2)) and in that file place something like

```
<script>document.title="You're still on my website :-)";</script>

```

.extra.tpl files are processed after the main template file is, so this script will run and set the window's title.

It's a hack, and in this case sounds like it shouldn't be necessary, but it's something you can use.
> 1 votes

---
Tags: civicontribute
---


# Question
Title: How do I create a custom entity (component)?
I'm fairly new to working with Drupal and CiviCRM so I apologize on my lack of knowledge. I was looking into customizing CiviCRM and stripping out a lot of stuff I don't need. Stripping out and hiding things seems fairly easy according to the documentation, but how would I go about creating totally new entities that I can add my own custom fields to? There doesn't seem to be any discussion or examples on this? I'm used to working with Microsoft CRM in the past where you can create your own entities and custom fields and then relate these new entities back to existing ones. I've looked into creating a custom extension via the documentation but this doesn't seem to cover creating a totally new separate entity. Am I missing anything?

\*Edit, see this example of Microsoft CRM where you can easily create custom entities to fit your needs. This is the type of functionality I'm looking for. https://www.youtube.com/watch?v=YrwBpRVeMwo. Obviously CiviCRM isn't Microsoft, but I feel that having the ability to create custom entities is highly important to tailoring a fitting solution.

# Answer
If you are using CiviCRM within Drupal, you can create Drupal Custom Content Types for magazine, advert, etc. Your custom content type definition can include fields of data type "CiviCRM Contact" which can be required, optional, multi-valued, etc.
> 1 votes

# Answer
This is possible in CiviCRM, but the documentation for doing so has been scattered and incomplete. It's now gathered here in one place: https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addanewentity
> 1 votes

---
Tags: extension
---


# Question
Title: Creating An Automatic Employee of Relationship At Signup
When someone signs up on behalf of an organization in Civicrm two records are created: one for the individual and one for the organization but no Employee of relationship is created.This relationship has to be added manually. How can one cnfigure Civicrm such that when an individual signs up on behalf of an organization an automatic 'Employee of' relationship is automatically created.

# Answer
> 3 votes
When someone makes a contribution on behalf of an organization, the relationship is automatically is created. I just tested this on my local sandbox, using the default "On behalf of Organization" profile.

Please replicate the relationship not being created at a CiviCRM demo and update your question, indicating that you were able to reproduce there.

---
Tags: civimember
---


title: Addresses not showing in walklist

text:
# Question
Title: Addresses not showing in walklist
I tried following this guide: https://book.civicrm.org/user/current/civic-engagement/everyday-tasks/

And created my surveys and reserved respondents but for some reason when we generate the report it only shows the name, and street number, and name is blank. Does anyone have any idea what the issue could be? I've also tried to re-install CiviCRM.

Thanks, Steve

# Answer
Steps I followed on Demo site now to test were

* confirm you have turned on address parsing by clicking on Administer \> Administration Console\> Configuration Checklist \> Address Settings, then in the Address Editing area, check the box for Street Address Parsing.)
* confirm you have Scheduled Job for Geocode and Parse Addresses running at civicrm/admin/job?reset=1
* create New Campaign civicrm/campaign/add?reset=1
* create new Survey
* reserve some respondents
* go to All Reports, find one you created above from
* should see the Parsed address fields display results (in my case at this report for next few hours http://d46.demo.civicrm.org/civicrm/report/instance/38)

I suspect you might have not run your Geocode and Parse Address job.

hth
> 2 votes

---
Tags: civireport, custom-reports
---


# Question
Title: Need membership form mod to control contact creation
The public facing membership signup (contribution) form (wordpress) will only create individual contacts. We need to control the type of contact created based on the membership type the user selects. If they select a 'Student' membership then we need an individual contact. If they choose a 'household' membership then we want a household contact to be created. Shouldn't be too hard to write, but I don't know where the code is or how the internal api works. What would be the most relevant php files to work with and what api commands are involved in contact creation?

# Answer
Have you experimented with the api explorer?

As far as the API is concerned on the wp demo site you will find a great explorer at http://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fapi%2Fexplorer#explorer. The URL will be similar for your own site.

Remember, the eplorer is "live" so you should experiment on the demo site or on your test site, not your live site.

As far as the rest is concerned, I am not a delevoper so I can't comment on whether what you want to do might be achievable or not, but it sounds rather like you intend to hack core and that is not recommended. An extension is the preferred approach.
> 2 votes

# Answer
You're mentioning using file overrides, but that's not maintainable in the long run - and is more complicated than it needs to be IMO.

I think a preferable approach is to create an extension that calls hook\_civicrm\_post on the Membership entity. Combine that with the API to edit the contact after the membership is created.

This will allow you to set a contact subtype. Changing the contact type is a little trickier because the fields that will be available aren't necessarily the fields you'd collect for a household. But that's OK - because for a household membership, you probably want to keep an individual, then create a household separately, create a relationship between them, then move the membership on to the household. You can do all this via the API.

If you DO want to go the override route, this page shows how to override a single contribution page.
> 2 votes

---
Tags: wordpress, 4.7
---


title: Managing & Adding Groups

text:
# Question
Title: Managing & Adding Groups
In order to "Manage" or "add" groups I need to know the following:

What are groups? How can they be used?

# Answer
The CiviCRM documentation provides a good rundown of groups and tags (and the best way to utilize each): http://docs.civicrm.org/user/en/4.6/organising-your-data/groups-and-tags/.

One of the great things about Groups is the option to use Smart Groups that automatically add contacts with certain attributes to a specific group, rather than you needing to remember to add each individual one.
> 3 votes

---
Tags: groups, smartgroups
---


title: Search Confusion

text:
# Question
Title: Search Confusion
I do not understand how to run searches & be sure that anyone who does not have an email address or has opted out of emails in any way is not included.

How do I segment the database, to run searches to find the right people?

Anyone have some directions?

# Answer
> 4 votes
If you need to exclude all of those email options at once for an export or something I would search up those people, put them in a group, and exclude the group from your searches.

To search up that group of people I would use search builder (Search\>Search Builder in the main CiviCRM menu) with the following settings:

Contacts: Email: Primary: Is Empty *Also Include* Contacts: On-Hold: Primary: \> 1 *Also Include* Contacts: Do Not Email: = 1 *Also Include* Contacts: No Bulk Emails (User Opt Out): = 1

If you are using civiMail the system should not let you actually send mails to any of the groups described, even if they are included in your target groups (just as it de-duplicates for you when you send to multiple groups). You can see this when you look at the "estimated recipients" on the right hand side in civiMail is lower than the actual sum count of your target groups.

---
Tags: email, search, search-results, custom-search, option
---


title: WooCommerce & CiviCRM Integration

text:
# Question
Title: WooCommerce & CiviCRM Integration
Can WooCommerce products be synced into CiviCRM Custom Fields?

I tried creating checkboxes in CiviCRM under a custom field & they are not getting checked off when someone purchases something in WooCommerce....

Any feedback?

# Answer
> 2 votes
They guys at VedaConsulting developed a great extension that integrates Woocommerce with CiviCRM, no sure if is what you are looking for.

You can find it in their github repository

---
Tags: custom-fields, integration, woocommerce
---


# Question
Title: Why does a Smart Group disappear when assigned a Parent
I'm running CiviCRM 4.7.6, and in attempt to associate an ACL with a Smart Group, I assigned my Smart Group a parent which is a static group. This seems to have worked, in that when I list the members of the static group, the members of the Smart Group are in the list, however now the Smart Group has disappeared from the list of groups.

To summarize:

1. Created Smart Group called "Current Members" that selects contacts based on their membership status
2. Created static Group "Members"
3. Assigned "Members" as the parent group for "Current Members"

Now, Static Group "Members" includes all the contacts from Smart Group "Current Members" has disappeared from the list of Groups.

Did I break some rule mixing Smart Groups and Static Groups, or is there some list of child groups I don't see?

# Answer
On the manage groups screen is there a triangle to the left of the word 'Members' that expands to show the child groups when you click on it? There should be.
> 1 votes

# Answer
I've got exact the same problem. I upgraded to 4.7.6 from 4.6 and all the childgroups disappeared, no triangle to be seen.

Using Civicrm with Drupal. Changed layout but that didn't help.
> -2 votes

---
Tags: groups, smartgroups
---


title: CiviMail - What is it? Need Info?

text:
# Question
Title: CiviMail - What is it? Need Info?
How do I know if I can use CiviMail? What are the benefits? What does it do? How is it better or worse than just the regular email part on civicrm?

I cannot quickly find any links to more info on this? Can someone provide me with some more informatioN?

# Answer
CiviMail is a mailing feature that interacts with your mail server much like the 'Email' action you mentioned. The main difference is design ability and ability to handle mass mailing campaigns to large groups of people.

Basically, if you are sending to more than 50 contacts at a time or you need to track email opens or clickthroughs - you should use CiviMail rather than the 'Email' action.

CiviCRM has good written documentation on CiviMail here: http://docs.civicrm.org/user/en/4.6/email/what-you-need-to-know/

(be sure to check out the other CiviMail sections around the linked section as well).

**Edit:** Bounce processing is another function that CiviMail is capable of. Processing bounces from your mailings is important to keep your sending reputation high in the eyes of other mail serves, to be sure your emails get through to people. This is especially important if you send using your own mail server and manage this yourself.

More info here: https://book.civicrm.org/user/current/advanced-configuration/email-system-configuration/

and here: https://wiki.civicrm.org/confluence/display/CRMDOC/Bounce+Handling
> 6 votes

---
Tags: civimail, email
---


# Question
Title: Can I subtract guest fees collected from a membership fee when a user registers
Our club allows people to come out as guests, for which we collects guest fee. If that person later chooses to become a member, we deduct that guest fee from their membership fee.

I know I can create different fee structures, but that assumes the person entering the information, whether that's a club executive or the member selects the correct thing. I haven't found a mechanism for membership upgrades, or a means of replacing one membership with another but applying a credit against the new one.

Is there a way with CiviCRM to automate this process?

# Answer
> 5 votes
One possibility is when they come out as a guest and pay the fee, you provide them with an automatic discount from the CiviDiscount extension, which is applicable to the full "Member" membership type and is automatically given to folks with a current "Guest" membership.

You may need to play with settings to see for sure if it will work in your case.

> **CiviDiscount**: This extension allows the admin to create and manage discount codes that can be used on membership and event pages.
>
> **Features**:
>
> * Support for price sets and individual items in a price set
> * Use of monetary or percentage based discounts
> * Automatic discount based on membership
> * Generate random discount codes
> * Usage and assigned code tabs on a contact record
> * Code summary screen displays usage for a given discount code
> * Option to apply discounts to additional participants

---
Tags: civimember, contributions, cividiscount
---


# Question
Title: How can I prevent deduping from killing my server?
On a reasonably big data set (e.g. one with 70,000 individual contacts), it's not hard to kill your server with a naive manual de-duplication attempt. For example, if you don't specify a group, that number of contacts generates about 5 billion comparisons.

Has anyone thought of a way to prevent unreasonable deduplication attempts?

# Answer
> 2 votes
I think Parvez's work on deduplication performance is a big piece of this puzzle: http://vedaconsulting.co.uk/civicrm-dedupe-workflow-ui (see step 1). Some of the answers here are also relevant to improving performance.

However, neither of these solves what's probably your most common use case - someone running a massive deduplication script. One solution might be to feed deduplication into a queueing system. Another might be to permission the dedupe screen - or even permission specific dedupe jobs, so that someone can run Parvez's smart dedupe but not a standard dedupe rule.

# Answer
> 0 votes
It occurs to me that when you can't find the appropriate screwdriver, there is of course the hammer.

Here's one version of a hammer: https://stackoverflow.com/questions/1189039/how-do-i-routinely-kill-mysql-queries-that-have-been-alive-for-too-long

It'd be nicer to have an extension that analyses the sql before executing it and catching/analysing it.

---
Tags: mysql, duplicate-contacts
---


# Question
Title: Sending one copy of each CiviMail campaign to a specific email address?
I have been asked to generate one copy of each mailing sent to go to a specific mailbox (say emails@example.org) that they will check for validation of emails sent (with content comparison) versus emails requested to be sent (with content requests).

I have proposed a group with just "emails@example.org" in it which gets put into the recipients for each civiMail we send out for lack of a better solution in my mind, but have been told that is unacceptable and it must be automatic.

I don't believe I can simply put "emails@" in every mailing group either because I will have no way of necessarily knowing if a new mailing group is created to add this email address to.

We are using civiCRM 4.6.4 and Drupal 7.43 and using Sparkpost as our mail service. I have thought a bit about forwarding in Sparkpost but I haven't thought of a way not to forward a number of copies of each email equal to the number of targets to our verifying inbox.

Has anyone set something like this up using civiMail? Or have any ideas how I might go about this?

# Answer
> 1 votes
CiviRules provides a good foundation for say 'if trigger X happens, then do Action Y'.

I have no idea if the option you need is there but if it isn't it might be a good place to add it.

In other words, create a rule that says, if a Group is created then add contact X to it.

---
Tags: civimail, sparkpost
---


# Question
Title: Landing page and events for organisational member
We have a number of organisational members and would like to have facility of being able to offer members their own profile page and the ability to create their own events.

The idea is to create a member directory where members can add and update their own information.

Is this possible in CiviCRM?

Thanks Robert

# Answer
> 1 votes
Profiles can be used to display fields about contacts publicly and can therefore be used to create a Member Directory. There is an explanation of how to do this here. Steps include setting the Profile to "Limit listings to a specific group" so you first create a Group that contains your 'members'. But doing this for the 'organisation' related to the individual who is doing the updating has some limitations iirc.

You can also give your Contacts access to their 'dashboard' provided they have a Permissioned Relationship over that contact. This can give them access to edit more information about their organisation - but from memory the fields available are not easily modified either eg to include a Description, or Logo (hopefully someone points to an easier solution).

Looks like you are not using Drupal, so the following is an answer for for others who might find this question.

In Drupal all of this becomes much easier. Webform-CiviCRM is your friend as it can allow one user update any fields about their related organisation.

Views gives many options for then displaying this info, though another approach entirely is to use the civicrm node reference module to link content (nodes) with the civicrm record of the Organisation, and then use that to not only pull civi data for that Organisation on to 'their' node, but also details about who their Secretary or President etc might be. Example of this can be seen here

---
Tags: civimember
---


# Question
Title: Report with filter 'yesterday' produces no result
When I create a report of contributions I can select a filter on 'Receive Date' of yesterday and any transactions with yesterday's Receive Date will be displayed. If I select a filter on 'Transaction Date' of yesterday no transactions are displayed even though there are transactions with a Transaction Date of yesterday.

In looking at the Contribution Table the transaction date is not shown in the table.

Can someone throw some light on this apparent issue?

# Answer
The transaction\_date field lives in civicrm\_financial\_item. Not sure that helps you much though.
> 1 votes

---
Tags: civireport
---


# Question
Title: How to edit a shortcode in order to change formatting of profile in a form?
Is there a way to edit a shortcode so that a profile being used in a form appears properly on a page? The default mode that appears is a little funky.

Thanks! +Josh

# Answer
It looks like you are wishing the profile snippet (on the left) looked more like the form on the right. You can achieve this by modifying your site's css file to style the profile snippet. Add a border, background color, change the font, hide the cancel button, widen the label column, etc. If you're unfamiliar with css, there are many good tutorials on the internet, and firebug is your friend.

To make the labels read like the one on the right, go into the civicrm admin area and edit those fields in the profile to remove "(given" and "(family" from the labels if you wish.
> 0 votes

---
Tags: wordpress, profile
---


# Question
Title: Best practice for dealing with electoral district / constituency?
I'm new to the forum, so let me know if I should ask elsewhere. We are a campaigning organisation and much of our campaigning is based on electoral consituency, but I'm not sure how best to capture this info.

How many members we can mobilise in that area, who is the current political representative (MP here in the UK), contacts for the local political parties etc?

I've been playing with the They Work for You API so I can get the constituency based on postcode, but I'm not sure what best to do with it. I'd considered setting the constituency as like an organisation level and the relavent relationships but there are a number of disadvantages to this.

It occurred to me that many other organisations must be in the same boat and wondered if anyone had any experience to share? I'm using latest 4.7 Civi with Latest wordpress. Many thanks,

# Answer
It sounds like you want to look at the Electoral API extension and at Using CiviCRM for e-advocacy more generally.

The Electoral API extension is in beta - we have it in production for a few clients. However, we haven't written support for any APIs except the New York Times and Sunlight Foundation, which are both US-centric sources. Please feel free to extend it to work with UK-based sources!
> 5 votes

# Answer
It might be helpful to set out use cases describing what specifically you want to do with the data: this might tip the balance towards one approach or another.

One approach would be to create a contact subtype for Constituency and then, as you suggest, create a contact for each constituency. As you say, relationships would then be one way to record which constituency someone is in but it makes for a slightly indirect link. You could instead set up a contact reference custom field to record someone's constituency. The field could be restricted to allow only contacts of subtype Constituency.
> 4 votes

# Answer
You might want to have a look at this CiviCRM MaPit integration that I wrote for this purpose: https://civicrm.org/blog/michael-mcandrew/civicrm-mapit-integration.

The demo no longer exists but the extension is simple and I know that it's still in use with an organisation using an up to date version of CiviCRM.

For this implementation, we chose to store the constituency (and other similar) information in a custom field as it made searching, and building custom permissions easier.

Also, https://civicrm.org/providers/Tech-To-The-People do a fair amount of work connecting people to their representatives at an EU level and would likely have experiences to share that would be useful for you.
> 1 votes

---
Tags: wordpress, custom-fields, extension
---


# Question
Title: Deactivating a contact for a certain timeframe
I have following issue. We got an email from an business partner. She will not be working for the next 1.5 years. After that time she will be back. She asked us to use during this time a different (general address) email address. This address is already connected to the company. Now I am wondering if it is possible to deactivate this contact for that specific time in terms of not losing a contact. Of course it should be reactivated automatically because I do not know if I will be responsible for our contacts at this time in the future.

This would be the best way to keep her contact in the database and nobody has to remember reactivating the contact.

Thanks for your help.

# Answer
> 4 votes
One option would be to add an Activity on her record with a Scheduled Date for 18 months time, and assign it to a contact that has an email address that will still be read in 18 months. that way you could change her email address to the one she wants using, or set her Comms Prefs to 'do not email', and then in 18 months they should receive a reminder to undo things so she gets the emails again.

---
Tags: contacts
---


# Question
Title: Notify when profile form is submitted does not work (form with attached files)
I have created an application form in CiviCampaign through Petitions.

Everything has been set up fine, except that even after adding one or several emails in Administer \> Customize Data and Screens \> Profiles and click "Settings" on the profile created for this form in the Advanced Settings section "Notify when profile form is submitted" nothing ever happens when a form is submitted.

This is particularly important because we are requesting that two files are attached before submitting and we can't get access to them through civicrm backoffice. I was expecting they would be sent in the notification email.

We are using CiviCRM in Joomla, so this was the only solution I found to create an application form, without using CiviContribute, which does not apply to what we need. When we use CiviContribute the email notification works fine.

Help would be greatly appreciated.

# Answer
A partial answer. If you want an 'application form' then a standalone Profile should suffice. There is no reason i know of why you would need to add complexity of CiviCampaign and Petitions.
> -1 votes

---
Tags: profile, forms
---


# Question
Title: Error on CiviCRM event registration pages
All of the event registrations on our website are throwing the following error message:

```
    0 - <div id="crm-container" class="crm-container" lang="en" xml:lang="en"> <style type="text/css" media="screen"> @import url(/administrator/components/com_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com_civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css); </style> <div class="messages status no-popup"> <div class="icon red-icon ui-icon-alert"></div> <span class="status-fatal">Sorry but we are not able to provide this at the moment.</span> <div class="crm-section crm-error-message">id (value: ) is not of the type Positive</div> <p><a href="https://www.usfashionindustry.com/" title="Main Menu">Return to home page.</a></p> </div> </div> <script language="JavaScript"> function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } } </script>

You may not be able to visit this page because of:

    an out-of-date bookmark/favourite
    a search engine that has an out-of-date listing for this site
    a mistyped address
    you have no access to this page
    The requested resource was not found.
    An error has occurred while processing your request.

Please try one of the following pages:

    Home Page

If difficulties persist, please contact the System Administrator of this site and report the error below.

<div id="crm-container" class="crm-container" lang="en" xml:lang="en"> <style type="text/css" media="screen"> @import url(/administrator/components/com_civicrm/civicrm/css/civicrm.css); @import url(/administrator/components/com_civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css); </style> <div class="messages status no-popup"> <div class="icon red-icon ui-icon-alert"></div> <span class="status-fatal">Sorry but we are not able to provide this at the moment.</span> <div class="crm-section crm-error-message">id (value: ) is not of the type Positive</div> <p><a href="https://www.usfashionindustry.com/" title="Main Menu">Return to home page.</a></p> </div> </div> <script language="JavaScript"> function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } } </script>

```

The website is running Joomla 3.5.1 and CiviCRM 4.6.15. We've made some changes recently to the profiles and did a large site upgrade a few weeks ago, but I'm still trying to track down when the issue started.

To troubleshoot, I've checked the resource URLs and the site config, all are setup to use https://www and the URL doesn't change when moving from one page to the next.

When I attempted to set up the Site Profile settings, that throws an error message as well:

```
There was an error in reading your site configuration.
Snapshot ID uOV7F-LqpIP-vGUht-frahE
Timestamp   2016-04-26 21:39 UTC
Status  error
Site URL    https://www.usfashionindustry.com/administrator/administrator/components/com_civicrm/civicrm/extern/cxn.php
App URL https://mycivi.org/app:org.civicrm.profile/cxn/register
Data    {"is_error":1,"error_message":"Client exception: Received garbled message","garbled_message":false}

```

I don't know why "administrator" shows up twice in the URL. With our Joomla install, there are two civicrm.settings.php files, and the one in the administrator directory has /administrator as part of the site URL. I tried changing this to see if that made a difference, but instead it broke some other back-end functionality.

Enabling error messages and debugging also hasn't turned up additional clues. I also tried changing the template on a registration page to see if there was a scripting conflict with the template (which is old), but the error persisted. Any thoughts? I'm tempted to upgrade to 4.7.x to see if that solves the problem.

The following is from the CiviCRM.randomstring file in the ConfigAndLog folder (with the root removed):

```
Apr 26 22:13:33  [info] $backTrace = #0 /administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(364): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /administrator/components/com_civicrm/civicrm/CRM/Utils/Type.php(371): CRM_Core_Error::fatal("id (value: ) is not of the type Positive")
#2 /administrator/components/com_civicrm/civicrm/CRM/Utils/Request.php(85): CRM_Utils_Type::validate("", "Positive", TRUE, "id")
#3 /administrator/components/com_civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
#4 /administrator/components/com_civicrm/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
#5 /administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(307): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
#6 /administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#7 /administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#8 /components/com_civicrm/civicrm.php(86): CRM_Core_Invoke::invoke((Array:3))
#9 /components/com_civicrm/civicrm.php(11): civicrm_invoke()
#10 /libraries/cms/component/helper.php(405): require_once("/components/com_civicrm/civicrm.php")
#11 /libraries/cms/component/helper.php(380): JComponentHelper::executeComponent("/components/com_civicrm/civicrm.php")
#12 /libraries/cms/application/site.php(191): JComponentHelper::renderComponent("com_civicrm")
#13 /libraries/cms/application/site.php(230): JApplicationSite->dispatch()
#14 /libraries/cms/application/cms.php(257): JApplicationSite->doExecute()
#15 /index.php(49): JApplicationCms->execute()
#16 {main}

```

# Answer
> 1 votes
Have you gone and resaved all the menu items? The way the menu item saved in the most recent versions of CiviCRM in Joomla has changed. CiviCRM throws this error in Joomla if you haven't selected one of the necessary settings in the menu item.

I would also check the (root)/media/civicrm/ConfigAndLog/CiviCRM.longRandomString.log. I have found it very useful.

---
Tags: civievent, joomla, error, registration
---


# Question
Title: Setting Different Fees For Sign Up and Renewal In Civicrm
The organization am configuring Civicrm for has different fees for Membership Sign up and renewal.

How can i configure Civicrm such that when Members are signing up they pay a particular fee but when they have to renew they pay a diffferent fee.

I have experimented with price sets but this merely shows price sets on both signup and renewal pages as options. But this is not how i want it to work.

# Answer
We have a similar situation and use a separate contribution page for renewals.

The menu link for renewals takes them to an intermediate Drupal page that is only visible if they are logged in, and only members (or ex-members) have a login. On that intermediate page is the link to the renewing CiviCRM contribution form.

This isn't perfect but works for our case where new memberships include a book, renewing memberships don't and the difference in the fee is only $5. If a lapsed member renews rather than rejoins we aren't fussed, we just don't send them the book.
> 1 votes

---
Tags: civimember
---


title: Bulk sms to a smart group in civi 4.4?

text:
# Question
Title: Bulk sms to a smart group in civi 4.4?
I want to send out a bulk sms asking for evaluation of our event, to the participant of the event, the day after the event.

I then thought of creating a smart group of those contact with the participant status 'attended' to my event. And then schedule a bulk sms to that smart group.

But it doesn't seem possible to send bulk sms to a smart group.

Is it possible to send bulk sms to a smart group? And if so, how to do that?

(Drupal and CiviCRM 4.4)

# Answer
You don't say what version of CiviCRM you are on.

I am sure you can do this with scheduled reminders in 4.6 or 4.7 provided you have an SMS gateway configured. See http://docs.civicrm.org/user/en/stable/sms-text-messaging/set-up/ and http://docs.civicrm.org/user/en/stable/email/scheduled-reminders/

You won't need a smart group as once you have selected the event you can specify which participant statuses are sent the SMS.
> 1 votes

---
Tags: smartgroups, sms
---


title: Join & Update Notifications

text:
# Question
Title: Join & Update Notifications
How can you tell if someone joins a mailing list (selects from a checkbox option in custom fields)?

How can you tell when someone updates their contact preferences?

# Answer
> 4 votes
You could use the extension CiviRules to do that.

You need to set up two different Rules, one for each process.

Select a trigger and condition with your requirements (group contact is added, and contact is changed, would be the triggers I think)

Dependent on your preference, you could create one of these actions:

* a scheduled activity assigned to a backend staff
* a tag (that could be shown in a report on your dashboard)
* send you an email (then you need to install the Email API as well, and choose to send email to alternate email adress)
* send you an sms (then you need to install the SMS API as well, and choose to send sms to alternate phone number)

---
Tags: contacts, custom-fields, email, upgrade
---


# Question
Title: How do CiviCRM profiles hook up with Drupal?
We have been using Drupal and CiviCRM for 5 years or so to edit profiles. Setup via the Administration -\> Customise Data and Screens -\> Profiles.

It is now saying 'The changes have been saved' and reloads the form with the old data rather than updating the CRM database.

I have been searching the drupal folder in civicrm for a submit hook and anything to test the connection. How does it work?

Drupal 7.41 and Civicrm 4.5.8.

# Answer
> 1 votes
The question was 'how do I debug this from first principles' so that I don't have to work from my sometimes flawed knowledge of the application.

The solution was to turn off a panel that was overriding the CiviCRM forms. This is readily discovered by looking at HTML source code as panels prints out the panels classes and they didn't look right.

Trying to debug the source code was no use in this case and cost a couple of days effort. If you want to check that civicrm is running or follow the form creation process start at civicrm\_form\_alter() in a drupal system.

---
Tags: drupal, profile
---


title: Activating component CiviCase failed

text:
# Question
Title: Activating component CiviCase failed
I want to activate CiviCase in admin/setting/component?reset=1 and this results in an "DB error".

This is the error-log:

```
   CiviCRM_API3_Exception: "DB Error: already exists"

```

\[...\]

```
Entschuldigung, eine Bereitstellung ist uns gerade nicht möglich.
DB Error: already exists

```

# Answer
> 2 votes
Solved :)

I activated CiviCase in the paste and deactivated it. Some sample relationship remained in the database. So deleting them is the answer...

---
Tags: civicase
---


# Question
Title: Best Relationship Type When Organization is Primary Member
What relationship is best to use in a scenario where an individual signs up on behalf of an organization but the organization is actually the Member? Is it the Employer of or Employee of relationship type?

I want the Organization to be the primary Member.

# Answer
If the Organization is the Member, then you need the Membership Type to be set to use the "Employer of" relationship. If you go here and click on the '?' next to Relationship Type it says

Relationship Type: Employer of

Direct member is: an organisation

Membership is automatically granted to: 'Employees' of that organization
> 3 votes

---
Tags: civimember
---


# Question
Title: HTTP Status Code error When Sending SMS in Civicrm-Wordpress
i get the following error in CIVI-wordpress install after configuring and sending an sms: Sorry but we are not able to provide this at the moment. No HTTP Status Code was returned.

I configured the clickatell SMS Gateway following the instruction here: https://book.civicrm.org/user/current/sms-text-messaging/setup/ Error Deatils from the debug is as follows Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] =>
[message] => No HTTP Status Code was returned.
[mode] => 16
[debug_info] =>
[type] => PEAR_Error
[user_info] =>
[to_string] => [pear_error: message="No HTTP Status Code was returned." code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info=""]

```

)

Any Ideas what the problem could be anyone. Using Wordpress 4.4.2 with ivicrm 4.6.8

# Answer
Check the phone number and see if there is the correct country code. The code was not adding the 1+ for US/Canada yesterday, April 26th. See comments on the file in GitHub for a temporary workaround: https://github.com/PalanteJon/org.civicrm.sms.clickatell/commit/ef4e4119b76331ee90bf547044607822907aa323#commitcomment-17262754

Here's a PR request with the workaround: https://github.com/gah242s/org.civicrm.sms.clickatell/commit/aa74097cf66510710b23c22bae5735db59c156db
> 1 votes

---
Tags: civisms
---


# Question
Title: Start new CiviCRM site in Drupal 7 or wait for Drupal 8?
We are interested in a fresh start for our organization with a new website using CiviCRM and Drupal. However, we're not sure if we should wait for the CiviCRM integration with Drupal 8 since it's the most recent version of Drupal, or start our full build in Drupal 7. Any feedback is welcome.

# Answer
The short answer is easy, which you can take away from *Does CiviCRM work with Drupal 8 and how can I help?* — CiviCRM is not yet fully functional with Drupal 8. You can see issues tagged for Drupal 8 in JIRA, and even better, help test and develop the Drupal 8 branch code.

---

The long answer is more complicated, and depends on your organization's development timetable, technology cycle, technical resources, use of Drupal for other purposes than hosting CiviCRM, first-adopter culture or lack thereof, and like factors.

First of all, Drupal 7 is not going away any time soon. It will continue to be supported until three months after the release of Drupal 9, which is not anticipated until 2020 or 2021 at the earliest. The large installed base of Drupal 6 prompted vendors to develop a long-term support mechanism. Considering that Drupal 8 is by any account a much bigger change from 7 than 7 was from 6, and that 7 has an even wider installed base than 6 did, one may reasonably expect that there will be demand for a Drupal 7 LTS version as well.

Now, if your organization already has plans in motion to end your own use of Drupal 7, getting support to launch a new D7 project may be hard. In that case, you might be better-off waiting for CiviCRM 5 and full Drupal 8 support later in the year. On the other hand, if your organization will support D7 for the forseeable future, launching on D7 with an eye to updating to D8 in a few years may make sense. Or, if you are new to Drupal altogether, and you have technical expertise in Symfony, Twig, and other D8 technologies, you may be better off skipping D7 for now, and having to re-learn all that's changed for D8 in the near future.

Most of my clients on CiviCRM do not have dedicated IT resources, and rely on our company to handle maintenance and updates. These clients we are keeping on D7 for now, and will probably not migrate them to D8 for at least another year, until the future of modules like Webform are more certain. We are also keeping an eye on the Backdrop CMS project, a fork of Drupal 7. There is a request for Backdrop support in JIRA, but as there is not much demand for the product (yet?), movement is slow.

And finally, if your organization does not or will not use Drupal for any other purposes other than to house CiviCRM, you might weigh whether WordPress should be considered.
> 13 votes

# Answer
I am working with an organization that has been struggling with that question. They were originally planning to upgrade their Drupal 6 site to D8, but D8 progress has been so slow (notably lack of webform module & incomplete CiviCRM integration) that they have decided to switch to Backdrop. Backdrop-CiviCRM integration is functionally complete, as is the Webform module. They are sponsoring work to port the Webform-CiviCRM integration module, which will complete their needs.
> 4 votes

# Answer
See Does CiviCRM work with Drupal 8 and how can I help? and Drupal 8 - what's the status?

Much depends on your timeframes and ability/willingness to help address the issues referenced there. It would be great if your org can help push forward the Drupal 8 work.
> 1 votes

---
Tags: drupal, drupal-8
---


title: suspicious activity HTML error

text:
# Question
Title: suspicious activity HTML error
When our members are trying to register with us they are presented with a HTML suspicious activity error.

Can anyone advise why?

I've searched through sites and all I can come up with is a IDS issue but i'm unsure how to turn this off.

# Answer
> 2 votes
Your CiviCRM logfile (instructions to locate) should show details about the rejected form submissions.

Would be interested to hear details of what submitted data was triggering CiviCRM's IDS to reject registrations - if you can excerpt some details of a rejected submission from the logfile, someone might be able to give an informed reply to your question.

# Answer
> 1 votes
In your website's user permissions, you can give your members the "Skip IDS check" permission. I would caution you to not grant this to anonymous users.

---
Tags: registration
---


# Question
Title: Can I batch data enter contributions using contact id instead of name?
I'd like to be able to batch enter contributions using the contact ID (or some other non-identifying information) rather than the contact name.

My workflow is this: 1. Treasurer of our church counts the offering and tithes and enters the info on a spreadsheet that is then given to the church secretary to enter into civi. 2. The church secretary shouldn't be privy to who is giving what to the church.

Was hoping that the batch data entry profile could be edited to remove the contact name and instead use the contact id but it doesn't look like it can without some custom coding.

Is there a workaround or alternative solution that doesn't require custom coding?

# Answer
> 1 votes
Without coding? hmmm.

CSV importing might work. Contributions -\> Import Contributions

The CSV can work with the internal ID

You would not have a nice screen with the batch import but only work with Spreadsheet/CSV's and import those.

But.. person responsible for either importing the CSV or doing the batch entry should be able to check if it makes sense what he did. Otherwise you could end up with very strange data due to a small mistake. So my advise is for you to also check your permission policy. Maybe someone else entering the info or give that permission to the church secretary anyway.

# Answer
> 0 votes
Can you change the workflow? ie have the treasurer enter the data to Civi? That avoids the secretary being involved with the giving data.

---
Tags: civicontribute, profile, batches
---


title: Multi-state memberships

text:
# Question
Title: Multi-state memberships
Our club has a two-stage membership process when it pertains to new members. In order to join our club, a person must first join us as a guest, for which there is a fee. The guest fee is applied to their registration fee when they become a member, as long as they become a member within the same membership term (we use fixed annual memberships, and we don't pro-rate memberships).

My initial thought was to have two different membership types: Guest and Club member, however when you change their membership type from guest to member the system adds another term to the membership instead of just changing it for the current term. We can manage this manually, but doesn't work so well with self-service profiles. The fact that we deduct the guest fee from the member fee isn't a problem, we can manage that with fee structures or CiviDiscount.

My next thought was to create a membership status for guests. When someone registers as a guest, they would become a member with a "guest" status. As far as I can tell however, there isn't a mechanism to automatically set the status to guest upon registration or based on the price set. You have to do it manually. All of the state rules are related to dates.

I also thought I could have users register for an event (when they come as a guest) and use their event registration to apply a discount to the membership, but we don't have a specific event for them to register for.

I've asked a few, more specific questions related to the above options, but I hope a less specific question with more application details might lead me in a direction I hadn't considered.

# Answer
> 1 votes
This isn't quite the same thing, but there is discussion in the posts below of membership approval process, which has some similarities - might give you some ideas.

Membership statuses and approval workflow
Using the Pending status for membership approval

---
Tags: civicontribute, civimember
---


title: Add a custom participant listing option

text:
# Question
Title: Add a custom participant listing option
I need a participant list option (Name + employer) in CiviEvent. I've created an participant list option. But I guess I've to build my own template. I guess it is documented somewhere but I could manage to find it. Could someone help me finding my way?

# Answer
I would add a custom group to Participant, that should show in CiviCRM automatically whenever you do something with a participant.
> 1 votes

---
Tags: civievent
---


# Question
Title: What's the Status of CiviVolunteer 2.0's Compatibility with CiviCRM 4.7 on Wordpress
I'm looking for an update on the status of CiviVolunteer 2.0 compatibility in WordPress with the latest version of CiviCRM. I'm developing a volunteer intake process and we've been stalling hoping to take advantage of the new features found in CiviVolunteer 2.0. I'm running CiviCRM 4.7.6 and an older version of CiviVolunteer (version 4.5-1.4.1) because CiviVolunteer 2.0 is not considered compatible with 4.7 and above. My understanding was that there was a blocking issue that was preventing full compatibility, but I also seem to recall hearing that you could try your luck using CiviVolunteer 2.0 and CiviCRM 4.7 together by changing the version strings before installing it.

# Answer
I've done a fair amount of testing of CiviVolunteer 2.x on 4.7. We found a handful of issues including a core bug. The outstanding Volunteer issue that keeps CiviVolunteer from being compatible with 4.7 is: https://issues.civicrm.org/jira/browse/VOL-196

The core bug we found was patched and the PR included in the CiviCRM 4.7.5 release. So you should be good on that score.

Just for completeness and/or if others make their way here via google in the future, the 4.7.5 release contained a regression that broke the Manage Groups screen. So CiviVolunteer will support 4.7.6+ pursuant to the resolution of the linked issue as well as the currently published 4.6.x branch.

I have not found any Wordpress specific bugs in my testing which has been split fairly evenly between Drupal and Wordpress installs.
> 3 votes

# Answer
Most of the issues blocking CiviVolunteer 2.0 working with 4.7 are resolved. I believe there were one or two still outstanding, though. I'm going to check with one of my colleagues here at Ginkgo Street Labs and we'll post an answer shortly.
> 3 votes

---
Tags: wordpress, civivolunteer
---


# Question
Title: Can any New Zealand-based NFPs share their CiviCRM experiences?
In the absence of a "users" mailing list where I would normally post this, I'm based in New Zealand, and I'm looking for New Zealand-based end-users or administrators of CiviCRM happy to share some experiences off-list about how well (or not) it's working. I am absolutely not interested in talking to any vendors or consultants, only folks who are actually using and supporting it in house (either hosted on on-premises).

Ideally your organisation would be at the medium end of the size scale (at least in NZ terms). Any experiences at all though would be welcome appreciated.

If any folks out there are keen please let me know.

Cheers, Dave

# Answer
> 1 votes
there's a board on the CiviCRM forums for NZ users - you might get a better dialogue by posting this question there: https://forum.civicrm.org/index.php?board=78.0 . StackExchange is better for a straight Q&A format.

There are a number of CiviCRM agencies who may be able to point you to testimonials of their clients. You can search for CiviCRM experts in your country on the CiviCRM website: https://civicrm.org/partners-contributors?country=1154&service\_languages\_181=All&services=All&supported\_cms\_s\_182=All

---
Tags: evaluating-civicrm
---


# Question
Title: What is the mechanism for tailoring an Angular form?
I want to modify the behaviour of an Angular form.

The answer to question 4700 tells me 'how' to do it (add some JavaScript), but I'm interested in 'where' to do it.

If it was a PHP form I could use a hook. Should I use an extension?

# Answer
I usually do it in an extension. This allows me to enable/disable changes at will.

1. Create an extension with Civix (eg com.example.myextension).
2. Inside the extension folder create (eg \[ext\_dir\]/com.example.myextension/js/) folder.
3. Create your JS file in there (eg \[ext\_dir\]/com.example.myextension/js/mychanges.js)
4. In the main extension file (eg \[ext\_dir\]/com.example.myextension/myextension.php) add this hook. I think its called on all pages and forms -- may have to use pageRun or alterContent.

```
function myextension_civicrm_alterTemplateFile($formName, &$form, $context, &$tplName) {

    $resource = CRM_Core_Resources::singleton();

    if ($formName=='theFormToEdit') {
        $resource->addScriptFile('com.example.myextension', 'js/mychanges.js');
    }
}

```
5. Install and enable your extension.
> 1 votes

---
Tags: extension, hooks, developer, angular
---


# Question
Title: How to import csv file with some required fields missing
I am running CiviCRM v.4.7.6. I am trying to import a csv file into contacts. Some of the members of the organization do not have email accounts and as a result the import rejects those records. Is there any way to import a file that has some of the required fields missing?

# Answer
> 6 votes
Email address isn't a required field unless you don't also have a last name. At present, CiviCRM requires either a last name or an email address, but not both.

# Answer
> 2 votes
Depending on how many contacts you have that don't have emails, a short-term work-around would be to:

1. Put into the CSV a blatantly false email address for each contact (example: example@example.org)
2. Import the contacts
3. Search for the email address you used, and
4. Use the Batch Update action (with a profile that has email address) to remove all of the fake email addresses at once.

This will remove the email address from each person, but still keep the contact records.

---
Tags: import
---


# Question
Title: Is CiviHR an extension or a separate application?
Hello I am interested in CiviHR. Is this an extension of CiviCRM or should this be a separate instance?

I see here it has to be a separate installation. https://forum.civicrm.org/index.php?topic=33429.0

I tried to find the demo, but all of the links to the demo sites I have found do not go anywhere. Is there a live CiviHR demo available somewhere?

# Answer
When I last looked at CiviHR, it uses CiviCase's functionality to achieve to a lot of things. So having it as an extension on CiviCRM would cause conflict. It is designed to be a standalone application.

Demo links are indeed broken, you can signup for a demo here
> 2 votes

# Answer
CiviHR is a set of many interrelated extensions. You can pick and choose among them for the functionality you want/need, though some depend on others in the set. Some of them can be added to a standard install of CiviCRM, but not all. I believe CompuCorp is intending to refactor the extensions so that they are all compatible with standard CiviCRM, but I am not sure about the timeline for that release.
> 2 votes

---
Tags: civihr
---


title: Exporting Contacts - Reporting?

text:
# Question
Title: Exporting Contacts - Reporting?
Is there a way to save different reports? ie. the fields wanted to export? so you don't have to enter those in every single time you do an export?

# Answer
If you mean exporting after doing eg a Search or Advanced Search, then on the screen where you select which fields to export, you can check a box to save that common set of fields for future exports (see image below). Then, the next time you go to do an export you can select to "Use Saved Field Mapping" and select the previously saved set of fields.
> 5 votes

# Answer
If you mean exporting data from a Report, then after selecting the fields on a report, you can click the Update Report to save those fields. Alternatively, you can click on the Save a Copy... button to leave the existing report as it is but make a new one with the new fields. Then when you export, those fields will be exported.
> 0 votes

---
Tags: custom-fields, export, reports, custom-reports, fields
---


# Question
Title: How to develop extension that relies on libs brought in by composer
I'm wanting to (re)develop an extension and I'd like to use some 3rd party libraries, eg. guzzle, that I would normally manage via composer.

So my github repo will contain a composer.json file, but not the vendor directory. So would I need to package installable versions with the libraries included?

Also, what if I were to install libraries that are already included (eg dependencies of the libraries I want might be already in use leading to a namespace clash).

Is there a workflow for this sort of thing?

# Answer
# Approaches

There are a few different patterns one could follow in connecting Civi extensions with composer:

1. (Broad scope) **Site build via composer**: The entire web site is defined with a custom `composer.json` file. It doesn't matter what kind of dependency you need to pull in (CMS, CMS module, CMS theme, CRM, CRM extension, PHP library, CSS library, etc), it's all brought in through the same tools/workflows.
2. (Medium scope) **Use `composer` for the `extensionDir`**: Civi has a special folder (e.g. `sites/default/files/civicrm/ext`) for storing downloaded extensions. We could keep this folder but manage it differently -- e.g. rewrite `CRM_Extension_Downloader` as a wrapper for `composer`.
3. (Narrow scope) **Intra-extension dependency**: If one particular extension requires a particular library, then the extension could have its own copy of `composer.json` and `vendor/`. The final zip file would embed `vendor/`.

# Site build via composer

IMHO, this is the holy-grail. It's consistent with the architecture of PHP and `composer`, and it resolves problems that afflict dependency-management in Drupal (`libraries/` guffaw!) and CiviCRM (dependencies guffaw!) and probably Joomla/WordPress.

It's worth drilling down on the architecture concern for a moment. Civi is deployed as a PHP app which shares a runtime with another PHP app. In PHP, the runtime can only load one version of a library -- e.g. you can load Guzzle v5.0 XOR v5.1 but not both, so it's important to pick a version of Guzzle that is acceptable to all libraries/modules/extensions. When using `composer` in narrow/piecemeal fashion, it doesn't get the full list of libraries/modules/extensions, so it cannot help you pick a version of Guzzle that satisfies the overall system. You're more likely to suffer from hidden version-conflicts (if, e.g., a Drupal module loads Guzzle v5.0 while your Civi extension loads Guzzle v5.1).

The main challenge is that many of the relevant systems (Drupal, Joomla, WordPress, Civi, etc) predate `composer` and have some impedance mismatch with `composer` (e.g. `composer` lacks a GUI; Drupal has multisite PHP loading; post-install hooks work differently). Getting these communities to switch is a major undertaking.

I think there are some fairly clear steps we can take toward supporting this model, but your question was really aimed at a different approach...

# Intra-extension dependency

No one controls enough of the ecosystem to quickly switch a critical-mass of site-building to `composer`. And this version-conflict stuff may sound theoretical. In fact, you can get some mileage out of piecemeal dependency management. (Case in point: `civicrm-*.tar.gz` ships with its own bundled copy of `vendor/`!) And your comments indicate an interest in this approach.

Unfortunately, you're basically on-your-own to make this work. Loosely, I'd try:

* In the `myextension.git` repo, add a `composer.json` file which lists any dependencies. Use `.gitignore` to avoid committing `vendor/`. In `myextension.php`, use `require_once __DIR__.'/vendor/autoload.php';`.
* When registering your extension on `civicrm.org`, do *not* specify a Github URL. Neither `github.com` nor `civicrm.org` is smart enough to build your releases automatically.
* Setup a CI tool which monitors your git repo and publishes the final `zip` archive. As a very loose example, I publish the `civix.phar` file with Jenkins (job, script). You could write a similar script to run `composer install`, `zip`, and then publish the final file.
* Whenever you want to publish a new release, login to `civicrm.org` and manually create a new release node (with suitable `info.xml` and download URL).

Unfortunately, there is a risk that your dependencies will conflict with others'. There's not a whole lot you can do about this... except pick obscure dependencies that aren't likely to conflict.

(In theory, if you know that your extension and the conflicted one never use the conflicted dependencies within the same page-request, then you could do some fiddly bits in the class-loading to only load the correct one. But in a powerful system like Drupal/Civi, it's really hard to provide this guarantee, and the other party may not play-along.)
> 9 votes

---
Tags: extension, developer
---


# Question
Title: Civicrm Integration: Error while adding api function
I have CiviCRM 4.7 installed on drupal 7.38. I Found it necessary to modify the url in civicrm.settings.php file as suggested here:
https://forum.civicrm.org/index.php?topic=33303.0
After this modification, my extension was successfully created and I enabled it. Also I have added a page and can already pull some data from the database using the CiviCRM api and display it on the page I added. I now intend to add an api function for an already existing entity, FinancialItem.
When I run the command(in the terminal):

> civix generate:api FinancialItem Create

I get the following error

Any suggestions as to what I should do to fix this?

# Answer
This looks like your CiviCRM install has an extension enabled in the DB which is not present, or was moved, on your disk.

Perhaps the extension you're working on was renamed after first being enabled, perhaps other changes were made to info.xml or the core extension files, perhaps it was moved, or perhaps your DB had another extension enabled on the remote server which isn't present locally.

The CiviCRM extensions page might be informative to check, otherwise you can compare extensions listed in the database to the ones which are available locally.
> 1 votes

# Answer
From the image you are using an extension that has an API with the name FinancialItem and You are trying to add an API that already exists in the extension with the same name in the extension cm.mukwetest.firstextension.

I don't think that is possible.

You the github repo is found here https://github.com/mercimukwe/cm.mukwetest.firstextension to see the content whole extension and the APIs which have been added.
> 0 votes

---
Tags: api, extension, civicrm.settings.php
---


# Question
Title: Paypal payments - Pending (Incomplete Transaction)
We're on civicrm 4.7.5 on Drupal 7.

All contributions paid through the paypal standard payment processor are failing to successfully complete.

The user sees a successful transaction, but the contribution status is " Pending (Incomplete Transaction)"

There is nothing in the CiviCRM log to suggest an error. The IPN is sent to the correct URL, the status recorded in paypal is HTTP 200 OK.

But when I copy the path into a browser:

https://\[ourwebsiteurlredacted.com\]/sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587

this prints the following message to screen:

```
Sorry, can not load CMS user account.

```

Any help debugging would be greatfully received!

# Answer
> 2 votes
I think there is a bug here of some sort - I have reverted to an old copy of ipn.php, from 4.7.3, and payments are now completing successfully again

# Answer
> 4 votes
Issue had been filed https://issues.civicrm.org/jira/browse/CRM-18483 and this is my fix https://github.com/civicrm/civicrm-core/pull/8270/files

As earlier in case of drupal site, CRM\_Utils\_System::loadBootStrap() eventually calls CRM\_Utils\_System\_Drupal::loadBootStrap() and fails at https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Drupal.php#L545 because we are not passing any drupal userID as $uid parameter in loadBootStrap() fn and got halt at the same point. Unlike in other CMS (wordpress, joomla) the underlying bootstrap code is not too reliant on user id and didn't break.

As per my fix CRM\_Utils\_System::loadBootStrap($params, TRUE, FALSE) where 2nd parameter stands for $loadUser = TRUE and third $throwError = FALSE so if there is no corresponding CMS userID assigned against civiCRM contactID then it won't break rather it will return false and will complete the workflow just what happen when we call REST url https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L711.

The reason behind calling loadBootstrap function lies in https://issues.civicrm.org/jira/browse/CRM-18245

Can anyone please verify my patch if it works for ya!!

Thanks

# Answer
> 2 votes
We had identical symptoms, after lots of cursing CiviCRM, finally found it was nothing to do with CiviCRM. PayPal IPN requires a **valid** email address. Our mailbox was full with someones vast supply of Spam. Cleared the mailbox and it worked fine. Hope this does it for you.

# Answer
> 1 votes
This is a really common error incidentally.

I suspect that that error you're seeing is unrelated to the PayPal issue.

1. Check the CiviCRM Error Logs for errors that happened around the time of the last transaction.
2. Check your htaccess logs for blocked requests from PayPal.
3. The error being thrown is in libraries/civicrm/CRM/Utils/System/Drupal.php line 545 in function loadBootStrap. This code is messy, with a function that does many things.
4. I would check visiting the IPN with the correct parameters in a browser and seeing if that updates the transactions as you'd expect.

---
Tags: civicontribute, paypal, ipn
---


title: Stripe and CiviCRM

text:
# Question
Title: Stripe and CiviCRM
I am evaluating Stripe and was wondering if CiviCRM 4.7.6/Drupal support Stripe? Stripe has two ways of integration, the 'Embedded payment form' (Stripe Checkout) and a 'Custom payment form' (Stripe.Js), are both these methods supported by CiviCRM \<\>Drupal?

# Answer
> 2 votes
Have you looked at this extension: Stripe Payment Processor?

I haven't used it myself so perhaps others can comment on how well it works.

There is also this related post: Has anyone tried Stripe payments through OmniPay?

---
Tags: drupal, payment-processor, stripe
---


title: How to use CiviX upgrade hooks?

text:
# Question
Title: How to use CiviX upgrade hooks?
I'm developing an upgrade to an extension and when this version is installed it's going to need to update the database.

The module extension has been made with civix and I notice there's a `CRM_XXX_Upgrader_Base` class that looks useful but I can't figure out where I'd put the code I need to run.

Are there any good examples of extension upgrade hooks that I could learn from?

I've looked at a couple of popular extensions, but they don't seem to have used/needed them, so I'm stabbing in the dark a bit.

# Answer
Here is an example of one I have used:

```
 public function upgrade_1002() {
    $this->ctx->log->info('Applying update 1002 (add country)id to civicrm_project table and renaming manager_id in civicrm_programme table)');
    if (CRM_Core_DAO::checkTableExists('civicrm_project')) {
      if (!CRM_Core_DAO::checkFieldExists('civicrm_project', 'country_id')) {
        CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_project ADD COLUMN country_id INT(11) DEFAULT NULL');
      }
      if (CRM_Core_DAO::checkFieldExists('civicrm_programme' , 'contact_id_manager')) {
        CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_programme CHANGE contact_id_manager manager_id INT(11)');
      }
    }
    return TRUE;
  }

```

Does this explain it a little? And obviously you also have to make sure your install query is fixed as this will be used when installing, not the upgrades.

And another one with the sql in a separate file:

```
  /**
   * Upgrade 1003 - add table civicrm_case_project
   */
  public function upgrade_1003() {
    $this->ctx->log->info('Applying update 1003 (create civicrm_case_project table');
    if (!CRM_Core_DAO::checkTableExists('civicrm_case_project')) {
      $this->executeSqlFile('sql/createCaseProject.sql');
    }
    return TRUE;
  }

```
> 1 votes

---
Tags: extension, upgrade, developer
---


# Question
Title: How many levels of security can I set for a data base of 12000 people with their confidential data?
I am planning to set up a database of 12000 members. The database will include considerable amount of personal and confidential data. How many levels of access can I set up - each level graded to allow access up to specified level of information?

# Answer
> 1 votes
Levels of access is tricky. Generally it is best to think of it in a id, ego, superego type of access. I would recommend at least 3 from most restrictive to least. See/edit own data, See other's data, See/Edit other's data.

If, for example you were to create a fieldset called 'super\_secret\_stuff' I would recommend the following approach. By default remove the privilege 'CiviCRM: access custom data' from all non-admin users. Then, only give the requisite groups access to 'super\_secret\_stuff' using the ACL Dashboard(q=civicrm/admin/access) within CiviCRM. This is where it gets tricky.

Generally speaking, if users have access to a specific set of custom data, and can see (and edit of course) other user's profiles then they will be able to see the 'super secret stuff' for those users. To restrict this, you can uncheck the privilege 'CiviCRM: view all contacts' and 'CiviCRM: edit all contacts' in the ACL Dashboard.

Of course, disallowing all users from seeing each other's basic information can be onerous if that is supposed to be an aspect of your system. In order to do this you need to start going behind the scenes. Probably the easiest way to do this is to use the **hook\_civicrm\_aclGroup**. Using this hook you can specifically grant access to tables that you want your users to be able to see across the database (i.e. basic contact info but not 'super\_secret\_stuff'). Look at the examples there.

Another hook you could use is the **hook\_civicrm\_buildForm** where you check to see if the form being looked at is 'super\_secret\_stuff' and if so if the userID of the profile == current user id.

In the buildform example use

```
function dbhooks_civicrm_buildForm($formName, &$form) {
    if ($formName == 'your custom form_name' ) {
        if ($session->get('userID') !== $form->_contactId){
            CRM_Core_Error::fatal(ts('You do not have permission to access this page, user:' . $session->get('userID')));
        }
}

```

---
Tags: civimember, security
---


# Question
Title: Hide profile icon when using Profile in listing mode
We're using a Profile to create a members directory that is only accessible when members are logged in. The profile search is working fine, and we've restricted access so users only see what we want them to see.

However, in the search results listing, the leftmost column contains a little person icon, and when you hover over it, it shows that person's contact details.

If I'm logged in as an Administrator, I see everything, but if I'm logged in as a user I see nothing except when hovering over my own entry.

I should specify that we're not using a shortcode in a WordPress page, we're linking to the "Listing Mode" of the profile directly.

Is there a way to disable this icon so that it doesn't appear in the listing results?

We're running CiviCRM 4.7.6 on WordPress 4.4.2.

# Answer
> 3 votes
Yes, there are at least two ways to disable this icon that I can think of.

**The first** is not very authentic, but requires less work and code modification. You use CSS to avoid the display of the icon. You'd need to include in your CSS file something like:

```
.crm-profile-name-<your-profile-name> .Individual-icon {
display: none;  }

```

Also, you'd need to repeat the CSS selector to `Organization-icon` and others types of contacts if that's your case. Mind that one can make the icon show up in the browser changing the CSS on the fly and so, would access the overlay information if it is still there. So, this method is not good to secure the data, you should first be sure that data is correctly protected, not showing up publicly in the overlay box.

**The second** method is much more gentile, but requires you to change the Listing template code. It's referenced by Dave Greenberg in this thread and the code stills work nice, I just tested it.

If you have never customized templates, I would say you should first read this page, as I'd be too long to explain every step to do this here.

Once you are good to go, copy the file `civicrm/templates/CRM/Profile/Page/Listings.tpl` to your custom templates directory, keeping the folders structure. Edit the file from line 59 to look like this:

```
    <table>
      <tr class="columnheader">
      {foreach from=$columnHeaders item=header name=headers}
        {if $smarty.foreach.headers.iteration GT 1}
        <th scope="col">
        {if $header.sort}
          {assign var='key' value=$header.sort}
          {$sort->_response.$key.link}
        {else}
          {$header.name}
        {/if}
         </th>
        {/if}
      {/foreach}
      </tr>

      {counter start=0 skip=1 print=false}
      {foreach from=$rows item=row name=listings}
      <tr id="row-{$smarty.foreach.listings.iteration}" class="{cycle values="odd-row,even-row"}">
      {foreach from=$row key=index item=value name=cells}
        {if $smarty.foreach.cells.iteration GT 1}
        {if $columnHeaders.$index.field_name}
          <td class="crm-{$columnHeaders.$index.field_name}">{$value}</td>
        {else}
          <td>{$value}</td>
        {/if}
        {/if}

      {/foreach}
      </tr>
      {/foreach}
    </table>
    {/strip}
    {include file="CRM/common/pager.tpl" location="bottom"}
    </div>
{elseif ! $isReset}
    {include file="CRM/Contact/Form/Search/EmptyResults.tpl" context="Profile"}
{/if}

```

This would make the column of profile overlay icon to go away.

Also, in an that old Forum thread there were a word from Dave Greenberg saying that setting all Summary Overlay profile fields visibility to 'User and User Admin' would disable the overlay, but in the actual CiviCRM version, this profile is reserved, so you can't change the visibility of the field. Hence, the above methods looks necessary to me.

---
Tags: profile, search
---