title: How could I use CiviCRM for sponsorship

text:
# Question
Title: How could I use CiviCRM for sponsorship
We have a node called sponsorship that is a person, place, or thing. Person is likely a child, but it could be a teacher, nurse, etc. A person generally has one donor that pays a monthly amount. A place could be a building that would have one or more donors, and a thing is an resource; such as a projector.

Using a View we would allow the site visitor to review the opportunities for sponsorship. When the user clicks on "donate" (or "sponsor") in the view, we want to associate the donation with the item they are sponsoring. If the item is fully covered by a donation the item status would change and it would no longer we displayed to a site visitor.

We are looking for suggestions on how we should proceed.

# Answer
> 1 votes
There are a bunch of ways to tackle this. I think the approach you're describing of using Views might be writing a bit more custom code than need be, but I'll work within those constraints.

First, @petednz has the right general approach - store some data in the contribution tying it to the entity being sponsored, and use PHP in the View to determine whether to show/hide the entity in the View.

Personally, I'd use the principles outlined in this page to embed a variable in the URL that gets stored in a hidden field on the contribution page, and ultimately as custom data on the contribution. This gets around needing to have a separate contribution page for each entity. The page is a bit dated IMO, but the general principle is sound.

# Answer
> 4 votes
I'm not sure how the "things" would fit into this model, but I might begin to tackle the child/person sponsorship this (Drupal-specific) way:

* Create a custom field for individuals (and/or potentially use a separate sub-type based on Individual) to indicate that they are available for sponsorship
* Create a relationship such as "Sponsor of/Sponsored by"
* Create a View that lists all contacts that are available for sponsorship and do not have an active "Sponsor of/Sponsored by" relationship
* Create a Membership type with the settings for your sponsorship(s) (e.g. monthly/annual/etc.) Potentially use Word Replacement (**Administer \> Customize Data and Screen \> Word Replacement**) to change "Membership" to "Sponsorship".
* Create a custom Webform-CiviCRM form that has two contacts: first contact is the sponsor (filling the form), second contact is the person to be sponsored (this could be filled via the URL with contact ID so links from the View could prefill this value, and/or an autocomplete field for searching). This form could also be set up to take a required contribution towards a membership/sponsorship of the type you created. The form could also be set up to create a relationship between the two contacts (which should then remove the second contact from the list of people available for sponsorship).

Obviously thorough testing would be needed, and I don't recall off-hand whether Webform-CiviCRM allows you to set up recurring payments or if you'd have to rely on membership reminders to have them come back to make subsequent payments.

