title: Tweaking my.cnf for performance

text:
# Question
Title: Tweaking my.cnf for performance
Over the last year, with the help of mysqltuner, I've adjusted my.cnf to improve the performance of the 7 CiviCRM installations on my VPS. But in the last few days, as I upgraded my sites to 4.7.10, MySQL has been repeatedly terminated due to low system memory and I'm wondering if a settings tweak could help avoid my having to pony up the dough for more RAM on my VPS. I currently have 3GB RAM, and now around 2.5GB is routinely in use. Running CentOS, Drupal 7.50, CiviCRM 4.7.10. Here's my current my.cnf:

`performance-schema=0
default-storage-engine=MyISAM
innodb_file_per_table=1
max_allowed_packet=512M
open_files_limit=50000
query_cache_type=1
query_cache_limit=256M
tmp_table_size=256M
max_heap_table_size=256M
innodb_buffer_pool_instances=1
join_buffer_size=16M
query_cache_size=128M
table_open_cache=10000
innodb_buffer_pool_size=750M`

Any glaring crazy settings there? I do have the option of having cPanel determine open\_files\_limit max\_allowed\_packets, and innodb\_buffer\_pool\_size if those would be beneficial.

Edit: mysqltuner output added:

```
 >>  MySQLTuner 1.6.4 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.6.31
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -----------------------------------------    --
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 20M (Tables: 47)
[--] Data in InnoDB tables: 6G (Tables: 10176)
[!!] Total fragmented tables: 868

-------- Security Recommendations  -----------------------------------------    --
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!

-------- CVE Security Recommendations  -------------------------------------    --
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1h 20m 23s (132K q [27.574 qps], 1K conn, TX: 249M, RX: 32M)
[--] Reads / Writes: 64% / 36%
[--] Binary logging is disabled
[--] Total buffers: 1.1G global + 16.9M per thread (151 max threads)
[OK] Maximum reached memory usage: 1.5G (52.60% of installed RAM)
[!!] Maximum possible memory usage: 3.6G (128.91% of installed RAM)
[OK] Slow queries: 0% (26/132K)
[OK] Highest usage of available connections: 13% (21/151)
[OK] Aborted connections: 0.15%  (2/1312)
[OK] Query cache efficiency: 84.1% (78K cached / 93K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (3 temp sorts / 2K sorts)
[!!] Joins performed without indexes: 189
[!!] Temporary tables created on disk: 30% (1K on disk / 3K total)
[OK] Thread cache hit rate: 97% (28 created / 1K connections)
[OK] Table cache hit rate: 21% (9K open / 45K opened)
[OK] Open file limit used: 0% (97/50K)
[OK] Table locks acquired immediately: 99% (26K immediate / 26K locks)

-------- MyISAM Metrics ------------------------------------------------------
[!!] Key buffer used: 19.0% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/2.5M
[OK] Read Key buffer hit rate: 99.4% (118K cached / 709 reads)
[OK] Write Key buffer hit rate: 97.9% (15K cached / 322 writes)

-------- InnoDB Metrics ------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 750.0M/6.4G
[OK] InnoDB buffer pool instances: 1
[OK] InnoDB Used buffer: 97.90% (46993 used/ 47999 total)
[OK] InnoDB Read buffer efficiency: 99.86% (29679387 hits/ 29721392 total)
[OK] InnoDB Write log efficiency: 97.49% (404397 hits/ 414797 total)
[OK] InnoDB log waits: 0.00% (0 waits / 10400 writes)

-------- ThreadPool Metrics --------------------------------------------------
[--] ThreadPool stat is disabled.

-------- AriaDB Metrics ------------------------------------------------------
[--] AriaDB is disabled.

-------- TokuDB Metrics ------------------------------------------------------
[--] TokuDB is disabled.

-------- Galera Metrics ------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Adjust your join queries to always utilize indexes
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    join_buffer_size (> 16.0M, or always use indexes with joins)
    innodb_buffer_pool_size (>= 6G) if possible.

```

In the past, I found that putting in a large innodb\_buffer\_pool\_size seems to contribute to the crashes, so I usually ignore that suggestion.

# Answer
First you should fix "***Total fragmented tables: 868***".

And it does seem your amount of RAM is too small. But you could first increase

```
 innodb_buffer_pool_size to 2.5GB

```

and

```
 join_buffer_size to 16M

```

Maybe then MySQL can run a bit longer, so you get a better quality output of mysqltuner.

Personally I would say all of the following are on the low side:

```
max_allowed_packet=512M,
query_cache_limit=256M,
tmp_table_size=256M,
max_heap_table_size=256M,
query_cache_size=128M

```

But would have expected mysqltuner to advise that too.
> 2 votes

---
Tags: mysql, performance
---


# Question
Title: CiviMail - How do I force crmMailing.$invalid to be false?
No luck getting Mailing to work with Civi 4.7.10 on Drupal despite all testing that says it should work. I think I've set every variable, token, requirement, etc there is. Even smartyDebug fails to show me an error. The Send test and Next are disabled (greyed out). Poking through the code in /var/www/drupal/sites/all/modules/civicrm/ang/crmMailing/BlockPreview.html I find

```
<button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid || !testContact.email ? ts('Complete all required fields first') : ts('Send test message to %1', {1: testContact.email})}}" ng-disabled="crmMailing.$invalid || !testContact.email" ng-click="doSend({email: testContact.email})">{{ts('Send test')}}</button>

```

Although I've never used php before it seems || is a conditional whereby if crmMailing.$invalid is true 'Complete all required fields first' will be printed and if its false then the 'Send test' button is active and it will run doSend. The question is how can I force crmMailing.$invalid to always be false and trick the form into allowing me to proceed. While I could just trample over the code and not even bother with a test, I always hold out hope that somehow I'll figure out why the code won't work in my case and want to keep mods to minimum.

# Answer
> 1 votes
Well, it looks like I need glasses because there is no PHP in that bit of code. I was unaware you could do a conditional in HTML . . . until I tried it and found out you can. Anyway, this may be one hell of a crude hack so use at your own risk.

1. Make a copy of sites/all/modules/civicrm/ang/crmMailing/BlockPreview.html
2. Track down the line starting with

> button crm-icon="fa-paper-plane" title="{{crmMailing.$invalid ||

3. Get rid of crmMailing.$invalid || . You'll be left with !testContact.email *. . .rest of line . . .* crmMailing.$invalid appears twice in that line at ng-disabled. So set that to

> ng-disabled="!testContact.email"

Getting rid of crmMailing.$invalid. I'd still like to know why this is set incorrectly. Where/How is it set?

---
Tags: civimail
---


# Question
Title: CiviMail - Next/Send test disabled - Cannot send mass email
Working on this a while, hope you can help. Version: 4.7.10 + Drupal 7.50 on Debian 8 w/ Apache 2.x + Postfix

The problem (the following steps are taken in CiviCRM)

1. Mailings -\> New Mailing
2. Mailing Name: Some Name Goes here
3. Template: Sample Responsive Design Newsletter - Single Column Template List item
4. From: TestingAndWorking@Mydomain
5. Recipients: MyTestGroup
6. Subject: This is a test

HTML: A-Ok unsubscribe, opt-out & domain address are there - no errors flagged

Text: A-ok unsubscribe, opt-out & domain address are there - no errors flagged

Result

Preview HTML/Plain Text: Ok. Next and Send test (for both single email and Group) are disabled

Steps taken to resolve

1. Ensure all required tokens are in place. Check
2. Test email settings. TestingAndWorking@Mydomain: Check
3. Check Headers, Footers, and Automated Messages: All but Resubscribe are set as default and enabled.
4. Is the bounce email address setup: Yep. What about an outgoing mail account? Yep - Set as Email-to-Activity
5. smartyDebug=1 -- Results in Authorization Failed on (Mailing,22&smartyDebug=1)
6. Check table civicrm\_mailing : reply\_id = 8
7. Outbound Mailer: mail()
8. Was an A/B Test tried. Yes. Result: Next works right until step 3 (Compose). Send test works for both individuals and group BUT Next is still disabled. Does smartDebug show anything? No.

Is there a way I can hack some piece of code to allow Civi to move on? What did I miss?

# Answer
> 2 votes
As weird as this sounds, if one forgets to enable the resubscribe message and set that for the mailing, it won't work. After setting this, all buttons 'lit up' and mail could be sent. Is it a bug? No. But a little more help within the interface could save a lot of time. A help message like "Did you forget to choose an Opt-out, Resubscribe, and Unsubscribe message? You need all three" They are marked as defaults but guess which one is disabled by default? Resubscribe. Arrgggghhh

---
Tags: civimail
---


# Question
Title: how to "petition" show using do_shortcode in template file in wordpress?
I want to show petition in page but using template file. Is it possible?

I have used below shortcode in template file but it not worked.

```
<?php echo do_shortcode('[civicrm component="petition" id="1" hijack="0"]');?>

```

Also I want to show another petition in popup but also there shortcode not working

See I want to default petition show in sidebar so i get default petition Id using custom query but i can't get petition with profile form using shortcode. Any other method to get petition using id. See below query for get default petition id.

```
$petition = civicrm_api3( 'Survey', 'getsingle', array(
            'sequential' => 1,
            'is_active' => 1,
            'is_public' => 1,
            'is_template' => 0,
            'options' => array(
                'limit' => 1,
                'sort' => 'id ASC',
                'offset' => CRM_Utils_Array::value( 'offset', $instance, 0 ),
            ),
            'is_default' => array( '1'),
        ) );

$petition_id= $petition['id']

```

Thanks In advance

# Answer
As mentioned in chat.civicrm.org the do\_shortcode does work in a single template (single.php for example) but not in a sidebar.

Two examples to get this going are https://github.com/aghstrategies/civicontribute-widget and https://github.com/agh1/civievent-widget
> 1 votes

---
Tags: wordpress
---


# Question
Title: CiviCRM Dashboard Hangs for 5+ minutes part 2
* CentOS release 6.8
* cPanel 56.0 (build 25)
* Apache (v. 2.4.18)
* PHP (v. 5.6.22)
* MySQL (v. 5.6.30)
* WordPress (v. 4.5.3)
* CiviCRM (v. 4.6.19)

