title: Using the Event Name Badge feature

text:
# Question
Title: Using the Event Name Badge feature
A client of ours wants to have badges that have 2 fields on one line and would also like to have the state be the full name vs the abbreviation. I'm pretty certain it would require custom code but posting here to be sure I haven't overlooked anything.

We are using 4.6.4 with this client. And Drupal latest.

# Answer
> 2 votes
As of Civi 4.4, you can configure label formats as shown here: http://book.civicrm.org/user/current/events/event-badges/

But yes, this means each field needs to be on a separate line.

In terms of having the full name for the state, Name and Mailing labels show the state/province name as the abbreviation rather than the full state/province name. This has been reported on v4.5.2, but may need patching until it is fixed in v4.8: https://issues.civicrm.org/jira/browse/CRM-15505

If you want to patch it yourself for now, here's what I do. In CRM/Contact/BAO/Query.php, line 5533 (or thereabouts) is as follows:

```
    $dao->$value['pseudoField'] = $dao->$key = CRM_Core_PseudoConstant::stateProvinceAbbreviation($val);

```

Change this line to:

```
    $dao->$value['pseudoField'] = $dao->$key = CRM_Core_PseudoConstant::stateProvince($val);

```

---
Tags: civievent
---


# Question
Title: Can't create a standalone profile for membership card information
I'm trying to create a profile page where a user tells us where they want to pick their membership card up. We have the field on new membership applications, but we want to send cards to existing members. Due to the cost of mailing we're going to drop them off at the member's preferred retail partner for pickup.

I have a custom field for the pickup location, and I created a custom profile with that field, plus the first and last name as view-only in order to verify the profile. The intent is to email the user and include their contact hash to ensure their profile appears. I received the following error when trying to preview the profile on the website front-end:

"Profile search, view and edit are not supported for Profiles which include fields for more than one record type."

I then stripped it back to only include the membership card pickup field. I still receive the error.

Is there any way to collect this information? I'd rather not send a bulk email and have to manually update every member's profile.

We are using wordpress 4.3.1 and civi 4.6.8.

# Answer
> 1 votes
Are some of the fields on the profile membership fields? I think the issue here is that Profiles that you can send people to via a checksum will only support Contact fields, not Membership fields, since if the person has more than one Membership there is no way to know which one to update.

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


# Question
Title: Returning from all contributions of a contact to all contributions at all? a bug?
If I have a look at a contribution of a contact with more than 50 contributions (and let me show all of its contributions!) civiCRM does NOT return to the contact but to ALL contributions at all. Because we have more than 500 000, this takes ages! Is this a bug? CiviCRM 4.4.19 Drupal 7.39 Rolf - ROBIN WOOD e. V.

# Answer
If you examine the link to view all contributions from the bottom of the contributions tab, it actually takes you away from the contact record and directs you to the contribution search, with your search parameters (namely, the contact ID) prepopulated. Once you're done viewing the contribution, you get taken back to the contribution search page (without your previous search parameters, alas). I would agree that it's not as user-friendly as it could be, but I wouldn't classify this as a bug per se. One workaround might be to open up the contribution info in a new tab, which will leave your contact's contribution search intact.

Lesley
> 1 votes

---
Tags: contributions
---


title: Payment Later/Payment Method missing

text:
# Question
Title: Payment Later/Payment Method missing
I was hoping someone could help me with this. I've been working on this for a couple of days and can't figure this out.

Basically, the payment method block is missing from Event online registration pages. When I fill in payment information and submit, I get the the following message.

> Please correct the following errors in the form fields below:
>
> ```
> Please select a Payment Method
>
> ```

The problem is there is no Payment Method block including the Pay Later in the Registration page even though the option is selected in the configuration.

There is no error in the Civicrm log. (ConfigAndLog) And couldn't find anything applicable in /var/log/apache2/error.log. Same for the Drupal Log.

Also, it does not appear to be a CSS issue as the block is just missing on the registration page according to firebug.

I did find this, but it didn't help much. https://forum.civicrm.org/index.php?topic=35391.0

Any ideas?

I'm running Drupal 6.37 and CiviCRM 4.6.8. (I know. I know. I need to upgrade to 7, but I've consistently run into upgrade issues with my custom theme and need to get them worked out)

Apparently we didn't have any paid events over the summer so the last one was in May 2015. So it could have stopped working anywhere between then and now.

# Answer
Thanks. It was some leftover custom code that was blocking it. Sometimes it helps to write things out!
> 4 votes

---
Tags: civievent, payment-processor
---


# Question
Title: How do I increase the backtrace line length
Log files include a backtrace which is very helpful for debugging but I find the lines get truncated so I cannot see all the values. After about 200 characters I usually see an ellipsis ... and the line is truncated. can this be extended to see more info?