I suppose the places could be set up in a similar way using a subtype of Organizations, potentially with different rules in Views (for example, you may want to allow any number of people to sponsor a place, I don't know).

Some of your more complex functionality may be more difficult to fit in (such as partial payments or a combined sponsorship among multiple people), and I'm not sure about how I'd handle the things (like projectors) in this model.

**EDIT:** It would be a different workflow then described above for the 'things' but you might be able to set up a contribution page with these items as the 'premiums' offered. (e.g. "Make a donation of at least $150 and you can select a projector for a school...")

---
Tags: developer, drupal-views
---


# Question
Title: Export Contacts after Include/Exclude Search: Selection of Fields not possible
After doing an Include/Exclude Search I want to export the contacts found, so I select "Export Contacts" from the "Actions"-drop down menu.

However there is no possibility to select the contact-fields I want to export, there is just the CiviCRM\_Contact\_Search.csv file generated containig the following fieldes: "Contact ID","Contact Type","Name","Group Name".

Is this on purpose, a missing feature or a bug?

# Answer
> 2 votes
Missing feature I would suspect. Can you step around it by just adding the contacts from your search result to (yet another) Group, then Export from the standard Search?

---
Tags: drupal, 4.6.2
---


title: Fatal error while upgrading

text:
# Question
Title: Fatal error while upgrading
While upgrading from 4.5.8 to 4.6.3 on a Drupal site, the upgrade script stuck and when I refreshed, i got

```
Fatal error: Cannot redeclare class CRM_Core_ClassLoader in
[MYSITE]/sites/all/modules/civicrm/CRM/Core/ClassLoader.php on line 36

```

Now I can't even log into the backend of my site.

# Answer
> 5 votes
Can you ensure that you do not have two copies of the civicrm codebase (irrespective of what you might have renamed it to) under

\[MYSITE\]/

Most likely the error is caused by php finding two copies of the CRM/Core/ClassLoader.php file

---
Tags: drupal, upgrade
---


# Question
Title: Error when trying to generate Activity Report after upgrading to 4.6.2
UPDATE: I upgraded to 4.6.3 and the problem persists. I can see that it's related to our petition, but beyond that I'm stumped. I'm having problems with other reports timing out too now, and we've only got around 600 contacts.

The error below occurs when I go to Contacts \> Contact Reports \> Activities

"Sorry but we are not able to provide this at the moment. DB Error: no such field"

Before the upgade this worked fine. Everything else seems to be functioning okay. Tired it in demo and it works there. Does anyone have ideas?

Thanks!

Here is the full text of the error message I see when I'm in debugging mode:

```
Sorry but we are not able to provide this at the moment.
DB Error: no such field
Error Details
Database Error Code: Unknown column '1INNER' in 'on clause', 1054
Additional Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, civicrm_email_target.email as civicrm_email_contact_target_email, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details, activity_civireport.campaign_id as civicrm_activity_campaign_id, activity_civireport.engagement_level as civicrm_activity_engagement_level, address_civireport.street_address as civicrm_address_street_address, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_name as civicrm_address_street_name, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code, address_civireport.state_province_id as civicrm_address_state_province_id, value_petition_questions_1_civireport.member_of_1 as civicrm_value_petition_questions_1_custom_1, value_petition_questions_1_civireport.retired_2 as civicrm_value_petition_questions_1_custom_2, value_petition_questions_1_civireport.affiliated_with_3 as civicrm_value_petition_questions_1_custom_3, value_petition_questions_1_civireport.interested_in_4 as civicrm_value_petition_questions_1_custom_4, option_value_civireport.label as option_value_civireport
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

            LEFT JOIN civicrm_email civicrm_email_target
                   ON activity_contact_civireport.contact_id = civicrm_email_target.contact_id AND
                      civicrm_email_target.is_primary = 1INNER JOIN civicrm_option_value option_value_civireport
            ON option_value_civireport.option_group_id = 2
            AND option_value_civireport.value = activity_civireport.activity_type_id
                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_petition_questions_1 value_petition_questions_1_civireport ON value_petition_questions_1_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_date_time >= 20120510000000 ) AND ( activity_date_time <= 20150509235959 ) AND ( activity_civireport.activity_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12,17,19,22,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51) ) AND ( address_civireport.postal_code = 93101 ) AND value_petition_questions_1_civireport.member_of_1 REGEXP '[[:<:]]CalPERS|CalSTRS[[:>:]]'  [nativecode=1054 ** Unknown column '1INNER' in 'on clause']
    [type] => DB_Error
    [user_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, civicrm_email_target.email as civicrm_email_contact_target_email, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details, activity_civireport.campaign_id as civicrm_activity_campaign_id, activity_civireport.engagement_level as civicrm_activity_engagement_level, address_civireport.street_address as civicrm_address_street_address, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_name as civicrm_address_street_name, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code, address_civireport.state_province_id as civicrm_address_state_province_id, value_petition_questions_1_civireport.member_of_1 as civicrm_value_petition_questions_1_custom_1, value_petition_questions_1_civireport.retired_2 as civicrm_value_petition_questions_1_custom_2, value_petition_questions_1_civireport.affiliated_with_3 as civicrm_value_petition_questions_1_custom_3, value_petition_questions_1_civireport.interested_in_4 as civicrm_value_petition_questions_1_custom_4, option_value_civireport.label as option_value_civireport
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

            LEFT JOIN civicrm_email civicrm_email_target
                   ON activity_contact_civireport.contact_id = civicrm_email_target.contact_id AND
                      civicrm_email_target.is_primary = 1INNER JOIN civicrm_option_value option_value_civireport
            ON option_value_civireport.option_group_id = 2
            AND option_value_civireport.value = activity_civireport.activity_type_id
                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_petition_questions_1 value_petition_questions_1_civireport ON value_petition_questions_1_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_date_time >= 20120510000000 ) AND ( activity_date_time <= 20150509235959 ) AND ( activity_civireport.activity_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12,17,19,22,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51) ) AND ( address_civireport.postal_code = 93101 ) AND value_petition_questions_1_civireport.member_of_1 REGEXP '[[:<:]]CalPERS|CalSTRS[[:>:]]'  [nativecode=1054 ** Unknown column '1INNER' in 'on clause']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, civicrm_email_target.email as civicrm_email_contact_target_email, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id, activity_civireport.duration as civicrm_activity_duration, activity_civireport.details as civicrm_activity_details, activity_civireport.campaign_id as civicrm_activity_campaign_id, activity_civireport.engagement_level as civicrm_activity_engagement_level, address_civireport.street_address as civicrm_address_street_address, address_civireport.street_number as civicrm_address_street_number, address_civireport.street_name as civicrm_address_street_name, address_civireport.city as civicrm_address_city, address_civireport.postal_code as civicrm_address_postal_code, address_civireport.state_province_id as civicrm_address_state_province_id, value_petition_questions_1_civireport.member_of_1 as civicrm_value_petition_questions_1_custom_1, value_petition_questions_1_civireport.retired_2 as civicrm_value_petition_questions_1_custom_2, value_petition_questions_1_civireport.affiliated_with_3 as civicrm_value_petition_questions_1_custom_3, value_petition_questions_1_civireport.interested_in_4 as civicrm_value_petition_questions_1_custom_4, option_value_civireport.label as option_value_civireport
        FROM civicrm_activity activity_civireport
             INNER JOIN civicrm_activity_contact  activity_contact_civireport
                    ON activity_civireport.id = activity_contact_civireport.activity_id AND
                       activity_contact_civireport.record_type_id = 3
             INNER JOIN civicrm_contact civicrm_contact_target
                    ON activity_contact_civireport.contact_id = civicrm_contact_target.id

            LEFT JOIN civicrm_email civicrm_email_target
                   ON activity_contact_civireport.contact_id = civicrm_email_target.contact_id AND
                      civicrm_email_target.is_primary = 1INNER JOIN civicrm_option_value option_value_civireport
            ON option_value_civireport.option_group_id = 2
            AND option_value_civireport.value = activity_civireport.activity_type_id
                 LEFT JOIN civicrm_address address_civireport
                           ON (civicrm_contact_target.id =
                               address_civireport.contact_id) AND
                               address_civireport.is_primary = 1

LEFT JOIN civicrm_value_petition_questions_1 value_petition_questions_1_civireport ON value_petition_questions_1_civireport.entity_id = activity_civireport.id  WHERE activity_civireport.is_test = 0 AND
                                activity_civireport.is_deleted = 0 AND
                                activity_civireport.is_current_revision = 1 AND ( activity_date_time >= 20120510000000 ) AND ( activity_date_time <= 20150509235959 ) AND ( activity_civireport.activity_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12,17,19,22,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51) ) AND ( address_civireport.postal_code = 93101 ) AND value_petition_questions_1_civireport.member_of_1 REGEXP '[[:<:]]CalPERS|CalSTRS[[:>:]]'  [nativecode=1054 ** Unknown column '1INNER' in 'on clause']"]
)

```

# Answer
> 2 votes
UPDATE: This is now submitted as CRM-16640, pull request to fix is here: https://github.com/civicrm/civicrm-core/pull/5971. This fix should be built in to 4.6.4+.

You've found a bug. I found a fix, but have to run out so don't have time at the moment to submit it upstream - I'll try to do so later this week.

For now - if you're able to edit your CiviCRM files, go to your `civicrm` plugin folder and find the file `CRM/Report/Form/Activity.php`. On line 521 you'll see this line:

```
    $this->_from .= "INNER JOIN civicrm_option_value {$this->_aliases['civicrm_option_value']}

```

Add a space before the word "INNER" like so:

```
    $this->_from .= " INNER JOIN civicrm_option_value {$this->_aliases['civicrm_option_value']}

```

# Answer
> 0 votes
If it's working on the demo site, then I would try generating a new activity report from the template. Go to (**Administer menu \> CiviReport \> Create New Report from Template**) and select "Activity Report". If it works from there, save the new report and delete the old one - and of course, come back here to report on whether it worked!

---
Tags: wordpress, civireport
---


# Question
Title: Multiple error messages upon upgrade to CiviCRM 4.2.20
I am trying to upgrade from 4.1.5 to the latest CiviCRM but need to go through some intermediate releases to get there. I have installed 4.2.20 but get the following error dozens of times on each screen.

> Strict warning: Non-static method CRM\_Core\_Block::setTemplateValues() should not be called statically in CRM\_Core\_Block::setTemplateValues() (line 587 of

Is there any way to get rid of it?

# Answer
> 2 votes
Those are warnings, not errors. It's simply PHP telling you that CiviCRM 4.2 is a rather old piece of software (which it is!). They will not prevent CiviCRM from working normally, certainly not for the brief time between now and when you get it upgraded further.

I recommend you ignore them and proceed with the upgrade. The latest version of CiviCRM is more up-to-date so will not trigger php warnings.

# Answer
> 1 votes
Can you upgrade to a later version than 4.2.20? Some Googling indicates this error may be solved in later versions.

---
Tags: upgrade
---


title: Problem using CiviMail with Bluehost

text:
# Question
Title: Problem using CiviMail with Bluehost
CiviMail likes to use VERP for bounce processing, but it looks optional because there's a checkbox for it on CiviMail Component Settings (where is the documentation for this screen??). Bluehost doesn't support VERP, but I found this thread, which explained how to comment out two lines in smtp.php. I did that and email blasts work now, but I did a test with a bad email address and it didn't bounce.

Can anyone explain the ramifications of commenting out those two lines? Will this ever work on a host that doesn't support VERP? Where is the documentation for CiviMail Component Settings? Thanks much in advance...

# Answer
VERP is **not** optional in CiviMail, the two lines you comment out are the one needed to be able to identify who was the recipient, so if it bounces, Civi can identify it properly.

If you don't process bounces, you will not know if an email is invalid, and you will keep sending emails to invalid emails. It's something mail servers *really* don't like, and one of the sure way to get you categorised as spammer and blacklisted.

If you have developer skills or budget, you could add a feature to handle the bounces not based on the email the bounce returns to (VERP), but on an extra field added to the header as discussed here

However, switching to a better mail server is usually a cheaper alternative than developer's time, especially if the result is likely to be less efficient as identifying bounces.

As for the civimail component setting:

```
Track replies using VERP in Reply-To header
- If checked, mailings will default to tracking replies using VERP-ed Reply-To.

```

It isn't about bounces (not having VERP isn't an option), but for what's happening when a recipient replies: should it go directly to civicrm and be processed there or should it bypass civi and go directly to the inbox of the sender?
> 6 votes

---
Tags: civimail
---


# Question
Title: How does one flush the non-database cache (such as memcache) from CiviCRM code?
I've seen from a different question a suggestion to use `CRM_Core_Invoke::rebuildMenuAndCaches()` as the "granddaddy" of all cache flushing. However, I'd like to know if this is only clearing the cache in the database, such as `civicrm_cache` and so on or if it also clears non-database cache as well such as memcache.

As far as I can tell the above function calls `CRM_Core_Config::cleanupCaches()` which calls `CRM_Core_Config::clearDBCache()` and that function truncates various cache tables. Am I missing something? How do the other caching backends get flushed?

# Answer
Currently the function `CRM_Core_Invoke::rebuildMenuAndCaches` does *not* flush the memory caches, even though it will rebuild the database cache, menus and sessions. In order to also flush the memory caches you need to also call: `CRM_Utils_System::flushCache( );` (This was confirmed by Lobo but I think it needed to be written more explicitly as an *answer* and not as how things *should* be.)
> 3 votes

# Answer
I think the function CRM\_Core\_Invoke::rebuildMenuAndCaches should also flush the memory caches, and hence call: CRM\_Utils\_System::flushCache( );

This will make things more consistent and actually rebuild all caches as the function name suggests
> 2 votes

---
Tags: cache
---


title: Collecting Facebook, LinkedIn profiles

text:
# Question
Title: Collecting Facebook, LinkedIn profiles
Collecting Twitter handles from users is straightforward: create a custom field, ask for the handle. But collecting links to Facebook or LinkedIn profiles is more tedious, since most people don't remember their shortlinks offhand, and probably even more people aren't even aware that they can choose a shortlink in the first place. Thus, their profiles have long, immemorable URLs like

http://us.linkedin.com/pub/john-doe/921/487/383
https://www.facebook.com/profile.php?id=907087534832176

We want to be able to link to these pages from membership directories, participant reports, and so on, but the challenge for the membership manager is how to collect them efficiently.

We encouraged with one group for people to add the URL of their LinkedIn or Facebook profile as a "website" field, but there was little or no uptake. Worse, we felt it disrupted the membership application process by sending someone not only offsite, but to a distracting social network where they might forget about their signup.

Is there an extension or other mechanism whereby someone could click, on a profile, click on a button and have their profile ID for either service entered? Or on the flip side, is there any way for a profile to pull Facebook or LinkedIn information, so that data like name, email address, employer, and birthdate could be pre-populated during event or membership registration?

There's some CodeCamp 2007 code and Social CRM ideas from 2011 on the wiki, but doesn't seem to be much that's been built.

---

To clarify, the ultimate goal is to allow members to provide a link to their Facebook and LinkedIn profiles on a "member profile" page on a Drupal site, though a CMS-agnostic solution would naturally be preferable. It does not have to be the Fb shortcut; the unique user ID number is fine and even preferable; it just needs to be someone we can use to create a URL that a button can link to.

Importing OAuth information from the CMS seems to be the way to go, though this complicates matters when trying to list people who do not want to use delegated authentication on the site.

# Answer
> 10 votes
The http://Attentive.ly CiviCRM integration automatically returns the social media accounts that match with over a hundred social media sites including Twitter, LinkedIn, Facebook, Google+, Klout, etc., as well as social listening on relevant recent posts to Twitter and Facebook. It does a lot more to help improve your organization's online engagement with top influencers (meaning those that have a high Klout score). The service is not free, and works best for organizations that have at least 25,000 - 50,000 contacts. See https://civicrm.org/extensions/attentively-integration.

# Answer
> 5 votes
Joomla contains a set of packages for connecting to social sites (Facebook, LinkedIn, Google, Twitter, Github, there may be more). If you are using Joomla you can instantiate one of these to collect the link data as well as other data the user authorizes, just as you see a lot of places you make a button to submit the request to whatever api it is. They all follow the same pattern, once you do it once it should be easy to do additional ones.

# Answer
> 4 votes
For FB, if the user entered the big ugly profile.php URL, you can get the shortlink (and profile pic) very easily using the Graph API, like this: `http://graph.facebook.com/4?fields=link,picture`. In our example, 4 is the user ID for Zuckerberg. If you have some JavaScript skills you could add a button to your contact template that allows the user to convert this. If not, your membership manager can just paste the URL into a browser location bar with the correct ID, press enter, and then copy-paste the short link and/or profile photo. You don't even need to be logged into FB to do this.

Edit: After some more reading, the Graph API has deprecated the option to get the pretty username link for the logged in user. Every user now gets a unique id for every FB app. So that part kind of stinks and makes my lookup idea unreliable. To make up for it, here is a bit of JS to get you started with your FB button on the profile:

```
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'your app id here',
      xfbml      : true,
      version    : 'v2.3',
  status     : true
    });
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

CRM.$(function($) {

    FB.api('/me', {fields: 'first_name,last_name,address,birthday,email,picture{url},link'}, function(response) {

        console.log(response);

    });

});

```

# Answer
> 3 votes
I would definitely agree with @Elin - the cleanest solution is to request the user Oauth/login to the respective service. In drupal there are many modules to do this (e.g. Drupal Oauth, Oauth connector, 3rd party services like Janrain or my favorite: HybridAuth)

Many provide Drupal rules integration or tokens which can even be added to civicrm (with the civicrm\_entity module for example.)

The best part about getting the user to authenticate is you can access additional info like their user image, post to their wall, etc.

I've used Facebook Autopost for example, to post new events on behalf of users.

# Answer
> 3 votes
There are two social media integration projects for this summer's Google Summer of Code. See https://civicrm.org/blogs/achia/social-media-integration-civicrm-ii (and posts on the http://forum.civicrm.org/index.php/topic,36315.msg155084.html#msg155084 forum thread) and http://forum.civicrm.org/index.php/topic,36059.0.html. Although both have been accepted, I'm not sure how much activity has occurred on the latter project. Various students are starting their work at various times, but I think s0014 should be posting by now.

I'd encourage working with the students and their mentors to try to ensure their work meets your needs. BTW, what are/were the criteria for awarding the bounty?

---
Tags: custom-fields, social-media
---


# Question
Title: How to revert the demo sites to English? (Or change to another language)
The demo site is in Russian (or Chinese or French -- or any language you don't read fluently), how can I switch it to English *(or my preferred language)*?

As the demo sites are periodically reset to a default state (in English), waiting is an option, but not the fastest one.

# Answer
> 5 votes
You can change the language in

Administer \> Localization \> Languages, Currency, Locations

and change the default language (first field) to English (United States)

However, as the site is in a different language, it might be hard to find (the url is civicrm/admin/setting/localization), so here are the direct links:

# Answer
> 1 votes
Trying to change the language can sometimes lead to a 'race' condition where you and another user are just changing it back and forth. Not nice. I think it's fine to change it once, since the user with a different language preference/need might be done.

But if the language is changed out from under you the polite thing to do, at least in my Canadian view, is to switch to using a different CMS demo site, or come back in 15 or 30 minutes.

---
Tags: localisation, demo-site
---


title: CiviCRM 4.6.2 extra components in menu

text:
# Question
Title: CiviCRM 4.6.2 extra components in menu
I just installed drupal 7 and then civiCRM on Linux Mint 17.1 in a VirtualBox

Install went smoothly.

I am only using CiviCASE and CiviReports moduals. Unfortunately, there are still menu items for Mailings and Campaigns.

Mailings and Campaigns are disabled components in my setup. The picture below shows the extra menu items and my list of enabled components.

I tried enabling/save/disabling but nothing got rid of those two menu items. The other component menu items did go away.

\[edit\] Here's what the drop down menu looks like for the extraneous Mailing menu item, as requested.

Any ideas on how to fix this? Is it a bug, a feature or easily fixed?

Thanks in advance for any help!

John in Oregon

# Answer
> 3 votes
There's a semi-documented "menu rebuild" commands that will probably help here. From your CiviCRM base URL, go to `/menu/rebuild` e.g. on Drupal with Clean URLs, http://example.org/civicrm/menu/rebuild. Follow that with `/cache/clear` if necessary!

# Answer
> 1 votes
The campaigns menu seems to behave now, but I was able to reproduce this for mailings and I agree it's a bug. I recommend filing a bug report on the issue tracker. More information about filing issues can be found at https://civicrm.org/issue-queue

---
Tags: civicase, civicrm-home
---


# Question
Title: Adding An Extra Tab When Configuring/Creating An Event
I want to add a new tab called "Web Tracking" when creating a New Event. I want to do this so that I can keep all the parameters for web tracking separate from the other Event parameters. How do I go about this?

The only relevant file I could find is civicrm/CRM/Event/Form/ManageEvent/TabHeader.php

I have attached a picture in case the description is not clear. (I got the picture from the CiviCRM forum)

# Answer
I see now that you are working on core code. But just for the record, if you were doing this in an extension you would proceed by implementing hook\_civicrm\_tabset.
> 9 votes

# Answer
I figured it out with the help of my mentor Kurund Jalmi.

Make changes to the following files:

1) civicrm/CRM/Event/Form/ManageEvent/TabHeader.tpl

2) civicrm/CRM/Event/xml/Menu/Event.xml

