# Question
Title: Option to add new contact freezes up - won't work
Can anyone help? I just upgraded CiviCRM and have been having problems since. I cleared cache and cookies and that helped with a bit but now we have issues with clicking on **Creating a new contact** -- I'm unable to open address details or anything beyond contact details. The page freezes up when I try. I contacted our hosting (CiviHosting) but they haven't been helpful.

Here's what they said:

> Yes, I see it now. The issue is a JavaScript error: uncaught exception: Missing number at position 0 which appears to be a problem with the jQuery date picker, but I am not actually familiar with this issue and I haven't seen it before. My guess is that there is an issue with one of your WordPress plugins or your theme. The first step to test would be to disable the plugins and change the theme. CiviCRM itself is known to work, so the issue is something else. Thank you.
>
> Ref-Mid: $JmoAAA==$405212bbaf@2b6a613d19 9:17 AM

Basically I'm not able to edit details on a contact when creating a new one, CiviCRM freezes up. We don't have any plug-ins or javascript installed. My WordPress version is 4.5.3. Thank you for your time!

# Answer
I had the same error in my console when trying to edit a participant report on an older civi install and discovered this helpful post: https://forum.civicrm.org/index.php?topic=20598.0

It doesn't sound like you've got exactly the same issue, but it's an interesting clue - i.e. in my case, some db data was generating a page that had js issues, it was not a conflict problem. Of course, it might also be a red herring.

Regardless, you'll want to turn off any js aggregation and use your js debugger to dig down and figure out who's version of the datepicker is giving problems, and where the problematic data is coming from. Sometimes just looking at the arguments being passed might be a clue. My best guess is that the datepicker is gagging on some invalid date that got mangled on Civi upgrade.
> 1 votes

---
Tags: contacts, profile, upgrade
---


title: A Smart Group of Contacts

text:
# Question
Title: A Smart Group of Contacts
We made around 100 contacts at a recent conference. How can I set up a smart group of these contacts that are not currently in our database?

# Answer
> 3 votes
I would assign a tag to the contact when you import them, then do a search for that tag and create the smart group from the search results.

---
Tags: contacts, smartgroups
---


# Question
Title: Membership Receipts from Civi webform for On Behalf of Organisation
(Civi 4.4.6, Civi Webform 7.x.4-10, Drupal 7.37)

From what I read on the Civi webform wiki (https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration), receipts should be generated from the attached contribution page just as they would from the contribution page itself. Is this not correct? What is happening with our client's is that none of the usual info about the organization for whom the user is joining/renewing is included in the email, so when the organization gets the copy of the receipt, there's nothing to identify who it was (other than, of course, the email address). Is there some trick to passing all the necessary information over?

Here is the image (identifying info awkwardly scribbled out - graphic artist, I am not):

# Answer
In that case you need to manually add tokens to the receipt - message template - so you can provide more information to the receipt -

Creating new tokens - https://wiki.civicrm.org/confluence/display/CRMDOC/Tokens

if you need to add some contact tokens then refer to the below - Can I put custom field tokens into a message template?

I guess this helps !!!
> 1 votes

---
Tags: civicontribute, webform-civicrm
---


title: STARTTLS failed in version 4.7

text:
# Question
Title: STARTTLS failed in version 4.7
CiviMail throws the error `Mailing_send_test : STARTTLS failed` when doing a test email. Sending results in bounces. I have a handful of CiviCRM installations running on the same server and only 4.7 installs seem affected.

Version 4.6.9 no error. Version 4.7.3+ error as described.

Does anyone know what would have caused this?