Previously posted here but wouldn't allow me to edit: CiviCRM Dashboard Hangs for 5+ minutes

---

```
Aug 11 15:27:22  [info] $backTrace = #0 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(PEAR_Error))
#2 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("Connection timed out", 110, 16, (Array:2), NULL)
#4 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/Net/Socket.php(156): PEAR->raiseError("Connection timed out", 110)
#5 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/HTTP/Request.php(737): Net_Socket->connect("###.###.###.###", 80, NULL, NULL, NULL)
#6 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(1393): HTTP_Request->sendRequest()
#7 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(329): CRM_Utils_System::getServerResponse("http://###.###.###.###/~user/wp-admin/admin.php?page=CiviCRM&q=civicrm/das...")
#8 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/AJAX.php(606): CRM_Core_BAO_Dashboard::getDashletInfo(12)
#9 [internal function](): CRM_Contact_Page_AJAX::dashboard()
#10 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
#11 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:12))
#12 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#13 /home/user/public_html/wp-content/plugins/civicrm/civicrm.php(1196): CRM_Core_Invoke::invoke((Array:3))
#14 [internal function](): CiviCRM_For_WordPress->invoke("")
#15 /home/user/public_html/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1))
#16 /home/user/public_html/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")
#17 {main}

Aug 11 15:27:22  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => 110
    [message] => Connection timed out
    [mode] => 16
    [debug_info] =>
    [type] => PEAR_Error
    [user_info] =>
    [to_string] => [pear_error: message="Connection timed out" code=110 mode=callback callback=CRM_Core_Error::handle prefix="" info=""]
)

Aug 11 15:27:22  [info] $backTrace = #0 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(PEAR_Error))
#2 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(PEAR_Error))
#3 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(566): PEAR_Error->PEAR_Error("Connection timed out", 110, 16, (Array:2), NULL)
#4 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/Net/Socket.php(156): PEAR->raiseError("Connection timed out", 110)
#5 /home/user/public_html/wp-content/plugins/civicrm/civicrm/packages/HTTP/Request.php(737): Net_Socket->connect("###.###.###.###", 80, NULL, NULL, NULL)
#6 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(1393): HTTP_Request->sendRequest()
#7 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(329): CRM_Utils_System::getServerResponse("http://###.###.###.###/~user/wp-admin/admin.php?page=CiviCRM&q=civicrm/das...")
#8 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/AJAX.php(606): CRM_Core_BAO_Dashboard::getDashletInfo(1)
#9 [internal function](): CRM_Contact_Page_AJAX::dashboard()
#10 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(278): call_user_func((Array:2))
#11 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:12))
#12 /home/user/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#13 /home/user/public_html/wp-content/plugins/civicrm/civicrm.php(1196): CRM_Core_Invoke::invoke((Array:3))
#14 [internal function](): CiviCRM_For_WordPress->invoke("")
#15 /home/user/public_html/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1))
#16 /home/user/public_html/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")
#17 {main}

```

I have noticed others having very similar issues but none of their solutions worked for me. The dashboard will not load for a long time and then once it does the dashlets are not loaded and infinitely spin.

I have found this log output in /home/user/public\_html/wp-content/plugins/files/civicrm/ConfigAndLog/CiviCRM.3f6fec17262bb84dcce5a4b3bb6fffe7.log and cannot figure out to fix it as I do not understand the error. Please help :-)

# Answer
> 4 votes
I think the best solution would be to upgrade to CiviCRM 4.7.11 which will include an improved dashboard that no longer depends on server-to-self http requests.

This upgrade will be released in about 2 weeks. The new dashboard features are sponsored by WMF.

Read more about the issue at https://issues.civicrm.org/jira/browse/CRM-17663

# Answer
> 2 votes
Your debug output indicates that your site is hosted at (obfuscated) `http://example.org/~user/`. To load the dashboard, your webserver has to be able to "talk to itself" via this URL. This is not always the case!

Based on your description, here's what I think is happening:

* Your browser requests `http://example.org/~user/wp-admin/admin.php?page=CiviCRM&q=civicrm/dashboard`
* CiviCRM receives this request and starts composing dashboard output
* CiviCRM tries to retrieve `http://example.org/~user/wp-admin/admin.php?page=CiviCRM&q=civicrm/dashlet/getting-started&reset=1&snippet=5` (and other dashboard elements) using PEAR's HTTP\_Request
* This connection fails, leaving the HTTP\_Request hanging ...
* After a while, CiviCRM gives up
* You see an error of some kind.

If that's the case, then the fix is to make sure that *your webserver can make requests to your webserver*. This sounds weird, but it's what CiviCRM is trying to do. Often this is because the webserver doesn't get working DNS result when looking itself up (servers behind proxies or without DNS), but you seem to be using an IP address.

You also need your webserver to be able to handle sufficient concurrent requests. It's possible a development webserver config might lack this. (This is the nginx `pm.max_children` setting mentioned here and in CRM-16035, in your Apache this is `MaxClients`).

Take a look at The dashboard does not render also - it covers some other possibilities.

Quick test to see if this is dashboard specific: use almost any other page in CiviCRM. AFAIK only the dashboard only makes requests to CiviCRM itself (there are a couple of other spots, eg some security checks, but mostly just the dashboard).

# Answer
> 1 votes
Probably not the solution you are looking for but it's worked for me in the past. -Configure your Dashboard and remove all the dashlets so your dashboard is blank. -Save -Clear Caches. -Re-enable the dashlets

# Answer
> 0 votes
I was able to finally resolve this issue.

I found this small portion at the very bottom of https://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Configuration+Troubleshooting labelled Fire with NAT. Followed the instructions to edit the hosts file to point internal traffic going out to it's own domain to be redirected back to the internal IP and everything was automagically fixed! Thank you everyone for all your help, I appreciate it! :-)

---
Tags: dashboard, dashlet, user-dashboard
---


title: CiviCRM Dashboard Hangs for 5+ minutes

text:
# Question
Title: CiviCRM Dashboard Hangs for 5+ minutes
I have migrated a site from:

* Unknown OS (Was through BlueHost)
* cPanel 11.52.6 (build 1)
* Apache (v. 2.2.31)
* PHP (v. 5.2.17)
* MySQL (v. 5.5.42-37.1)
* WordPress (v. 4.5.3)
* CiviCRM (v. 4.6.9)

To:

* CentOS release 6.8
* cPanel 56.0 (build 25)
* Apache (v. 2.4.18)
* PHP (v. 5.6.22)
* MySQL (v. 5.6.30)
* WordPress (v. 4.5.3)
* CiviCRM (v. 4.6.19)

I have followed the documentation found at https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location and have managed to get CiviCRM to run but with a hiccup. The initial loading of the CiviCRM dashboard takes a very long time, sometimes 5+ minutes, but after the initial load everything is incredibly fast and flawless. Seems to happen only when it is trying to establish a new session as if I clear cache and try to get back to the CiviCRM dashboard it reproduces the issue but the issue will not reproduce as long as the session isn't reset like logging out or clearing cache. I have also noticed that if you sit and let it load that the dashlets then will not load and just shows the spinning loading image and never actually loads but I am guessing these two issues are related.

I have also followed the recommendations found here: civicrm dashboard won't load and have not been able to fix it.

Also I have tried many things like clearing the cache, deleting CiviCRM and re-installing then importing the database and then using the CiviCRM database update utility and seems like nothing is solving the issue.

Snooping around in the Apache, PHP, MySQL, & CiviCRM log files I found only one error being reported that I know is related to the dashboard hanging at public\_html/wp-content/plugins/files/civicrm/ConfigAndLog/ here is the pastebin: http://pastebin.com/TRTg0sHx

I feel as if I have tried everything and am out of ideas, any help as what to do to get this resolved would be greatly appreciated.

EDIT: Ignore "UPDATE (7/12/2016)", found out that this was a separate issue, sorry for the confusion.

UPDATE (7/12/2016): Decided to try a fresh cPanel account, fresh WordPress, and fresh CiviCRM installtion and only running the bare basics to see if the problem would still exist and it does. But on the new install these errors come up:

```
Warning: session_start(): open(/tmp/sess_c279ba138c878520b23fb7085f54a267, O_RDWR) failed: Permission denied (13) in /home/civicrmtest/public_html/wp-content/plugins/civicrm/civicrm.php on line 282

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/civicrmtest/public_html/wp-content/plugins/civicrm/civicrm.php:282) in /home/civicrmtest/public_html/wp-content/plugins/civicrm/civicrm.php on line 282

Warning: Cannot modify header information - headers already sent by (output started at /home/civicrmtest/public_html/wp-content/plugins/civicrm/civicrm.php:282) in /home/civicrmtest/public_html/wp-includes/option.php on line 823

Warning: Cannot modify header information - headers already sent by (output started at /home/civicrmtest/public_html/wp-content/plugins/civicrm/civicrm.php:282) in /home/civicrmtest/public_html/wp-includes/option.php on line 824

```

The first two errors above show and then the dashboard takes forever to load and then once the dashboard loads the last two errors display. Also the dashlets do not load properly afterwards and keep the "Loading..." message with the twirling image.

# Answer
I was able to finally resolve this issue.

I found this small portion at the very bottom of https://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Configuration+Troubleshooting labelled Fire with NAT. Followed the instructions to edit the hosts file to point internal traffic going out to it's own domain to be redirected back to the internal IP and everything was automagically fixed! Thank you everyone for all your help, I appreciate it! :-)
> 2 votes

# Answer
https://issues.civicrm.org/jira/browse/CRM-16035 has now been fixed. So your best solution now would be to upgrade to CiviCRM 4.7.11 which will include an improved dashboard that no longer depends on server-to-self http requests.

This upgrade will be released in about 2 weeks. The new dashboard features are sponsored by WMF.

Read more about the issue at https://issues.civicrm.org/jira/browse/CRM-17663
> 2 votes

# Answer
Try the following options and see if it solves the problem

* Add your IP and domain to /etc/hosts file
* Check if your firewall is blocking any AJAX calls
* Check if any .htaccess file in any of the directories (mainly wp-admin directory) is blocking the AJAX call
> 1 votes