# Answer
> 2 votes
:( it is hard-coded. I changed $maxArgLen in CRM/Core/Error.php and now I can see the full backtrace.

# Answer
> 1 votes
Or call `CRM_Core_Error::debug('message',CRM_Core_Error::formatBacktrace(debug_backtrace(), TRUE, 300));`

where 300 is the maximum characters allowed for each arguments

---
Tags: php, debugging, logs
---


title: Adding Case Role to CiviCRM Cases Views

text:
# Question
Title: Adding Case Role to CiviCRM Cases Views
I have created a CiviCRM Cases View. How would I add a column for "Case Manager" role to the Views? I am unable to find the field where that can be displayed.

# Answer
Actually you'll need to start with a CiviCRM Relationships View.

If you start with a view of CiviCRM Cases, you may get bad data if they have multiple open case types with different case managers.

So create a new view of CiviCRM Relationships, then in the advanced section add the Case ID relationship, then add the Contact A (the client) relationship and finally the Contact B (the case manager) relationship.

Add a Display Name field using relationship Contact A, then add another Display Name field using Contact B.

Here are all of the fields I eventually added:
> 6 votes

---
Tags: civicase, drupal-views, roles
---


# Question
Title: Auto fill credit card billing name and address information for civicrm event registrant - webform-civicrm integration
Is it possible to auto fill the credit card fields when a person registers for an event using the webform-civicrm integration module?

# Answer
(Clarified that information needed was billing name and address information, not credit card details)

This information can be automatically filled in if the registrant is logged into the website (and has a valid Civi record attached to their website account), or by sending invitation emails with a checksum token inside.

Unfortunately I don't think there is a "same as above" checkbox on the event registration form.
> 1 votes

---
Tags: civievent, civicontribute
---


title: Rich text in form pre-help?

text:
# Question
Title: Rich text in form pre-help?
I'm putting together a terms agreement using custom data, as a part of a new member signup profile. I have a single required checkbox to agree, but I'd like to put the content of the terms in the from pre-help area. Is it possible to put HTML here? It's a huge mess as plaintext.

Thanks

# Answer
> 1 votes
Yes you can paste HTML in but guessing you tried that before asking so perhaps there is something else happening on your site. Here is a link to a field on demo where i just used to prove case.

---
Tags: html
---


# Question
Title: 'To' field not populated in the 'email contact' screen upon clicking on email in contact screen
On the contact screen, I click on the contact's email address, the 'email contact' screen pops up but the "To" field is blank. This works correctly on the demo site.

Set-up: Joomla 3.4.3, CiviCRM 4.6.8 (but have had this issue w/ previous Joomla and CiviCRM versions)

Is this a corruption of one of the files? What can I check on?

Thank you!

# Answer
> 1 votes
Figured it out: In Administer \>\> Customize Data and Screens \>\> Display Preferences: The WYSIWYG field was set to "Joomla Default Editor" (it didn't matter what the default editor in Joomla's Global Configuration was set to - tried them all and the issue kept occurring).

When I set WYSIWYG in CiviCRM's Display Preferences to "CKEditor" or "TinyMCE" all is well.

---
Tags: contacts, mailing
---


title: testing contribution pages

text:
# Question
Title: testing contribution pages
I need to test some contribution pages before they go live. Is there standard data or a procedure I use? Specifically I need to verify that the donor receives an email confirmation of whatever type of contribution they made. Thank you for your help.

# Answer
> 2 votes
Yes there is - go to Manage Contribution Pages and search for your page. On the right hand side next to the page you want to test, click "Links", then "Test Drive". You can also see this link at the top of the page when editing your contribution page.

For credit card transactions, use Test Visa Card number 4444333322221111, expiry date anything in the future, CVV any three digit number. NEVER USE REAL CREDIT CARD NUMBERS FOR TEST TRANSACTIONS!

You will get a test receipt as long as you've set the email address to yourself!

No transaction will be made. You will only be able to find the contribution inside Civi by specifically searching for test contributions.

This works for donations as well as memberships. It's very useful. I always test every page before making it live!

# Answer
> 0 votes
In addition to doing the test drive, it is worthwhile doing a live transaction, particularly if you've not tested any contribution pages.

In the past I've done the following:

* Enable pay later, if that is not an option, and test using that.
* Use a CiviDiscount code that makes the charge very small, say $1. If you're not using CiviDiscount, you can always reverse the charge.

---
Tags: contribution-page
---


# Question
Title: How can I add (e.g. "add to group") to membership search results or other Action lists?
Our Membership chair entered all of our membership records without assigning them to a group ("Members") but "Add to Group" is not an option in the Membership report screen as it is in other search screens. I don't find a way to add that Action in the Custom Fields, Profiles, or any other menu that I have checked.This is likely to come up in other contexts and similar mods can be done in other areas, so there may be an easy way to do this that I can't find. Otherwise I will have to go in and modify each record. Any help much appreciated.

# Answer
> 4 votes
So there is this perverse magic - wash your car and it rains, get in the shower and the phone rings. Post a question on Stack Exchange and find your answer eight minutes later. If you go to Reports | Membership Reports | Membership Details, the default action is "Add to a Group". Now if I only had a group for Impatient Idiots, I could add myself.

---
Tags: civimember
---


# Question
Title: Adding popup info via CRM.help() - doesn't quite work
I am trying to add some end user popup help text for some fields in a profile. I have looked at several examples in core and extensions and have tried to follow them as examples. I have an extension already loaded where I am (attempting) to manage the code. I have added the anchor html and "onclick" javascript into the field's pre-help text for the custom field.

The popup works, of sorts. The popup appears, along with the title supplied in the anchor tag, but the actual content of the popup does not.
`

`

The .hlp file has IDs named correctly AFAIK, as what-is-this-title and what-is-this. What am I missing?

# Answer
This is how I have implemented the popup help texts in CiviSEPA. The main difference here is that the .hlp file extension is omitted, the directory separator in the path are escaped and that I have enclosed the code in `{literal}` `{/literal}`-tags.
> 0 votes

---
Tags: custom-fields, extension, javascript
---


# Question
Title: Why can't I send bulk SMS (even though I can send individually)?
I'm working for Engineers Without Borders Galicia and we are migrating our volunteer managing system to CiviCRM. I'm experiencing something quite like this bug: https://issues.civicrm.org/jira/browse/CRM-15702

I can send SMS to individuals from his profile page, but bulk SMS are not sent , although the report says the job is completed. The users in the group (a one man group) have all emails. Our SMS provider is Twilio and there is no trace of the bulk sms. The normal ones get perfectly sent (and logged).

Any help would be very much appreciated.

Iván Lago.

IT Engineer at Engineers Without Borders Galicia

More info: Server version: Apache/2.2.22 (Debian) CMS: Drupal 7.36 CiviCRM version:4.6.0 PHP: 5.4.39-0+deb7u2 MySQL: 5.5.41-0+wheezy1 SMS Provider: Twilio (test acount)

//Edit 1: As someone noticed at CiviCRM forums, there's no such version 5.6.0 . It was a typo fail that I've copy-pasted many times. Sorry about that. **CiviCRM version is 4.6.0.**

//Edit 2: To give more data, I'm forcing the process of sending pending sms with the call:

> php /var/www/sites/all/modules/civicrm/bin/cli.php -u \[myuser\] -p \[mypassword\] -e Job -a execute

Obviously, with my user and password where necessary. The jobs get done... but no sms are ever sent :( .

# Answer
> 5 votes
Hi I'm having this exact problem and have done some debugging:

When making a new SMS there are three steps

1. you first select recipients
2. then you write the body of the SMS
3. you schedule the SMS

Between step one and two the table `civicrm_mailing_recipients` correctly gets filled with email\_id set to null and phone\_id set with the id of the contacts' phone numbers. This gets done in the function `getRecipients` in `CRM/Mailing/BAO/Mailing.php`, and the phone\_ids get set because `$mode` is set to "sms".

But after completing step three this function is called again and `$mode` is now empty, and the email\_id is set instead and phone\_id is set to null.

This results in an empty result from an sql-call in the function `deliver` in `CRM/Mailing/Bao/MailingJob.php`, which try to get the recipients, but returns empty and thus there's no one to send to.

This second call to `getRecipients` is made by the function `create`, also in `CRM/Mailing/BAO/Mailing.php`, and it's there $mode is NOT getting set, and there's no checking if it's an sms or not:

```
  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email);
  }

```

So to fix that I altered it to this:

```
  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

```

And now it works. When the "Send Scheduled SMS"-job is run, the bulk sms gets sent. I've filed an issue at https://issues.civicrm.org/jira/browse/CRM-17331

# Answer
> 3 votes
It is because you have a test account. If you go to a paid account, the issue will stop.

https://www.twilio.com/blog/2012/07/new-twilio-free-trial-phone-numbers-for-all.html

> SMS
>
> ```
> You must verify a phone number before you can send SMS messages
> to it from your trial phone number.
>
> ```

https://www.twilio.com/help/faq/twilio-basics/how-does-twilios-free-trial-work

> Trial numbers can only call and text verified numbers.

https://stackoverflow.com/a/25581823/4406810

> 2) Is it because I have a trial account and will it work once I upgrade? From an trial account You can send SMS to the number with you registered. To other numbers it will work after you upgrade your account.

# Answer
> 1 votes
I experienced this myself, but understood that it was plenty of ways to run into the issue of not being able to send bulk-sms. Try to limit the issue first:

If it is in fact the same issue as I experienced, on the forum thread, then this will help you figure out what the issue is all about.

1. Send a bulk sms with a template including a token, and an e-Mail adress recorded at the contact.
2. Send a bulk sms with a template without any tokens, and an e-Mail adress recorded at the contact.
3. Send a bulk sms with a template including a token, and no e-Mail adress recorded at the contact.
4. Send a bulk sms with a template without any tokens, and no e-Mail adress recorded at the contact.

5. And then possibly combinations where "No bulk e-mail" is ticked off.

There was submitted a fix for case 5 I think, but our issue actually was case 1, I think.

Good luck!

---
Tags: civimail, drupal, 4.6.0
---


# Question
Title: CiviEvent registration prevented with “missing fields” error for CiviDiscount free registrations for event
We are running CiviCRM 4.6.8 on Drupal 6.37.

We are a theatre company and we use CiviEvent to sell tickets/register attendees for events. We've have set up a membership group for alumni actors and used CiviDiscount to set up the option for alumni actors to register for a pair of comp tickets to any performance:

But, because the registration costs $0, no billing fields appear (nor does the Civi Copy Address"Billing Address same as" checkbox), and the registrant receives an error message and is unable to complete registration:

Especially since seating is limited, we need to still be able to track attendees, even if they are comped in. This seemed like the best way to allow a particular group of people access a specific discount--non-members wouldn't receive the discount, obviously, and we'd still be able to track who attends which performances and when seats are no longer available.

This also happens if "Pay later" is selected, which I've seen listed as other questions, and appears to be fixed for version 4.6.9, which has not yet been released. Is there a solution in the meantime?

# Answer
This sounds like the same problem as: https://issues.civicrm.org/jira/browse/CRM-17082

Looks like you need to apply 2 patches mentioned in the issue.
> 1 votes

---
Tags: civievent, registration
---


# Question
Title: How to capture verbal contribution commitments: invoice, contribution pending or pledge?
If a constituent makes a verbal commitment (ie. at event or via phone campaign) to make a one-time donation (ie. pledge) and we want to track + invoice them to fulfill that pledge, what is the best way to process via online self-service?

It looks like Pledges are designed for this, however:

* They require an installment period. We only have a commitment for a one-time donation.
* We need to ensure the payment matches / fulfills the pledge. Is there a special link for a pledge fulfillment/payment online? If not, the system will consider the pledge unpaid and continue to send reminders.

Alternatively, we can create a contribution with payment pending (or create a Pledged status type)

* How do you send an email invoice and ensure that the payment matches the pending contribution?
* Is there a way to construct the URL so the payment marks the contribution as complete?

I'd be open to using webforms - This seems like a common use-case.

# Answer
Unfortunately pledges do not work with online contribution forms the way you'd like without an extension. You can use the framework for partial payments that's available in github and seen at the CiviCon in Denver earlier this year

First you'll need to create the contribution(not a pledge) on the back end. You probably can use the same concept with a checksum email if you don't want to require a login.
> 1 votes

---
Tags: contributions, pledges
---


# Question
Title: Some contact information not returned by API Get call
I am fetching individual contacts using the following:

```
function get_member($id) {
 $member = array();
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
 $config = CRM_Core_Config::singleton( );
 require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
 $contact = civicrm_api('Contact','Get',array('contact_id' => $id, 'version' =>3));
 if ($contact) {
    $member = $contact['values'][$id];
    $member['membership'] = civicrm_membership_contact_get($id);
 }
 return $member;
}

function civicrm_membership_contact_get($contact) {
  $params = array('contact_id' => $contact);
  try{
    $result = civicrm_api3('Membership', 'get', $params);
    $id = $result['id'];
    return $result['values'][$id];
  } catch (CiviCRM_API3_Exception $e) {
    $errorMessage = $e->getMessage();
    $errorCode = $e->getErrorCode();
    $errorData = $e->getExtraParams();
    return array(
      'error' => $errorMessage,
      'error_code' => $errorCode,
      'error_data' => $errorData,
    );
  }

}

```

The values array returned has all of my name fields, address fields, job title, employer, email, region... but not my website URL. Screenshot is of the actual contact entry in the Civi admin.

How do I get the Website URL in my data?

# Answer
According to the API explorer, the Contact Entity does not return the website information. To include that data, you would have to use a GET action on the Website entity. See the example at (your site)/civicrm/api#examples for the fields the Website entity can return.
> 1 votes

---
Tags: api
---


title: Webform civicrm not creating contacts

text:
# Question
Title: Webform civicrm not creating contacts
Something is not right with my webform civicrm installation (version 7.x-4.12 with webform 7.x-4.11, CiviCRM 4.5.4). Creating a contact (even with one field included) fails, with this constraint violation logged:

```
The CiviCRM "contact create" API function returned the error: "DB Error: constraint violation" when called by line 589 of wf_crm_webform_postprocess.inc with the following parameters: "Array ( [contact_type] => Individual [contact_sub_type] => Array ( ) [webform_label] => Contact 1 [first_name] => Test [last_name] => Test [source] => Test [check_permissions] => [version] => 3 ) "

```

webform civicrm works fine updating existing contacts. Looking at the CiviCRM backtrace, the errors begin with inserting into civicrm\_log because there isn't a corresponding id in civicrm\_contact, since the contact hasn't been created. Here's a backtrace:

```
Oct 02 02:25:31  [info] $backTrace = #0 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/CRM/Core/Error.php(866): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: constraint violation", -3, 16, (Array:2), "INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key...")
#4 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-3, 16, (Array:2), "INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key...")
#5 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -3, NULL, NULL, "INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key...", "DB_Error", TRUE)
#6 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-3, NULL, NULL, NULL, "1452 ** Cannot add or update a child row: a foreign key constraint fails (`aca_civicrm_v2`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)")
#7 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 ) ")
#9 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 ) ")
#10 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  23217 , 'civicrm_contact,23217' ,  23181 ,  20151002022531 ) ")
#11 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/CRM/Core/DAO.php(455): DB_DataObject->insert()
#12 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/CRM/Core/BAO/Log.php(139): CRM_Core_DAO->save()
#13 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(233): CRM_Core_BAO_Log::register(23217, "civicrm_contact", 23217)
#14 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php(320): CRM_Contact_BAO_Contact::add((Array:14))
#15 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/api/v3/Contact.php(409): CRM_Contact_BAO_Contact::create((Array:14))
#16 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/api/v3/Contact.php(103): _civicrm_api3_contact_update((Array:9), NULL)
#17 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(86): civicrm_api3_contact_create((Array:8))
#18 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/Civi/API/Kernel.php(95): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#19 /var/www/vhosts/mydomain.com/site/sites/all/modules/civicrm/api/api.php(25): Civi\API\Kernel->run("contact", "create", (Array:8), NULL)
#20 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform_civicrm/includes/utils.inc(1473): civicrm_api("contact", "create", (Array:8))
#21 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(610): wf_civicrm_api("contact", "create", (Array:6))
#22 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform_civicrm/includes/wf_crm_webform_postprocess.inc(143): wf_crm_webform_postprocess->createContact((Array:16))
#23 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform_civicrm/webform_civicrm.module(205): wf_crm_webform_postprocess->preSave(Object(stdClass))
#24 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform/includes/webform.submissions.inc(147): webform_civicrm_webform_submission_presave(Object(stdClass), Object(stdClass))
#25 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform/webform.module(3298): webform_submission_insert(Object(stdClass), Object(stdClass))
#26 /var/www/vhosts/mydomain.com/site/includes/form.inc(1513): webform_client_form_submit((Array:33), (Array:24))
#27 /var/www/vhosts/mydomain.com/site/includes/form.inc(903): form_execute_handlers("submit", (Array:33), (Array:24))
#28 /var/www/vhosts/mydomain.com/site/includes/form.inc(385): drupal_process_form("webform_client_form_1633", (Array:33), (Array:24))
#29 /var/www/vhosts/mydomain.com/site/includes/form.inc(130): drupal_build_form("webform_client_form_1633", (Array:24))
#30 /var/www/vhosts/mydomain.com/site/sites/all/modules/webform/webform.module(1986): drupal_get_form("webform_client_form_1633", Object(stdClass), FALSE, FALSE)
#31 [internal function](): webform_node_view(Object(stdClass), "full", "en")
#32 /var/www/vhosts/mydomain.com/site/includes/module.inc(895): call_user_func_array("webform_node_view", (Array:3))
#33 /var/www/vhosts/mydomain.com/site/modules/node/node.module(1440): module_invoke_all("node_view", Object(stdClass), "full", "en")
#34 /var/www/vhosts/mydomain.com/site/modules/node/node.module(1335): node_build_content(Object(stdClass), "full", "en")
#35 /var/www/vhosts/mydomain.com/site/modules/node/node.module(2670): node_view(Object(stdClass), "full", NULL)
#36 /var/www/vhosts/mydomain.com/site/modules/node/node.module(1465): node_view_multiple((Array:1), "full")
#37 /var/www/vhosts/mydomain.com/site/modules/node/node.module(2762): node_show(Object(stdClass))
#38 [internal function](): node_page_view(Object(stdClass))
#39 /var/www/vhosts/mydomain.com/site/includes/menu.inc(517): call_user_func_array("node_page_view", (Array:1))
#40 /var/www/vhosts/mydomain.com/site/index.php(21): menu_execute_active_handler()
#41 {main}

```

Using CiviCRM API explorer there is no problem adding a new contact with the same parameters. I don't see any MySQL/PHP errors in the logs.

There is at least one other person experiencing a similar error, although he has narrowed the issue down to the name prefix field, which I am not using in my test forms.

What else should I be looking at to troubleshoot this?

# Answer
From the backtrace, it appears that the contact has already been created by the time the logging error happens. Since the API uses rollbacks, the error inserting into the log probably forces the contact crete to be rolled back, thus deleting the new contact.

Seems like something is wrong with your logging schema. One easy solution might be to switch to advanced logging, which is a recommended setting anyway, and ditch the simple logging and whatever bug it's got in it.
> 2 votes

---
Tags: api, contacts, webform-civicrm
---


# Question
Title: Payment processing error after migrating to a new server
We use the the CiviCRM payment processing extension for Click and Pledge. We migrated from shared hosting to a virtual server hosting. After the migration the payment processing is getting an error;

> Fatal error: Class 'SoapClient' not found in /home/XXXXXXXXXXX/public\_html/wp-content/plugins/files/civicrm/extensions/wordpress-civicrm-master/com.clickandpledge.payment.clickandpledge/clickandpledge.php on line 202

The domain name has not changed and the DNS records are pointing to the new server IP address. It has been several days and the new IP address has gone through the internet.

Any suggestions on how to correct?

Everything else with the migration seems to have worked fine.

# Answer
Seems your new hosting environment doesn't have `SoapClient` enabled in their PHP.

Check `phpinfo()` output to verify this.

You may be able to enable this yourself or you may need to request it from your new hosting provider - if you have control of your PHP settings you can do this in `php.ini`, or talk to your provider to have them do it.

See also https://stackoverflow.com/questions/11391442/fatal-error-class-soapclient-not-found
> 1 votes

---
Tags: extension, payment-processor, contribution-page, migration
---


# Question
Title: Network Error due to Cross-Origin Request Blocked
All,

This post https://forum.civicrm.org/index.php?topic=34829.0 describes the problem I just experienced. I was able to work around the issue by deleting www from the address in the address bar. Obviously, this is not a solution.

What is the proper way to solve this problem?

# Answer
> 2 votes
Ensure that your site is accessible via a single *canonical* hostname. Configure your webserver or CMS to redirect requests for other hostnames to the canonical hostname.

Currently your site is permitting people to browse on both *www.example.org* and *example.org*. While this works fine for Drupal/Joomla/WordPress, CiviCRM doesn't handle it well, and you'll see form submission errors or CORS issues.

By configuring a canonical hostname redirect, visitors hitting the wrong URL (eg *www.example.org/donate*) will be immediately redirected to the preferred hostname (eg *example.org/donate*).

The following settings must match:

* canonical hostname in your webserver or CMS configuration (varies by software in use)
* Base URL in CMS config (Wordpress: `wp_options` table; Drupal: `$base_url` in settings.php; Joomla!: \_______?)
* `CIVICRM_UF_BASEURL` configured in `civicrm.settings.php`
* Resource URLS in civicrm admin section

Make sure to check both scheme (`http://` vs `https://`) and hostname (`example.org` vs `www.example.org` vs `www2.example.org`). Some modules or extensions (eg Drupal "secure pages") that offer redirects will also need to be considered/configured.

Configuring canonical hostname redirect is recommended for SEO as well as because it makes civicrm behave much better :)