3) Do a menu rebuild

4) Create the corresponding php and template files
> 5 votes

---
Tags: civievent, forms, gsoc
---


# Question
Title: What should I do if an issue is marked as fixed in JIRA but it is still occurring?
What should I do if an issue is marked as fixed in JIRA for a particular version, but it is still occurring in a later version?

# Answer
Basically, you should reopen the original issue in JIRA once you have confirmed the problem is re-occuring in a later version than was fixed. Or if your account doesn't have the permission to do this in JIRA, leave a comment on the issue.

Every issue in JIRA has a field that says which version of CiviCRM included the code developed to address it. Bugs might re-occur because only part of it was fixed, or the QA wasn't thorough enough, or more commonly some later change recreated the problematic behaviour somehow.

Before reopening the issue, check that you can reproduce the error on the demo site, and make sure the behaviour matches the original bug description.

If it seems a bit different, create a new issue and include a link to the old one in your description, saying why you think the bug is similar but not the same (this can save time for people working to fix the bug).

If you're reasonably sure the bug is the same then reopen it, describe your experience including you site's version number, and indicate that you have reproduced the problem on the demo site. Note that you have to login to JIRA before you see the button to Reopen an issue:

If you don't see the button, then just leave a comment:

If an error was closed without being fixed because it couldn't be reproduced, you have an opportunity to assist even more. Try to take screen shots of the problem, and if possible, offer to do any testing the core team might request. This can involve checking a setting, examining a log file, or even putting in a debug statement. Rarely they might even benefit from accessing your system to investigate more thoroughly.
> 8 votes

# Answer
I suggest opening a new issue if you don't have permission to re-open the closed one - with adequate links to the closed one.

Commenting on the closed issue might be noticed or it might not - but if not noticed straight away then it will be back off the radar.
> 1 votes

---
Tags: issues
---


# Question
Title: Assigned Activites not showing up on users Contact Dashboard
I'm needed to add a scenario where a specific user role has access to edit/update activities they are assigned but access nothing else in civi. What is the best way to do this?

edit: after the discussion with petednz we found that there is an issue with assigned activities showing up on the contact dashboard.

edit2: filed jira issue at https://issues.civicrm.org/jira/browse/CRM-16557

# Answer
Maybe over complicating things a lot here. But assuming you have confirmed this isn't possible directly via 'permissions' and the users Contact Dashboard, I would try the following in Drupal. Build an Activities based Views block which uses Contextual Filter and Views 'relationships' (to get the Activity assignee) which will show the user 'their Activities'. Assuming that gives you the list you want, then add a link to each Activity in the View that jumps them to a Webform-CiviCRM with the activity ID in the URL. That might be getting you close.
> 2 votes

# Answer
This was a regression bug from 4.4 to 4.5. I have submitted a fix for the next release (4.6.4).

See https://issues.civicrm.org/jira/browse/CRM-16557
> 1 votes

---
Tags: activities, permissions
---


# Question
Title: Upgrading to CiviCRM 4.63 from 4.4x on current Joomla 3.x
The upgrade went fine - the DBs script ran with no errors --

Can view contacts, members, past events just fine

When I go to try to manage event - I get the errors below - I also get issues when I try to use a contribution page (same error) and I can not initiate a new mailing - I just get a page with the civi headers on it but no mailing content. (image attached for clarity) Thoughts and thanks

editing an event error Database Error Code: Unknown column 'filters' in 'field list', 1054 Additional Details: Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error  =\> handle )

```
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] =>

```

SELECT id, code, description, amount, amount\_type, events, pricesets, memberships, autodiscount, expire\_on, active\_on, is\_active, discount\_msg\_enabled, discount\_msg, count\_use, count\_max, filters FROM cividiscount\_item i WHERE is\_active = 1 AND (count\_max = 0 OR count\_max \> count\_use) \[nativecode=1054 \** Unknown column 'filters' in 'field list'\] \[type\] =\> DB\_Error \[user\_info\] =\> SELECT id, code, description, amount, amount\_type, events, pricesets, memberships, autodiscount, expire\_on, active\_on, is\_active, discount\_msg\_enabled, discount\_msg, count\_use, count\_max, filters FROM cividiscount\_item i WHERE is\_active = 1 AND (count\_max = 0 OR count\_max \> count\_use) \[nativecode=1054 \** Unknown column 'filters' in 'field list'\] \[to\_string\] =\> \[db\_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM\_Core\_Error::handle prefix="" info=" SELECT id, code, description, amount, amount\_type, events, pricesets, memberships, autodiscount, expire\_on, active\_on, is\_active, discount\_msg\_enabled, discount\_msg, count\_use, count\_max, filters FROM cividiscount\_item i WHERE is\_active = 1 AND (count\_max = 0 OR count\_max \> count\_use) \[nativecode=1054 \** Unknown column 'filters' in 'field list'\]"\] )

# Answer
> 1 votes
Can u disable the cividiscount module. Seems like that module is responsible for the above error.