# Answer
We had a similar (but not identical) issue with one of our sites - dashlets would spin for ages before eventually timing out. Occasionally we would get some loads but it was sporadic.

We followed the direction in https://issues.civicrm.org/jira/browse/CRM-16035 to increase the pm.max\_children.

I have no idea if this will fix your issue but, as it sounds similar, I thought I might as well throw it in the mix! Apologies if it doesn't help!
> 1 votes

---
Tags: dashboard, dashlet, user-dashboard
---


title: Environment Settings, mismatch timezone

text:
# Question
Title: Environment Settings, mismatch timezone
I have just done a new install of WordPress and CiviCRM, it has displayed this warning when looking at the CiviCRM dashboard:

Environment Settings Timestamps reported by MySQL (eg "2016-03-22 14:45") and PHP (eg "2016-03-22 20:45" ) are mismatched.

The link it refers to is this: https://wiki.civicrm.org/confluence/display/CRMDOC/checkMysqlTime

Which I have read but maybe I am missing something.

I ran this command on MySQL "SELECT TIMEDIFF( NOW( ) , UTC\_TIMESTAMP );" and it returns -06:00:00

So then in my php.ini I set date.timezone=America/Chicago to match, then as another precaution I went to the WordPress wp-admin dashboard in the settings and set the timezone to UTC-6 and yet the warning is still displaying, does anyone have any ideas?

# Answer
> 2 votes
Sorry for the delay but was I was able to solve my issue, I had set the time zone in WordPress \> Settings \> General and then changed from manual offset option to location based offset option. This is due to WordPress and CiviCRM handling time differently than WordPress when using the manual offset method.

# Answer
> 4 votes
In testing i determined that all of the UTC offset TZ WordPress offers are invalid from a php perspective.

Set the timezone to the proper php TZ (Europe/Zurich for example) and that error will go away.

# Answer
> 0 votes
Perhaps clearing CiviCRM cache after changing it in the civicrm.settings.php file will fix it :)

---
Tags: wordpress, installation, timezone
---


# Question
Title: Generating links or a popup to edit a single multivalue custom field record in CiviCRM 4.7
I have a custom report generated for viewing some contact data and I would like to include a link to send the user to an edit form for a single multi-value custom field record. I would then use civicrmDestination to send them back to the report. I have tried various formats copied from links in the CiviCRM interface. None seem to work. The closest format was this but there is an issue with the "&cgcount" parameter. It seems to always force editing the first record. Is there a way to ignore this and just used the multivalued set record id which is 60159 in my example below?

```
/civicrm/contact/view/cd/edit?reset=1&type=Organization&groupID=11&entityID=92&cgcount=1&multiRecordDisplay=single&mode=edit&fsId=60159

```

Ideally I would also like to include a link to create a new custom value record for the row's related contact.

Alternately I would be happy to use JavaScript to create a popup form to edit these records. I am not sure what format to use for that either.

# Answer
You're on the right track. If you go to the contact summary page and click the popup links to add/edit custom data then you can re-use those exact links in your report. Give the `<a>` a class of `crm-popup` and Civi's js will do the rest for you. No need to redirect back to the report, you can make it refresh automatically via ajax when the popup form is saved by using the `CRM.refreshParent` method similar to crm.livepage.js
> 2 votes

---
Tags: custom-fields, 4.7
---


# Question
Title: Webforms with offsite payment processor development
Is anyone currently working to resolve the incompatibility between off site payment processors such as paypal standard and webforms?

On the wiki, it states its being developed.

Does any off site payment processor work with webforms yet?

Many thanks all,

Andy

# Answer
> 4 votes
The issues related to paypal standard and webform\_civicrm have already been resolved. I've just updated the wiki documentation to reflect this.

# Answer
> 0 votes
Yes, sort of. We collect data and correct pricing in Webform and pass that to a PHP file to process payment at Stripe (which I highly recommend). I can send you the PHP if interested.

---
Tags: civicontribute, payment-processor, paypal
---


title: API Extension PHPUnit Tests not working

text:
# Question
Title: API Extension PHPUnit Tests not working
I am fairly new to Civicrm, I created a new API for an Entity which I would like to make a pull request for but however it seems preparing a test environment in Civicrm is quite difficult.

I have followed this tutorial but seems it's not for Civicrm 4.7 since some of the paths mentioned are not in Civicrm version 4.7

Tutorial URL: https://wiki.civicrm.org/confluence/display/CRM/Setting+up+your+personal+testing+sandbox+HOWTO

I can't seem to be able to find these paths , mentioned below

> **Configure the PHP constant CIVICRM\_DSN**. Database connection using PHP constant To define PHP constants for unit-testing, **copy the file "/tests/phpunit/CiviTest/civicrm.settings.local.php.txt"** to **"/tests/phpunit/CiviTest/civicrm.settings.local.php"**. Edit the file to include to include a line like this:
>
> define('CIVICRM\_DSN', 'mysql://db\_username:db\_password@localhost/civicrm\_tests\_dev'); Configure the environment variable CIVICRM\_TEST\_DSN. (The format is the same as the CIVICRM\_DSN above.)
>
> Don't use this approach unless you already have a strong understanding of environment variables. Pass the MySQL details as command-line parameters each time you run the unit-tests. (This approach doesn't require updating any other files, but it's cumbersome to use when you regularly run unit-tests.)

https://wiki.civicrm.org/confluence/display/CRM/Setting+up+your+personal+testing+sandbox+HOWTO

When I go to the root of my API extension and type :

```
civix test CRM_MyEntity_EntityAction

```

I get error below which suggests I should read the tutorial above

# Answer
Agree with JohnFF and JonG that it's good to look at buildkit/`civibuild` for this. If you review the main page for the test suite (http://wiki.civicrm.org/confluence/display/CRMDOC/Testing), you'll notice a common theme -- all the tests should work out of the box on new builds if you use `civibuild`. (They need to -- because the `civicrm.org` test infrastructure runs on `civibuild`.) A manual installation requires more work.

In this case, the instructions you've come across in Setting up your personal testing sandbox HOWTO are out-of-date -- those instructions apply from roughly v2.x - v4.6. The test-runner changed a bit in v4.7.

**How it works in v4.6 and earlier**: Civi included a fork of `phpunit` with several small patches, and the tests only worked if you used this fork of PHPUnit. This had several consequences like:

* Every developers' copy of CiviCRM required an extra config file under `test/phpunit/CiviTest`.
* Upgrading `phpunit` (eg to run in newer versions of PHP) was onerous.
* Running a test-class in an extension was pretty hard. You needed a way to link your test with the Civi installation. (The location varies depending on the CMS and configuration.)
* Running a test in an IDE was... hard? impossible? (I never did it 4.6 or earlier.)

**How it works in v4.7**: Tests are no longer special programs with a strongly-prescribed structure. Instead, we've addressed the broader problem of how to load Civi in your CLI scripts. You can use any test-runner (`phpunit`, `codeception`, `behat`, etc) with any package (`civicrm-core`, `civicrm-drupal`, or an extension). A "Civi enabled test" is just a plain-old PHP script which includes a line like this:

```
eval(`cv php:boot`); // or...
eval(`cv php:boot --test`); // or...
eval(`cv php:boot --level=classloader`);

```

The `cv` tool is responsible for loading/booting CiviCRM in your test.

When designing tests, there are different types of tests... such as bare unit-tests, headless database tests, and end-to-end tests. For more discussion about these concepts, see:

If you haven't used `civibuild`, then pay particular attention to the README for `org.civicrm.testapalaooza` under "Setup: Option B: Manual".
> 1 votes

# Answer
Depending on how you installed civi, these test files may not have been included. How did you install it? If you use buildkit you get these. Otherwise feel free to download them from the github repo, but although I think I was able to successfully do that I remember it being fiddlesome.
> 0 votes

---
Tags: extension, civicrm-home, civicrm-entity
---