---
Tags: civimember
---


# Question
Title: Why can't Smart Groups be assigned the Access Control group type?
I'm using CiviCRM 4.5.8 and WordPress. I want people to only access the data for their state. I was going to use ACL to do that. I set up a smart group for Wisconsin, but there's no check box for Access Control. I can only check Mailing List. What's up with that? Thanks in advance!

# Answer
> 3 votes
According to a 2007 forum post by Donald Lobo (a CiviCRM founder): For efficiency purposes the acl role needs to be assigned to a static group.

Perhaps the CiviRules Extension will allow you to add your users to a static group(?)

---
Tags: smartgroups
---


# Question
Title: Does CiviRules add/remove a contact to a Group based on Membership starting/expiring
Haven't used CiviRules before and I see it is only listed as working on 4.4 - but I want to see if on 4.6 can it

* add a contact to a Group when they purchase a new Membership,
* remove them from a Group when their Membership expires
* act on only specified Membership types

# Answer
Yes Pete, we have not worked on any conditions for membership status. We never had (and never will :-)) have the ambition of creating all sorts of Conditions. We have created the engine and the conditions/actions that our projects need. However, the engine allows you to create your own conditions and actions quite easily, that is documented on our wiki: http://redmine.civicoop.org/projects/civirules/wiki

Documentation pages on creating conditions: http://redmine.civicoop.org/projects/civirules/wiki/Tutorial\_create\_a\_new\_and\_simple\_condition http://redmine.civicoop.org/projects/civirules/wiki/Tutorial\_create\_a\_more\_complicated\_condition\_with\_its\_own\_form\_processing It should be a pretty easy job to add a condition for membership type or membership status.
> 3 votes

# Answer
I will add to this as I explore, but first up my findings.

There is an 'event' for

* membership is added
* membership is changed

There is an 'action' for "add to group" which allows adding to single or multiple groups.

AFAIK there is no Condition yet for \- Membership type \- membership status change

Also checked out if I could make the Rule based on the Activity that is generated when someone Expires eg \- Activity Type = Change Membership Status \- Activity Subject = Status changed from Grace to Expired

While the former exists, the latter doesn't so I can't see that I can currently build the Rule off that.

So either way looks like we need to add some new Conditions. Will update on progress
> 2 votes

---
Tags: civirules
---


# Question
Title: How can I import Memberships without membership start date?
I want to import membership in update mode and I don't have `start_date` so at the time of import it shows me `start_date` is required field. I have removed `membership_start_date` required field from `/civicrm/CRM/Member/Import/Form/MapField.php` file after that it is giving me error-

> Invalid value for field(s) : Membership Start Date is required to create a memberships.; Start Date" in import\_error.csv file

# Answer
Let's assume that you can't edit the CiviCRM files or database - or only will do so as a last resort :)

These are existing memberships, so you should be able to export the memberships info with the actual start date, add the start\_date to your CSV file and import with the start date.

I'm surprised membership start date is required....I'll ask that question on stack exchange :)
> 1 votes

---
Tags: civimember, import
---


title: Does CiviCRM work with Ninja Forms?

text:
# Question
Title: Does CiviCRM work with Ninja Forms?
In wordpress, when setting up a ninja form text block I get the following error. It shows up next to the "Add Media" button so I assume that it is trying to add a Civicrm button and fails.