# Answer
> 1 votes
Thanks to Brian at icdservices.biz who found one other extension that needed up be updated in order for 4.6.3 to work -- everything is fine now.

Thanks

---
Tags: joomla, upgrade
---


# Question
Title: Re: CiviCRM contribs/extensions - any scripting language limitation?
Not an issue or bug, but a question for admins of CiviCRM - is it acceptable to use Python for part of a new extension (instead of PHP) or is that expecting too much, since that means asking users to install Python in addition to their stack of PHP, MySQL, Apache and whatever OS?

I know that Python install isn't the only issue here but so - it seems that CiviCRM doesn't (yet) have any kind of ETL extension (and I mean a contributed extension like CiviDiscount, not 'native', one that would be an optional add-on, like modules in Drupal). I am looking at some way to avoid Kettle/Talend (Kettle 'works' but sucks by comparison w/SSIS which is not open-source).

At first I thought well, people could just contribute Kettle scripts that other people could take and modify but that is pretty clumsy. So...looking at writing simple MapReduce in Python.

So, it would not necessarily be part of the interactive CiviCRM user functionality, using RESTful Api to do transactions, but totally backend functionality to do data transformation from MySQL or whatever database. I hope the transform could also be used to produce reports in some other way than hacking w/those templates. Using Apache Hadoop could also be a showstopper...just exploring now.

# Answer
> 3 votes
It depends.

If it's an extension that does something that I need, I would use python (well, it's already installed on all my servers, but would have installed it).

It will however limit the distribution to those that have root access to their servers and can install whatever they want on it, so probably make more sense for "big install" civi.

By the way, by extension, you mean "additional features", not "civicrm native extension", right?

If it's the former, I feel ok with python interfacing with civi (eg. via the rest interface), cleanclothes has for instance a complete frontend developed in python that only uses civi as a backend (and for the most advanced features if I recall)

If it were the latter, I would be concerned having php calling somehow python, mostly because I'm not even sure how it could work cleanly.

You need to tell us more about what your extension does.

---
Tags: extension
---


# Question
Title: Easily switch group of contacts to a newly created contact subtype
I'm creating a new contact subtype, "Student", based on Individual. I've already got a bunch of individuals who I know are students, and I would like to quickly just convert them over to this new subtype.

What would be a simple solution to this problem?

# Answer
1. Create a profile (Administer \> Customize Data and Screens \> Profiles) that includes the Contact field "Contact Subtype."
2. Bring up your desired group of individuals (whether through a search, group listing, etc.).
3. Select the appropriate individuals and use the "Batch Update via Profile" action.
4. On the next screen, select your Profile that contains the "Contact Subtype" field and click Continue.
5. On the Batch Update screen, select the Student subtype for the top individual, then click the Copy icon next to the column label "Contact Subtype." That will copy the Student subtype selection all the way down the list. Scroll down to the bottom of the page and click "Update Contacts".

You're all set!

Note: the limit for Batch Update via Profile is 100 contacts, so if your number is greater than 100, you'll have to do Steps 3-5 multiple times.
> 8 votes

---
Tags: contacts
---


# Question
Title: Issue using shortcode to insert Contribution Page into a WordPress Page
When I insert a shortcode for my contribution page into a page on WordPress, the text on the page gets duplicated and I can't figure out why.

I'm not sure if this is a CiviCRM issue or a WP issue for my theme, but if I remove the shortcode it doesn't do that, so I figured this is a good place to start.

You can see it here: http://www.gardensedge.org/support/

# Answer
> 3 votes
Try disabling the Jetpack Open Graph component and see if the problem persists.

---
Tags: wordpress, civicontribute, contribution-page
---


# Question
Title: How to remove a financial type from profile is already created and data is submitted?
By mistake I have included a financial type while creating a profile which should not have selected. Now if I go to settings of profile now its disabled. How can I get it enable again? or a way to remove irrelevant financial type Please?

# Answer
> 2 votes
I'm not 100% clear on your question but I think it is one of the following:

1. The *\[x\]CiviContribute* option in the screenshot above is automatically checked if you add a profile to a Contribution page. If you remove the profile from all Contribution pages, that option will disappear again.
2. If you want to remove a particular field from the Profile (e.g. if you added the "Financial Type" field to this profile), click on **View or Edit Fields for this Profile** in the screenshot above and look for that field to disable or remove it.

---
Tags: civicontribute, profile
---


# Question
Title: How can I send a copy of a receipt to member who has already recieved it during signup?
I've got a situation where by the template for the receipts (for contributions) which are sent out during signup had the previous year on it, and consequently, need to re-send the receipt to the members who have signed up in this year with an updated year.

I was wondering if there is any easy way to do this?, i can easily create a mailinglist, but i've no way of replicating the receipt (or just re-sending the currently sent ones, but with the new date) that I am aware of?

# Answer
Via **Contributions \> Find Contributions** (`civicrm/contribute/search`) you can search for the contributions in question, then select *Print or Email Contribution Receipts*.

The next page is titled *Print Contribution Receipts* but it has an option to email them anyway.
> 6 votes

---
Tags: email, contributions
---


# Question
Title: Wordpress page title only fixed in 4.6.4?
Can I assume that the fix mentioned in this post is for 4.6.4 NOT 4.6.3, the current stable version?

http://forum.civicrm.org/index.php/topic,36339.msg154556.html#msg154556

Any idea how long until 4.6.4 is the stable version or what magic happens in that version to allow Wordpress to use the title of the PCP for the page title (instead of the site title)?

# Answer
On reviewing the situation in the presence of various plugins that try and change the title for SEO or Open Graph reasons, I think there is an issue with the way Civi tries to set the title. I've created at pull request on the CiviCRM WordPress plugin's repo at GitHub that should fix this.
> 3 votes

# Answer
The forum post indicates that it was already fixed in the 4.6.0 version of civicrm. Please read the forum topic closely, specifically haystack's and coleman's reply here:

http://forum.civicrm.org/index.php/topic,36339.msg154574.html#msg154574

If you need to backport a patch to your existing version, this document will be of help:

http://wiki.civicrm.org/confluence/display/CRMDOC/Verify+a+bug+fix
> 2 votes

---
Tags: wordpress
---


# Question
Title: How should I configure multiple Drupal sites to share a CiviCRM database?
I have an existing CiviCRM instance on Drupal site (D1). I have a second Drupal site (D2), which does not have CiviCRM. I want to make the CiviCRM instance (data/contacts/settings) from D1 available inside of D2.

I want to have CiviCRM Views integration and CiviCRM Entity module working from both D1 and D2.

Reading the CiviCRM multisite documentation, it is still not clear to me what my ideal setup would be.

I am hoping that someone will share how they think it should be set up!

# Answer
> 1 votes
You should read about Drupal multi-site feature. That's we can use the same database and same modules if the D2 is working as an parked domain for D1 website.

I would like to share the reference link https://www.drupal.org/documentation/install/multi-site

Please check that one.

---
Tags: drupal, multisite, civicrm-entity
---


# Question
Title: Googlebot & Could not find valid value for id
Over the last few years every few days a fatal error is triggered by a Googlebot. Seems harmless and unnecessary but it is possibly affecting ranking.

The errorreport extension (ca.bidon.reporterror) reports:

```
HTTP_FROM: googlebot(at)googlebot.com
REDIRECT_QUERY_STRING:q=civicrm/event/register&snippet=4&type=
but also sometimes:
REDIRECT_QUERY_STRING:q=civicrm/event/register

```

The logfile in ConfigAndLog says:

```
May 17 19:16:31  [info] $backTrace = #0 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Core/Error.php(363): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Utils/Request.php(95): CRM_Core_Error::fatal("Could not find valid value for id")
#2 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
#3 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
#4 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Core/Invoke.php(307): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
#5 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#6 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#7 /home/account/domains/ourdomain.nl/public_html/crm/sites/all/modules/civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
#8 [internal function](): civicrm_invoke("event", "register")
#9 /home/account/domains/ourdomain.nl/public_html/crm/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
#10 /home/account/domains/ourdomain.nl/public_html/crm/index.php(21): menu_execute_active_handler()
#11 {main}

```

I have 27 full examples of this now. Probably I'm not the only one experiencing this. What would be a cause of this? And what would be a start of a solution?

# Answer
> 1 votes
Just speculating here, but seems like google is getting the links either from the pages and/or some unknown static web pages.

A possible, but not so great solution is:

a. Create and register a new CiviCRM fatal handler

b. If you detect the user agent is googlebot and/or some other friendly search engines, redirect to main page of site, maybe with a CMS message

c. If not, keep fatal message as is (unless you want to redefine this also)

# Answer
> 0 votes
It sounds like Googlebot is trying to (unsuccessfully) fill out your event reg form or perform some kind of AJAX action. It has also been known to play with query string parameters. Check if you have any kind of search page or event listing functionality on your site. Reviewing your reports in Google Webmaster Tools may help as well. One fix is to add a line to your robots.txt file informing Googlebot not to crawl an event/register page if it is missing a query string, like this:

```
User-agent: Googlebot
Disallow: /civicrm/event/register

```

Also check out this SE question about reigning in Googlebot's sometimes odd behavior.

---
Tags: civievent
---


# Question
Title: How to make a single form that works with an individual, and organisation and their Relationship in Wordpress
Most of the Memberships for my organisation reside with Organisations which are then represented by a named individual.

Is it possible using CiviCRM in Wordpress to design a website form which collects the Individual data such as first name & last name AND Organisation data such as Organisation Name and then ties the two together by setting the Relationship as Employer\<--\>Employee.

There seem to be some solutions available for Drupal users such as Webform Integration or CiviRelate.