# Question
Title: SOLVED - Cron setting for CiviCRM 4.x.x on Drupal 7.x via cPanel Cron admin panel
Greetings and salutations. I know some of you must be growing impatient with all of these cron questions from the noobs. I am at a loss. I have consulted all of the documentation links posted in the cron question threads and tried every example given. I have even changed hosting providers and installed a fresh copy of Drupal 7 and CiviCRM separately (the bundle caused all kinds of errors that I didn't know how to fix). I have everything working now except cron. Still. I have scoured every resource I can find trying to understand cron and c/p'ed every example of cron settings relevant to CiviCRM and Drupal. I still cannot get cron to fire automatically and the error on the status page will not go away. I can click the button and run it manually, so it doesn't seem to be a permissions issue. I really don't know what else to do at this point. My current cron setting is

```
22 */2 * * * wget -O - -q -t 1 http://mydomain.com/cron.php?cron_key=mykey > /dev/null

```

Can anyone please explain to me WHY this is wrong so that hopefully I can get this running? Please and thank you.

Solution: Single quote (') before http and after the end of site key in addition the wget etc.

This is how it should look:

\*/6 * * * * wget -O - -q -t 1 'http://mydomain.com/sites/all/modules/civicrm/bin/cron.php?name=username&pass=password&key=site-key'

Thank you everyone for the help and to Hock for providing the info about single quotes around the http attribute.

# Answer
> 7 votes
The cron job you have there looks like a Drupal cron job. You should look at the scheduled jobs wiki page for full details, but in the case of a Drupal site using `wget` (since that is the direction you're seeming to go in), try:

```
*/6 * * * * wget -O - -q -t 1 http://mydomain.com/sites/all/modules/civicrm/bin/cron.php?name=username&pass=password&key=site-key

```

You'll find the "site-key" in the `civicrm.settings.php` file, and the "username" and "password" correspond to a Drupal user with Administer CiviCRM permission.

You'll see that I have it going every six minutes rather than every 2 hours: you'll want to set CiviCRM cron to run multiple times per hour; you can set specific scheduled jobs to run less frequently from the management page in CiviCRM.

# Answer
> 0 votes
I have had the same issues but thanks to above I sorted it out so thanks for that. My confusion was over using CRON in Cpanel and how that interfaced with CRON in Drupal and Scheduled jobs in Civicrm So the link available in Drupal does work but does not affect the Civicrm Scheduled Jobs. Note the different cron.php locations.

viz: From Drupal to run externally (this works for Drupal but not Civicrm) http://my.org/drupal/cron.php?cron\_key=YufnNO9tj4npU4BN6zLJOVsu\_pKO7eapX2siu5-yMOU

Viz: From Cron in CPanel (this works for Civicrm but not Drupal - which is correct ) wget -O - -q -t 1 'http://my.org/drupal/sites/all/modules/civicrm/bin/cron.php?name=username&pass=password&key=site-key' Note the single quotes. I hope this helps someone.

---
Tags: cron
---


# Question
Title: How to remove the dummy contacts from the default contact DB
How can we remove the dummy contacts from the default contact database?

# Answer
> 2 votes
I assume you have loaded the sample data and you want to get rid of those? If that is the case, best advice is re-install WITHOUT loading the sample data. If you have loaded the sample data, you do not only have contacts but also cases, contributions, pledges, activities, events etc. and some configuration.

# Answer
> 2 votes
Another option, assuming you have data already in your contact DB.

* Install a fresh DB with test data, or visit the CiviCRM demo site
* Use CiviCRM's export to export the (test) contacts to CSV with essential contact details
* Import this CSV into your CiviCRM site, choosing "Fill" to avoid overwriting any "real" contacts, and making these contacts members of a "To remove" group
* View the members of this To Remove group
* Select all contacts displayed, review and deselect any who should not be deleted
* Use the actions to Delete contacts

# Answer
> 1 votes
If you do just want to get rid of those example contacts then the problem of deleting Contacts is that any that have Contributions will need those deleting first or you will get this "This contact(s) can not be permanently deleted because the contact record is linked to one or more live financial transactions. Deleting this contact would result in the loss of financial data." when you try and Permanently Delete.

Your test records should all have an ID below 'x'. You should be able to use Search Builder or Adv Search and find all those contacts either by Internal ID, or 'date created' (under changelog in Adv Search) and get them all in to a Group eg D.

Then in Adv Search say 'find all contacts in Group D', set Adv Search to 'show results as Contributions' then delete those contributions, then delete the Contacts.

---
Tags: civievent
---


title: Contribution receipt showing no fields

text:
# Question
Title: Contribution receipt showing no fields
We are using CiviCRM 4.7.10 on Joomla 3.6.2. The contribution receipt isn't showing any field data, except amount and date, though it does show the intro text put into he Contribution form. This is a contribution form that has an optional donation, but mostly collecting profile data.

My understanding that all fields from this form should display on the receipt - How can we get all the form data to email in the receipt?

# Answer
> 1 votes
Is this an online or offline receipt. It looks like an offline donation receipt. The information available for each is different.

---
Tags: joomla, email, receipts
---


# Question
Title: How to relationships field on the contact profile
I want to create a relationships field on a contact profile like the 'Current Employer" field. I want to be able to access this new field rather than using the 'Relationships' tab.

Why? I want to retain the 'Current Employer' field. My client, Navy Sailing has over 180 branches around the world. We assist with the management of contacts that belong to those branches (organization), and creating a contact relationship with those branches seems to be the best way to manage the requirements. I need the field on the profile in order to make it easier administrators to edit and to view, rather then multiple clicks to use the tab. (and needs to be an obvious piece of data on the profile)

Is there anyway to get a relationships field on the profile, e.g. directly under the 'Current Employer' field OR in a custom field set elsewhere on the profile???

Carl

# Answer
The "Current Employer" field is special in that the `employer_id` is actually stored on the contact record (in the `civicrm_contact` table on the underlying database). All other relationships are stored only in `civicrm_relationship`.

Nevertheless, you could fake this:

* Create a custom field of type "Contact Reference". This by itself might meet your needs - do you still need a relationship if you have a contact reference field?
* If so - you can write an extension (if you're not a coder, you can hire one to do this for you) that fires on `hook_civicrm_custom`. When they contact reference field is changed, a corresponding relationship can also be updated.
> 1 votes

---
Tags: relationships
---


title: CiviCRM Home Menu Blank - Drupal 7

text:
# Question
Title: CiviCRM Home Menu Blank - Drupal 7
Thank you for looking at my question.

I am a Drupal and Civi newbie.

When I installed CiviCRM the CiviCRM menu appears in the menu bar however, there are no dropdowns. When I click on it the page appears blank and the "configure your dashboard button does nothing". The pages are there when I type in the url but the links dont show up in the menu.

I have:

Uninstalled and reinstalled, Cleared caches, Confirmed the site/default folder is writable, Confirmed CIVICRM\_UF\_BASEURL, Moved menu to Management--Admin, Disabled and re-enabled, Installed the Admin Menu module.

How do I get the menu to appear properly?

Thank you for your help.

P.S. received this error also which may be related to menus: Fatal error: Unsupported operand types in /home/xxx/public\_html/xxx/modules/system/system.module on line 2134

UPDATE

Heres the debugging console text: imgur.com/a/nEcTD

```
civicrm?reset=1:46 Mixed Content: The page at 'https://beta.myblackmarket.uk/civicrm?reset=1' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Lato:300,400,700,900,400italic'. This request has been blocked; the content must be served over HTTPS.
civicrm?reset=1:50 Mixed Content: The page at 'https://beta.myblackmarket.uk/civicrm?reset=1' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Playfair+Display:900'. This request has been blocked; the content must be served over HTTPS.
yM1bINZq:7 Uncaught TypeError: $ is not a function
civicrm:447 Uncaught TypeError: CRM.$ is not a function
civicrm:699 Uncaught TypeError: CRM.$ is not a function
webform_civicrm_forms.js:403 Uncaught ReferenceError: jQuery is not defined
civicrm?reset=1:1 Mixed Content: The page at 'https://beta.myblackmarket.uk/civicrm?reset=1' was loaded over HTTPS, but requested an insecure script 'http://maps.google.com/maps/api/js?sensor=true'. This request has been blocked; the content must be served over HTTPS.

```

# Answer
> 1 votes
This sounds like a Javascript error - please check out this guide to troubleshooting Javascript errors in CiviCRM. Feel free to update the question with more info if this gets you further to a solution.

Also - that fatal error sounds like it's related to Drupal core. I'd fix that before trying to get CiviCRM working - it's much harder to fix a system broken in two places than one!

---
Tags: drupal, menu, civicrm-home
---


# Question
Title: How to add field for length of a specific membership type to Contact Summary page
I'd like to add a custom field to the Contact Summary page that calculates and displays the time that the person being viewed has held a full membership.

In this case we have student, candidate and full memberships and a full member will have records for each in their membership tab, showing the transition dates from where their student membership ended and candidate membership started, where the candidate membership ended and their full membership started.

For the "Years as Full Member" custom field, we want to be able to glance at the summary page and see that a member has held a full membership for 9 years, 12 years, 25 years, etc... The calculation is simple enough but I don't know how to integrate it within CiviCRM/Drupal.

# Answer
> 1 votes
This requires you write an extension. I've written similar extensions to show the "original join date" on a contact summary screen. If you haven't written PHP, you will probably want to hire someone to do this for you.

Your case is a little trickier, because it'll need to be updated once a..day? Month? Whereas "original join date" only needs to be filled in once.

Here's the basic approach:

* Create a custom field to store the data. Set it to view-only.
* In your extension, define a new API. When the API is called, it should make an API call to find the folks whose custom field will need updating. If these folks are defined as a group/smart group, that will help!
* Loop through each contact, using the API to query their memberships.
* Take the earliest membership join date that applies and do your math, using PHP's date arithmetic functions.
* Use the API to update the field that stores the data.
* Define a scheduled job (**Administer menu » System Settings » Scheduled Jobs**) to run the scheduled job on the schedule of your choice.

---
Tags: custom-fields
---


# Question
Title: What is the database schema for groups and parent groups?
I need to manually delete a group that is corrupt. Already tried a few things. This corrupt group assigned itself as the parent to other groups and continues to add additional children groups every time 'managed groups' is open. I tried to delete the group via civicrm ui and directly in the db but then unable to edit any records or import records. Error message is below.

I also manually removed parent child relationships directly in the database and then disabled the corrupt group in civicrm. This disabled all the group that were just removed as children.

Also, cannot delete records from the group. And the number of records in this group changes every time 'managed group' is opened. Obviously corrupt and needs to be deleted. Any info on the data schema for groups and parent groups appreciated.

Here is the error when this corrupt group is deleted:

> $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )
>
> ```
> [code] => -3
> [message] => DB Error: constraint violation
> [mode] => 16
> [debug_info] => REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 39435, 'Added' ) [nativecode=1452 **
>
> ```
>
> Cannot add or update a child row: a foreign key constraint fails (`xxx_civicrm`.`civicrm_group_contact`, CONSTRAINT `FK_civicrm_group_contact_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)\]

# Answer
Groups are stored in `civicrm_group`. Parent/child relationships are stored in `civicrm_group_nesting`. However, based on the error you've posted, that's not the issue. The issue is that the group was deleted, but there are still contacts who are a member of the group (which is stored in `civicrm_group_contact`).

I'm not sure how you did that - as the error reports, there should be a "delete cascade" when you delete a group to remove the `civicrm_group_contact` records. To fix this, make sure you have a backup, then:

Hopefully that should clear this error!
> 1 votes

---
Tags: database, groups, data-model
---


# Question
Title: How can I send mass email to all contribution page pcp owners?
I have a contribution page that has pcp enabled. I want to send out a mass email to all the pcp owners. I can display a list of all the pages with owners, but I can't do any actions on them. Is there an easy (or even a hard) way to do this?

# Answer
> 2 votes
This is definitely a blind spot in CiviCRM! I don't think there's anything except a very hard way: Write SQL to get the contact IDs, then import those IDs, assigning them to a new group.

To get the IDs of EVERYONE with a PCP, here's the SQL:

`SELECT contact_id from civicrm_pcp;`

If you want to get the PCPs associated with a particular contribution page, and that contribution page's ID is 12, here's the SQL:

`SELECT contact_id from civicrm_pcp cp JOIN civicrm_pcp_block cpb on cp.pcp_block_id = cpb.id WHERE cpb.entity_id = 12 AND cpb.entity_table = 'contribute';`

If it's an event page, change `contribute` to `event`.

Export that as CSV (this is trivial in PHPMyAdmin, for command line you can look up syntax). Import the list of ONLY contact IDs to CiviCRM through **Contacts menu » Import Contacts**. On screen 4 of 4 of the import, you can specify a (new or existing) group to add your contacts to. Once it's imported, you can mass mail the contacts.

Sorry it's such a hassle! Hopefully an organization invested in PCPs will step up and fund a better solution. If nothing else, a custom search would be easy to write.

---
Tags: email, contributions, pcp
---


# Question
Title: Update Reports not available after Upgrade to 4.7.10
After Upgrading to 4.7.10 from 4.7.8, it looks like the Reports have lost some of their features. The buttons for Preview Report, Update Report Save as Copy at are not displayed anymore.

Here is the screen before upgrade:

Here is the screen after upgrade:

# Answer
This functionality has been moved to the action drop-down list.
> 1 votes

---
Tags: civireport, 4.7.10, display
---


# Question
Title: DB Error: constraint violation when a member renews online
In the following from the ConfigandLog, log, the value of group\_id is given as 13 when it should be 9. In civicrm\_groups there is NO 13 but in civicrm\_custom\_group there is.

Aug 29 20:25:14 \[info\] $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> exceptionHandler )

```
[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 4405 ,  13 ,  20160829202514 , 'API' , 'Removed' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`gsv10274_04`.`civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 4405 ,  13 ,  20160829202514 , 'API' , 'Removed' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`gsv10274_04`.`civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_subscription_history (contact_id , group_id , date , method , status ) VALUES ( 4405 ,  13 ,  20160829202514 , 'API' , 'Removed' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`gsv10274_04`.`civicrm_subscription_history`, CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE)]"]

```

)

Why is Civi using the wrong group ID? Is this causing the fatal error?

# Answer
this looks like some custom code you have setup which is passing through the wrong group id. Its indicated by the API identifier in the failure. I would check what custom code you have and establish where group 13 is being passed in, you could turn on the backtrace recording so that the exact source can be determined.

The other thing to check is that the contribution page is set correctly in the section where contacts are automatically added to groups. Someone may have set it there and subsequently removed the group.

Either may cause this issue.
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Why does the donation process not produce a receipt either on screen or dispatched by email to donor?
We have joomla 3.6.2, CiviCrm 4.7.10 and PayPal Express (PP) Donor receives an email from PP stating you sent a payment to .... Donor should also receive an emailed receipt from CiviCrm but does not Donor should also be returned from PP to an online receipt but is not, instead sees a red error page.

Where do I start looking for the answer!??

error message is CiviCRM-001 - @import url(/components/com\_civicrm/civicrm/css/civicrm.css); @import url(/components/com\_civicrm/civicrm/bower\_components/font-awesome/css/font-awesome.min.css); Sorry but we are not able to provide this at the moment. Failed to update contribution in database

Return to home page.

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'; } }

# Answer
> 1 votes
'Failed to update contribution in database' tells us that your Contribution is never fully completed on the CiviCRM side of things - and hence it will not get to the part where CiviCRM sends out a receipt.

In other words - the monies are processed on the PayPal side of things - but when CiviCRM hears about it - and is trying to record that the transaction was successful - it runs into a Failed to update.

---
Tags: civicontribute
---


# Question
Title: Paypal Express not working with Webforms CIVICRM Intergration
I've upgraded Webforms to the latest version which fixed but Paypal Express CIVI payment processor is not working.

I've inputted the correct API information into the payment processor. I know its correct because we have used paypal pro successfully. The only issue with paypal pro was that when someone clicked the paypal button, it also had the same issue as paypal express. However when someone submitted the form it worked.

Paypal express doesn't work with either hitting submit or hitting paypal button.

CIVICRM 4.5.8 DRUPAL 7

Thanks, Andy

# Answer
This has been a known bug/issue in webform\_civicrm ( see e.g. Webform CiviCRM Paypal Button not Working ) -\> try upgrading to the latest webform\_civicrm (dev -\> clone or download master: https://github.com/colemanw/webform\_civicrm.git ).

I also strongly encourage you to upgrade your CiviCRM - there have not been any security releases for 4.5.x for quite some time now.
> 1 votes

---
Tags: webform-civicrm, paypal
---


# Question
Title: hook_civicrm_post - on creating event cannot update the record in `civicrm_event` table
I have a custom field in `civicrm_event` table which I want to update on creating event. However the hook\_civicrm\_post on creating event cannot update the record in `civicrm_event` table due to database transaction lock still in place at that point. Is this possible to be achieved with another database transaction? Can someone give me an example.

# Answer
See custom fields, See custom fields http://docs.civicrm.org/user/en/4.6/events/custom-data-for-events/
> 0 votes

---
Tags: wordpress, civievent, database
---


# Question
Title: CiviMail - Sender appearing as "Info #NAME?"
When emails we send from Civi are viewed on phone devices, the sender in the preview appears as 'Info #NAME?'. On desktop, it works fine.

Can anyone identify the problem/suggest solution?

Thank you

Holly

# Answer
The first place to check is here: /civicrm/admin/domain?action=update&reset=1

```
FROM Name
FROM Email Address

```
> 1 votes

---
Tags: civimail
---


# Question
Title: Copy old WAMP directory to new installation of WAMP
Can anyone assist with the following scenario please...

-I had a local install of Wordpress and CiviCRM using WAMP.

-PC died but I was able to retrieve the Hard Drive and install in another PC as a secondary drive, and all of the files are still there.

-I have reinstalled WAMP on the new PC (C:) and now want to know if I can point the new WAMP installation to the old directory (F:) that contains my wordpress and civicrm data, or somehow copy the data into the new installation - in fact this is the preferred option.

Is this possible to do?

Thanks, Joe.

# Answer
You need to change the root directory that WAMP is using for the website:

For wamp 2.5 on Windows, use a text editor, e.g. notepad++ to edit c:\wamp\bin\apache\apache2.4.9\conf\httpd.conf

1. Change DocumentRoot "c:/wamp/www" to DocumentRoot "c:/my/new/path" (Note slash direction). This will change the location where files are served from (~Line 230).
2. Change to (Note slash direction). This applies permissions from the old directory to the new one (~Line 252).
3. Copy all content from c:\wamp\www to your new directory (c:\my\new\path), including index.php
4. Edit c:\my\new\path\index.php and change line 40 $server\_dir = "../"; to $server\_dir = "C:/wamp/"; This changes the location where config files etc. for wamp are read from. Change $suppress\_localhost = false; to correct projects links (~Line 30).

*I pulled this from this post: https://webmasters.stackexchange.com/questions/43522/how-to-change-the-www-root-directory-on-wampserver*
> 1 votes

---
Tags: database, php
---


# Question
Title: Cannot separate CiviCRM database tables from Wordpress tables on installation
I just installed CiviCRM for the first time on a test Wordpress installation for checking out CiviCRM. I followed the instructions at https://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+WordPress and used civicrm-4.7.10-wordpress.zip. For some reason, when running: http://{wordpress install directory}/wp-admin/options-general.php?page=civicrm-install, the database part of the form is populated with the Wordpress database. I created a clean, empty MySQL database and tried to enter it. When I pressed the Check Requirements button, it replaced the database name with my Wordpress database name. Everything works, but I really wanted to have the Wordpress tables and CiviCRM tables in separate databases for future site management. Is there a way, after the fact, to point to the database I want? I can easily export the CiviCRM tables and import them into the clean database.

Thanks for any help here and sorry if this is simple - this is my first day working with CiviCRM.

# Answer
> 5 votes
OK. I was able to fix it by

1. Directly editing wp-content/uploads/civicrm/civicrm.settings.php to point to the new clean civicrm-only DB.
2. Exporting the civicrm tables only from my original wordpress DB.
3. Importing the exported civicrm tables into the new, blank civicrm-only DB.
4. Dropping the civicrm tables from the original wordpress DB so it is wp-only.

All seems to be working, but it seems like I should have been able to easily set this up with the install script, which seemed to override anything that I put in for the CiviCRM DB by the WordPress DB.

All looks OK. For the more experienced CiviCRM folks, can there be any gotchas here?

# Answer
> 2 votes
I'll add this as an answer - The Recheck requirements button resets the DB credentials. I expect this happened between testing when we implemented defaulting to using the WP Database and the credentials in wp-config.php.

In any case, this needs to be fixed. Issue - https://issues.civicrm.org/jira/browse/CRM-19279

---
Tags: wordpress, installation
---


title: How do i enable click tracking in UI

text:
# Question
Title: How do i enable click tracking in UI
I am using SparkPost for mail delivery of CiviCRM mass mailing. SparkPost analytics show targeted and bounced emails etc but shows zero for clicks and opens. How can i enable tracking of clicks and opens?

# Answer
Go to your sparkpost account(https://app.sparkpost.com) and click on 'Account' and then 'SMTP RELAY' and click on radio button 'Enable Tracking'. This will make sure tracking of clicks and opens.
> 1 votes

---
Tags: civimail
---


title: Offsite payment processors

text:
# Question
Title: Offsite payment processors
We require an offsite payment processor that works with webforms and can take card payments.

Paypal Express doesn't work. Paypal standard can't take card payments with an account.

Are there any other offsite payment processes like paypal express please?

Thanks, Andy

Drupal 7. CIVICRM 4.5.8

# Answer
> 1 votes
Paypal standard should give two options. 1 to pay with your PayPal account and 2. To pay with a cc. Sometimes the cc option has a misleading label. For example it will be labeled:"don't have a PayPal account"

---
Tags: webform-civicrm, payment-processor, paypal
---


# Question
Title: How do I change my organisation's address in a mailing?
I want to send out a civi mailing relating to a change of office address - the trouble is, the required {domain.address} refers to the old address and I can't see how to change this?

Is there a quick way?

Thanks, James

# Answer
You can change your organization address by going to Administer \> Communications \> Organization Address and contact info.

Alternatively and less recommended,you can disable the check for mandatory tokens in CiviMail by going to: Administer \> Civimail \> Civimail component settings
> 7 votes

---
Tags: civimail, tokens
---


title: How to import check box field data?

text:
# Question
Title: How to import check box field data?
How do I successfully import contact's check box field data? I am using civicrm 4.6.19 and importing from csv.

I want to import the "is deceased" field and the communication preferences...

Thanks

# Answer
Create a deceased column. If a person is deceased give the value 1, otherwise give the value 0.

Generally, 1 is checked 0 is unchecked for the check boxes.
> 5 votes

---
Tags: import
---


# Question
Title: mySQL 5.1 to 5.5 upgrade - radio button data error
We have upgraded MySQL from 5.1 to 5.5 and now when we extract the data what was previously showing as yes/no is now showing as 1/null, in addition the first row of data is showing the correct yes/no values.

This seems only to be affecting custom fields which used the inbuilt yes/no radio field type.

Where we had custom alphanumeric fields, type radio, yes/no value options - the data is fine. So a fix could be to reset up all the fields affected as alphanumeric, re-import the data and then delete the old fields - but this will no resolve the underlying issue. Concerned if we do this it might come back to bite us later.

Any pointers appreciated.

# Answer
> 1 votes
I did made a test against Civicrm 4.6.10 against Mysql version 5.6.30

where I did created two custom field with option as below

1. custom alphanumeric fields, type radio, yes/no value options
2. custom Integer fields, type radio, 1/2 value options

Both gets saved against database as excepted first one with alphanumeric got saved as yes/no and other one got saved as 1/2

So I would recommend you to create a new custom field with alphanumeric and try importing the records again which should import correctly.

I guess this helps!!!

---
Tags: custom-fields, mysql
---


# Question
Title: How can I customise the display of an event's associated images?
In an event, how can I make the picture big enough to be more like a background in the body. I have tried making the pixels larger.

# Answer
This is really a CSS question, but you can slice it several ways. All solutions will require a bit of understanding or expertise.

* **CSS only**: You could add CSS to a custom site theme which sets the event background based on the event ID. (For example, the event info page contains a region with class `.crm-event-id-3` you could target.) This may be less flexible if you don't want to make image changes in your CSS, but it is fine if you can set-and-forget, or don't mind changing text files. *This is what I'd typically do - I find CSS an effective tool.*
* **Smarty, CSS via Custom TPL**: Depending on your needs, you might find you want to use Event information to set CSS inline (eg, if you wanted to be able to use CiviCRM to change images via the web UI). To achieve this you might provide custom templates for CiviCRM. Documentation is at Customize Built-in, Profile, Contribution and Event Registration Screens and Page Templates. Note that the first page there recommends the next method! *I would avoid this because working with Smarty makes me sad, and for backgrounds you'll end up working in CSS anyway.*
* **Smarty, CSS via Extension**: The docs above recommend using an extension to customise the Smarty templates or inject custom CSS. This is the "new" means to achieve the above, but may have a higher barrier to entry. It is better to maintain. *I'd do this if, for example, client request was "make it possible for staff to change background per event". I'd still avoid Smarty and just inject CSS to the page.*

Three options there! How you deliver this really depends on what your design requirements are, but I hope the pointers are some help.
> 2 votes

---
Tags: civievent
---


# Question
Title: Getting a Custom Field Value on a Contact with Javascript API
I have a custom field for contacts that I would like to retrieve the value for using JavaScript.

Using the API explorer I have generated the code that does this. It works PERFECTLY from the API explorer (which uses PHP).

However, when I run the Javascript code in my extension I get an error. Here is the code:

```
CRM.api3('Contact', 'getvalue', {
  "sequential": 1,
  "return": ["custom_102"], //custom_fieldId
   "id": 2 // contact id
 }).done(function(result) {
   // do something
 });

```

Here is the error:

```
Object {
    invalid_field: Array[1],
    is_error: 1,
    error_message: "field Array unset or not existing" }
    error_message : "field Array unset or not existing"
    invalid_field : Array[1]
         0 : "custom_102"

```

I am at a complete loss here... and would really appreciate some help!

# Answer
> 3 votes
The syntax is incorrect - and I just confirmed that the syntax generated by the API Explorer for Getvalue is incorrect, so you're not to blame!

The culprit is this line:

```
"return": ["custom_102"],

```

In JSON, the square brackets indicate an array. "return" expects an array for a `Get` action, but `Getvalue` accepts only a single value (for the obvious reason). If you remove the brackets:

```
CRM.api3('Contact', 'getvalue', {
  "sequential": 1,
  "return": "custom_102", //custom_fieldId
   "id": 2 // contact id
 }).done(function(result) {
   // do something
 });

```

You should be in business!

---
Tags: custom-fields, api, javascript
---


# Question
Title: How to pass field data from a Drupal node to the CiviCRM contact record of the author
I have a scenario where site users are able to create content in Drupal. Let's assume they will only ever create one node. Their details are in CiviCRM already since they have a Drupal user account, but I'd like to pass values from fields in the node (e.g. URL and the Title) of the node into custom fields in the node author's contact record in CiviCRM.

# Answer
I got this working by installing the CiviCRM Rules and CiviCRM Entity modules in Drupal. I was then able to create a rule that would populate custom fields in the node author's CiviCRM individual contact record with values from the node when the node was created or updated. In my case, it was the node title, the node path, and a custom date field on the node.

The key was to create a rule that would trigger on node create or edit, and then update each of the CiviCRM fields I wanted. The CiviCRM fields were accessible in Rules as `node:author:civicrm-contact:custom-1`, `node:author:civicrm-contact:custom-2` and so on.

Note the use of `node:author` not `current:user` \- I wanted the node:author record to be updated. Whilst these would be the same when the author creates/updates the node, they would be different if another user updated the node. If you use current:user, then the fields of the current user would be updated. I guess there is a use case where that would be desirable, but it wasn't what I wanted.

I was then able to use Drupal's Admin Views module (which incorporates Views Bulk Operations) to carry out a bulk save on all the nodes that had been created prior to configuring this set-up - this triggered the rule and updated the individual field

The only thing I haven't solved at this point is how to allow multiple instances of my custom field set in CiviCRM (i.e. to capture the fields for multiple nodes created by the same author). I initially configured the field set this way, but found that each save of a node added a new instance of the field set in the CiviCRM contact record rather than updating the existing field set. When I reverted to a single instance, the fields were simply updated on each save.
> 2 votes

---
Tags: drupal, civicrm-entity, civirules
---


# Question
Title: Remove the login that appears at the bottom of a registration profile
I have a profile for a visitor to use that allows them to purchase a membership and at the same time creating a drupal account. All works well, except there is a login block at the bottom of the page that I want to eliminate because it is moot and the user will receive a one-time login from drupal.

Why is the login on the profile page, and how can I get rid of it??

Carl

# Answer
I suspect it's the Drupal login block - so to not show that on your civicrm pages - get into your blocks configuration and in the visibility settings make it such that it does not display on civicm/\* (or make that less generic if you like).
> 2 votes

# Answer
Simple answer is: It was a login block and not a login that mysteriously was created by the profile.

If one uses a different theme for the civicrm section of their website and finding ~rogue~ blocks ... remember that its a civicrm theme and not the default website theme. Simple fix and easily overlooked. Kudos for KarinG!
> 0 votes

---
Tags: civimember, profile
---


# Question
Title: Search builder participants - relative start dates and event types
I'm trying to setup a search that finds participants for:

* a specified event type,
* with events that have started within a variety of time periods relative to today: I need to be able to find events that have started within the last 3 months, 6 months, 9 months, 12, 15 months... etc. I have a fairly wide variety of time periods I need to search.

This will be used to grant access to course materials relevant to various stages through a 3 year course.

But in search builder, I do not see an opportunity to search event types, nor to search date fields based on relative dates.

Are these two features possible in any of the search facilities?

Thanks!

# Answer
> 1 votes
I think a patch for this is now being pushed to core for 4.6 and 4.7. Thanks to the Fuzion team!

# Answer
> 1 votes
You don't say what version of CiviCRM you're using, but I can do this using the Advanced Search function. Using this search I can filter by event types and use relative dates for the event start date. It's under the event panel when you're adding in your filters. This will give you a list of unique contacts that meet the criteria.

If you want to see all registrations (including each registration for people on more than one course) you can use the Find Participants search in the events menu.

Or you can also use the "display results as" feature in the advanced search if you want to build up your search with other non-event data. So you can filter on all criteria in the advanced search and then "display results as" participants to see the unique registrations.

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


# Question
Title: Error 500 on Print/Merge Document page when doing Thank-Yous
I'm getting an Error 500 result when trying to produce Thank You letters for contributions since upgrading to 4.7.10 (and Drupal 7.50). Other Print/Merge operations are functioning normally. Backtrace and debug do not produce any additional information. The error comes ~1 second after clicking "Make Thank-You Letters"--seeming as though it's not even processing the information.

I've eliminated the following variables as the cause: Number of records, which records are selected, document type, thank you document body, page format, grouping.

I read that Error 500 is often a permission error. Everything seems correct, but I'm no expert in that realm. Tried the sandbox demo and it's not a bug there.

# Answer
> 2 votes
Thanks to KarinG for giving me the right way to attack this question.

The CiviCRM log had no record of the error. However, the error\_log did. It read:

`[01-Sep-2016 10:17:39 America/Denver] PHP Fatal error: Cannot use object of type CRM_Contribute_Form_Task_PDFLetter as array in /home/mydomain/public_html/mysubdomain/sites/all/modules/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php on line 267`

Googling that error led me to https://issues.civicrm.org/jira/browse/CRM-19182 which is reporting the problem as a bug in 4.7.10 that will be resolved in version 4.7.11. If, like me, you can't wait. Look at the commits linked from that page, or like KarinG said you can get the release candidate.

# Answer
> 2 votes
General recipe for Errors like that is to find a clue as to what's going on in the log files: first two places to check:

* check the CiviCRM log in /files/civicrm/ConfigAndLog/
* check your php and/or php-fpm error log (location of that depends on your install one possible option is: /var/log/httpd/

---
Tags: contributions, error
---


title: Case Type page blank

text:
# Question
Title: Case Type page blank
This is super strange. We've tried the latest CiviCRM 4.7.10 clean installed on BOTH the latest Wordpress AND Drupal 7.50 and in both installations, going to Administer \> CiviCase \> Case Types results in a BLANK page titled simply "CiviCRM" (not "Case Types" as you'd expect) with the surrounding CiviCRM blocks, header and menu. This Case Types page seems to be the only one affected.

The issue produces no network or console errors in either Chrome dev tools or Firebug. Turning on all the debug & backtrace options of CiviCRM and Drupal devel also results in zero reported errors, but the Case Types page refuses to work. I've also tried disabling all browser extensions in case one was injecting HTML and screwing things up.

I've found a few reports of something like this but none were relevant or provided solutions that worked in my particular cases.

AJAX problem in CiviCase - Administer Case Types

EDIT: When I install exactly the same codebase on my local dev environment then the Civi Case Type page works as expected, so it's possibly an incompatibility with the remote server software but still very strange that I'm not seeing any error messages anywhere.

EDIT 2: PHP and MySQL are newer on the remote server than on my local. Also, the only difference I can see in the installations between my local and the remote server are that in my local I used a single database for both civi and drupal, whereas on the remote I used separate databases. But I'm not sure how that would make any difference.

EDIT 3: Compared network activity between non-working remote and working local and discovered this difference - the remote server is responding with 302 instead of 200 for the query rest?entity=CaseType& ...:

# Answer
Seems like apache mod\_security was the culprit. I deactivated it temporarilly and CiviCRM Case Types page works just fine. Now I need to find out exactly what rules are causing the issue.

EDIT: In my case I added the IDs for REQUEST-42-APPLICATION-ATTACK-SQLI to the ModSecurity whitelist and the issue disappeared. I realise this is probably not ideal - it would be better to write an exception rule just for civi queries, but that's beyond my current knowledge.

I think the CiviCRM dev or docs team needs to look into this as likely more people will have this type of server configuration by default.
> 1 votes

---
Tags: civicase
---


# Question
Title: How to change the default license selection in `civix generate:module`?
By default `civix generate:module` will create an extension licensed with AGPL-3.0. How would one go about changing that default to something else, say, GPL-3.0?

**Edit:** I'm aware of the --license argument, but to clarify, I'm looking to change the default license permanently, so that I would have e.g. GPL-3.0 on all future invocations of `civix generate:module`, without additional arguments.

# Answer
> 1 votes
I believe you can use any of the licenses in https://github.com/totten/license-data/blob/master/index.csv, which is used by civix.

In your case, just add `--license=GPL-3.0` to the command.

It looks like you may be able to set a value in `~/.civix/civix.ini` to provide a local default: https://github.com/totten/civix/blob/v16.03.2/src/CRM/CivixBundle/Command/InitCommand.php#L118

---
Tags: civix
---


# Question
Title: Quick explanation of 'hidden smart groups' and why they're included in my mailing uninvited?
I haven't been able to find information on these hidden smart groups anywhere using google or this forum. Perhaps because they are hidden on purpose?

I'm wondering what these groups are, and why, when I schedule a mass mailing using civiMail targeting search results rather than a group with an unsubscribe group, the last step says something like:

"Include: Search Results (####)

**Include: Hidden Smart Group (84)**

Exclude: A group I need to exclude (###)"

Are those 84 people in my initial search? I'm hoping that we are not emailing folks that have not subscribed to this mailing list.

84 does not match the number of people in the unsubscribe group we are using.

Thanks for any explanation available!

# Answer
> 3 votes
The search needs to persist through your whole mailing process, so it gets treated as a "hidden smart group". It's silly of CiviCRM not to explain better, but that's the deal. No mystery hidden people getting added without your knowledge.

---
Tags: civimail, smartgroups
---


# Question
Title: CIVI EVENTS - Copy and Copy and COPIES of an event - Anyone experiencing the same issue?
Copy of BPI Heat Tech Written Test 50 Questions (ID: 6187) East Syracuse New York BPI Heat Tech Written Test No Jun 09, 2014 9:02 AM
Copy of Copy of BPI Heat Tech Written Test 50 Questions (ID: 6188) East Syracuse New York BPI Heat Tech Written Test No Jun 09, 2014 9:02 AM
Copy of Copy of BPI Heat Tech Written Test 50 Questions (ID: 6189) East Syracuse New York BPI Heat Tech Written Test No Jun 09, 2014 9:02 AM
Copy of Copy of BPI Heat Tech Written Test 50 Questions (ID: 6190) East Syracuse New York BPI Heat Tech Written Test No Jun 09, 2014 9:02 AM

There is no ryhme or reason to when it will happen but we have been experiencing this issue for over a year now. We are up to over 1000 "copy" events in our system with no end in site. ID numbers are normally not in a row as there are above but scattered.

I was given the follwing response on here, which did no good, I could not find the BAO event copy as described and I also inactivated the repeat event tab.

**TECH RESPONSE** It doesn't feels like a CiviCRM Core problem to me but I don't know what else it could be either.

The "Copy of" seems to indicate that it use the CRM\_Event\_BAO\_Event::copy as if used by the Copy action in manage event page.

You may check for any custom code that could contains CRM\_Event\_BAO\_Event::copy or something like that.

You could also try to disable CiviCRM extensions or Joomla extensions one by one and see if it keeps happening

We are using: CiviCRM 4.6.15. Joomla 3.6.2

# Answer
> 1 votes
Have you confirmed that these copies exist at a db level? I.e. Are they just showing the same event multiple times? Look at the urls and see if they have different ids to confirm this.

---
Tags: civievent
---


# Question
Title: Question about duplicate matching rule for event registrations
what happens when you select "individualsupervised-supervised" for duplicate matching rule? i have only selected unsupervised rule in the past, and it has caused problems because once the second child of the same parent with the same address is entered, the first child's name is on the registration again. I want to know how to make sure if the same person registers multiple people, both or more names show up on the registration list.

# Answer
> 2 votes
Even though many children/youth these days have their own email address - parents will often use their own for registration/event purposes - b/c they aniticipate (correctly so) that's where receipts/reminders will go.

For such registrations you need to use/create a rule like first name + email address \[as last name is often also the same within a household\].

I prefer Drupal - webform-civicrm for this as it allows me to set up one specific matching rule for the Primary Contact \[default unsupervised\] - and then I can set up different matching rules for the other (children) Contacts on the form.

See https://civicrm.org/blog/sarahgladstone/recipe-for-handling-youth-registration-with-civicrm for a nice write up/example by Sarah on how this works.

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


title: can't add profile to an event

text:
# Question
Title: can't add profile to an event
I have three environments that I can work in.

1. Production - the live site, currently 4.7.9
2. Development - a development site, currently 4.7.7
3. Staging - a sandbox, currently 4.7.9

I create an event in Production, go to the Online Registration tab. The "Include Profile (top of page)" label is there but the field is missing. The "Include Profile (bottom of page)" field is there as a text field (not a dropdown list). I can type in either the name of the profile or the profile ID, but the profile doesn't appear on the site web page, only the three default event fields (first name, last name and e-mail). The behavior on the Development site is the same.

When I create the same event/profile on the Staging (sandbox) site, the the "Include Profile" fields generates a dropdown list of current profiles and the profile fields correctly appear on the site web page.

Any ideas on what's going on?

Thanks!

Adam

# Answer
> 1 votes
This most often indicates a Javascript error - and in particular, this suggests a collision of Backbone.js with your CMS. I suspect this question is actually a duplicate of mine here: Backbone isn't loading on Civi 4.6.11/WP 4.4.1

I should perhaps edit that question, since this appears to be a common issue with certain WordPress themes that have a media loader.

---
Tags: civievent, profile
---


# Question
Title: Issues using 'Related Permissions Module' with v4.6 of CiviCRM. Will there be an upgrade soon?
We are using CiviCRM Webforms to allow parents to sign-up their events for there children. I am restricting access to related contacts using groups but would like to enforce permissions using 'Related Permissions Module', however this does not seem compatible with v4.6. Will there be an upgrade soon

# Answer
Good question!

It adds fields to the relationship\_type form - & the methodology for that broke in 4.5 I believe. So, I believe that if you install the github version Related permissions on 4.6 the relationship type form is likely to, at the very least, need testing. The added fields are the ones that force particular relationship types to always be permissioned. I think the earlier version doesn't offer that functionality & also doesn't require the entity\_settings module. If you auto-installed you probably have that earlier version.

The way the fields are added to the form is by declaring it to the entity\_setting module - which added them via extra.tpl - but they were winding up outside the form - so the alterContent hook was moving them around in the DOM to an appropriate place. Wasn't much fun & is now broken - but not sure a good way to inject fields into settings forms without doing a tpl override
> 5 votes

# Answer
Although the extension is still listed as v1.2, there have been recent updates to the codebase which have helped us with a conflict with CiviMail in 4.7.10.

Once installed, the info lists compatibility with 4.7 even though the extensions page on civicrm.org only lists up to 4.4.
> 2 votes

---
Tags: webform-civicrm, acl
---


# Question
Title: How do we tie groups or memberships to a product and be able to mail with it?
We are new to CiviCRM and have consulted both this forum and the book + videos. Still at a loss for a solution.

We have multiple publications with different people titles associated with it. (e.g. Publication A + Editor, Author, Reviewer, etc.). The titles can also be connected in another way (e.g. Editor + Publication A, Publication B, Publication C).

We attempted to set up smart groups with the Title + Publication (A,B,C) but then when we wanted to create a second smart group with Title2 + Publication (C,B,A) and have it connect to a mailing list, it said "error- that group already exists."

Q - How do we achieve the need of having to connect these titles and publications using groups or memberships?

Q - Can memberships be a smart group?

Q - Do we make Publications as a group, and Titles as a membership? Or use fields for one or the other?

Thanks in advance.

# Answer
One approach to this would be to use Relationships. Make a Relationship Type of "Editor of / Editor is" that will connect Individuals with Organisation sub-type "Magazine".

Use that relationship to connect John as the Editor of the Jungle Journal. And similarly to connect Bob as Editor of the Birds Books.

Then you can make a Smart Group of all Individuals that are 'Editor of'.

Then repeat for the other Relationship Types, ie make one for 'Author of' and another one for 'Reviewer of'
> 0 votes

---
Tags: civimail, civimember, smartgroups
---


title: Is Parent Group required on multisites?

text:
# Question
Title: Is Parent Group required on multisites?
When I edit a group, it will not allow me to save unless I select a Parent group. Is Parent Group required? If a Parent Group was accidentally assigned, how do you remove it without assigning a new Parent?

CiviCRM 4.7.9 and WP

This image shows an example of a Group that does not have a Parent Group. When I edit the Group the settings, the Parent pull-down list is automatically populated with a group called "Not Used (Smart Group)". It is not possible to deselect or select "none". Also, there is an asterisk next to the parent group indicating that it is required.

The second image shows a Group that has a Parent, and I would like to remove this relationship. But it is not possible. When I try to remove the Parent and save I receive an error message that Parent Group is required.

# Answer
It appears that you're using CiviCRM in a multisite configuration. You may want to update this question and future questions to reflect that. Relatively few folks use it, and it affects the answer to this question.

There is also a \[multisite extension\]\[1 that can be used to control further permissions with regards to this.

In short - you don't normally need a parent group, but with multisite, you do. There's details on why here.
> 5 votes

# Answer
interestingly we hit this issue recently too. Not because we were actually using multisite, but because we had 'enabled' it so that we had the 'Associated Organisation' field available to us to help connect individuals to groups (ie show the User which were 'their groups' based on their relationship to an Organisation, and that Organisations 'association' with a Group.

I believe this is the relevant PR https://issues.civicrm.org/jira/browse/CRM-19122
> 0 votes

---
Tags: groups, multisite
---


title: multiple organizations?

text:
# Question
Title: multiple organizations?
we downloaded and installed civicrm a few years ago, and have a recollection of being able to manage multiple organizations through one installation... is that still "a thing"? We are envisioning creating a central arts database in our community and collaborating more closely on fundraising among all the arts organizations who would like to participate.

we would, of course, want to be able to keep the contacts (and donations) for each organization separated, and track which org referred which donor to who...

please advise if i am completely delusional :)

# Answer
A lighter-weight solution to this (imo) is to use the Permissioned Relationship approach, which can be used to limit User A - who has a Permissioned Relationship to Organisation A - to only access Contacts that Org A has a permissioned relationship over.

This deploys very well without the wiring involved in multisite (imo) and hence is more approachable for 'beginners' (and for advanced folk who need a lighter weight solution.

Beauty of this solution is that it can scale really easily afaik. And for Drupal sites, together with Webforms and Views and whatnots can let delegates of Orgs manage their contacts without actually ever needing to set foot on the civi side.
> 2 votes

# Answer
Totally making sense! One way to keep different sub/organizations in your civicrm is via Membership type - each Organization can have its on Memberhsip types - even if you make that a free one - you will have a way to connect Individuals to sub/Organizations; for example: you can pull reports that select Individuals with a specific Membership to an organization and show what monies they contributed year to date;
> 1 votes

# Answer
KarinG's answer is good, but I *think* that implicit in your question is that you want to give all the arts organizations access to CiviCRM - but enforcing separation of their contacts/donors.

If that's the case, what you want is to use the "multisite" functionality. This is designed for pretty much exactly this use case, and I have two clients who use it in exactly this way.

Multisite is very much a thing, and has even been getting some great improvements recently, with more coming from the folks at Cividesk soon! That said, multisite isn't a task for a CiviCRM beginner!
> 1 votes

---
Tags: contacts, multisite
---


# Question
Title: Automatic discount for membership not working
Using D7/CiviCRM 4.6.10 and Cividiscount 3.1

I've set up a discount code to enable current members to renew their membership at 50% of the standard membership fee. If i make the code non-automatic and enter it manually it works.

Setting the automatic discount options for the code for the membership type and 'any current status' should ensure that if the user has the membership type and their status is one of the those considered current (i.e. New, Current, Grace) then they automatically get the discount, but I'm seeing nothing applied on the contribution page.

The contribution page recognises the user as a current member, as it is displaying a message to tell the user when their current membership is due to expire, but it is not applying the discount, and nor it it displaying the "not eligible" message.

Is this a known issue, or am I missing something subtle in the configuration?

# Answer
Further research shows that this is indeed a known issue for this version of CiviCRM: https://issues.civicrm.org/jira/browse/CRM-17388 states that it has been fixed for version 4.7. That version is only in beta at the time of writing, so not of help on a production site. I wonder if this fix will be rolled into 4.6.x given that 4.6 is the new LTS (long term support) version?
> 0 votes

# Answer
Graham, I found the fix here https://issues.civicrm.org/jira/browse/CRM-17388

We had exactly the same issue but really thankful it is resolved with the patch

Jon-man
> 1 votes

# Answer
Have you applied the changes to cividiscount.php as outlined from these issues?

https://github.com/dlobo/org.civicrm.module.cividiscount/pull/120
> 0 votes

---
Tags: civimember, cividiscount
---


# Question
Title: Can i retrieve an event that i have deleted?
I have deleted an event and would like to retrieve it back. Is it possible to retrieve it? Please advise how to do it. tks

# Answer
> 3 votes
Do you have a (recent) backup of your site? That's what you'd need to restore.

---
Tags: civievent
---


# Question
Title: How to count event attendees with price sets and multiple bookings?
I am using price sets with events. In all the reports it has 'Fee Level' and it looks like this

Two Day Passes - 2,

I can count the number of people who registered, but not the number of passes sold except via, filter on 'Fee Level' and 'sed and awk'.

```
awk -F',' '{print $6 }' Report_20160905-720.csv | sed 's/"//g' | awk -F ' - ' '{sum+=$2} END {print sum}'

```

The fees section of the event is setup with price sets and field type 'number' which is the count. If I purchase 2x $30 passes the form calculates the amount. The reports however, have Two Day Passes - 2 and I can't see how to add up the actual number of passes bought, just the number of registrations.

Thanks

# Answer
> 1 votes
Install Eileen's: https://civicrm.org/extensions/extended-reports

That will allow you to Filter for participants who have the 'Two Day Passes - 2' option.

---
Tags: civievent, civireport
---


# Question
Title: How to search for contacts without a specific relation?
I'm trying to figure out how to search for contacts (individuals) that do not have a "Current Employeer" relation.

Is that possible?

# Answer
The search builder should be able to give you this as it has a larger range of search operators available to you.

Head to **Search \> Search builder** and then use the criteria:

**Contacts \> Current Employer ID \> Is Null**

That should return everyone who has no value for your current employer field.

Hope that helps!
> 2 votes

---
Tags: search, relationships, custom-search, search-builder
---


# Question
Title: Logged in user information doesn't populate profile fields
Perhaps there's an easy way out of this - so I'll keep the details down (for now).

1. A new user signs in to Wordpress and
2. CiviCRM reliably adds this user's email to the contacts.
3. The user gets redirected to a page with a CiviCRM profile on it to get more information on the user.

-\> The information entered does not populate the new CiviCRM contact, but adds a new one OR if one enters the user's email address it signals that there's a duplicate entry.

Now the documentation says:

> For websites that have logged-in users, you may want to allow people to provide additional information as they register for an account on your website. Similarly, when people fill out a profile form you may want to encourage (or force) them to sign up for a user account.

Latter works (in a different use case); but it's the former option that fails - no matter what I try to tweek in the settings.

Cheers

Stefan

# Answer
I'd added the CiviCRM profile via the button to add short code - and skipped over the obvious:

Click "Edit" instead of "Create".

I didn't find the mistake until I read over short code I'd inserted, which read:

```
[civicrm component="profile" gid="18" mode="create" hijack="0"]

```

and should have:

```
[civicrm component="profile" gid="18" mode="edit" hijack="0"]

```

Cheeers
> 1 votes

---
Tags: wordpress, contacts, profile
---


title: Events Payment - quirky scenario

text:
# Question
Title: Events Payment - quirky scenario
Can anyone assist with the following scenario please...

Our organisation conducts training events, the fees for which are calculated at a fixed price per trainer - not by the number of students that attend. So regardless of whether or not 10 or 25 students attend, the fee is the same, which is actually not paid by the students themselves but rather a 3rd party organisation after the event is completed.

It may be worth noting that we are using CiviCRM as more of a historical database as opposed to a online registration/payment system, and generally all data (contacts and event) will be entered manually after an event takes place.

As I am typing this I am thinking that perhaps a manual (gulp!) workaround is to just divide the event fee by the actual number of students that attended the event and set this as the event amount when the data entry is taking place....?

So I'm not sure how best to configure an event to allow for $0 to be paid by the student, but I'd like to see a $ value for the overall event a summary report somehow.

Make sense? Is this possible to do?

Thanks, Joe.

# Answer
Check out what you can achieve by using the Batch Update by Profile process.

Create a Profile that has the Fee Amount field for Participants.

Go to Find Participants. Search for those that attended your event. Under Actions click on Batch Update by Profile.

You should then be able to enter the required amount for the top row, and use the 'photocopy' icon above the Fee Amount column to apply that to all Participants.

If you want to record the 'total cost' of the event you could also look at adding a Custom Field on to Events and use that to record the total cost of the event.
> 1 votes

# Answer
To My understanding -

Yes you can create an Event with Zero amount -

Create an Event First - In the Fees section - select Paid Event - Yes

Only select Enable Pay Later option?

In the Regulat Fees set the Fee Label and Amount as 0.00 as default

this will allow you to create a fee amount of Zero

Also you have an option of selecting Multiple participants upto 10 but still you will find only one contribution against the first contact

Also for the report - Go to Event Participants List and select all the participant based on the event

you can list all the members registered for this event which you can export to CSV

I guess this helps !!!
> 0 votes

---
Tags: civievent, paylater
---


title: Send Email to Assigned In an Activity

text:
# Question
Title: Send Email to Assigned In an Activity
I am creating an activity and assigning it, but would like that to be emailed to the assignee. Is there a way automatically email the person that is assigned on an activity?

# Answer
There is a setting at Administer/Customize Data and Screens/Display Preferences, a tick box with the description Notify Activity Assignees. Ticking that will send a mail to the assignee.
> 1 votes

---
Tags: activities
---