> Notice: Trying to get property of non-object in /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php on line 170 Call Stack: 0.0000 239040 1. {main}() /var/www/wordpress/wp-admin/admin-ajax.php:0 0.1404 4172272 2. do\_action() /var/www/wordpress/wp-admin/admin-ajax.php:89 0.1404 4173800 3. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1404 4173944 4. ninja\_forms\_new\_field() /var/www/wordpress/wp-includes/plugin.php:503 0.1940 4190192 5. ninja\_forms\_return\_echo() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/ajax.php:193 0.1940 4207304 6. call\_user\_func\_array() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1940 4207768 7. ninja\_forms\_edit\_field() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/functions.php:7 0.1941 4207952 8. do\_action() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:6 0.1941 4209592 9. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.1941 4209760 10. ninja\_forms\_edit\_field\_output\_li() /var/www/wordpress/wp-includes/plugin.php:503 0.1958 4214568 11. nf\_output\_registered\_field\_settings() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:123 0.1987 4218784 12. ninja\_forms\_edit\_field\_el\_output() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/li.php:419 0.1993 4221088 13. wp\_editor() /var/www/wordpress/wp-content/plugins/ninja-forms/includes/admin/edit-field/edit-field.php:132 0.1995 4230840 14. \_WP\_Editors::editor() /var/www/wordpress/wp-includes/general-template.php:2565 0.2024 4238472 15. do\_action() /var/www/wordpress/wp-includes/class-wp-editor.php:222 0.2096 4250120 16. call\_user\_func\_array() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250272 17. CiviCRM\_For\_WordPress\_Shortcodes\_Modal-\>add\_form\_button() /var/www/wordpress/wp-includes/plugin.php:503 0.2096 4250344 18. CiviCRM\_For\_WordPress\_Shortcodes\_Modal-\>post\_type\_has\_button() /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.shortcodes.modal.php:101

It prevents the text field from being saved in the form. In this case I don't need any civicrm processing in the form so it does not need to be there but I don't know how to remove it. Has anyone dealt with this before?

Versions: Wordpress 4.3.1, Civicrm 4.6.8, Ninja forms 2.9.28

# Answer
> 2 votes
Fixing this will require a change to the Civi-WP plugin. In the meantime, put the following code on a new line below the one that reads `$screen = get_current_screen();` which should be at line 164 of 'civicrm.shortcodes.modal.php'.

```
if ( ! isset( $screen->post_type ) ) return;

```

That should mean your fields are saved again.

---
Tags: wordpress, forms
---


# Question
Title: MyISAM vs InnoDB - WordPress Installation
We're running CiviCRM 4.6.8 on WordPress 4.3.1.

I've been getting the following error message since the last CiviCRM upgrade:

> Warning 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.

The site is on a shared server, so I can't change the storage engine unless we move the website to a VPS package.

Does it matter? Should we fork out the $ for a VPS? Migrate elsewhere?

# Answer
> 0 votes
You can find a number of shared hosts that do support InnoDB if your budget doesn't cover costs for a VPS (not to mention that you may/not have the expertise or time to manage/administer a virtual private server).

# Answer
> 2 votes
To speak to the worth of a VPS -- **yes, it is worth the money to use a VPS instead of shared hosting when CiviCRM is involved.** Certainly, you get the benefit of controlling your server environment for things like database engine changes, but perhaps the biggest benefit you will see is increased performance. The shared environment may work in the short term, but as your database and needs grow, I suspect you will hit limitations with your hosting.

See this question for reference: Choosing a VPS solution for CiviCRM

# Answer
> 0 votes
And you can not use MyISAM for CiviCRM!

---
Tags: wordpress, database, mysql
---


title: How to request bug fix for LTS

text:
# Question
Title: How to request bug fix for LTS
How do I request that LTS include a particular bug fix?

The issue in question is https://issues.civicrm.org/jira/browse/CRM-13287. It's an issue for my site upgrading to 4.4 now and presumably 4.6 once it's officially the LTS release, so I'd like to get it incorporated.

I can run a patch for the simple fix as described in the jira, it's just the deletion of a single space changing $nullIndex = $nullValueIndex = ' '; to $nullIndex = $nullValueIndex = '';

But once I have the patch, what do I do with it to get it applied to LTS?

# Answer
> 5 votes
The process to get a bug fix included is to **submit a Pull Request ("PR") to that branch on Github**.

This is documented in the civicrm wiki: How to Submit a Patch to a Version Branch

1. Get yourself a GitHub account.
2. Create an issue in JIRA (already done, `CRM-13287`).
3. Create a fork of the appropriate branch of `civicrm-core` to your own account.
    * *At this point I'd usually create a branch named for the JIRA issue.*
4. Make changes to your forked repository.
    * *For this small change you could easily apply the patch manually in the GitHub web UI, but for most changes you would clone the codebase to your computer using Git / GitHub app, change the code locally and test it, then push the changes back to your fork.*
5. Use the GitHub web UI to submit a Pull Request back to the original branch.
6. Note the PR number / URL in GitHub, go back to the JIRA issue and add a comment identifying the the PR in the issue.

To get a change into LTS, submit your change to the appropriate version branch - currently 4.4 - as well as to the master branch.

---

**Going further** ... Your aim is to make it easy for maintainers to accept the change, to make it clear why they should accept the change, and to reassure them that the change is not harmful. Submitting a PR addresses the first of these.

The PR makes it easy for maintainers to merge the changed code in. To help illustrate the motivation for accepting the change, you might need to improve the ticket in JIRA so that the severity of the problem is clear. To demonstrate that the change is not harmful, you might expand test coverage to prove that the functionality before and after the change is equivalent or even improved.

---
Tags: custom-fields, lts
---


# Question
Title: Autoloader problem after upgrade to version 4.6.8
I'm not quite sure if this is a drush or a civicrm problem, sorry if this is the wrong forum.

I did an upgrade yesterday evening from version 4.6.4 to version 4.6.8. Drush version is 5.9. Today I tried to clear the cache using `drush cc all`, but I get an "unrecoverable error" message saying that:

```
PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /<myciviinstall>/civicrm/civicrm-4.6.8/civicrm/vendor/composer/autoload_real.php on line 37
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /<myciviinstall>/civicrm/civicrm-4.6.8/civicrm/vendor/composer/autoload_real.php, line 37

```

This also happens for the `drush cc civicrm` command, and for the civicrm cron job:

```
30 * * * * /<hiddenpath>/bin/drush/drush -u 1 -r /<mysite>/public_html -l mysite.com civicrm-api job.execute auth=0 -y > /<hiddenpath>/cron/cronlogs/civi_error_drush_`date +\%F_\%T`.log /dev/null`