Any ideas on how one might do this in wordpress?

# Answer
Sounds like you might need to set your Membership page up so that it is 'on behalf of' ie so the Membership is created for the Org, and the Individual becomes permissioned 'current employee of' that Org. The 'on behalf of, settings are on the Contribution 'Title' tab. The profile it offers by default is a 'reserved' Profile (so is on the Reserved 'tab' on Profiles), but you can clone it, change the clone and use that if you don't like what the default one offers by way of fields.
> 3 votes

---
Tags: profile, webform-civicrm
---


# Question
Title: CiviCRM Message Templates link changed, cannot find
We recently upgraded to 4.6.3, and the page message templates live at seems to have changed: the link in our menu bar (https://secularstudents.org/civicrm/admin/messageTemplates?reset=1) is returning a page not found error. All of our message templates still exist. Any suggestions on where to find them so I can change the navigation link to work properly?

# Answer
> 4 votes
CiviCRM 4.6 has a new permission to edit templates separate from "Administer CiviCRM", and I'm almost certain the issue you're having is that you need to add permissions post-upgrade.

From your URL, I'm pretty sure you're running Drupal (and I think I knew that anyway!) so go to http://secularstudents.org/admin/people, select the "Permissions" tab, and locate the permission called "Edit CiviCRM message templates". Check that off for the appropriate roles and press "Submit" at the bottom of the page, the problem should then be solved.

---
Tags: civimail, message-templates
---


title: Type "Timestamp" in CiviCRM

text:
# Question
Title: Type "Timestamp" in CiviCRM
I ran into some validation problem when run a DAO with a 'YmdHis' date string using a ***Date*** type callback. It turns out the ***Date*** type does not take a full date+time string. So I changed to use ***Timestamp*** callback with a timestamp string like this this one "1432650922" but it failed again.

Took a look and realise that the ***Timestamp*** type is not really for Unix timestamps but for date strings in either 'YYYYMMDD' or 'YYYYMMDDHHMMSS' format.

In this case, should we call it ***Datetime*** rather than ***Timestamp***? Just to avoid confusions.

# Answer
> 2 votes
yes, agreed. Can you work on this and submit a PR for this against master (4.7). Should be a relatively easy fix. I'd probably recommend keeping Timestamp for the 4.7 cycle and mark it as deprecated and get rid of it in the 4.8 / 5.0 version

# Answer
> 1 votes
Note that there are 2 field types - datetime & timestamp supported by mysql. Prior to 4.7 CiviCRM DAO actually blocks writes to fields declared in the xml as timestamps (this is changed in 4.7).

Timestamp fields save the time in GMT & mysql interprets the time to display based on the connection time zone.

I don't fully understand where you are hitting the issue - but I wanted to clarify that point

---
Tags: developer
---


# Question
Title: Why is CiviCRM not seeing the timezone correctly?
I have been unable to get the CiviCRM warning about timezone settings corrected after this just past daylight savings transition. Usually I would correct it by changing the timezone setting of the Drupal user ID's. In the past, the user's timezone setting would be an hour off to the real time, so adjusting the timezone setting in Drupal back to current time always corrected the issue. However this time the user timezone setting already was correct.

I have written up the following PHP tester:

```
<?php

$db = new mysqli('localhost', 'dbuserid', 'blablablapassword', 'db');

if($db->connect_errno > 0){
  die('Unable to connect to database [' . $db->connect_error . ']');
}

$sql = <<<SQL
    SELECT NOW() AS `NOW`
SQL;

if(!$result = $db->query($sql)){
  die('There was an error running the query [' . $db->error . ']');
}

while($row = $result->fetch_assoc()){
  echo 'MySQLi date: ' . $row['NOW'] . '<br />';
}

$result->free();

echo 'PHP date: ' . date('Y-m-d H:i:s');

?>

```

Which outputs:

```
MySQLi date: 2015-05-26 21:32:56
PHP date: 2015-05-26 21:32:56

```

Looks like they match to me.

I have also hard coded set the timezone into the Apache virtual site's configuration by adding to the site's .htaccess file:

```
  #Added PHP Timezone information to match Linux configuration
  php_value date.timezone "America/New_York"

```

Where else could be causing CiviCRM to complain thusly:

```
Environment Settings
Timestamps reported by MySQL (eg "2015-05-26 21:28") and PHP (eg "2015-05-26 20:28" ) are mismatched.
Read more about this warning

```

I am thankful, Michael

# Answer
> 3 votes
I know you said you checked the user's timezone but did you check the sitewide time zone in Drupal at /admin/config/regional/settings?

---
Tags: drupal, timezone
---


# Question
Title: Contribution Export Places Campaign IDs in Campaign Title Column, Nothing in Campaign ID Column
When we search for contributions and export, the export places Campaign IDs in Campaign Title column and nothing in Campaign ID Column. Any ideas?

CiviCRM 4.6.3 (happened in older versions also)

WP 4.2.2

Thanks,

e.

# Answer
> 1 votes
This is a bug. Please file an issue on JIRA referencing this page. Instructions on filing a bug report here: https://civicrm.org/bug-reporting

---
Tags: civicontribute
---


title: Multiple file upload field

text:
# Question
Title: Multiple file upload field
I have civicrm installed with Drupal. I was not able to find how to create a multiple file upload using a civicrm custom data field. By default it allows only single file to be uploaded at a time. I require some 'Add more' type of functionality in CiviCRM.

# Answer
> 4 votes
When you create the Custom Field Set for contacts\*, you can check the box that says "Does this Custom Field Set allow multiple records?":

From the book:

> **Multiple record fieldsets**
>
> By default custom data sets have a 'one-to-one' relationship to the entity they are attached to. For example, one field set for a person's physical attributes which contains one field for their height and one for their eye colour will be attached to one individual record. This makes sense because we only ever need to record one eye colour and one height for each person. However, in certain circumstances, we want to record multiple custom field sets for a single contact, for example, when recording a person's educational history. In this case, a single person may have multiple educational degrees, so a custom field set about educational history, which contains fields for subject, institution, and grade, should allow multiple records, and this is what multiple record fieldsets allow.
>
> You can only add multiple record field sets to contacts - you can't add them to other entities. To use this option, select the "Does this Custom Field Set allow multiple records?" option. A few things to bear in mind when creating mutiple record custom field sets:
>
> * Multiple data applies to the whole field set, not to individual fields.
> * Multiple data be can only be added to Contacts. It cannot be added to Activities, or Contributions, etc.
> * Mutiple data cannot currently be exported
> * Before deciding to model something as a multiple value custom field set, you may wish to consider whether it could or should be modelled as an activity. For example, an educational degree could be an activity with custom data added.

# Answer
> 2 votes
CiviCRM does not have this capability at present, but it could be created for your site.

Using a file field in a repeating fieldset is the only way to add an undetermined number of files to an object in CiviCRM, though there is a configurable maximum number of repetitions. You could also add a set number of file fields that should be sufficient for most use cases. The former will look a bit nicer.

Once you have defined the fields to store the (references to the) uploaded files, you will need to create your own upload page to handle multiple simultaneous uploads. Look for a pre-existing function in jQuery that can do this, or in a different library compatible with the CiviCRM browser technology stack.

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


title: Two "total number of participants"?

text:
# Question
Title: Two "total number of participants"?
I'm defining a two day event. For the first day there will be a 120 max participant limit and for the second day a much lower limit.

I also want to have "Early", "Regular" and "Late" fee levels with appropriate "discounts", which are limited in time as "Early Bird" fees are usually handled.

In addition I want to give some discount if you sign up for both days.

My current configuration is based on the three fee levels as time limited price sets each having three options, first day, second day and both with appropriate fees (where the fee is manually calculated according to the strategy I want).

The problem is that with this approach I cannot limit the second day participants to the level I want.

What are my options? Is there a way to do this completely with CiviCRM:s current feature set?

# Answer
Since you have a different participant limit, its really a distinct event and you should treat it that way by creating a second event. Yes your participants have to register twice but then you'll have a much nicer record of which day they attended (and all the benefits of automated reminders as well).

With the two-event configuration you can offer registrants of the first event a special discount for the second - just include the discount code in the confirmation email. You'll need to configure your discount codes carefully to activate and de-activate at the correct time. As a bonus, include a checksum link to the registration page, then the registrant won't have to re-enter all their information.
> 3 votes

# Answer
Try using a price set, as that lets you specify the maximum registrations by field. Then you could have a field for each day.
> 0 votes

---
Tags: civievent, cividiscount
---


title: CiviCRM Training resources?

text:
# Question
Title: CiviCRM Training resources?
Hi does anyone have access to any training videos or material for civicrm? For example, Admin and database reporting, user training, etc.

Thanks in advance

Edward

# Answer
For a free option, you can also look to past CiviCRM conferences. A lot of presenters upload their notes to the session pages. Videos are often posted as well. The videos for the most recent conference in Denver are now available: https://www.youtube.com/playlist?list=PLjSU7YfE0E01HW7JPVAI80XDI0sgOSPDs. There are helpful notes already posted on the session pages.

https://denver2015.civicrm.org/sessions

https://london2013.civicrm.org/sessions
https://london2014.civicrm.org/sessions

https://dc2014.civicrm.org/sessions

http://sf2013.civicrm.org/sessions
> 11 votes

# Answer
Civiteacher.com is very reasonably priced (especially for a whole team). I've used it since its inception, and it has been helpful across a number of concepts and functions.
> 9 votes

# Answer
This page has resources that you can use to put together 1 or 2 day training courses on the general use and administration of CiviCRM: http://wiki.civicrm.org/confluence/display/CRM/Training. It's designed as a syllabus for someone with experience with CiviCRM to teach others so might not be exactly what you are looking for but it's useful none the less. It's also used as the basis for a lot of the in person training courses that happen around conferences, etc.
> 7 votes

# Answer
Progressive Technology Project puts a lot of videos for Powerbase (their branded CiviCRM) on Youtube.

Cividesk has a webinar training series - see the calendar here.
> 5 votes

---
Tags: tutorials
---


# Question
Title: why i cannot get all number errors when importing data
i face errors data when import. when i click download erros , i can't get all of them for example erros = 4000, when i click download erros link i only got 500. why are cannot i get all the number of errors?

i attahed for more detail.

thanks in advance

civicrm 4.411 drupal 7.32

# Answer
I am not sure how you got 500 Error because by default only 250 errors will be printed in civi. if you want the full list just go to CRM/Import/Parser.php file and change the const `MAX_ERRORS` value. This way you can get the full list. also do consider the `DEFAULT_TIMEOUT`.
> 7 votes

---
Tags: drupal, import
---


# Question
Title: How to create a case activity using the API?
I want to create an activity inside a case. I can create a case using `$result = civicrm_api3('case', 'create', $params);` But how do I pass the case id in the api which creates an Activity. To create Activity I am using: `civicrm_api('Activity', 'create', $activityparam);`

# Answer
> 5 votes
The param you are looking for is `case_id` which can be used like:

```
civicrm_api3('Activity', 'create', array(
  'subject' => 'Hello',
  'case_id' => 123,
  ...
));

```

# Answer
> 1 votes
you don't have to create an Activity because we already have a table called civicrm\_case\_activity. Which links the case Id against the new activity created and you can also view the activity against CiviCase Dashboard. I guess this helps!!!

---
Tags: api
---


title: Update of Smart Group cache

text:
# Question
Title: Update of Smart Group cache
I am on CiviCRM 4.6.2 on WordPress and recently noticed that Smart Groups are not updated.

If I look at contacts in a Smart Group it will say one number. But if I then click on *Edit Smart Group Search Criteria for ...* then the real member count is shown and the list shows the correct members. As seen on the two screenshots the membercount is different. 696 is the correct count.

Updating the cache does not resolve the issue. How do I get these groups to update?

# Answer
It turned out to be a user mistake. The members were included wrongly in the smart groups because of a parent / child issue.

> XXX is included in these Parent group(s) based on belonging to group(s) which are their children.
> 5 votes

# Answer
I am *fairly* sure I've seen this happen (on 4.5.8, at least) when contacts have been manually added to the Smart Group. So the initial page shows everyone - 'smart' and manual, but when you click 'Edit Smart Group Search Criteria for' it just shows the 'smart' contacts ie. the results of the search.
> 3 votes

# Answer
I think you need to switch the scheduled job on?!
> 2 votes

---
Tags: smartgroups
---


# Question
Title: "Forward this email" creates contacts with e-mail and no first/last name
If you click the "Forward this Email" link on a CiviMail mailing, you get a screen that allows you to create records with no first/last name (see attached screenshot). Moreover, there's nothing to indicate how they got into CiviCRM. What would be the best fix for this?

* Force someone to enter a first/last name (similar to "Tell-a-Friend" on event reg);
* Create an activity (or even relationship) linking this user to the user who submitted their mail - again, similar to Tell-A-Friend;
* something else entirely?

I understand the need to make it easy to forward an e-mail without giving additional information - but it's also not OK to have records with no way to tell how they got into the system.

# Answer
> 3 votes
I think that page has not changed since it was first implemented. I'd probably vote for the following changes:

a. Add optional form fields first name and last name

b. Create an activity to make it similar to tell-a-friend, which is kinda the same concept

# Answer
> 2 votes
I agree this is less than ideal. Probably the minimum solution would be to fill the "source" field for the newly created contacts with e.g. "Forward email from Bob Smith".

---
Tags: civimail
---


# Question
Title: how to prevent people enrolling for an event twice
We are advertising a free event which people can sign up for online.

People are registering themselves more than once for the event so we are getting duplicate registrations.

If we use the back end to try to add a person to an event that they are already registered for, the system does not allow it. - That's fine.

We would like to make it so people cannot register for an event they are already registered for .

Why does the online registration allow this to happen ?

# Answer
> 8 votes
Check if 'Same email address?' checkbox is ticked in Manage Event \>\> Configure Event \>\> Online Registration.

If this checkbox is enabled, CiviCRM will allow a user to register multiple times using the same email address.

Untick 'Same email address?' checkbox to prevent people from registering for the same event more than once.

# Answer
> 3 votes
Assuming you're allowing registrations from users who aren't logged in, you might check the duplicate checking rule that you're using for the event and make sure that you're collecting enough information for the rule to match.

For example, if you don't require an email address, and your duplicate matching rule matches on email address, you'll create duplicate contacts, each with their own registration.

---
Tags: civievent
---


# Question
Title: cron jobs process_membership, send_reminder and process_membership_reminder_date
I want to send out membership reminders 6 weeks, 3 weeks, etcetera before membership lapses. To send them out, i see multiple cron jobs:

* process\_membership, named Update Membership Statuses and Send Renewal Reminders
* send\_reminder, named Send Scheduled Reminders, and
* process\_membership\_reminder\_date, named Set Renewal Reminder Dates

The first one should be on, I guess, like daily or so ? It may depend on the second one - not sure ? The 3rd one comes with a warning that it should be off:

```
WARNING: Membership renewal reminders have been migrated to the Schedule Reminders functionality

```

indicating that perhaps the first one doesnt have to be on at all.

I'm all confused :-) How do I set this up ?

# Answer
> 3 votes
The first one, *process\_membership*, goes around and updates the membership statuses. It's what sets a member's status to "expired" once the end date comes around. Once upon a time, it sent reminders, but it doesn't anymore (new installations don't have that label for the job). You should be able to have it run daily.