(I did recently add mysqli per the recent blog post, and I went from PHP 5.5.38 to 5.6.24 in the process. But perhaps that's unrelated.)

Edit: I use CiviSMTP.

# Answer
> 1 votes
This sounds like it's the same problem described here.

While the solutions there suggest hacks to the code, most likely you're either a) connecting to a mail server that has a self-signed certificate, or b) your CiviCRM is installed on a server with an outdated list of CAs. Fixing the root problem is preferable. Let's Encrypt issues free SSL certificates in case your problem is the former one.

---
Tags: civimail, 4.7
---


# Question
Title: Upgraded to 4.6 Civicrm javascript errors Error can't send email or press some buttons
Error: b.indexOf is not a function b@https://www.websiteremoved.com/administrator/components/com\_civicrm/civicrm/bower\_components/select2/select2.min.js

I can't add receipients or get past step one of generating a draft, firebug reveals a constant error of:

: b.indexOf is not a function b@https://www.websiteremoved.com/administrator/components/com\_civicrm/civicrm/bower\_components/select2/select2.min.js

It is literally this article from the old forums but I cannot seeem to find any solutions at all Please help! Its Christmas!!!

forum.civicrm.org/index.php?topic=36343.0

# Answer
> 0 votes
The answer is the new Civicrm introduced a new pretty template with lots of popups and other cool web features, turn it off and return to the classic gui interface and it works fine.

# Answer
> 3 votes
issues.civicrm.org is down right now - but I see this issue: CRM-12570 "Javascript error when mootools is loaded in Joomla backend". I'll also note that everyone reporting this problem is using Joomla. So my guess is that there's a Joomla plugin that's causing a jQuery conflict or similar.

To troubleshoot this, I would:

* Disable all your other Joomla plugins. I hope you're doing your upgrade on a dev server before doing it on a live server! If disabling all of them solves the problem, start turning them back on until you can identify which one has the conflict.
* Check your Net tab in your browser's developer tools when loading a page on your site vs. on the demo Joomla site. Are there any errors, or unusual JavaScript files on your live site compared to the demo? If so, identify their source.

# Answer
> -1 votes
I'm having this issue as well, but I'm on a Drupal site. I don't have anything extra installed, just the core of drupal and a very basic Civicrm. No extenstions, no plugins. In drupal, there's only one other mod an that's webforms. Everything is updated.

I can't seem to fix this!

---
Tags: civimail, joomla, javascript
---


# Question
Title: Custom Field doesn't show up in Advanced Search
I created a custom data set called Volunteer Fields with one field. The name of the field is "Volunteer?". It's a Yes/No radio button and it's marked as Searchable. The documentation says:

Is this Field Searchable? Makes the field appear in a panel of custom fields in CiviCRM's Advanced Search page.

**I can't see it in Advanced Search**. I can see and edit the field on the View Contact screen. I can search on the Volunteer? field using Search Builder, but there's no panel for custom fields in Advanced Search. I can't find the field anywhere in Advanced Search. Please Help...thanks!!

# Answer
Navigate to **Administer - Customize data and screens - Display preferences** and select the **Custom field** section listed under **Contact search**. After that you should see the Custom field accordion in the Advanced search
> 5 votes

# Answer
Ah - yes - it's easily overlooked: In Search -\> Advanced Search -\> click the Custom Fields fieldset to see your Custom data sets. I just created a Custom data set: Date SE with a MyDate field in it for another SE question -\> I made it searchable - and here it is \[and this is 4.7.7\]:
> 4 votes

# Answer
In response to Moopet's comment above.

I had an issue today where a Custom Data field set I'd created previously (activity Data) was not showing in advanced search, neither did it show in Find Activities, but it was avilable for reports and in Search Builder. (All fields in the set were marked as searchable).

I realised that the fields were linked to some activity types that had been disabled recently.

I re-enabled the activity types, then in the Data Set settings dis-associated the Data set from the activity types, and then disabled the activity types again.

The Field set now shows in Advanced Search as expected.
> 0 votes

---
Tags: search
---


title: CiviMail Social Media Media Integration

text:
# Question
Title: CiviMail Social Media Media Integration
I'd like to know if there is anything newer than this August, 2013 post regarding how to include social media "share this email" links in CiviMail.

Thanks.

# Answer
> 1 votes
Okay, I'll bite, I've got a client with the same request and I'll bet lots of people would use it if it was there.

The post you reference has some code for how to create a token that can be used in manually building some html to include in your email, which in theory is all your really need.

What would be nice is: 1. A series of tokens for each of the different social media share options to simplify the civimail editor's job. 2. A test by those tokens that would hide the share links on emails that aren't configured for public archiving.

Sounds like a simple extension. Or what was your experience?

As an aside, here's what a CiviCRM competitor is offering: https://blog.aweber.com/email-marketing/social-share-buttons-in-your-emails.htm

---
Tags: civimail, social-media
---


# Question
Title: settings_location.php - is there an example
I'm trying to browse images in wysiwyg editor (via the kcfinder) (for example Event description) but I get an error due to misconf. I hits the file civicrm/civicrm/civicrm.config.php which loads civicrm/settings\_location.php (which you have to create) but I'm missing something inside this file, Is there an example of it?

# Answer
> 1 votes
The `settings_location.php` file should not normally be required, but an example is described at:

https://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=83034188

The file `civicrm.config.php` should be able to handle bootstrap in most common configurations without `settings_location.php`. However, this depends on having somewhat plain/predictable directory structure, and it could break down when using things like (a) symlinks, (b) special filesystems, or (c) multi-tenant/multi-site installations.

---
Tags: wordpress, wysiwyg, kcfinder
---


# Question
Title: How can I edit the name provided in the billing block for an event registration?
In CiviCRM 4.6.18 I have enabled the billing block for pay later registrations for an event. I've noticed that a users are registering and using the billing block, and entering their names incorrectly (most commonly entering a name all in lower case).

I can subsequently edit the contact record to correct the capitalisation (or other issue) with the contact's name, but the name in the billing address does not reflect these edits, and neither can I find any way to edit this billing name through the UI - editing the billing address does not provide access to the name fields.

Am I missing something here?

This billing block seems to highly inflexible. Perhaps its better to not use it at all, and have a second profile instead that I can better control.

# Answer
> 2 votes
Graham,

You will have the issue with first and last name no matter where users enter the information. The name is entered as the contact name and the billing fields are just pulling the data for the billing address. I would like at the Civi Normalize Extension (https://civicrm.org/extensions/normalise-data-entered-firstname-last-name) to help you with this.

Thanks, Steve

# Answer
> 1 votes
Graham, just found out that editing billing address information is possible as with any other address information as of 4.7.9 (possibly earlier). Yay!

---
Tags: civicontribute, billingblock
---


# Question
Title: INSTALLER fails. Database can't "SELECT GET_LOCK" at civicrm/install/index.php(271)
After complete wipe and install new MYSQL 5.7.9 can't get fresh civi drupal up and running but existing drupal sites work fine. So I'd like to know if others can install on this combination or if a db downgrade is in order. Or something else? help!

My configuration:

OS X 10.11.1, MySQL 5.7.9, PHP 5.5.21, Drupal 7.41, CiviCRM 4.6.10

At first I was trying to migrate a site from live to local, many fails. So I stripped it down to the following steps...

1. mysql drop database name
2. mysql create database name
3. untar drupal as ~/Sites/drupal
4. localhost/drupal/install.php (Standard)
5. untar civicrm in ~/Sites/drupal/sites/all/modules
6. admin/config/development/maintenance set drupal maintenance mode
7. chmod u+w sites/default
8. sites/all/modules/civicrm/install/index.php

**Install gives error below and subsequently module is enabled in drupal but all civicrm urls give a shorter version of the same error:**

```
Error

The website encountered an unexpected error. Please try again later.
Error message

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 692 of /Users/rota/Sites/drupal/includes/bootstrap.inc).
CiviCRM_API3_Exception: DB Error: unknown error in civicrm_api3() (line 45 of /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php).
Status message

CiviCRM theme configuration setting is available under Administer > Appearance > Administration theme
```

**Backtrace**

```
North-Fork:ConfigAndLog rota$ cat Civicrm.cde18d9d66ead3de8f5c02e6d89d7355.log.201512010951
Nov 30 20:53:18  [info] $backTrace = #0 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#4 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#5 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", "DB_Error", TRUE)
#6 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "3057 ** Incorrect user-level lock name 'pincsf.1.cache.CiviCRM setting Specs_...")
#7 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#9 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#10 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#11 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
#12 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1234): CRM_Core_DAO->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", TRUE)
#13 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Lock.php(151): CRM_Core_DAO::singleValueQuery("SELECT GET_LOCK( %1, %2 )", (Array:2))
#14 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/Core/Lock/LockManager.php(84): CRM_Core_Lock->acquire(NULL)
#15 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager->acquire("cache.CiviCRM setting Specs_settingsMetadata___name_resCacheCode._")
#16 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(715): CRM_Core_BAO_Cache::setItem((Array:1), "CiviCRM setting Specs", "settingsMetadata___name_resCacheCode", NULL)
#17 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/v3/Setting.php(66): CRM_Core_BAO_Setting::getSettingSpecification(NULL, (Array:1), NULL, NULL)
#18 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_setting_getfields((Array:2))
#19 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#20 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("setting", "getfields", (Array:2), NULL)
#21 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(43): civicrm_api("setting", "getfields", (Array:2))
#22 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(591): civicrm_api3("setting", "getfields", (Array:2))
#23 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(382): CRM_Core_BAO_Setting::validateSettingsInput((Array:1), (Array:0))
#24 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(558): CRM_Core_BAO_Setting::setItem("B8kFl", "CiviCRM Preferences", "resCacheCode")
#25 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(567): CRM_Core_Resources->setCacheCode("B8kFl")
#26 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(144): CRM_Core_Resources->resetCacheCode()
#27 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(122): CRM_Core_Resources->__construct(Object(CRM_Extension_Mapper), Object(CRM_Utils_Cache_SqlGroup), "resCacheCode")
#28 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(48): CRM_Core_Resources::singleton()
#29 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(223): civicrm_html_head()
#30 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(103): civicrm_initialize()
#31 [internal function](): civicrm_menu()
#32 /Users/rota/Sites/drupal/includes/menu.inc(2812): call_user_func("civicrm_menu")
#33 /Users/rota/Sites/drupal/includes/menu.inc(2775): menu_router_build()
#34 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(788): menu_rebuild()
#35 [internal function](): civicrm_enable()
#36 /Users/rota/Sites/drupal/includes/module.inc(905): call_user_func_array("civicrm_enable", (Array:0))
#37 /Users/rota/Sites/drupal/includes/module.inc(484): module_invoke("civicrm", "enable")
#38 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(1330): module_enable((Array:2))
#39 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(271): Installer->install((Array:5))
#40 {main}
```

# Answer
> 3 votes
Another solution is to upgrade at least to CiviCRM 4.6.16 or to CiviCRM 4.7.7 or you can also patch your installation.

If you are familair with patches you can also download a patch from the civi site. https://github.com/civicrm/civicrm-core/commit/3f7df5902facad68489e225b504a887c2b45eb91.diff and then apply that patch to your civicrm installation.

# Answer
> 4 votes
Here's a patch that seems to address the issue, although there could still be compatibility issues in the PEAR mysql and mysqli library versions used by CiviCRM.

This patch is for CiviCRM 4.7.4:

```
diff --git a/civicrm/CRM/Core/Lock.php b/civicrm/CRM/Core/Lock.php
index b594e0b..4643fc4 100644
--- a/civicrm/CRM/Core/Lock.php
+++ b/civicrm/CRM/Core/Lock.php
@@ -121,6 +121,9 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
     else {
       $this->_name = $database . '.' . $domainID . '.' . $name;
     }
+    if (strlen($this->_name) > 64) {
+      $this->_name = sha1( $this->_name );
+    }
     if (defined('CIVICRM_LOCK_DEBUG')) {
       CRM_Core_Error::debug_log_message('trying to construct lock for ' . $this->_name);
     }

```

# Answer
> 2 votes
Solution, don't upgrade to MySQL 5.7.x until this incompatibility is addressed:

> The MDL subsystem imposes a limit of 64 characters on lock names, so this limit now also applies to named locks. Previously, no length limit was enforced.

MySql 5.7 Reference Manual, 2.11.1.1 Changes Affecting Upgrades to MySQL 5.7

# Answer
> 0 votes
You should get a full error message if you turn on debugging go to

Administer menu \> System Settings \> Debugging and Error Handling, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save"

and then re-try

# Answer
> 0 votes
Check once after deleting the templates\_c folder (temporary).

../files/civicrm/templates\_c/

---
Tags: drupal, mysql, installation, 4.6.10
---


# Question
Title: Problem installing and removing CiviCRM on a Joomla 3.6.3 site
I'm trying to install CiviCRM 4.7.10 on a newly installed Joomla 3.6.2-site. I uploaded the code to a folder on the server, and did an "install from folder". However, this one failed (maybe faulty network connection). However, something was installed, and upon trying to reinstall, I get the following error message:

> Warning: require\_once(/home/agslo/public\_html/administrator/components/com\_civicrm/civicrm.settings.php): failed to open stream: No such file or directory in /home/agslo/public\_html/tmp/com\_civicrm/admin/configure.php on line 115
>
> Fatal error: require\_once(): Failed opening required '/home/agslo/public\_html/administrator/components/com\_civicrm/civicrm.settings.php' (include\_path='.:/usr/lib/php:/usr/local/lib/php') in /home/agslo/public\_html/tmp/com\_civicrm/admin/configure.php on line 115

According to the Module manager in Joomla, there is a CiviCRM component installed. However when I try to uninstall it, I get an error msg too, saying it cannot find Joomla XML setup file, and I am asked to manually remove it.

Anyone that can assist me in solving this so I can have CiviCRM installed? Either by first removing the component, or by doing a new install.....

Magnus

# Answer
> 1 votes
If the CiviCRM component does not install correctly

(for example you get a blank screen instead of the confirmation page),

delete the ~/components/com\_civicrm and

~/administrator/components/com\_civicrm and

~/media/civicrm directories manually

and then try each of the following before attempting to reinstall:

Please refer to the below link : this is for 4.5 but still this should work for 4.7 too

https://wiki.civicrm.org/confluence/display/CRMDOC/Joomla+Installation+Guide+for+CiviCRM+4.5

I guess this helps !!!

---
Tags: joomla, installation
---


# Question
Title: How do I connect a Drupal content type to CiviMail? CiviRules?
I'm still getting my head around CiviCRM, and also only have admin access (but not sftp) so if I need to get into the code I'll have to ask our external support team.

I want to be able to take the HTML from a certain type of content when posted on our Drupal 7 site (Media Release) and automatically send it to a CiviCRM Mailing List group.

CiviRules out of the box only allows CiviCRM events as triggers; is there a robust way to link it to Drupal events? Is it only possible through code rather than a UI option somewhere?

Addendum: I've started playing with com.pogstone.contenttokens to get drupal content across, but am not sure how to get the full version rather than a teaser.

# Answer
We built a solution that uses Drupal Views and a you can then use a token to deliver the content of that view in to a CiviMail. That may be useful to you or it may at least put your 'external support team' on to the job. There was a discussion on the old forum about this here
> 1 votes

# Answer
Not sure I fully understand you question. What is the reason for using Drupal events rather than CiviCRM events? I would imagine if you want to link Drupal events to CiviCRM you would need some coding.
> 0 votes

---
Tags: civimail, drupal, civirules
---


# Question
Title: Set up for a Scheduled Reminder using case activity
Using Civi 4.7.8 (about to go 4.7.10) I want to create a scheduled reminder such that when the status of a custom activity type (which I've called 'Decision') changes to 'Completed', the case coordinator gets an email notification. I'm just struggling a little with some of the settings and naming conventions being used, so I thought by posting a question here I could:

a) get some useful clarity, b) perhaps help make things clearer for others in a similar state of confusion, and c) maybe help move towards a more consistent naming/labelling regime for activity contacts.