```

I should point out that the reason for the somewhat strange path in the PHP Fatal error message, is that I'm running civicrm (on Drupal 7) via softlinks to keep old versions present but "out of the way" so to speak. This to be able to (more) quickly swap back to older versions. This approach has worked well for me in the past, and I didn't have this drush problem yesterday evening before the upgrade.

Googling, I find clues that this may indicate that the version of the composer autoloader is out of date, but I'm not sufficiently familiar with composer to be able to tell for sure (is composer a drush thing only?).

Anyone got an idea?

# Answer
> 1 votes
This error can occur when there is a clash with a Composer autoloader for another module, e.g. the Currency module.

A README has been added to currency 7.x-2.5 re this error, advising: 'try manually updating Currency's Composer dependencies by running the command "composer update" in Currency's root directory.' This worked for me. Vandalf isn't using Currency but maybe a similar issue with another module? Try searching for files called composer.json under your modules directory.

---
Tags: cron-job, drush
---


# Question
Title: Remove Default Profile Fields from Drop Downs
Ok, when creating new profiles within CiviCRM for events or contribution pages, some of my customers are using fields that do not coincide with the information that the payment processor recognizes, so the "My Billing Address is the Same" doesn't carry over all of the information.

Is there a way to remove some of the "default/standard" Individual/Contact profile fields available in CiviCRM with Drupal?

* CiviCRM Version: 4.6.4
* Drupal 7

Let me know if you need any further clarification.

I really appreciate any help on this one! :)

Thank You!!

# Answer
Typically the "billing address" you collect for credit cards should only contain the fields actually needed by the credit card processor, as that's all it is used for. The home address can collect additional fields, and the user would need to enter that additional info as it won't be collected for the credit card.
> 1 votes

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


# Question
Title: Should smart groups be highlighted so users are aware they are smart and so avoid corrupting them?
One of my users has corrupted most of their smart groups by manually adding & deleting contacts. Talking to the user, she was not aware of what was a smart group and what was a regular group. in fact, in normal use there is no visual difference (unless I'm missing something). However, in 'contacts/manage groups' menu option it is clearly displayed but not otherwise. Clearly indicating that a group is smart would avoid this problem - use a different colour? I have noticed other questions about smart groups that indicate corruption caused by users manually adding contacts. Do other users think this would be worthwhile?

# Answer
> 4 votes
That's a good suggestion. I've also heard the suggestion to provide an admin option to "lock" smart groups to prevent manual adding/removing of contacts.

# Answer
> 2 votes
What version of CiviCRM are you using Andy? I have heard the same experience from customers in the past, I think it makes sense to highlight the difference between smart groups and 'static' groups.

---
Tags: smartgroups
---


title: Recommended version of PHP?

text:
# Question
Title: Recommended version of PHP?
What PHP version would you recommend for running CiviCRM version 4.6.8?

I was using an old version of PHP (4.3.3), but that is no longer sufficient to run CiviCRM and 5.4+ is recommended in the documentation. Would it be wise to upgrade to the latest version 5.6.13 or might I be safer with something like 5.5.29?

# Answer
The safest bet is probably 5.5. 5.6 ought to work but hasn't been tested as thoroughly. As a core CiviCRM developer I currently use 5.5.9 in my test environment.

You should also look at which version is recommended for your CMS, often that is more of a limiting factor.
> 6 votes

---
Tags: php
---


title: Price-set Overload!

text:
# Question
Title: Price-set Overload!
I have CiviCRM deployment in which many events are created each week with unique price-sets. The staff using the back-end often goes in and makes typos, edits, and generally tweaks price-sets often. Each time they make an edit, the price-set is saved as a copy, and they piling up in a serious way.

The price-set listing page takes minutes to load, and has no pager, and the drop down to select a price-set in the Event Configuration page is becoming quite unusable.

Some questions: 1. Is it necessary for Price sets to be duplicated on each edit? 2. Can price sets be deleted without consequence to the events, registrations, and payments (IE, how do price sets work?) 3. Is there a "safe" way to purge these old, unused price-sets, without having to go through each one, perhaps via direct DB manipulation? We would be willing to simply purge all price sets if we could do it without losing event,registration,payment data.

Any ideas would be much appreciated!

# Answer
Price-sets are referenced by events and contribution pages. They are independent from events but can be referenced by them. They are similar to locations or option-sets - if you delete one then anything refering to it will be unreferenced. You can use the API (or API-explorer) to delete them faster than the UI but be very careful with SQL as you can break a lot if you are not careful. 1. No, there is no need to duplicate price sets, but it may be convenient 2. Safest way is to de-reference a price set and then delete it (or delete old events that refer to it.) 3. API, extension or (in drupal) using civicrm\_entity you can create rules or bulk editing via views (ask as a separate question if you need help.)
> 1 votes

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


# Question
Title: CiviCRM not creating Wordpress user accounts on member registration
We are seeing intermittent behavior with CiviCRM and Wordpress. Sometimes the membership registration page will create a new Wordpress account as expected. Sometimes it doesn't. What would cause this behavior?

The CiviCRM membership registration page has the Wordpress account creation required checked in the profile and primary e-mail is present on the form. Here is the form for reference: https://aslta.org/membership/selection/

WordPress 4.3.1 CiviCRM 4.6.6

# Answer
> 2 votes
+1 for this question - I have had the same issue and I don't have the skills to pin it down. We have a "members only" section of our website and so having up-to-date WP Users is quite important. As a workaround, I go in about once a month and export "current" members from CiviCRM and then import them into WordPress to ensure that there are WP User accounts for each. It's messy but...

I thought it was just a bug with how we've got CiviCRM/WordPress setup (we're amateurs and muddling our way through!).

(Sorry this isn't a comment - I don't have enough cred yet to post them :). But it's an answer, just not a good one!)

---
Tags: wordpress, civimember, user-account
---


# Question
Title: The field 'custom_39' has no associated option list
This error comes up when I try to edit or create a group:

> Sorry but we are not able to provide this at the moment. The field 'custom\_39' has no associated option list.

It produces a 732K long error log that I will not paste here. Any hints how I would debug this one.

# Answer
> 1 votes
It sounds like you may have a smart group that relies on a custom field which you have since disabled or deleted. See if you can find the id of the smart group in that huge backtrace. Or else try re-enabling that field to see if the problem resolves itself.

# Answer
> 1 votes
I discovered that the issue was related to the extension **Auto Group Assignments (org.amnesty.es.autogroupassignments)**. I had this deinstalled, but apparently does not do so correctly. Both disabling and deinstalling gives DB already exist errors. I can now only edit/create groups with this extension activated.

The work around is to do a manual but partial clean-up after deinstall:

* drop table ***civicrm\_value\_automatic\_group\_assignments*** (and *possibly **log\_civicrm\_value\_automatic\_group\_assignments***)
* delete ***Affects\_API\_calls*** and ***Default\_Group\_for\_New\_Contacts*** from *civicrm\_custom\_field*
* delete ***Automatic\_Group\_Assignments*** from ***civicrm\_custom\_group***

This however still leaves you with a *DB exist* error when you reinstall the extension

---
Tags: custom-fields, groups
---


# Question
Title: How to work with names that don't fit first, last
I'm implementing CiviCRM for a client who works with African contacts whose names do not fit CiviCRM's first, \[middle,\] last format.

e.g. someone's name may have 4 parts, and may be presented in any order, although they will be presented in a particular way on their passport.

In terms of name display it seems that sort\_name is favoured, but this presents names like: `last, first`. This jumbles the order in lists and is not helpful like it is with Western names.

I cannot put the whole name in the last name field and not use the first name because this is a requirement for creating a contact.

I would like to either

1. get control over 'sort name', e.g. I could make it simply concatenate first name, space, last name, instead of last name, comma, first name.
2. allow empty first names (then I can just use the last name field).

Is there a way to achieve either of these?

# Answer
Many thanks to Andrei for supplying this answer in a comment:

> If you navigate to **Administer-\>Customize Data and Screens-\>Display Preferences** at the bottom you have two fields:
>
> Individual Display name format: `{contact.first_name}{ }{contact.last_name}` and
> Individual sort name format: `{contact.first_name}{ }{contact.last_name}`

By updating this setting I can just put whichever is the first name in the first name field, the rest of the names in the last name field, and the records will always show `name1 name2 name3 ...` everywhere it is listed/sorted.

The last step was to update the existing entered names. I did this with the following SQL, which was appropriate for my particular use (and may not be for yours!):

```
UPDATE civicrm_contact SET sort_name = display_name
WHERE contact_type = 'Individual';

```

And now my names are working exactly as the client requested throughout the system. Many thanks.
> 2 votes

---
Tags: 4.6
---


# Question
Title: SMS breaks when upgrading to version 2 of extension & 4.6.2 of CIVICRM
SMS API version 1.2 & Clickatell version 2 extensions were added. Clickatell was set as an SMS Provider. Clickatell was working with version 1 of the extension and 4.5.8 of civicrm.

When sending the sms, there is no indication of a failure, it just never gets sent.

Log file output - 2015-06-16 21:30:02 Send Scheduled SMS
Entity: Job Action: process\_sms Summary Finished execution of Send Scheduled SMS with result: Success (a:0:{}) Details

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

Full message: Finished execution of Send Scheduled SMS with result: Success (a:0:{})

```
LOG FILE-
Jun 16 22:45:02  [info] $INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishing scheduled jobs execution.' )  = #0 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(608): CRM_Core_Error::backtrace("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...", TRUE)
#1 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2380): CRM_Core_Error::debug_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
#2 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
#3 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
#4 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(237): CRM_Core_DAO->save()
#5 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(87): CRM_Core_JobManager->logEntry("Finishing scheduled jobs execution.")
#6 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
#7 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
#8 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#9 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("job", "execute", (Array:2), NULL)
#10 /home/depot/public_html/drupal/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1533): civicrm_api("job", "execute", (Array:2))
#11 [internal function](): drush_civicrm_api("job.execute", "auth=0")
#12 /usr/bin/drush-4.x/includes/command.inc(131): call_user_func_array("drush_civicrm_api", (Array:2))
#13 /usr/bin/drush-4.x/includes/command.inc(836): _drush_invoke_args("civicrm-api", (Array:2), "civicrm")
#14 [internal function](): drush_command("job.execute", "auth=0")
#15 /usr/bin/drush-4.x/includes/command.inc(236): call_user_func_array("drush_command", (Array:2))
#16 /usr/bin/drush-4.x/drush.php(101): drush_dispatch((Array:22))
#17 /usr/bin/drush-4.x/drush.php(41): drush_main()
#18 {main}

```

# Answer
I use Twilio, but had this problem too. I found what i believe to be a bug in Civi's mailing code (which also handles sms'es). In the function `create` in `CRM/Mailing/BAO/Mailing.php` on line 1755, `getRecipients` are called without the last argument `$mode`, and `getRecipients` are executed as if it's an email and not an SMS. I added a check to see if it's and sms, and added the extra argument, and it worked for me:

```
  // Populate the recipients.
  if (empty($params['_skip_evil_bao_auto_recipients_'])) {
    // check if it's an sms
    $mode = $mailing->sms_provider_id ? 'sms' : NULL;
    self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
  }