The second one, *send\_reminder*, is for all reminders--activity, event, birthday, etc. in addition to memberships. Although you could get away with running it daily, you should run this hourly, because you may have time-sensitive reminders set up for events.

Once you have the job running, you should go into the Scheduled Reminders admin page and set up the appropriate reminders.

The third one, *process\_membership\_reminder\_date*, should stay disabled--it's obsolete, as the warning says. You could even delete it if you like.

---
Tags: civimember, cron-job, scheduled-reminders
---


title: I Need more contact base types

text:
# Question
Title: I Need more contact base types
I need to add to my CRM object which are neither Individual/Household/Organization. In my case an example would be embryos which relate to their parents (yes, in fertilization process) which have many attributes but none of the individual's (they don't have names/phone/address/skype etc).

thanks

# Answer
You might consider not making those into contacts. Instead, set up a set of custom fields on an individual (parent) or household that allows for multiple entries (in a tab). You can then record the necessary information without cluttering your CRM with contacts who have no names and can't be contacted.
> 7 votes

# Answer
Another option would be to create a sub-type of "Individual" and use a hook to remove options from the create/edit form. This is probably not as good as Andrew's proposed solution but wanted to include it for completeness.
> 5 votes

---
Tags: contacts
---


# Question
Title: symlink at sites/all/modules/civicrm doesn't work
I am used to put all my development stuff (not only civicrm) at a certain point on my linux machine, therefore I use symlink from

```
<drupal base>/sites/all/module/civicrm to /my/devel/path/civicrm

```

This has the benefit of pointing the link to a newer version of civicrm as a means of upgrade or testing new developments.

This doesn't work when I change the symlink to point to another version of my development. The instructions regarding upgrade civicrm (for example to 4.6) won't be helpful here because they talk about replacing the files locally.

Do you think the way I work is not logical?

thanks

# Answer
Make sure there is only one symlink (name does not matter) from modules directory to any civicrm directory outside web root. You might also need to restart apache after you delete the additional symlinks / directory
> 1 votes

# Answer
It's how I do it, it works fine.

So you have (outside of the drupal folder) several folders civicrm-4.5.4 civicrm-4.6.2 ...

and (within the sites/all/modules create a single symlink civicrm -\> the later civicrm-4.6.2)

The name doesn't matter, but as you will have urls that use it, I recommend keeping civicrm as the name of the symlink, and only keep a single one that you symlink with the civicrm version you want

then you upgrade normally using civicrm/upgrade and voila
> 2 votes

# Answer
Symlinks may have to be enabled in the Apache configuration by putting Options FollowSymLinks in your .htaccess or apache config file.
> 1 votes

---
Tags: developer
---


title: hide profile title in Fieldset (legend)

text:
# Question
Title: hide profile title in Fieldset (legend)
Is there a way to hide the profile title. I have added a tracking profile which is being populated by values passed in the URL to the contribute page. The fields I have added are being hidden, so the title is unnecessary.

# Answer
> 4 votes
The simplest way is to use CSS to have something like the following

```
.whatevercontext fieldset.crm-profile-id-13 legend {
  display: none
}

```

and then put that into your site's theme CSS file alongside other customizations you do for your site. Alternatively, you could create a special CSS file and enter the URL in **Administer \> System Settings \> Resource URLs**. Both methods avoid hacking CiviCRM's CSS code.

However, you should double-check the affected form(s) after each upgrade just to make sure the selector hasn't changed.

# Answer
> 2 votes
You can probably do something similar with jQuery and hide it via an extra.tpl file documented here:

https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates

# Answer
> 1 votes
Examined the source, determine the class value for the fieldset, and add an entry to the style sheet (civicrm.css).

fieldset.crm-profile-id-13 { visibility: hidden; }

I do not like changing production files, so I will do some addition research to determine a better location for the change. Is there a custom style sheet for profiles?

---
Tags: developer
---


# Question
Title: System Slow - Event Registration with Payment
On events which require payment, the system takes up to 2 minutes to generate the second page of the registration process, which is the page titled "Confirm Your Registration Information".