(I'll also be happy to improve the documentation based on what I learn.)

So the first thing that got me confused is - that in my activity - the involved parties look to be:

1. the person who reported the activity, as in the name that appears against "Reported by:". I believe this is the same as the creator of the activity, or as the documentation also calls it, the "Activity Source". Creating a new activity elsewhere in Civi, e.g. selecting 'New Activity' from the Contacts menu this field is labelled as "Added by:", so there's yet another name option.
2. The client of the case. In my activity this contact is called the 'Client', probably because the activity type that I'm interested in is used within the context of a case. In the scenario where we are selecting "New activity" from the "Contacts" menu this field is labelled as "With Contact". By process of elimination I reckon this contact is what's called in the documentation the 'Activity Target/s'.
3. The third type of contact is the activity assignee/s, which unlike the others looks to be unambiguously named both in the UI and in the documentation.

So I think I know which contact is which: Reported by = Added by = Activity Source Client = With Contact = Activity Target Assigned to = Activity Assignee/s

In the reminder set-up I can specify my activity type and the status for that activity. I'm assuming here that these are essentially conditions for the reminder, i.e. a reminder can be be sent when an activity of the specified type and status exists.

Then I get confused again, because I now need to set a time, and for activities the options I have are to either set a specific date, or I can set a date/time relative to the "Activity Date Time". Assuming the "Activity Date Time" is the date and time set in the activity record, I can see that this date and time does not change if the activity gets edited (unless it is explicitly changed by editing the activity record).

Let's say I set the time for the reminder to be 1 hour after the Activity Date Time.

So, let's say a I create the activity, and it has a status when created that doesn't match the criteria for my reminder. Some time later, let's say two hours later, the activity is edited and the status is changed to match what my reminder is looking for, but the date and time of the activity are not edited. I now have a situation where my activity should trigger a reminder, and my target date/time is in the past.

Is it the case that because the criteria are met, and the target date/time is in the past, that the reminder will be sent? And is it the case that if I had instead set the time for the reminder to be three hours after the Activity Date Time, then the reminder would not be sent in this case because although the activity criteria are met, the time is in the future?

Is this how it works, or have I got it horribly wrong?

# Answer
I would use CiviRules for this? We have one client that uses CiviRUles to send a survey email once a case gets to a certain status.
> 1 votes

---
Tags: civicase, activities, scheduled-reminders
---


# Question
Title: Attachments not sending when emailing a contact in CiviCRM v. 4.7.10
When sending an email to a contact, the email sends OK, but without the attachment. I can see from here that this is a known bug in 4.7.10, and a simple fix has been provided, which will be implemented in 4.7.11. I made the fix in 4.7.10, but it doesn't work - emails still send without the attachments. Until 4.7.11 is released, does anyone know how to make 4.7.10 work? Thanks.

# Answer
> 1 votes
Please ignore what I wrote. The fix does work. I just fixed the wrong installation. What a dork. All sorted now.

---
Tags: contacts, email, attachments
---


# Question
Title: Is it a bug that Relative Dates are broken in Search and Smart Groups?
According to CiviCRM user guide article's *Searching* section **The Date Range Filter**:

> Relative date ranges are especially useful for searches that you would like to then save as Smart Groups (automatically populated groups that are configured to include contacts that share a certain set of characteristics or activities).

However, it seems that it is actually impossible to use them this way, because during search *relative dates* (e.g. Today) are transformed into *fixed dates* (e.g. August 18th).

**See:** How to use Smart Groups with relative dates? and smart group change log criteria

Is it a recent bug or has it been like this forever? Will there be a fix for that?

# Answer
> 2 votes
I think you may find that, although the search results show the relative dates converted to fixed dates, when you create a smart group from the results it will save the relative date range.

That is certainly what happens in my live v4.4.

I have also checked this as best I can on a 4.7.10 site that has had no activity or changes on it since February this year. I have a smart group based on a search that used the relative date filter **Previous month**. That group has no contacts now and if I go to **Edit smart group search criteria...** (via the Contacts link on the Manage Groups page) I see:

> No matches found for: ...AND Activity Date - greater than or equal to "01 July 2016 12:00 AM" AND less than or equal to "31 July 2016 11:59 PM" ...AND.

but when I click on **Edit smart group search criteria...** for the second time it shows me the actual search parameters which include:

> Activity date :**Previous Calendar month**

# Answer
> 1 votes
Let me clarify the sequence and point to some strange behavior.

## STEP 1. ADVANCED SEARCH

Open *Advanced search* and go straight to *Activities* (without changing anything else).

Choose Activity Type (=Phone Call), relative Activity Date (=**Today**), Activity Status (=**Unreachable**). Click *Search*.

## STEP 2. CREATE SMART GROUP

I see Activity Date has been replaced from relative **Yesterday** to fixed August 18th.

I create a Smart group by Selecting all records and choosing the Action **Group - create smart group**.

## STEP 3. SMART GROUP PARAMETERS

Not much here, but note that Activity Date here is also listed as fixed - August 18th (not **Yesterday**).

I click the *Save Smart Group* button.

## STEP 4. EDIT SMART GROUP.

That is where all the fun begins.

**First**, if I do nothing, the Smart Group stays fixed to the particular date and never gets updated to new values.

**Second**, if I try to Edit the Smart Group, it shows entirely different search parameters.

* Relative Activity date field is empty.
* There is a fixed date value in Activity date field.
* Activity status **Unreachable** has been changed to **Completed** and **Scheduled**.

## SUMMARY.

* The unexpected change of parameters in Edit mode has a very buggy feel.
* Relative date values are transformed to fixed which do not get updated.
    + Scheduled Job - Rebuild Smart Group Cache (no parameters) does not help.
* I can not test this on CiviCRM Sandbox, because database is being reset daily(?).
* @JoAnne reports the Relative dates work in Smart groups in v4.4

---
Tags: search, smartgroups, dates
---


# Question
Title: alter/remove specific popup notifications
What's the best way to alter or remove specific popup notification messages? I have a situation where the duplicate membership warning when creating a membership from the backend is not relevant for a client, and would like to suppress the warning so as not to confuse users or clutter the interface.

I've played with CRM\_Core\_Session::getStatus() but it doesn't appear to be aware of this notification (likely because it's triggered via the tpl file rather than PHP).

# Answer
You are in the right path, if you look at the `CRM_Core_Session` class you'll see the method getStatus which takes a boolean as a parameter, if `TRUE`then it will reset the status.

That said, I would create a extension or use an existing one and implement hook\_civicrm\_postProcess.

You'll need to know what is the class/form name of the form you are targeting, an easy way would be to inspect the source of the form/page from which you want to remove/replace the notification and search for `.tpl`

Example: `CRM/Contact/Form/Task/Email.tpl`, its class/form name would be `CRM_Contact_Form_Task_Email`

Then in your extension:

```
function myextension_civicrm_postProcess( $formName, &$form ) {
    if($formName == 'CRM_Contact_Form_Task_Email') {
        $session = CRM_Core_Session::singleton();
        // Reomve status message from form
        $session->getStatus( $reset = TRUE );
        // Set your new message
        $session::setStatus(ts('This is a custom message.'), ts('Custom Message'), 'success');
    }
}

```
> 1 votes

# Answer
I don't think Civi has a setting to turn OFF the notification

But If you still need to turn Off the message or need to change the content of the message then you need to look for these files

~\civicrm\templates\CRM\Member\Form\Membership.tpl

~\civicrm\templates\CRM\Member\Form\MembershipStandalone.js

you can override the files to your custom template folder and you can make changes or you can also disable the alert

I guess this helps !!!
> 0 votes

---
Tags: jquery
---


# Question
Title: How to raise a form error in \CRM_Core_Form::postProcess()
I have a class with a signature:

class CRM\_Contact\_Form\_Task\_FooPdf extends CRM\_Contact\_Form\_Task {

What generates a PDF. During the PDF generation, there might be an error. This task also uses the standard mail template:

```
public function buildQuickForm() {
  // Add message templates.
  CRM_Mailing_BAO_Mailing::commonCompose($this);
  CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Contact/Form/Task/EmailCommon.js', 0, 'html-header');
  $this->addDefaultButtons(ts('Continue'), 'done', 'cancel');
}

```

It works totally fine. It shows up among the actions on a search form, when I select it, the template UI shows up, and i have access to the data. The only issue is that during the PDF generation, sometimes I need to raise an error, which is not a fatal error, but something that the user must correct himself. At the PDF generation, i am in the \CRM\_Core\_Form::postProcess() phase. Can I set a form error and re-display the form with the submitted values?

Issuing this (and of course skip to stream the PDF) does not work, as I am redirected simply to the main admin page of CiviCRM, the form is not re-generated:

```
$this->setElementError('text_message', 'moo');

```

But I guess it's because i am already at the postprocessing.

# Answer
You are correct that `postProcess` runs too late. Consider the conventional request lifecycle for HTML\_QuickForm/CRM\_Core\_Form:

At the end of the `Validate` phase, it makes a major decision about whether to rerender the form with errors. However, the `postProcess` function is part of the `Process` phase which should only run on valid forms.

The conventional way to set a validation error in `HTML_QuickForm` is to register a validation function. For example, in `CRM_Group_Form_Edit::buildQuickForm()`, note how it calls `addFormRule(...)` (and how the `static function formRule()` conditionally returns an array of errors). This runs at the correct time.

For mitigations, you might consider:

* Add some checks in the validation phase to predict whether the error condition will arise. (Ex: If the issue is a missing dependency or inadequate RAM, then validate the dependency or RAM beforehand.)
* Report the error via `CRM_Core_Error::fatal()`, `throw new Exception()`, or `CRM_Core_Error::statusBounce()`.
* Don't rely on `HTML_QuickForm` as the main form processor. Implement client-side logic with Javascript and AJAX callbacks.
* (Evil but possibly working) Do the heavy lifting during the validate phase. (This will, e.g., make it hard for third-parties to hook into the form... but it may work...)
* (Evil but possibly working) Dig into the mechanics of the `CRM_Core_Form` lifecycle and figure out a way to short-circuit/cross-wire the phases for your controller.
> 1 votes

---
Tags: mailing, quickform
---


# Question
Title: Runtime Exception Booted CiviCRM, but failed to find 'api/class.api.php'
I created an extension module with `civix` then cd'd to the module directory and tried to create a custom report based on a copy of an existing report. I used the following command:

```
$ civix generate:report --copy CRM_Report_Form_Case_Summary DemandCaseReport CiviCase

```

This generates an error message that I haven't yet been able to fix.

```
Initialize report CRM_Case_Form_Report_DemandCaseReport

[RuntimeException]
Booted CiviCRM, but failed to find 'api/class.api.php'

generate:report [--webPath [WEBPATH]] [--copy [COPY]] [--] <<ClassName>> <<CiviComponent>>

```

I'm using civix version v16.03.2-3-geeff5c0. It's a WordPress installation.

I can see that a file with that name resides in `/wp-content/plugins/civicrm/civicrm/api/class.api.php`

Is there an environment variable that I should be setting or something else that I'm overlooking?

Grateful for any tips, thanks.

# Answer
It appears that `civix` is ignoring or overwriting additions to or modifications of the `include_path`. I added the full path name `/Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm` (where `api` resides) to `include_path` in the `php.ini` (checked I got the right one with `php --ini`). That didn't work.

But I got it to work by soft linking the `api` directory into the new extension directory, i.e. changed directory to the extension directory and did the following command: `$ ln -s /Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm/api .`

It's not an ideal solution but it enabled meet move forward.
> 0 votes

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


# Question
Title: Inconsistency with date fields in the API
I've been working on an extension for civicrm and am using the API to retrieve fields to be used in forms presented to the end user.

I am using the 'html.type' returned to determine which type of html form input to display (text, textarea, select, etc.).

The first issue is that the returned values don't match up with html input types, for example:

```
CRM.api3('Contact', 'getfield', {
  "sequential": 1,
  "name": "birth_date",
  "action": "get"
})

```

returns

```
"values": {
    "name": "birth_date",
    ...
    "html": {
        "type": "Select Date"
    }
}

```

but `Select Date` is not an html input type. This isn't too much of a problem as long as Civi is consistent with what it calls a date field. But in the above example, the field `birth_date` expects a date without a time.

But calling

```
CRM.api3('Event', 'getfield', {
  "sequential": 1,
  "name": "event_start_date",
  "action": "get"
}

```

returns the same 'html.type' value:

```
"values": {
    "name": "start_date",
    ...
    "html": {
        "type": "Select Date"
    },
    ...
}

```

and yet this field expects a datetime, not just a date.

So if you're trying (as I am) to have an extension operate on a list of fields which can be selected by the user and so aren't known in advance, I can't see any way to differentiate between the two cases.

I may be missing something obvious, but I can't work out what.

# Answer
> 1 votes
We've worked this out to handle form creation for civicrm fields in the CiviCRM entity project. https://drupal.org/project/civicrm\_entity

We use the 'type' property returned from a getfields api call like so: This code here we determine what widget to use: checkout civicrm\_entity.module civicrm\_entity\_get\_field\_widget() the section pertaining to dates:

```
 if (isset($field_spec['type'])) {

        switch($field_spec['type']) {
          case 4:
            $widget = array('widget' => 'date_select','format' => 'Y:m:d');
            break;
          case 8:
            $widget = array('widget' => 'date_select','format' => 'H:i:s');
            break;
          case 12:
            $widget = array('widget' => 'date_select','format' => 'Y:m:d H:i:s');
            break;
        }
      }

```

so the '#type' of the form element is set to 'date\_select' and the format is used to set the '#format' property this does require the date\_api module from the Date project

---
Tags: api, extension, gsoc
---


# Question
Title: For gift memberships, send email receipt to the giver
When Alice is creating and paying for a gift membership for Bob, she enters Bob's contact info and email address on the Membership Contribution form, so the emailed receipt goes to Bob (with a copy also going to the back office via the cc settings on the form) and Bob's email address becomes part of the contact record.

We have an optional custom field on the form where Alice can enter her own (different) email address and, ideally, receive a copy of the receipt as well.

in CiviCRM 4.6 we could make this happen by patching into postProcessMembership(), pulling the email address out of the form parameters, and tacking it onto the cc\_receipt field that was passed to the sendMail function. However, in 4.7, the form handling is different enough that this method no longer works.

Is there a clean way to add a recipient to the emailed contribution receipt based on a value entered on the contribution form in CiviCRM 4.7?

thanks,

# Answer
After some digging with debug\_backtrace() to unravel the program flow within CiviCRM, I found this solution, which works:

(1) Implement hook\_civicrm\_postProcess(), and use it to get the giver email from $form-\>\_submitValues. Stash it into a global variable.

(2) In CRM/Contribute/BAO/Contribution.php, patch function composeMessageArray() to append the giver email to $values\['cc\_receipt'\] prior to the sendMail calls at the end of the function, then clear the global.

Obvious, this will need to be tested and reapplied with each upgrade of CiviCRM, but we already have a handful of such patches so one more is not too bad.
> 2 votes

# Answer
I'm glad you found an answer that works for you! For others with this situation not using Drupal, you can install the Gift Memberships extension.
> 1 votes

# Answer
On Drupal you can configure a Gift Membership form with Webform CiviCRM - store the Contacts, their Relationship, the Membership, process the Monies, control the Email receipts - it's my go-to solution for Gift Memberships!
> 0 votes

---
Tags: civicontribute, civimember, email
---


# Question
Title: Can you use civicrm for inbound marketing instead of HubSpot?
We are considering using HubSpot with our Drupal 6 website to help with lead generation. Is anyone using civicrm for his purpose? Can civicrm create workflows once someone opts in via a form?

Specifically, we want to create landing pages with opt-in forms to capture web visitors' first name, last name and emails. Once we have that lead information, we want to be able to send them auto responder emails with messages that link to or contain content like white papers, video, text attachments etc. on a specific schedule. For example, we want an automated workflow that would send a lead something right after they submit info, then send another piece of content 2 days later, then a week later, and 2 weeks later. This automated workflow, landing page, and all the data about visitor behavior with this content is what HubSpot provides.

# Answer
> 5 votes
You can create webforms with CiviCRM to capture the data you're requesting. With the CiviRules extension, you can easily send automated email on a schedule like you describe. In fact, CiviRules was originally created to do almost exactly this.

# Answer
> 2 votes
You could use webforms and scheduled reminders if you get the webform to create an activity when it is submitted. The activity created date will be the trigger for the scheduled reminders. However, you can only include links to content not attachments in scheduled reminders.

---
Tags: drupal, email, evaluating-civicrm
---


# Question
Title: How do I ensure all Check Boxes are ticked for a single Custom Field on a Profile form?
I have a single Custom Field of type "Alphanumeric" and "CheckBox" with a check list which requires all boxes to be ticked before continuing.

I have set the field to Mandatory but this allows the form to be submitted with just one option selected.

Is there a way to set a CheckBox widget to require all boxes to be ticked? I don't really want to create lots and lots of Custom Fields to achieve this.

# Answer
Using Jquery snippet below has solved my problem. First you will need to attach a javascript file to your Theme or Template so it will be loaded after JQuery, then hook into CRM.$ and away you go...

```
$( document ).ready(function() {
    CRM.$(function($) {
        $(".CRM_Profile_Form_Edit").on('submit', function (e) {
            if ($('input[id^="custom_XXX_"]:checked').length != $('input[id^="custom_XXX_"]').length) {
                $('#editrow-custom_XXX').addClass('crm-error crm-error-label');
                alert("Please ensure you tick all options.");
                return false;
            }
        });
    });
});

```

> NOTE: Replace "**XXX**" above with the ID of your custom field in CiviCRM (You can find this out by using the "View Source" feature in your browser and looking at the HTML Input Element for the field in question).
> 0 votes

# Answer
I dont think their is some setting in CiviCRM to set all the check box to required in a single custom group

But, you can create a javascript to set all the check box to Flag if one box is clicked

or you can check the value of the check box before form submit and alert the user

I guess this helps !!!
> 0 votes

---
Tags: custom-fields, profile
---


# Question
Title: Does Civi still support the ability to set a specific start date for recurring contributions?
Civi used to have a feature that allowed me to set a start date other than "today" when I set up a recurring contribution with a credit card. We did not have this field active on our website, only staff used it to tweak recurrings as necessary. After we upgraded recently to 4.6.2 I can no longer find that field. I accessed it by clicking on Submit a Credit Card Contribution button. I don't recall exactly where it was placed, only that I used it several times and it was a great feature for us.

Am I missing something? Did this feature get moved? Or should I go to Civi's forum and ask for it to be re-instated?

# Answer
This issue appears to have been resolved. When we upgraded to Civi 4.6.10 the missing fields have reappeared. These fields were very useful, not having them was problematic, and I am very happy that I can use them again.
> 1 votes

# Answer
Setting a start date in the future for a recurring payment series has only recently garnered core support (i.e. the ability for a payment plugin to tell core that it supports a future start date). So in any particular CiviCRM install, you may find:

1. If your payment processor doesn't support future start dates, it won't show.
2. If your version of Civi is too old, it won't show.
3. If you've got an extension that solves this problem before Civi core did, it might show anyway.

More details here: https://issues.civicrm.org/jira/browse/CRM-15555
> 1 votes

# Answer
I ran a test for this actual situation. In Civi 4.6.8, the field exists, but using the PayPal payment processor, it seems to be ignored.

The test occurred on 09/18/2015. The start date was 09/24/2015. But the transaction was executed on 9/18/2015. While the transaction was pending, the received date reflected 09/24/2015. This was changed when the transaction was executed.

Looking at the code for PayPal, the start date is set up as:

```
$start_time = strtotime(date('m/d/Y'));
$start_date = date('Y-m-d\T00:00:00\Z', $start_time);

```

and passed via:

```
 $args['profilestartdate'] = $start_date;

```

This looks like a bug.
> 0 votes

---
Tags: recurring-contributions
---


# Question
Title: Membership Auto-Renew Changes in AuthorzeNet
We have memberships setup to auto renew on a monthly basis utilizing AuthorizeNet. All works fine. When a member needs to change their CC information (or any other info) and the change is made within AuthorizeNet recurring payments the transaction continues to process correctly but the info is no longer sent to Civi so the monthly renewal is not recorded.

Anyone else experience this?

The site is running Civi 4.6 with WordPress.

# Answer
Changes made to recurring contributions directly through the payment processor portal tend to break the communication back to Civi on subsequent installments (as you have surmised).

For any significant changes to a recurring contribution (amount, credit card type, financial type, etc.), it is best to cancel the existing recurring subscription and create a new one to avoid communication and other issues. If all you need to update are the credit card details (e.g. someone wants to use a different AMEX card from the one they originally created the subscription with), then making those changes from within Civi should communicate with Authorize.net without interrupting communication back from authorize.net on subsequent installments. You would do this by clicking the "More" hyperlink to the right-hand side of the recurring contribution record, select "Change Billing Details" and entering the details. The best way to see if this works is to update the credit card details directly from Civi, then log into the authorize.net portal and check to see that the updated information is listed on the subscription in question.

Hope this helps! Tamar
> 0 votes

---
Tags: civimember, recurring-contributions
---


# Question
Title: Upgrade to 4.6.16+ caused site to fail with error
The upgrade from 4.6.10 to 4.6.16 ran and pronounced itself successful, but after re-enabling the modules The site reports an error which shows via Drush as:

WD menu: CRM\_Core\_Exception: Invalid Filter in CRM\_Core\_BAO\_CustomGroup::validateSubTypeByEntity() (line \[error\] 647 of MYSITE/public\_html/sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php).

Running cron or clearing cache does nothing to help.

I did a compare of the backup files to those in the modules/civicrm direcotry and found one new file (Civi.php) and few other differences

diff /drupalbackups/civicrm4.6.pre16/civicrm-version.php /public\_html/sites/all/modules/civicrm/civicrm-version.php 3c3

## \< return array( 'version' =\> '4.6.10',

> return array( 'version' =\> '4.6.16', 5c5
>
> ## \< 'revision' =\> '3a0725b2d0' );
>
> ```
>             'revision' => 'dcf53fa10e' );
>
> ```
>
> Only in /public\_html/sites/all/modules/civicrm: Civi.php diff /drupalbackups/civicrm4.6.pre16/composer.json /public\_html/sites/all/modules/civicrm/composer.json 4a5 .... QUITE A FEW CHANGES IN THIS FILE diff /drupalbackups/civicrm4.6.pre16/composer.lock /public\_html/sites/all/modules/civicrm/composer.lock 7c7,8 .... QUITE A FEW CHANGES IN THIS FILE

Only in /drupalbackups/civicrm4.6.pre16: .htaccess (I placed that to control against timeouts)

# Answer
> 2 votes
This is a JIRA ticket here which references a patch that others have said has fixed things. I just tried cherrypicking the changes over and then run drush cc but still seeing same errors.

clearly relates in my case to a contact\_sub\_type that looks like it had its name changed (in contact\_type I am seeing label = Funder. and name=Funder\_ but in custom\_group it is just referred to as Funder)

I did try changing the contact\_type name from Funder\_ to Funder but no joy

EDIT: actually i think renaming did succeed, as i then reversed the patch out, for the sake of something else to try, but same error on drush cc - and then on a whim visited civicrm/upgrade, and while that page told me "Your database has already been upgraded to CiviCRM 4.6.16.0" it did the job, and the resolved alerts flooded on to the phone etc.

Hope that gives you some clues.

Also, in case it has any relevance, the sub-type that caused the problem had "CiviEngage - Funder" in the description, so wondering if the misnamed type came as part of that? Maybe worth checking.

# Answer
> 1 votes
The patches in Jira did not fix the problem for me, I was upgrading from 4.6.16 to 4.6.20.

I was able to fix this problem by changing the CustomGroup.php file to output the `$subType` and `$subType` the error is about in the error output and then setting those values to to `NULL` in the custom\_group table's `extends_entity_column_value` column for each error.

# Answer
> 0 votes
The patch described on JIRA ticket CRM-18504 resolved the problem for me on 4.7.7

---
Tags: upgrade, php
---


title: WordPress 4.4.5 no longer working?

text:
# Question
Title: WordPress 4.4.5 no longer working?
I've worked with several groups that have 4.4.5 installed on their WordPress sites. For many reasons, they have not kept up with upgrades. (These groups are unstaffed and have no capacity, let alone tech capacity...truthfully, I don't even trust myself to do upgrades.)

All of them have messaged me to say they cannot access their databases in the last couple of weeks -- some who have upgraded to WP 4.6, others that haven't.

Trying to figure out what could have happened that is making them all break.

Some just have "DB Error: unknown error" errors. Others have longer errors:

```
www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#4 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#5 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...", "DB_Error", TRUE)
#6 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "3057 ** Incorrect user-level lock name 'indianaa_movedcivicrm.1.cache.communi...")
#7 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#9 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#10 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#11 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...")
#12 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1234): CRM_Core_DAO->query("SELECT GET_LOCK( 'indianaa_movedcivicrm.1.cache.community-messages_communityM...", TRUE)
#13 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Lock.php(151): CRM_Core_DAO::singleValueQuery("SELECT GET_LOCK( %1, %2 )", (Array:2))
#14 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Lock/LockManager.php(84): CRM_Core_Lock->acquire(NULL)
#15 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager->acquire("cache.community-messages_communityMessages._")
#16 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/SqlGroup.php(96): CRM_Core_BAO_Cache::setItem((Array:4), "community-messages", "communityMessages", NULL)
#17 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/CommunityMessages.php(123): CRM_Utils_Cache_SqlGroup->set("communityMessages", (Array:4))
#18 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/CommunityMessages.php(169): CRM_Core_CommunityMessages->getDocument()
#19 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(120): CRM_Core_CommunityMessages->pick()
#20 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Contact_Page_DashBoard->run((Array:2), NULL)
#21 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#22 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
#23 /home/indianaa/www/www/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:2))
#24 [internal function](): CiviCRM_For_WordPress->invoke("")
#25 /home/indianaa/www/www/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1))
#26 /home/indianaa/www/www/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")
#27 {main}

```

# Answer
> 1 votes
Sarah, Having just gone thru this I have sympathy for you.My environment was Wordpress and Civi 4.4.5.

The hosting company upgraded MySQL to a higher version which rendered the Prod and Dev CiviCRM 4.4.5 database inaccessible. I was given a week's notice of the DB upgrade but could not fit the Civi upgrade into that timeframe due to other commitments. Luckily I had started to upgrade my Development environment (copied from Prod) before they flicked the switch. I upgraded Dev to 4.6.9 and they supplied a patch related to locking and MySQL which allowed the environment to work. Once applied the 4.6.9 version commenced working. My Prod version was inaccessible and I had to copy my Dev version to Prod, modify everything so it pointed at prod again and apply the patch. All going now.

I have just upgraded Dev to 4.7.10 and testing it.

Would suggest you look into your MySQL DB version, the Config and Log directories within CiviCRM for errors.

Goodluck Garry

---
Tags: wordpress, error
---


# Question
Title: How to a create custom field that is multi-line text or text area?
I want to create a custom 'About Me' field for a web profile, but there doesn't appear to be anyway to make a text area or multi-line text custom field.

I know I can set the field length to allow users to enter plenty of text (currently set to 1000 characters), but the input box will still only be a single line.

Of course, in Webforms in Drupal, for example, I can set the length of the input box as well, but, again, still only a single line.

The problem, then, is not that the user can't enter the text I want them to, but that their experience of doing so is disconcerting and uncomfortable. They can't see most of the text they've entered, which makes editing very difficult and frustrating.

I feel like there must be an obvious solution for this, but can't find it.

Thanks, Lewis

# Answer
> 4 votes
Use the 'Note' type of custom field to get a text area

---
Tags: custom-fields, user-experience
---


# Question
Title: SOLVED / Cannot partially or fully edit a contact profile - Uncaught CRM_Core_Exception / after 4.7.10 upgrade
SOLVED by enabling OpenSSL support in PHP.ini file (remove ";" in front of the "extension=php\_openssl.dll" line)

After upgrading to 4.7.10 (Wordpress 4.6), I receive an error when saving changes to a contact profile (the address in my case). Please find below the details, any quick help will be much appreciated as we're blocked right now with this issue. Thanks

> BACKTRACE
>
> # 0 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Error.php(182):
>
> CRM\_Core\_Error::backtrace()
>
> # 1 internal function: CRM\_Core\_Error::handle(Object(PEAR\_Error))
>
> # 2 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\packages\PEAR.php(931):
>
> call\_user\_func((Array:2), Object(PEAR\_Error))
>
> # 3 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\packages\PEAR.php(566):
>
> PEAR\_Error-\>PEAR\_Error("Need PHP 4.3.0 or later with OpenSSL support for https:// requests", 2, 16, (Array:2), NULL)
>
> # 4 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\packages\HTTP\Request.php(703):
>
> PEAR-\>raiseError("Need PHP 4.3.0 or later with OpenSSL support for https:// requests", 2)
>
> # 5 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Utils\Geocode\Google.php(126):
>
> HTTP\_Request-\>sendRequest()
>
> # 6 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\BAO\Address.php(387):
>
> CRM\_Utils\_Geocode\_Google::format((Array:21))
>
> # 7 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\BAO\Address.php(144):
>
> CRM\_Core\_BAO\_Address::fixAddress((Array:21))
>
> # 8 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\BAO\Address.php(120):
>
> CRM\_Core\_BAO\_Address::add((Array:21), TRUE)
>
> # 9 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\BAO\Location.php(69):
>
> CRM\_Core\_BAO\_Address::create((Array:83), TRUE, NULL)
>
> # 10 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Contact\BAO\Contact.php(348):
>
> CRM\_Core\_BAO\_Location::create((Array:83), TRUE)
>
> # 11 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Contact\Form\Contact.php(986):
>
> CRM\_Contact\_BAO\_Contact::create((Array:83), TRUE, FALSE, TRUE)
>
> # 12 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Form.php(423):
>
> CRM\_Contact\_Form\_Contact-\>postProcess()
>
> # 13 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(166):
>
> CRM\_Core\_Form-\>mainProcess()
>
> # 14 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(133):
>
> CRM\_Core\_QuickForm\_Action\_Upload-\>realPerform(Object(CRM\_Contact\_Form\_Contact), "upload")
>
> # 15 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm\Controller.php(203):
>
> CRM\_Core\_QuickForm\_Action\_Upload-\>perform(Object(CRM\_Contact\_Form\_Contact), "upload")
>
> # 16 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm\Page.php(103):
>
> HTML\_QuickForm\_Controller-\>handle(Object(CRM\_Contact\_Form\_Contact), "upload")
>
> # 17 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Controller.php(351):
>
> HTML\_QuickForm\_Page-\>handle("upload")
>
> # 18 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Utils\Wrapper.php(113):
>
> CRM\_Core\_Controller-\>run()
>
> # 19 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Invoke.php(286):
>
> CRM\_Utils\_Wrapper-\>run("CRM\_Contact\_Form\_Contact", "Nouveau contact", (Array:1))
>
> # 20 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Invoke.php(86):
>
> CRM\_Core\_Invoke::runItem((Array:13))
>
> # 21 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\CRM\Core\Invoke.php(54):
>
> CRM\_Core\_Invoke::\_invoke((Array:3))
>
> # 22 D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm.php(1227): CRM\_Core\_Invoke::invoke((Array:3))
>
> # 23 internal function: CiviCRM\_For\_WordPress-\>invoke("")
>
> # 24 D:\xampp\htdocs\gdc\wp-includes\plugin.php(524): call\_user\_func\_array((Array:2), (Array:1))
>
> # 25 D:\xampp\htdocs\gdc\wp-admin\admin.php(222): do\_action("toplevel\_page\_CiviCRM")
>
> # 26 {main}
>
> Désolé, nous ne sommes pas en mesure de fournir ceci actuellement. Need PHP 4.3.0 or later with OpenSSL support for https:// requests Message d'erreur détaillé Détails additionnels :
>
> Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )
>
> ```
> [code] => 2
> [message] => Need PHP 4.3.0 or later with OpenSSL support for https:// requests
> [mode] => 16
> [debug_info] =>
> [type] => PEAR_Error
> [user_info] =>
> [to_string] => [pear_error: message="Need PHP 4.3.0 or later with OpenSSL support for https:// requests" code=2 mode=callback
>
> ```
>
> callback=CRM\_Core\_Error::handle prefix="" info=""\] )
>
> Retourner à la page d'accueil.
>
> Fatal error: Uncaught CRM\_Core\_Exception: \[0: Transaction integrity error: Expected to find active frame thrown in D:\xampp\htdocs\gdc\wp-content\plugins\civicrm\civicrm\Civi\Core\Transaction\Manager.php on line 107

# Answer
> 0 votes
The error message says:

> Need PHP 4.3.0 or later with OpenSSL support for https:// requests

What PHP version are you using? CiviCRM PHP Requirements are currently:

> PHP 5.5 or greater is recommended, but not PHP7 yet (see CRM-17789: Support PHP 7 ). PHP 5.3.10 is the bare minimum.

This might help re OpenSSL support: Enabling the openssl in xampp.

From the backtrace, the https request appears to relate to Google geocoding, so as a workaround you could try disabling that to get yourself up and running.

---
Tags: wordpress, error, core
---


# Question
Title: CiviCRM still creates MyISAM tables which results in Warning
*CiviCRM 4.7.10 --- WordPress 4.6*

The following warning message appeared in **CiviCRM System Status**:

> Your database is configured to use the MyISAM database engine. CiviCRM requires InnoDB. You will need to convert any MyISAM tables in your database to InnoDB. Using MyISAM tables will result in data integrity issues.

This message appeared 5 days after upgrading to 4.7.10 from 4.7.8. The table with the MyISAM engine was: **civicrm\_task\_action\_temp%**. I corrected it in MySQL using:

```
ALTER TABLE civicrm_task_action_temp% ENGINE=InnoDB;

```

On inspecting the code, I found the following in **civicrm\civicrm\CRM\Contact\Form\Task.php on line 145**

> $sql = "CREATE TABLE {$form-\>\_componentTable} ( contact\_id int primary key) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci";

and **civicrm\civicrm\CRM\Export\BAO\Export.php on line 1494**

> CREATE TABLE {$exportTempTable} ( ... ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci;

All other MyISAM tables are defined as TEMPORARY.

Prior to performing the upgrade, I cleaned the caches using **CiviCRM/System Settings/Cleanup Caches and Update Paths**. Hence the reason **civicrm\_task\_action\_temp%** was recreated.

Hopefully, this fix can be included in the next update.

# Answer
> 2 votes
Based on Dan's pointer to https://issues.civicrm.org/jira/browse/CRM-15601 , it seems like this used to work. It probably regressed with https://github.com/civicrm/civicrm-core/commit/3fa9688a5 which introduced a very subtle change to how it ignores temp tables. Compare:

* (Old) `strpos($dao->Name, '_temp') !== FALSE`
* (New) `TABLE_NAME NOT LIKE '%temp'`

Proposed fix: https://github.com/civicrm/civicrm-core/pull/8930

---
Tags: database, mysql, 4.7.10
---


# Question
Title: How to redirect to a static url after member signup
I am working on a wordpress website with civiCRM. Member signup with CiviCRM is working correctly. I need an admin approve the new wordpress users after signup. I used "New User Approve" wordpress plugin for this. When the user make payment and completes the signup the page will redirect to the CiviCRM dashboard by default. But because of I am using the new user approve plugin the newly created wordpress user is not active and so that user can't sign in successfully and can't access the dashboard. That results in an error message. So I need to show a Thank you page after submitting the registration details. How can I do it?

# Answer
> 1 votes
In order to do what Joe suggests pretty certain you will need to have installed Front End Page Options extension otherwise the 'redirect' option won't exist.

# Answer
> 0 votes
Go to Contributions -\> Manage Contribution Pages -\> Choose ( or create ) your page -\> Configure -\> Thank You page Redirect

---
Tags: wordpress
---


# Question
Title: Unable to Import, edit certain records and edit Group settings: DB Error: constraint violation
I am unable to make certain edits to CiviCRM; unable to edit certain records and unable to edit the visibility of groups.

I think the problem is this: Cannot add or update a child row: a foreign key constraint fails (\`ea...")

The error message is referring to a group '58' which I deleted and replaced with group "62".

How do I find the exact problem and fix it?

I'm on WP 4.5.3 with CiviCRM 4.7.9.

Here is the error message:

> Database Error Code: 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), 1452

# Answer
> 1 votes
It seems you have some entries remaining in `civicrm_group_contact` which point to the deleted `civicrm_group` entry?

You can confirm this with a query to look for group contact entries which point to a missing group.

```
-- Show contacts who belong to a group that doesn't exist.
SELECT *
  FROM civicrm_group_contact
 WHERE group_id NOT IN (SELECT id FROM civicrm_group);

```

If entries are found with that query, you can clear them out (or update them to point to the new group, or export those contact IDs, or ...).

```
-- Standard disclaimers apply; back up your DB before doing this!
DELETE
  FROM civicrm_group_contact
 WHERE group_id NOT IN (SELECT id FROM civicrm_group);

```

If updating, you'll want to avoid creating duplicate entries by reassigning group\_id without checking for existing group additions.

---
Tags: database, error, groups, smartgroups
---


title: How to get IATS working

text:
# Question
Title: How to get IATS working
Seems that IATS will not work using extension 1.5.3 - It logs the transaction in CiviCRM but never makes a connection with IATS. I'm not sure it is even connecting with the network.

Any clue folks?

# Answer
> -2 votes
Ok!! I have found the culprit. Here is the response from my webhost:

**This looks to be a limitation on your server when connecting to the remote server and we can test this directly using openssl.**

**Shown below is a failed connection to the remote server using TLSv1 (what your wget command specifies) to the remote server's HTTPS port (443):**

```
CT-156611-bash-3.2# openssl s_client -tls1 -connect iatspayments.com:443
CONNECTED(00000003)
31985:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1092:SSL alert number 40
31985:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:536:

```

**The same connection fail results from my local workstation. However, when specifying a higher version of TLS such as TLSv1.2, I am able to connect from my workstation as shown below**

```
$ openssl s_client -quiet -tls1_2 -connect iatspayments.com:443
depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root
verify return:1
depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
verify return:1
depth=1 C = US, ST = VA, L = Herndon, O = Network Solutions L.L.C., CN = Network Solutions OV Server CA 2
verify return:1
depth=0 C = US, postalCode = 76131, ST = TX, L = Fort Worth, street = Suite 1800, street = 100 Throckmorton Street, O = First American Payment Systems, OU = Information Technology Group, OU = Secure Link SSL Pro, CN = www.iatspayments.com
verify return:1

```

**Your server is running CentOS 5 which does not support TLS versions higher than TLSv1 and many servers are beginning to reject those connections, such as payment gateways. If you require this support, then it will be necessary to re-image the server to CentOS 7**

# Answer
> 3 votes
If with EOL you mean End Of Life - you are mistaken! iATS 1.5.3 is already working for many transaction pathways in 4.7.x - but we will not release an official release until ALL 21 type of transactions, payment processor switches, chq debit img swapping, encrypted swipe is working as it currently is on 4.6.x LTS.

In general before upgrading any site you will really want to check to ensure that ALL extensions that you have enabled have releases for the CiviCRM version you're upgrading to - otherwise you're taking a risk.

A number of sites \[from at least 3 CiviCRM partners that I know of and likely more\] are already transacting with iATS on 4.7.x - they would have created a staging copy to check that their pathways are working.

So I'm not sure what issues you're running into. Are you using TLS 1.2? Is SOAP enabled? Any clues in the iats log tables? agent code/password correct - and configured properly?

**See iATS Extension - README.md file:** 9002 Error - if you get this when trying to make a contribution, then you're getting that error back from the iATS server due to an account misconfiguration. One source is due to some special characters in your passwd.

**Also:** Please have a look at the link http://home.iatspayments.com/Relaunch-SHA256 and check if your environment is compatible.

**EDIT:** to test if your server environment is indeed TLS 1.2 - go into your CiviCRM -\> Payment Processor configuration and edit the URLs from www to www2 - so: e.g.: https://www2.iatspayments.com/NetGate/ProcessLinkv2.asmx?WSDL Run a transaction - if this works \[if this does not produce a 9002 error\] - then your server environment is -not- TLS 1.2

---
Tags: civicontribute, 4.7, iats
---


# Question
Title: User account picking up incorrect user name
CiviCRM 4.6.2 / Wordpress

On the civi change log we have spotted a edits of contact records entered by one user are being recorded as edits by another user. Any ideas on how this might happen, what can be done to stop it happening?

# Answer
Finally figured out what happened on this. It looks like at the point of moving from Drupal to Wordpress the assocation between the user account and the civi contact were mismatched.

Did a manual fix through the front end (just 10 records impacted). On the contact record, click the user id link which takes you though to the user account record. Where these were mismatched we modified the contact record to match the user record. Job done. Lesson to self: don't forget the user/contact relationship!
> 1 votes

# Answer
There are two main causes that I can think of.

1. The person doing the editing was doing it whilst logged in as the other person. Possible scenarios and suggested 'solutions' are:

* shared computers where the other person didn't log out when they had finished and the editor didn't bother to sign in as themselves. Solution: Remind all concerned of the importance of logging out when finished and of using their own log in.
    * The editor is able to masquerade as the other person and was doing so when making the changes Solution: Remind editor that they should not make changes whilst masquerading as someone else OR revoke their masquerade priviledges.
    * The editor knows the password of the other person and deliberately logged in as that user. Solution: Get the other person to change their password and keep it private.
2. The table that links wordpress user to civicrm contact record has become (or was for a while) corrupted so that the wordpress login for the editor is/was linked to the civicrm record for the other person. (This could happen for a drupal-based site if the uf\_match table was corrupted. I presume there is something similar in wordpress, but I don't really know.)
> 6 votes

# Answer
JoAnne's answer is excellent. There's a third scenario I should add, however.

Sometimes, staff will try to register someone else for an event from the frontend without logging out. (Profiles in edit mode, petitions, and contribution pages do this too, but events seem most common.) They enter the other contact's name and email, and when they're done, CiviCRM has the other person's information in the first user's contact.

There is a notice about this at the top of contribution and event forms, complete with a link to let you fill out the form *not* as yourself (it tacks on `&cid=0` to the URL). However, that notice is frequently missed.
> 5 votes

# Answer
If you have logging enabled /civicrm/admin/setting/misc?reset=1 then you should be able to track back via the changelog Tab on the record and see when things went awry which might shed some light on why this is happening.
> 1 votes

---
Tags: user-account
---


title: Custom Fields for Specific Individuals

text:
# Question
Title: Custom Fields for Specific Individuals
I'm entirely new to CiviCRM and setting it up for the first time for our church.

One of the needs is to record information for Weddings. This will mean that against the record for a Bride or Groom (or both) we will need to record custom information e.g. date of wedding, deposit paid, calling of Banns (we're in the UK), organist booked etc. etc.

I think we can do this by setting up a group and attaching custom fields to the group. but we also want this information to be searchable so that we can report on all wedding booked in 2017 or send an email to the vicar 2 months before the wedding to remind them to make contact with the couple.

We will also need to record similar types of information for baptisms and funerals, but this will probably follow the same structure as for weddings.

Any advice on how this can best be handled within CiviCRM?

Many thanks,

Sandy

# Answer
> 2 votes
I would say: have a look at Events. You'll find a lot of functionality.

You could create an Event Type "Wedding", where you can have custom fields only for "Events" of type "Wedding".

The same can be done for "Baptisms" and "Funerals".

Emails 2 months in advance would be easy.

# Answer
> 1 votes
I will offer an alternate solution. create a custom Activity Type for Weddings and put the fields on that.

Then do the same for Funerals, Baptisms etc. One Activity Type for each.

The Activity can then be associated with as many people as necessary

# Answer
> 0 votes
Do you want to just record the wedding info somewhere, or are you wanting to use Civi to manage the wedding workflow?

You could use CiviCase to define the series of actions that are needed from the initial contact with the church up to the wedding day and those would function as a checklist of tasks and timeline.

(It's a possible enhancement for a church I'm working with - originally motivated by an "organisationally challenged" curate!)

CiviCase takes more setting up than a custom Event or Activity type and it's not the best starting point for someone new to Civi so you might want to try one of the other options initially or get some help.

# Answer
> 0 votes
Thanks for the suggestions.

I've looked at recording the Wedding information as an Activity and that seems fairly straightforward.

I can also see how we can generate a Scheduled Reminder to the minister two months before the Wedding to remind them to make contact with the wedding couple.

Taking this a step further I'm trying to see if there is a way to auto-generate a scheduled reminder direct to the couple based on specific data in one of the custom fields? For instance if they don't live in our parish it would be great to send them an email automatically three months before the wedding date to remind them to arrange to have their Banns called in their local church.

I can's see a way to do that with either Activities or Events - am I missing something? Do I need to look at CiviCase or another way of recording this data to make this form of automation possible?

If I can I want to try to avoid starting to do things one way and finding it is too limited and having to restart with a different structure!

Thanks for any help or advice.

---
Tags: custom-fields
---


title: MySQL to MySQLi

text:
# Question
Title: MySQL to MySQLi
We have a 4.1 installation with PHP 5.3. The current PHP install uses MySQL, not MySQLi. I need to enable MySQLi to support a new application. Our hosting company says this will entail recompiling PHP and Apache to enable this.

Will this completely break our CiviCRM install?

# Answer
> 1 votes
In my case it did not break CiviCRM (4.6.9 at the time). In fact, CiviCRM recently made a blog post suggesting the same upgrade in preparation for future versions.

Edit: a link to said blog post: https://civicrm.org/blog/totten/psa-please-verify-php-extension-mysqli

---
Tags: mysql
---


# Question
Title: I set up and scheduled a mailing, but it didn't send. Now what?
I scheduled a mailing to send according the the instructions, and it didn't send. Now what?

# Answer
This has happened to me in the past for a few reasons

* In one instance, my time zone was set wrong so the scheduled time had already passed, and the mailing was never triggered.
* My cron jobs weren't running. A temporary fix would be to trigger the job manually in Administer \> System Settings \> Scheduled Jobs \> Send Scheduled Mailings.
* My cron job hadn't run yet. For example, I can schedule my email to go out at 1:15, but if my cron jobs run every hour it won't go out until 2:00.
> 2 votes

---
Tags: civimail, mailing
---


title: How to find not valid email accounts?

text:
# Question
Title: How to find not valid email accounts?
I have CiviCRM 4.4.2. When I send mailings to fictitious email addresses, CiviCRM doesn't return any error. In the report, everything looks fine (100% successful deliveries).

It is important to clean all the emails that are no valid anymore.

Any idea?

Thank you!

# Answer
> 2 votes
Sounds as though bounce processing isn't set up correctly. See:

Bounce Handling

Setting Up the Return Channel

# Answer
> 1 votes
If you're on 4.4.2 I'd strongly encourage you to upgrade before doing much else.

Civi doesn't know those are invalid email addresses until something tells it so. It hands off the mail to the mail system and, if something goes wrong, a bounce mail is generated which can be processed and used to update Civi. The details depend on how you are sending mail.

If you are sending mail directly, then you need a bounce processor - see https://docs.civicrm.org/user/en/stable/advanced-configuration/email-system-configuration/#configuring-inbound-email-processing

Alternatively if you use something like Sparkpost and https://civicrm.org/extensions/sparkpost-email-extension-for-civicrm then bounces are handled for you.

# Answer
> 0 votes
I made a nifty email amender that automatically cleans email addresses as they're added. You can set the rules yourself :) let me know how you get on http://github.com/johnff you'll have to clean up currently existing addresses yourself though.

---
Tags: civimail
---


# Question
Title: Error Fetching HTTP headers - iATS Recurring contribution
We are setup with iATS for credit/debit card and ACH transactions and are in the last stages of testing. One time card and ACH contributions are working. For the sake of testing, we are doing daily recurring contributions to make sure the mechanism works. We haven't yet tested recurring ACH. Recurring credit card transactions are going through, but with mixed results.

**Issue:** Within the last week, we've gotten intermittent errors during the recurring contribution scheduled job that prevents the contribution from being marked `Complete` in Civi. The error is "Error Fetching HTTP Headers."

**Symptoms:** Two transactions with through perfectly (Aug 17 12:00am; Aug 23 12:00am) and emailed automatic receipts. The other transactions, however, are processing (visible in iATS' journal and with my bank), but marked `Pending (Incomplete Transaction)` in Civi. The Civi source reads: `iATS Payments Recurring Contribution (id=2) Unexpected Server Error, please see your logs`. Emails for these Pending transactions did not send.

**Details:**

In the Job Log for `iatsrecurringcontributions`: The job last night started at 2016-08-24 00:00:04 and then finished at 2016-08-24 00:01:07 with these details:

> Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}
>
> Full message: Finished execution of iATS Payments Recurring Contributions with result: Success (1 contribution record(s) were processed.
>
> Failed to process recurring contribution id 2: Unexpected Server Error, please see your logs Created activity record for contact id 203)

In looking at the Drupal logs, I have two relevant records for last night's Pending (Incomplete Transaction), an error and a notice, both from hostname 127.0.0.1.

***The error:***

```
SoapFault: SoapFault Object (
[message:protected] => Error Fetching http headers
[...a long list of arrays detailing the transaction, our iATS information, API calls and drush commands]
[previous:Exception:private] =>
[faultstring] => Error Fetching http headers
[faultcode] => HTTP
)

```

***The notice:***

```
Raw Response:
HEADER:
BODY:
BODYEND:

```

**Attempted Resolution:** From initial searches in Stackexchange and Google at large, it might be a server setting, perhaps? After a couple days of trouble initially, I increased two settings in my /etc/my.cnf file just to test and then restarted httpd and nginx:

```
max_allowed_packet = 128M (was 16M)
wait_timeout = 300 (was 60)

```

Since I still had the issue last night, it must be something else. **Any ideas on how to resolve the "Error Fetching http headers"**?

Civi 4.6.14 (will be updating to 4.6.20 before go-live); Drupal 7.44; iATS Payments extension 1.5.3; CentOS Linux 7.2.1511; Plesk 12.5.3; PHP 5.6.24 on website; PHP 5.4.16 on command line; nginx 1.11.1; Apache 2.4.6

# Answer
Sorry - we've not seen this (yet) - best to post an issue on our GitHub queue: https://github.com/iATSPayments/com.iatspayments.civicrm \- so that both Alan and myself as well as iATS staff sees this.

Perhaps the automatic ones are not run as -u your webuser but as another user - different env - different drush?

My favourite/most stable/like clockwork (no drift) way to run the recurring contributions job is:

to switch it OFF in the scheduled jobs GUI

and then to:

> # apache crontab for drupal/civicrm:
>
> 0 2 * * * /usr/bin/php /usr/local/bin/drush.php --root='/var/www/platform/site/' --uri='https://site.org' -u 1 civicrm-api job.iatsrecurringcontributions auth=0 -y
>
> # and then run the scheduled jobs that are switched ON:
>
> 3 * * * * /usr/bin/php /usr/local/bin/drush.php --root='/var/www/platform/site/' --uri='https://site.org' -u 1 civicrm-api job.execute auth=0 -y
> 2 votes

---
Tags: civicontribute, recurring-contributions, scheduled-job, iats
---


title: Running a script from cli

text:
# Question
Title: Running a script from cli
How would I call CRM\_Core\_I18n\_Schema::rebuildMultilingualSchema($locales, NULL); from the command line? Minor upgrade seems to have had an insignificant DB error and this line did not get called.

Coming from: CRM/Upgrade/Incremental/php/FourSeven.php line 654 Wordpress, CiviCRM 4.7.10

# Answer
> 3 votes
The command `cv` (https://github.com/civicrm/cv) provides helpers for running PHP code via CLI. For example, to run a single line of PHP code, you might say:

```
cd web-root
cv ev 'CRM_Core_I18n_Schema::rebuildMultilingualSchema(array(...), NULL);'

```

The snippet you posted involves a variable `$locales` which isn't defined here. If you know the intended content (e.g. maybe `array('en_US')`) then you could plug that in directly.

Alternatively, maybe you could call that particular upgrade function `addHelpPreAndHelpPostFieldsPriceFieldValue()` directly. (This is not always going to work; it's a case-by-case judgment looking the substance of the function.) If it's appropriate, then:

```
cd web-root
cv ev '$u = new CRM_Upgrade_Incremental_php_FourSeven(); $u->addHelpPreAndHelpPostFieldsPriceFieldValue(NULL);'

```

More generally, you could copy the desired code out of `CRM/Upgrade/Incremental/php/FourSeven.php` and put it in a new file (`my-upgrade-fix.php`). Hack the code as desired and then run:

```
cd web-root
cv scr my-upgrade-fix.php

```

---
Tags: wordpress, database, i18n, cli
---


# Question
Title: Custom field API and Custom field Machine name
We are working on a roll out which will include approx 100 instances of CiviCRM being created for an org. The organisation is Federal in so far that there is a central org and then a significant number of local branches.

Part of the project is to develop a data push for activities from the branch instances of CiviCRM to the head orgs instance so that data analytics can be done by the head organisation. The issue is that the ID's of the custom fields for the branch instances of CiviCRM are different to the head instance (and different between themselves).

We are proposing using Machine name instead of Activity ID for the API calls. Does the API support data pushed to it by machine name as opposed to ID?

# Answer
> 1 votes
If I understand right, the CustomField 'name' is unique in every CustomGroup. In my prototype I have two CustomFields 'Role' but they have two different 'custom\_group\_id'. When I try to add a 'Role' CustomField to either one of these CustomGroups, then it errors out with the message:

Field Label Custom field 'Role' already exists in Database.

But I can still add 'Role to any other CustomGroup where it is not used yet.

In the form I can only set the label, but at creation the 'name' is created from the label. When I rename the label, the 'name' is unchanged. This is the machine name of CustomField.

So before you push, you should do a query on both:

```
$result = civicrm_api3('CustomField', 'get', array(
  'sequential' => 1,
  'custom_group_id' => "Entity",
  'name' => "Role",
));

```

This will return the right id and will allow you to do your push. Then it is very useful to straight away to use the returned id through api chaining.

# Answer
> 0 votes
This sounds like a use case for multisites!

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


# Question
Title: iATS Extension Working, but Throwing Errors
iATS 1.5.3 is throwing the following errors (1.5.0 was too) on Civi 4.7.10 running under Drupal 7.50 on CentOS:

* Notice: Undefined index: config\_backend in \_iats\_civicrm\_domain\_info() (line 202 of /home/ourbase/public\_html/wcc/sites/default/files/civicrm/upload/com.iatspayments.civicrm-1.5.3/com.iatspayments.civicrm-1.5.3/iats.php).
* Notice: Undefined index: config\_backend in \_iats\_civicrm\_domain\_info() (line 202 of /home/ourbase/public\_html/wcc/sites/default/files/civicrm/upload/com.iatspayments.civicrm-1.5.3/com.iatspayments.civicrm-1.5.3/iats.php).
* Warning: simplexml\_load\_file(http://wcc.ourbase.us/sites/default/files/civicrm/upload/com.iatspayments.civicrm-1.5.3/com.iatspayments.civicrm-1.5.3/info.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in iATS\_Service\_Request::iats\_extension\_version() (line 728 of /home/ourbase/public\_html/wcc/sites/default/files/civicrm/upload/com.iatspayments.civicrm-1.5.3/com.iatspayments.civicrm-1.5.3/CRM/iATS/iATSService.php).
* Notice: Trying to get property of non-object in iATS\_Service\_Request::iats\_extension\_version() (line 729 of /home/ourbase/public\_html/wcc/sites/default/files/civicrm/upload/com.iatspayments.civicrm-1.5.3/com.iatspayments.civicrm-1.5.3/CRM/iATS/iATSService.php).

Transactions seem to go through, so my focus is on getting these errors to not display. Either by correcting the errors or suppressing the notifications. In regards to the latter, I have error reporting turned off everywhere I'm aware of (php settings in cPanel, civicrm itself)

# Answer
To suppress notices/warnings on Drupal go here: /admin/config/development/logging

and hit: none (you'll want 'none' on any production site);

Would you please open up on issue in our GitHub queue: https://github.com/iATSPayments/com.iatspayments.civicrm

paste in your notices - and also let us know exactly what type of transaction you're executing when these notices occur? Frontend/backend; Credit Card; ACHEFT; SWIPE; one-time/recurring; Contribution; Membership or Event etc.
> 1 votes

# Answer
Those all look like notices and warnings that are fixed in master.

You do want to suppress warnings and notices on production, but not when you're testing, and the warning above is actually semi-serious. It's trying to set an internal iATS version variable but failing to load it's own file via http.

That's now fixed with this: https://github.com/iATSPayments/com.iatspayments.civicrm/commit/d4f26bc588ced5405d4b6ac4db5a580162926e07

but you should be aware that there might be other issues if your server can't load it's own site via http (e.g. your dashboard might not work).
> 0 votes

---
Tags: civicontribute, extension, error, php, iats
---


# Question
Title: MapQuest Issue - Direct Tile Access No Longer Supported?
When I use the map link within a contact details to get a map view of their address, the mapping starts to load but the map image tiles all display the following message:
"as of July 11 2016, direct tile access has been discontinued. etc. etc.".
So I went to the MapQuest site, created a free account, got an API key but don't seem to be able to insert it anywhere in civicrm?
FYI, I'm using openStreet Maps as the provider and Google for Geocoding, therefore no APIkey required (right?).
Should I be able to enter the API key from MapQuest in somewhere?

# Answer
CiviCRM OpenStreet Maps function is pointing to map tiles that are no longer available.

See: https://stackoverflow.com/questions/38315300/mapquest-direct-tile-access-discontinued
> 0 votes

# Answer
You can use OpenStreetMap tiles if you replace the tile pointer in this file:

```
.../templates/CRM/Contact/Form/Task/Map/OpenStreetMaps.tpl

```

Change this...

```
    map.addLayer(new OpenLayers.Layer.OSM("MapQuest OSM", [
        "https://otile1-s.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
        "https://otile2-s.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
        "https://otile3-s.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
        "https://otile4-s.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",
    ], {
        attribution: "<p>Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>. Data © <a href='http://www.openstreetmap.org/' target='_blank'>OpenStreetMap</a> contributors.</p>"
    }));

```

To this ...

```
    map.addLayer(new OpenLayers.Layer.OSM("openstreetmap", [
        "https://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
        "https://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
        "https://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
    ], {
        attribution: "<p>Map Courtesy of <a href='http://www.openstreetmap.org/' target='_blank'>OpenStreetMap</a></p>"
    }));

```

You do want to use https!
> 1 votes

---
Tags: map
---