```

Read more at the issue I filed here.
> 2 votes

# Answer
You probably have to determine in which extension your error is, the SMS API or the Clickatell part. The SMS API is an extension, which you can find here: https://github.com/CiviCooP/org.civicoop.smsapi

It is probably a good idea to raise your issue in GitHub so the developers and maintainers are aware of it. According to the documentation the extension works with CiviCRM 4.5 and has not been upgraded to version 4.6. You can either ask the developers/maintainers if they already have any plans to upgrade the extension (and fix your error). Alternative is to upgrade the extension yourself if you can?
> 0 votes

---
Tags: sms
---


# Question
Title: Is it possible to view map of contacts from front end of the website in Joomla?
I want to display all my contacts/specific group map in front end of Joomla website. is this possible ?

# Answer
> 2 votes
Yes, this is possible.

Have a look at "How to create member listings/directories/maps" on my post on profiles: https://aghstrategies.com/content/civicrm-profiles-beyond-contributions-registrations-part-1

---
Tags: contacts, joomla
---


# Question
Title: Alert/warning when template is used for same contact twice
We use templates to send thank you to our donors. We try to add new templates after a while, to tell a new story. Some donors beat our system, and contributes twice before we change our template.

Do you know a clever way to have an alert or warning to inform back end users, that they are going to use a template already used for a certain contact?

# Answer
> 1 votes
The good news is that mass mails track the template id that was used, so in theory, you could build that functionality.

If you're doing these one at a time, you do have access to past mailings in the activities tab, which may have the information you need.

Not the answer you're looking for, but nice to know that in theory it's possible.

---
Tags: templates
---


# Question
Title: On multi-site CiviCRM, are mailings supposed to be separated per-domain?
According to the CiviCRM wiki here, under "Functional Separation in Multisite", mailings are listed as separated by domain. However, when my users access the "Scheduled and Sent Mailings", they see mailings from all domains. I know that civicrm\_mailing has a field domain\_id. Is there something I need to do to enforce this separation? Or am I just misreading the wiki?

# Answer
> 1 votes
I've since fixed this bug, with funding from Healthcare-NOW and significant assistance from the dev team at the Autralian Green Party: https://issues.civicrm.org/jira/browse/CRM-16981

# Answer
> 3 votes
This is a bug. Please log an issue on https://issues.civicrm.org.

---
Tags: multisite, civimail
---


# Question
Title: Non-administrators unable to tag contacts using Tags tab redux
I'd like to draw attention to a flaw in the ACL permissioning. I'm a volunteer setting up a national database for a new non-profit, but I want non-admins to be able to edit the data for their state and not others. I got that to work using smart groups and the ACL system (yay!). The flaw is that non-admins can't tag contacts. I'm not talking about administering tags...they can't add an existing tag to an existing contact. The permission edit\_all\_contacts is required, but that ruins the state level permissioning. This is a serious flaw that defeats the benefits of the ACL system. This issue was also documented in June: Non-administrators unable to tag contacts using Tags tab In that case, it was Drupal version: 7.37. CiviCRM version: 4.6.3.

I'm using 4.5.8 and the current versions of Wordpress and the Members Plugin. Our org is new and we can't afford much at this point, but we plan on contributing to ya'll once we're up and running. Thanks for the great software and I look forward to your reply!

# Answer
I can't really see the use case where "Edit All Contacts" should be required for adding a tag. I think this is something that should be changed. So the solution is to submit a patch or ask a developer to do so.

Now, I'm not part of the CiviCRM core team - but I do submit patches like this one on behalf of my clients. I'm pretty slammed, but I'll make you an offer. If your organization is willing to join the CiviCRM Membership Program, I'll volunteer to fix this in an upcoming version of CiviCRM - and to help you install a personalized patch so you don't need to wait until you upgrade.

If this is amenable to you, please:

* File an issue for this at https://issues.civicrm.org. Reference this question, and mark the "Funding Source" as "Contributed Code".
* Add a comment on this answer linking to your new issue.
* In 1-2 days, the core team will reply. If they agree that there's no legitimate case for "Edit All Contacts" permission to create tags, you'll join the membership program.
* I'll ask the membership coordinator to inform me when this happens.
* At that point, I'll develop a patch, submit it to the core team, and work with you to get it working on your system.

Please let me know what you think!
> 4 votes

---
Tags: permissions, acl, tags
---


# Question
Title: Event Report Template - Adding Sorting By/Group
How does one add "Organization" as a field to the sort list in the event report template? I have found how to add custom fields but not system default fields.

Version 4.6.8 Joomla

# Answer
If you mean 'how do I show the Organisation that is the Employer of the person attending the event' then you need to see if the 'Current Employer' field is available for that event. "Organisation" is not a field per se. It is a Contact Type.
> 1 votes

---
Tags: civireport, joomla
---


# Question
Title: Can't add New Events "From Template" after upgrade to 4.6
After upgrading from Civi 4.4 to 4.6.7, we no longer have the capability to add a new event from an existing event template.

To replicate:

1) Visit Events \> New Event 2) On the "New Event" page, select an existing template in the "From Template" box

Expected behavior:

After OK'ing a "you're navigating away" browser dialog, the "New Event" page reloads with most fields completed based on our existing template.

Current behavior:

Nothing happens. Nothing shows up on the browser's JS console.

I tried changing themes to make sure it's nothing in our theme's JS.

Any suggestions for further troubleshooting?

Thanks!

# Answer
> 2 votes
Other suggestions that might help add clues:

1. confirm if you have similar problems with creating Events from templates you created post upgrade. Ie is this problem only relating to templates that existed prior to the upgrade
2. if any of your clicks result in a pop up box, instead of clicking, right click, open in 'new tab' then continue, that way you should see errors/backtrace (assuming you have this turned on from Admin \> System Settings)
3. compare behaviour between your system and the civicrm demo site.

---
Tags: civievent
---


# Question
Title: How can many email, address and phone records suddenly disappear?
Title says it pretty much and came to us from a client. The initial concern was that this had occurred due to an upgrade. There was plenty of evidence in the log tables however to show that the data had been deleted by a particular user in bulk.

# Answer
> 2 votes
Eventually it was identified that there is a way this can be done inadvertently when editing a single contact record in order to delete a single address record. This came up on this JIRA ticket.

In the scenario we investigated, it seems that the user was editing a single record, and in order to edit a single address entry they accidentally / inadvertently clicked on the 'spanner' icon to the right which opens up the Location Type page, and this gives access to the Delete button which it is concievable the person might click on thinking they are deleting the single Address, rather than the Location Type.

They do then get the big warning noted in Andrew's answer which we are suggesting could be improved in the JIRA ticket.

Note that the user requires 'administer CiviCRM' permission to get that link to edit location types.

It was possible to restore the data from the log\_tables in this case.

# Answer
> 4 votes
The reason proved to be that an admin user removed a Location Type. There is a clear warning if you try to do this via the UI.

> WARNING: Deleting this option will result in the loss of all location type records which use the option. This may mean the loss of a substantial amount of data, and the action cannot be undone. Do you want to continue?

Have asked about making the warning more specific in CRM-17273: Deleting Location Type should warn about loss of related contact data

---
Tags: contacts
---


# Question
Title: How can I fix "Fatal error: class Mail not found"?
I just migrated CiviCRM back to a development environment and I am getting:

> PHP Fatal error: Class 'Mail' not found in ../web/sites/all/modules/civicrm/CRM/Core/Config.php on line 628

This is when I am running a test mailing. The rest of the site seems OK.

CiviCRM 4.6.3 and Drupal.

# Answer
The development system must not have Mail. I went to

```
mysite://civicrm/admin/setting/smtp?reset=1

```

And picked 'save to database' as the mailer option as I don't really want to send mail anyway, just debug it.
> 1 votes

---
Tags: civimail
---


title: A small problem with the Côte d'Ivoire

text:
# Question
Title: A small problem with the Côte d'Ivoire
I've noticed that on some installs of CiviCRM 4.6 that I'm working with, when using a profile that includes the Country field, for an address for example, I'm seeing that Côte d'Ivoire is listed after Czech Republic, when it should be listed just after Costa Rica.

The order in the database table is correct, so what's causing the listing order to change? I can't reproduce this on the demo site, and the sites that I am seeing it on are using a different default language (English UK as opposed to US English). Might that be a cause of the issue? Any clues as to how to fix this minor yet irritating issue very welcome.

# Answer
> 2 votes
I'm guessing it's whether the particular sort implementation in each case is configured to be UTF8-aware. If I order by name asc in MySQL, I see Côte d'Ivoire just after Costa Rica. If I look at a hex dump of the actual bytes, ô expands to EF BF BD, which will appear long after o (6F) and even z if the sort isn't UTF8-aware. Have a look at the localisation configuration of PHP on your servers.

Sort order can be affected by cultural differences as you suspected, eg Swedish vs German at https://sgehrig.wordpress.com/2008/09/24/on-how-to-sort-an-array-of-utf-8-strings/

---
Tags: localisation
---


# Question
Title: Changing the name of a payment processor on the front end
Would it be possible to change the name of a payment processor in the event registration screen?
When a new attendee is registering for event under Payment Options \> Payment Method they see the radio buttons for the available payment processors such as Paypal or Stripe. I want to change the text for the Stripe option to be Credit Card. Our user base doesn't know what Stripe is and it would helpful if it was more general than the actual name of the credit card processor. Any help would be appreciated.

# Answer
> 4 votes
There are many ways to do this. 2 easiest

1) Change the name of the payment processor in /civicrm/admin/paymentProcessor

The problem with this approach is it becomes less clear to you the administrator.

2) A \*hack\*, go to your current registration page where the radio buttons to choose payment processor appear. Find the \< div \> tag that encompasses both using your browsers debug tools(right click, inspect element). Record the id(id="xxx") of that div.

in the confirmation screen or registration screen(which screen do the radio buttons appear on in your event) open the the WYSIWYG editor for introductory text and **click on the source button**.

Then, enter the following javascript. at the very top, above any text you may have entered.(replace xxx with id you found before)

```
<script type="javascript/text">
    var divOfInterest = document.findElementById("xxx");
    var replacements = {"Stripe":"CreditCard", "Paypal":"Your Paypal Account", "payment3":"betterlabel"};

    for (var toReplace in replacements) {
        divOfInterest.innerHTML = divOfInterest.innerHTML.replace(toReplace, replacements[toReplace]);
    }

</script>