What is the problem, and what can I do to bring the performance up to acceptable levels?

The site runs quickly on every other page, including other CiviCRM tasks. It is only this process which is slow.

# Answer
> 5 votes
If I'm looking at the right site, it looks like the second page of your event registration has a consistent 60 second delay added on top of the usual page generation times, and that the delay is introduced before the user is asked for payment.

Unless your payment processor requires communication before the transaction, this suggests that the issue is within CiviCRM or your hosting environment.

**An additional 60 or 120 second delay is often a timeout**, for example when a webserver attempts to get reverse DNS during the request and fails. However there's no way to be sure without looking under the hood, so I'll provide general advice on how to proceed also :)

* Use tools like http://www.webpagetest.org or http://fpt.pingdom.com to ensure your site performs well generally - enter the URL of your registration pages and make sure *the entire page* is delivered to the visitor within a few seconds.
* Ensure your hosting environment is capable of delivering your content in a reasonable timeframe.
* Disable configurations which add to request time, eg reverse DNS lookups.

I suspect this issue is not related to your payment processor at all.

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


# Question
Title: CiviMail Unsubscribe link goes to an empty Wordpress page
How do I troubleshoot a non-working Unsubscribe link through CiviMail?

In using CiviMail to send a mass mailing, the required Unsubscribe function creates a link like this: http://get-hope-global.org/?page=CiviCRM&q=civicrm/mailing/unsubscribe&reset=1&jid=23&qid=42&h=68396bb3066b85d5

Following that link shows our website header and footer without any other information in between. No activity is logged on the associated record in CiviCRM.

I am using CiviCRM 4.5 on WordPress 4.2.2 to send the mailing through the transactional e-mail service Mandrill.

# Answer
> 5 votes
Do you have a basepage set?

Without a basepage, WordPress will use index.php and unpredictable results will occur. Go to Administer -\> System Settinngs -\> CMS Database integration. In WordPress Base Page set a page (civicrm for example), make sure that a WordPress Page (not a post) exists with the same name and slug.

Once this is set your unsubscribe url should be http://get-hope-global.org/civicrm/?page=CiviCRM&q=civicrm/mailing/unsubscribe&reset=1&jid=23&qid=42&h=68396bb3066b85d5

Try it again and see what happens.