```

Again, make sure you clicked the 'source' button on the WYSIWYG editor. Also, make sure you are adding your javascript to the correct Intro text(prob in registration or confirmation)

Note: this will replace any instance of the word "Stripe" with credit card in that \< div \>.

---
Tags: civievent, payment-processor
---


# Question
Title: Manual registration not being recorded into workshop (price set) count.
We have an event that has workshops (configured as a price set). When we do a manual (not member / user driven) registration of any person, that information is not being tracked in the workshop reports (price set count for workshop). Can anyone help tell us why this might not be being recorded?

# Answer
> 1 votes
Found the answer - it was in the report filtering. I cleared a few, and the missing records were found.....

---
Tags: civireport
---


# Question
Title: Why does the link from Membership Dashboard give a search with the wrong results
On Membership dashboard you can click on numbers in right column to 'see details' but the number of results is different to that on the dashboard.

This may also affect other Dashboard click-throughs such as on Events.

# Answer
> 1 votes
Submitted the PR https://github.com/civicrm/civicrm-core/pull/6911.

The issue was occuring due to the recent change made in Search form as per which field(s) will have entity info in their name (membership\_)status\_id (also for uniqueness) rather then status\_id which raises ambuiguity when we process the param for building whereClause because there are other table that can share same column name e.g. contribution.status\_id.

# Answer
> 1 votes
The url is /civicrm/member/search?reset=1&force=1&status=1,2,3&type=1&owner=1

which suggests the results should filter by Status and Primary but the Status filters are not applied on the search, hence you see 'all' results, rather than just the New, Current and Grace.

Have added a Jira issue for this bug and hope to provide patch at some point.

---
Tags: civimember
---


# Question
Title: How do I report a problem in civicrm_api3 class?
I am using civicrm\_api3 class with the REST api, and Options do not get handled correctly because the code does not allow for an array within the overall parameters array.

I have it fixed (it is a very simple fix), but I don't know who I should let know.

# Answer
> 1 votes
The procedure for reporting bugs is detailed at https://civicrm.org/bug-reporting . This goes through verifying and reproducing the bug, and then it can be added on the issue tracker.

If you have a patch, you can submit a pull request on GitHub (often against https://github.com/civicrm/civicrm-core) with a reference to the bug report.

---
Tags: api
---


title: Member to Member donations

text:
# Question
Title: Member to Member donations
1. can a Programmer customize CiviCRM to do

Member to Member donations with TRACKING of all the members and donations ?

2. what programming LANGUAGE is civicrm written in ?

# Answer
Do you mean members donating TO other members or donations to be credited to other members?

You may be able to utilize the built in personal campaign pages for the first question, then your accountant/bookkeeper would write a check. The latter item is accomplished by the Soft Credit feature.

PHP is the primary language, although javascript, jquery, and ajax are some of the code families used in CiviCRM.
> 2 votes

---
Tags: civimember, developer, pledges, civipledge
---


# Question
Title: Is it possible to print badges with priceset fields?
I use civicrm 4.6.4 on drupal 7.38. My event includes dinner with 2 meal types: fish and meat. Along with other options I created a priceset.

I'd like to define event badges (Administer\>CiviEvent\>Event Badge Layout\>New Badge Layout) where the meal type is indicated on. However I didn't find any priceset fields in the list. Only event fees (not using pricesets) are available. Is it possible to make pricesets fields visible on badges? How do I do that

Many thanks

Johan.

# Answer
> 3 votes
You could use hooks to create custom tokens:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customized+(and+Custom)+Tokens

Or you can see if the Fancy Tokens extension adds the tokens you need:

https://civicrm.org/extensions/fancy-tokens

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


# Question
Title: what is the intent of contribution batches listing financial line items instead of contribution total
To see what I'm referring to:

* create a contribution record
* edit the record and alter the amount
* create a new accounting batch
* observe the record in the contribution search

Instead of displaying the contribution record, it displays the financial line items, which in this case is two records. For example, if you initially created the contribution with an amount of $50 and later changed to $25, you would see:

```
contact   $50
contact  -$25

```

What is the reasoning behind this? It seems overly complicated and is confusing for users. Simply modifying the total amount for a contribution is not necessarily a formal bookkeeping action where there is money in/money out -- it may simply be fixing a data entry mistake.

My inclination was to treat this as an error, but I'd like to understand the reasoning behind it.

**Update/Additional Thoughts**

I had a situation shortly after posting this that helped explain the possible value; but I think it also highlights some shortcomings.

The scenario was a contribution that had been created and batch processed, but was later found to be recorded in error. The user could edit the contribution to adjust the amount, and then when creating another accounting batch, the difference (adjustment) was available for processing.

That is a useful and accounting-significant workflow. However, I still think the scenario where a person simply creates a contribution and then modifies it should not be reflected in this way. There is no accounting impact by that action, and listing the change history only confuses things.

So (IMHO) a preferred behavior would be to only create new line item adjustments if the contribution has been batch processed; otherwise it's sufficient to simply edit the record.

**More Thoughts**

One more issue related to this that I really don't think should be how things function --

If you return at any point to edit a contribution -- for example to add a check number or alter some other value other than the amount -- it results in a positive and negative line item adjustment for the full amount. So if the contribution was $100 and you edit to add the check number and save, when you create an accounting batch you will see:

```
contact   $100
contact  -$100

```

That is totally unnecessary and very confusing (also creates a lot of extra records).

# Answer
> 3 votes
Yes, in some cases a change is just a correction of a data entry error, and in others it is an 'actual' business transaction change.

A primary objective of the CiviAccounts effort was to make the system audit-able so that certain generally larger organizations could start using CiviCRM. This requires that all changes are recorded. So for example, if a $50 cash contribution is received and recorded, then it is later changed to $25, the system will have recorded this change. This allows one to track what might be a significant change.

Generally, to prevent cooking the books like this to the benefit of a rogue employee, it is desirable to require a second person to sign-off or approve changes.

I think it would be reasonable feature request or perhaps new extension request to either not record bookkeeping entries for any changes made before a batch is exported or to allow a second person to approve them being deleted before the batch export. It might be more appropriate for certain types of batches, eg ones involving initial data entry, and not for others, eg online transactions.

This would be ideal for use cases like tiny orgs with less formal financial workflows, and for larger orgs that close data entry batches every day after reconciling with a tally of cheque amounts done with a calculator.

With respect to edits creating bookkeeping transactions that reverse then repost the same amount: that was an undesirable outcome of (re-)factoring the code to make it more modular and maintainable. The bookkeeping transaction for an edit can vary extensively based on changes to various fields in the contribution, and to various fields in each of the line items. I agree this leads to undesirable bloat of bookkeeping transactions. In defense of this implementation approach, popular accounting packages do the same thing when saving a change to the cheque number associated with a transaction.

---
Tags: contributions
---


# Question
Title: How do I rename an activity used in CiviCase?
I have this problem on CiviCRM 4.6.8 with Joomla, and reproduced on the demo server.

If I rename an activity (from Administer-\>Customize Data-\>Activity Types) used for a Timeline within CiviCase, I can't figure out how to get the activity label to update in the backend or frontend of CiviCase. Even if I remove the activity from the timeline and try to re-add it, it uses the original name.

Is there any way to rename it without deleting the Activity type and creating a new one?

# Answer
> 2 votes
There is an open issue for this here: https://issues.civicrm.org/jira/browse/CRM-16664

Latest comment from the core team is:

> This is both hard to fix and low priority because it only affects super admins who have privileges to define case types. Patches or funding would be most welcome in moving this issue forward.

---
Tags: activities, civicase
---


# Question
Title: Memberships don't get updated when they elect to auto-renew
We are using Wordpress and when a member elects to have their membership auto-renewed and we received payment for this in CiviCRM it doesn't update their end date, it still shows their membership expired.

Also, when it's a new member joining for the first time and they elect auto-renew, it puts their membership into a pending status even though we have received payment.

Any help here would be greatly appreciated as it's causing me to do a lot of manual updating on these records.

# Answer
> 1 votes
just to confirm some basics since your question doesn't specify if membership status update is happening for other situations.

For Membership Status to auto update you need to have the Scheduled Job enabled. You can see this on the demo site here. And you need to have a cron running. Neither of these may be the issue you are facing, but are fundamental to the membership status update working.

Otherwise you should confirm your Membership Status is not 'overridden'. Again this is something you have probably checked but it helps if you can confirm such things.

It may help if you can clarify the Contribution Status of the payment. Is it being set to Completed automatically?

---
Tags: wordpress
---


# Question
Title: Why do front end dashboard/profile views create a duplicate Civi contact?
Civi 4.6.8 on J! 3.4.4

I have synced J! to Civi contacts. J! users can log in to see additional menu options including view Civi contact dashboard and use a profile search form to see other contacts. For some users - but not all - using these Civi functions creates a new Civi contact with their email address. First, I can't see why a contact should be created at all simply by viewing; second, I don't understand why this happens for some users and not others. I think they all have the same permissions. Can you advise me where to look to troubleshoot?

Thanks

# Answer
So a careful look at the civicrm\_uf\_match table revealed that some of the Joomla user IDs in the table were not the current user IDs of those users. Clearly the original Joomla users had been deleted and recreated with new IDs but the civicrm\_uf-match table had not kept in sync with the changes. I'm not sure why - probably some past database problem that I've forgotten. In Joomla installations, Civi only checks Joomla users for a linked Civi contact record when they interact with Civi as documented here. So the matching of the Joomla user to the Civi contact was failing. I manually changed the records in civicrm\_uf\_match to correct the Joomla user ID and all is now OK.
> 1 votes

---
Tags: joomla, user-account, cms-integration
---


# Question
Title: Why external ID removed in membership import in update mode?
During Membership import in update mode externalID available in civicrm 2.0 and it seems that it is being removed in CiviCRM 4.6.7.

As I have a csv file to import membership with only externalID field in it.

What am I missing here ? Any suggestions ?

# Answer
The reason it doesn't work is that in CiviCRM, a contact may have more than one membership, so handling just external ID (or contact ID, at that rate) in update mode could be ambiguous.

I agree that it would be nice to take either of those, simply spitting out errors if it's actually a question of which membership to pick, but that hasn't been implemented.

To update memberships, do an export of existing memberships and get the **membership ID**, not the contact ID, for the ones you want to update.
> 1 votes

# Answer
Civicrm Membership is using contact id in the latest version so the best way is to get all the contact Id corresponding the external Id - try importing it again
> 0 votes

---
Tags: civimember, import
---


# Question
Title: Contribution Detail Report- "contact name suffix" isn't showing up as one of the possible report criteria
I'm trying to create a Contribution Detail Report and the "contact name suffix" isn't showing up as one of the possible report criteria. Please advise!

# Answer
> 1 votes
Allison, you're correct, neither prefix nor suffix is available (surprising) Assuming that coding isn't an option. There are several ways to can export the contacts prefix/suffix. For example You can...

Create report you want and include civicrm "contact ID"

If you can also create a contribution search that returns the same contacts, then you can export the search results and include the suffix field.

If you can't create a contribution search, then you can do an import "Update" and add a "tag" that will identify the contacts in your report (match on contact ID) You can then run a search and export the suffix.

If you'd like the report to include suffix, you can submit a request to the paid issue queue and the Core team will give you an estimate on what it will cost to add suffix. Seems like a good way to contribute back a function that others would like as well.

---
Tags: civireport
---


# Question
Title: Why is no Receipt is being sent for a Contribution when using PayPal Standard?
CiviCRM 4.6.5 and WordPress 4.2.4

When the payment processor Paypal Standard is chosen, the receipt is not being sent.

When returning from paypal, it goes onto the thank you page and the payment is marked as completed, so everything is fine for the payment processor.

When I choose "Pay later", the receipt is sent so the e-mail processor is fine too.

What could cause this issue?

Seems related to this issue: https://issues.civicrm.org/jira/browse/CRM-15629

But it was supposed to be fixed in 4.6.3

Thanks.

This is what I get in the ConfigAndLog file:

> Aug 25 12:00:17 \[info\] Contribution record updated successfully
>
> Aug 25 08:00:21 \[info\] $Fatal Error Details = Array ( \[message\] =\> \[code\] =\> )
>
> Aug 25 08:00:21 \[info\] $backTrace = #0 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(364): CRM\_Core\_Error::backtrace("backTrace", TRUE) #1 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1018): CRM\_Core\_Error::fatal() #2 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Task/Invoice.php(478): CRM\_Core\_DAO::getFieldValue("CRM\_Contact\_DAO\_Contact", NULL, "display\_name") #3 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionPage.php(922): CRM\_Contribute\_Form\_Task\_Invoice::printPDF((Array:1), (Array:2), (Array:1), NULL) #4 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/MessageTemplate.php(508): CRM\_Contribute\_BAO\_ContributionPage::addInvoicePdfToEmail("398", "2") #5 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionPage.php(412): CRM\_Core\_BAO\_MessageTemplate::sendTemplate((Array:13)) #6 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(2291): CRM\_Contribute\_BAO\_ContributionPage::sendMail("2", (Array:36), FALSE, FALSE) #7 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(853): CRM\_Contribute\_BAO\_Contribution-\>composeMessageArray((Array:28), (Array:9), (Array:36), FALSE, FALSE) #8 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(788): CRM\_Core\_Payment\_BaseIPN-\>sendMail((Array:28), (Array:9), (Array:7), (Array:36), FALSE, FALSE) #9 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(290): CRM\_Core\_Payment\_BaseIPN-\>completeTransaction((Array:28), (Array:9), (Array:7), Object(CRM\_Core\_Transaction), FALSE) #10 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(343): CRM\_Core\_Payment\_PayPalIPN-\>single((Array:28), (Array:9), (Array:7), FALSE, FALSE) #11 /home2/sherbro3/public\_html/wp-content/plugins/civicrm/civicrm/extern/ipn.php(52): CRM\_Core\_Payment\_PayPalIPN-\>main() #12 {main}

# Answer
This patch fixes the problem for me: https://github.com/civicrm/civicrm-core/pull/6900
> 2 votes

---
Tags: wordpress, civicontribute, paypal, 4.6, ipn
---


# Question
Title: What's the purpose of the hash added to filenames in custom folder?
I have a ton of image files to add to Civi (far too many to do manually) and have figured out what tables to update & make it all work. But I notice that files uploaded via the Civi UI have a hash string added to the filename that's stored. So xyz.pdf becomes xyz$$$.pdf where $$$ is the hash. What's the purpose of this hash string? Is it to make a unique URI? Should I do this as well for my files? It all works without this. (I don't want to use the API by the way, and we're on 4.6.8)

# Answer
Two reasons I can think of:

* what happens if you upload twice a file with the same name for different contacts? the hash allow to avoid overwriting
* probably increase a bit the protection and privacy too, eg. by guessing and trying to download warren\_buffet.jpg or bill\_gates.jpg, we could know if you have some wealthy donors in your db

This being said, it's been there since forever and I never quite questioned it.

If it's for mass uploading contact images, you can probably just set the field into civicrm\_contact and put the image at the right place, I remember having done something like that a while ago, it probably still works

as andy detailled, you need to touch a few more tables if you want to upload the file in a custom field

* add a row to civicrm\_file with the file name
* add a row to civicrm\_entity\_file to link to the contact id, civicrm\_file table & your custom table
* update your custom table with the numeric id from the civicrm\_file
* upload the file into the right folder
> 3 votes

# Answer
If you are spending time trying to manually reproduce how Civi handles files in your own custom code, consider using the Attachment api, which will do it all for you:
> 0 votes

---
Tags: 4.6.8
---


# Question
Title: Can I add a timeline to a Case programatically?
Is it possible to Add a predefined Timeline to a Case from a hook, via API or otherwise? That is, duplicate the effect of a user clicking the "Add Timeline" button in a case?

# Answer
> 2 votes
You can base it on the code found in CRM/Case/Form/CaseView.php. You'll need to adjust references to $this, etc.

```
  $session            = CRM_Core_Session::singleton();
  $this->_uid         = $session->get('userID');
  $xmlProcessor       = new CRM_Case_XMLProcessor_Process();
  $xmlProcessorParams = array(
    'clientID' => $this->_contactID,
    'creatorID' => $this->_uid,
    'standardTimeline' => 0,
    'activity_date_time' => date('YmdHis'),
    'caseID' => $this->_caseID,
    'caseType' => $this->_caseType,
    'activitySetName' => $params['timeline_id'],
  );
  $xmlProcessor->run($this->_caseType, $xmlProcessorParams);
  $reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');

  CRM_Core_Session::setStatus(ts('Activities from the %1 activity set have been added to this case.',
      array(1 => $reports[$params['timeline_id']])
  ), ts('Done'), 'success');

```

# Answer
> 1 votes
That's just what I needed, thanks Demerit! For reference for anyone trying to do something similar to what I'm doing, here's code that works for me. I'm starting with:

$rid = the ID of a recipient of an inbound email

$mid = ID of the case coordinator

...then fetching the person's case, changing the case status, and adding the timeline:

```
   $caseresult = civicrm_api3('Case', 'get', array(
    'sequential' => 1,
    'return' => "id, case_type_id",
    'contact_id' => $rid,
    'status_id' => "Open",
    'is_deleted' => 0,
    'options' => array('limit' => 1),
  ));
  if ( $caseresult['count'] == 1) { //case found, so proceed
    $case_id = $caseresult['values'][0]['id'];
    $case_type_id = $caseresult['values'][0]['case_type_id'];
    //update case status
    civicrm_api3('Case', 'create', array(
      'sequential' => 1,
      'contact_id' => $rid,
      'status_id' => 3,
      'id' => $case_id,
    ));
    $xmlProcessor = new CRM_Case_XMLProcessor_Process();
    $xmlProcessorParams = array(
      'clientID' => $rid,
      'creatorID' => $mid,
      'standardTimeline' => 0,
      'activity_date_time' => date('YmdHis'),
      'caseID' => $case_id,
      'caseType' => 'member_application',
      'activitySetName' => 'timeline_1',
    );
    $xmlProcessor->run('member_application', $xmlProcessorParams);
  }

```

Note that 'member\_application' and 'timeline\_1' are hard coded. I found the right values to use by temporarily modifying CRM/Case/Form/CaseView.php and adding the Timeline I want to case manually, then looking at the output in my debug.txt file:

```
$xmlProcessor->run($this->_caseType, $xmlProcessorParams);
$file = fopen("/tmp/debug.txt", "a");
fwrite($file, print_r($xmlProcessorParams, TRUE));
fclose($file);
$reports = $xmlProcessor->get($this->_caseType, 'ActivitySets');

```

---
Tags: civicase
---


title: Joining fee for new memberships

text:
# Question
Title: Joining fee for new memberships
I’m looking for an elegant way of implementing a joining fee for new members. The joining fee is different for each membership type and is payable in addition to the normal annual membership fee. After the first year the member should be able to renew at the normal rate, preferably without an administrator needing to change anything. The CMS is Joomla.

Some of the suggestions that I’ve seen (https://forum.civicrm.org/index.php?topic=29226.msg125372#msg125372 and https://forum.civicrm.org/index.php?topic=27362.msg121121#msg121121) involve the use of different sign-up and renewal contribution pages, with each using a different price set. I’ve tried that but the “(Not Xyz User, or want to do this for a different person?)” link can turn a renewal page into a new member signup page. (The organisation has valid use for renewing for someone else, e.g. other household members, so disabling this for everyone wouldn’t be a good idea, if that’s even possible.)

Other info that may be relevant:

* At present the organisation’s rules require new member applications to be in writing & signed, so at least for now I will probably need to prevent online signups altogether
* The membership period is fixed (1 January to 31 December); a 50% discount applies to the membership fee—but not the joining fee—from 1 July to 31 December.
* If a member does not pay the membership for a whole year and wants to re-join then the joining fee is payable again.

# Answer
> 4 votes
You could include the joining fee in the membership fee, and then give an automatic discount (joining fee amount) for renewals (requires testing).

Or, some custom code could be written to remove the joining fee field/amount if the user is a member.

In both these scenarios the user will need to be logged in.

# Answer
> 3 votes
I think Sanjay is pointing you in a useful direction. Take a look at CiviDiscount which allows you to set discounts for memberships with conditions such as - if you have Membership Type or Status.

I think CiviDiscounts can also work with negative discounts if it makes sense to apply that to the 'new' membership, rather than applying it to the renewals. But recommend you give it a try.

---
Tags: civimember, contributions
---


# Question
Title: Getting contact address with membership on paypal standard
How do you get the contact created by the membership contribution screen to return the name and address (like the shipping address...) of the Paypal standard payment...

The transaction goes through properly in the sandbox (ipn ok) but contact created for the new membership has no name or address, just the email...

Thanks..

# Answer
> 0 votes
Sounds like you don't have any profiles enabled on the form. You can start with the basic name and address one CiviCRM comes with out of the box or create one of your own to collect the fields you're after.

You just click on the profiles tab when managing the contribution page to enable the one(s) you'd like members to complete when they register.

Here's more information about CiviCRM profiles: http://book.civicrm.org/user/current/organising-your-data/profiles/

---
Tags: paypal
---


title: integration with payment processer

text:
# Question
Title: integration with payment processer
I'm bidding on a redesign of an existing Joomla site that requires tight integration with CiciCRM. The client wishes to move from PayPal to an online merchant account.

Is there a list of preferred payment processors to use with CiviCRM?

thanks, david

# Answer
> 2 votes
Ginkgo Street Labs has collated four of the most common processors into one post: Evaluating Payment Processor Options

For a larger comparison see: Payment Processors

For general instructions see: Contributions - Payment Processors

---
Tags: payment-processor
---