# Answer
> 2 votes
Did you check the access controls to make sure mail user has permission to access the subscribe/unsubscribe page. (note: I'm not sure if WordPress has this exact control)

To get to the access control go to Administer =\> Users and Permissions =\> Permissions.

Below the green box should be a link to WordPress Access Control Look to see what your mail user has access to do. On Drupal for unsubscribe I believe the mail user needs to ability to edit a contact and access the unsubscribe page. Again not sure what the WP permissions are.

You might also check your apache logs or whatever webserver you are using logs.

---
Tags: civimail, wordpress, email
---


title: CiviCRM dashboard and menus do not load

text:
# Question
Title: CiviCRM dashboard and menus do not load
I cannot load CiviCRM 4.6.3 in my WordPress installation. I can login to Wordpress, but when I click on CiviCRM,

1. The menu is not loaded
2. the dashboard remains on "Loading…"

When I check the console (F12 in Firefox) I see this error:

> L’utilizzo di getAttributeNode() è deprecato. Al suo posto utilizzare getAttribute(). mootools.js:343:0
> SyntaxError: expected expression, got '\<' admin.php:1:0
> SyntaxError: expected expression, got '\<' admin.php:1:0

What can I check?

# Answer
> 2 votes
This sounds like a javascript error on your Wordpress site. These are typically caused by buggy WP plugins. I suggest you disable plugins to identify the problem.

Here are more detailed javascript troubleshooting steps for CiviCRM.

# Answer
> 1 votes
I resolved by deleting the contents of the table "civicrm\_menu"

# Answer
> 1 votes
You may need to rebuild the menus, you can do this by going to http://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1

This should rebuild the menus and bring them back. It's easier than truncating the db table.

---
Tags: wordpress, civicrm-home, debugging
---


# Question
Title: How do I uncheck the recurring contribution check box by default?
I've searched here and on the CiviCRM forum but haven't been able to find an answer to what I was hoping would be fairly simple.

I want to give people the option of making their contribution recurring, however I don't want the checkbox checked when the form loads I only want the checkbox checked if the user selects it. This is to avoid an embarrassing situation a month down the road when we process their donation again.

Here's a page with the form in test mode

I'm not all that good with code, but did look with Developer Tools and found this:

```
<!-- .tpl file invoked: CRM/Contribute/Form/Contribution/Main.tpl. Call via form.tpl if we have a form in the page. -->

```

I looked at Main.tpl (lines 147-177) but don't understand enough to remove the checked="checked" attribute from the input tag.

```
{if $form.is_recur}
<div class="crm-section {$form.is_recur.name}-section">
<div class="label"> </div>
<div class="content">
  {$form.is_recur.html} {$form.is_recur.label} {ts}every{/ts}
{if $is_recur_interval}
    {$form.frequency_interval.html}
  {/if}
  {if $one_frequency_unit}
    {$frequency_unit}
    {else}
    {$form.frequency_unit.html}
  {/if}
  {if $is_recur_installments}
    <span id="recur_installments_num">
    {ts}for{/ts} {$form.installments.html} {$form.installments.label}
    </span>
  {/if}
  <div id="recurHelp" class="description">
    {ts}Your recurring contribution will be processed automatically.{/ts}
    {if $is_recur_installments}
      {ts}You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.{/ts}
    {/if}
    {if $is_email_receipt}
      {ts}You will receive an email receipt for each recurring contribution.{/ts}
    {/if}
  </div>
</div>
<div class="clear"></div>

```

{/if}

Thanks in advance.

# Answer
> 4 votes
You're in the right place to see what's going on, but the wrong spot to do anything. The field will arrive in the template fully-rendered, within {$form.is\_recur.html} or an equivalent Smarty variable. Editing the template won't help you there.

The form PHP code would allow you to change it, but that's not the best way to go about this: doctoring core CiviCRM code is a bad idea, and while there's a way to set up override files for code files, it's a clunky method. Besides, you'd have to navigate Quickform, which is a headache in itself.

The better approach to forcing a checkbox checked or not is to use jQuery. You'll have CSS-style selectors, so you won't need to troll through the templates to see where to alter the box. You can add your code in one of three places:

1. Somewhere in your WordPress theme
2. In an extension you write, using the Resource addScriptFile method to add a script within hook\_civicrm\_buildform (the preferred method)
3. Using an .extra.tpl file in your template override directory

---
Tags: civicontribute, recurring-contributions
---


# Question
Title: Aggregate Contributions Reports and fiscal years (and households, too)
We have a client with a July 1 to June 30 fiscal year. To filter by a timeframe, the CiviReport system for aggregate contributions insists on grouping by a time period, which is NOT a fiscal year (Year, month, week, or day). If I filter by an aggregate amount, it then it does not include those who gave less in a calendar year even if they gave the required amount in a fiscal year. (It also displays them in separate lines.) How can I get true aggregate reporting in the timeframe I require?

ALSO: Any way to get this to work on the HOUSEHOLD level? I really need to group giving by any member of a household together without requiring people to enter gifts only to the household.

Thank you!

P.S. We need to upgrade, so these comments are for version 4.4.6

# Answer
> 2 votes
I believe this extension will provide the aggregation you're looking for: https://civicrm.org/extensions/aggregate-household-contributions-report

I'm also the main person working on CRM-16195 that Lobo mentioned - I'm trying hard to make time for this (unpaid) work to get it into 4.7, but time is tight! However, your use case is listed on our notes sheet: http://wiki.civicrm.org/confluence/display/CRM/Notepad+for+CRM-16195

# Answer
> 1 votes
This issue (which is work being done for 4.7) might help address part of your problem:

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

however the underlying grouping that civicrm uses (which it actually punts to mysql grouping) might not match your fiscal year requirement and you might need to adopt a different approach

---
Tags: civicontribute, civireport
---


# Question
Title: Find Contacts who are in one and only one group?
i could write a sql query but is there a way to do this search from the UI?

# Answer
> 2 votes
Since sql is probably your best bet, the sql is pretty straight forward.

```
SELECT c.display_name,
       g.name,
       count(*)
FROM   civicrm_group_contact gc,
       civicrm_contact c,
       civicrm_group g
where  gc.contact_id = c.id
and    gc.group_id = g.id
and    gc.status = 'Added'
group by 1
having count(*) = 1

```

# Answer
> 1 votes
If you're trying to count the number of groups each contact is in (and select only those with a single group) then to SQL you shall go!

# Answer
> 0 votes
I think you'll have to model this as a custom search (i.e. embed your sql query in a custom search). Not sure if your description includes smart groups, in which case the problem is a bit more complicated.

---
Tags: search, groups
---


# Question
Title: How can I see a piechart breakdown of contributions by financial type this year?
The "Donor Report (Summary)" produces pie charts, however these seem to be only by date, even if I choose group by Financial Type. Also, it complains *"Do not use filter on Date if group by Receive Date is not used"* if I turn off date grouping. But I need a chart that shows the data by financial type not date, but within a given range (e.g. this year).

The "Donor Report (Detail)" allows me to summarise the data in a text format - the data I want is in the headings; I can't find a way to have only this displayed, or in a pie chart.

Would I need to write a custom report for this functionality, or is there something I'm missing?

I'm on 4.4 LTS.

# Answer
> 3 votes
Have you tried civisualize? the contribution dataviz got you covered

---
Tags: civicontribute, civireport, civisualize
---


# Question
Title: Default PDF Page Formats aren't respected after upgrade to 4.5.8
I have been trying to discern if issues I have been experiencing since a recent upgrade to 4.5.8 are actually a bug. We use Wordpress.

Basically I've discovered that our many, many message templates, which all used to have a default PDF Page Format set, seem to struggle to retain their assigned default. Additionally, when you are in the process of generating a letter against a contact, and you try to override the default Page Format settings in the 'accordion' section, the margin values etc are not overwritten when you make a new selection.

I have tried to replicate the issue on the up-to-date test site, but it seems I can't get access to the message templates section so it is impossible to tell. I've had a good search and no-one else seems to have reported this. Has anyone else noticed issues here?

Thanks

# Answer
I did try creating an example against http://wp45.demo.civicrm.org/ \- It worked fine. Even I have worked in previous version (4.4). I haven’t got any issue at all. So, please try setting the table width = 100% - this should work correctly.

**Example: from Demo** (used message template: “Sample CivicMail Newsletter Template”).

Had a table setting like below **table bgcolor="#ffffff" cellpadding="0" cellspacing="0" width="612"**

Just change the above line to **table bgcolor="#ffffff" cellpadding="0" cellspacing="0" width="100%"**

This gave me a correct output – with proper margin – I guess this Helps!!!
> 1 votes

---
Tags: pdf, message-templates, 4.5
---


# Question
Title: How can I make a contact the case manager of several cases with the same client contact?
Our organization is trying to use CiviCase as a ticketing system. So we have one case type, the "Ticket".

We can have multiple Tickets open for the same client. However, I can't assign the same contact as a "Case Manager" for multiple tickets to the same client.

So let's say client A has 2 open Tickets. On the first Ticket, I assign myself as the Case Manager. That works as expected. However, when I try to assign myself as the Case Manager of the second Ticket for client A, I get an error:

> The relationship type definition for the case role is not valid for the client and / or staff contact types.

If I create 2 cases to the same client, I am automatically assigned as a Case Manager to both of those cases. However, if I remove myself as Case Manager, and try to re-add myself, I get the same error as above.

How can I assign myself (or anybody else) as the Case Manager of multiple cases to the same client.

# Answer
So, I know it's against best practices, but after digging into the code a bit, I've located a (hacky) solution to my problem. When adding a Case Manager via a case view, CRM\_Contact\_BAO\_Relationship::legacyCreateMultiple is executed.

At line 194 there's a check for duplicate relationships. If I comment out the "*continue*" at line 203 within the dupe check, I can successfully assign the case manager to the case.

I would much rather not have to do a core edit, so I await a better solution.

Edit: I had run into a problem elsewhere that ended up being caused by my hack. I do not recommend implementing my hack as I'm not sure of the implications.
> 2 votes

---
Tags: civicase, relationships
---


# Question
Title: Civi webform: change error message for unique entry
Civi webform where I have a field 'existing contact' as an autocomplete. It needs to be unique i.e. one per contact (in this case contact = Constituency), so I have checked 'Unique' in the field settings.

When you submit the form with a non-unique value you get the error message:

> The value 106320 has already been submitted once for the Constituency field. You may have already submitted this form, or you need to use a different value.

Is there anyway to show the contact Display name instead of the ID in this error message?

Thanks

# Answer
Currently no. Technically this field simply stores an integer (contact ID) and that's all the webform module knows about. There is probably a way to override this error message to supply the contact name via a hook but would require some work by a developer. A pull-request for this improvement would be welcomed.
> 2 votes

---
Tags: webform-civicrm
---


title: Is Vanco a supported payment processor?

text:
# Question
Title: Is Vanco a supported payment processor?
Is there any CiviCRM support for Vanco as a payment processor? I do not see them on the list of payment processors in the current release. I searched the exchange and did not find them mentioned. I saw a two year-old posting on Drupal for a module, but the instructions seem out of date.

CiviHosting told me it works with the current release of CiviCRM and Drupal 7, but when asked how to do it, they tell me they do not know.

Any help would be appreciated.

# Answer
We developed the Vanco payment processor several years back and it's working through version 4.4. We are talking with Vanco about updating it; I'm fairly positive it will not work for 4.6. We should have a plan next week.
> 6 votes

# Answer
Yes, Vanco is interested in ensuring there is support for the plugin integrating it and CiviCRM. Speaking as a Vanco employee, If I cannot help you, I will find someone here who can.

To prevent spam, you can find me on LinkedIn at j.c. grogan
> 2 votes

---
Tags: drupal, payment-processor, vanco
---


# Question
Title: Problem with open_basedir restriction in effect
Issue began with -

Wordpress 4.2.2 CiviCRM 4.6.2 (later 4.6.3 - see below) Php 5.4.33

About 5 days ago on Wordpress installation we were suddenly unable to click into the CiviCRM dashboard via Wordpress backend. The only thing that may have happened that we can see is that a automatic backup may have been attempted but there was not enough server disk space for the back up. The disk has been cleaned out and there is plenty of space now.

When attempting to head to civi - the dashboard icons never stop spinning and there is a Warning at top of page that reads:

> Warning: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 386

With no civicrm menus, I did have partial functionality via URLS of some admin pages such as to Admin / Settings / Upload directories - nothing appears wrong there - but almost nothing works..

Cron was also spitting me the full warning:

> **Warning**: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php** on line **386**
>
> **Warning**: session\_start(): Cannot send session cookie - headers already sent by (output started at /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386) in **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php** on line **132**
>
> **Warning**: session\_start(): Cannot send session cache limiter - headers already sent (output started at /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:386) in **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Session.php** on line **132**
>
> **Warning**: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in **/home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php** on line **386**

\__

I note two similar cases - both seem unresolved: http://forum.civicrm.org/index.php?topic=36378.0 where the file is exactly the same - File(/home/wp-includes/version.php)

And there is also the post here: How do I correct the fault causing "file\_exists(): open\_basedir restriction in effect" \- But this is a different file - and there is no response how that went.

SO - I attempted to upgrade to latest CiviCRM 4.6.3 \- There was a warning to update some customised receipt templates, but then the upgrade failed with the warnings:

> Warning: file\_exists(): open\_basedir restriction in effect. File(/home/wp-includes/version.php) is not within the allowed path(s): (/home/bmeeco:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 394
>
> Warning: Cannot modify header information - headers already sent by (output started at /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:394) in /home/bmeeco/public\_html/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php on line 413

Note the new line numbers..

I am stuck for ideas - any help greatly appreciated

Chris

# Answer
> 4 votes
Another potential cause is that Civi's WordPress.php file is incorrectly guessing the path to your WP install. You can force the path in your civicrm.settings.php file, like so:

`define('CIVICRM_CMSDIR','/home/bmeeco/public_html/wordpress');`

Edit: I think you've actually found a bug (CRM-14987). The way it guesses the WP path can cause warnings (it's almost guaranteed to if you are on cheap shared hosting). My solution will get you by, however.

---
Tags: wordpress
---


# Question
Title: Is it possible to make Case Resources a smart group?
I discovered via http://forum.civicrm.org/index.php/topic,35204 that the Case Resources available in CiviCase pull from the Case Resources group. Is there any way to make it use a Smart Group?

If not, my best workaround idea is to create the Smart Group I want, then run a script daily to synchronize that Smart Group with the Case Resources static group.

# Answer
> 2 votes
It uses whatever group is defined in `<custom_templates>/CRM/Case/xml/configuration/Settings.xml`

Just note that it needs to match the "name" field in the database in civicrm\_group, which is usually different from the label that appears on screen. So if you create a group in the admin pages called "Ant Exterminators", the name might actually be "Ant\_Exterminators\_37". This would be true even if you deleted the current Case Resources group and recreated it - it might be "Case\_Resources\_43".

I tried it and it works with a smart group (at least on a slightly older CiviCRM version).

---
Tags: civicase
---


# Question
Title: Can a price set item be marked "Partially Deductible"?
Is there a way to add an item and indicate that an item's cost is partly deductible? For instance, a $500 ticket to a gala dinner that has a $400 deductible component.

I see where to mark financial types as tax-deductible - and I see that there's a field called `non_deductible_amount` in the `civicrm_contribution` table. However, I'm not clear how to populate that value.

# Answer
I think that's just a manually-set field. It certainly predates the accounting improvements, and I think it predates price sets.

The problem is that it's not always a reasonable assumption that the bulk of a contribution is deductible. You might have a organization with a 501(c)3 arm and a 501(c)4 arm. The dinner is $500 per couple, toward the c3, with $100 non-deductible because it's the value of the dinner itself. Then, they ask for a $250 contribution to the c4 on the form as well. The result is that really only $400 of the $750 is deductible, but the `non_deductible_amount` is $100.

Really, this needs to be at the line-item level or dropped entirely.

I tend to avoid the field and encourage folks to just say in the receipt text that they received $100 worth of goods/services in return for the gift. The donor can do the math, and it's not too important for the organization to track that at the contribution level.
> 2 votes

---
Tags: civievent, civicontribute, price-sets, taxes
---


# Question
Title: Contact Reference Field Import & Batch update
How can someone import or do a batch update using a profile using a contact reference field? I have tried both and get errors on the import even though the format of the text is correct and those fields do not appear on the profile when doing a batch update. Thoughts?

# Answer
Just make sure that the referenced fields are imported as the same type. Even if it is you use a name lookup for Contact , CiviCRM will need the Contact ID.

Also watch the date format, I prefer YYYYMMDD as that always works for me.
> 2 votes

# Answer
Contact Import should work for contact reference fields, I did a quick test against 4.6 and it works as expected.

Currently batch update for contact reference fields is not supported in 4.6 or below version of CiviCRM.
> 2 votes

---
Tags: import, contact-reference
---