# Question
Title: Create a user and associate it with an individual of an organization
how can create a new user connecting to an individual of an organization by giving it the ability to send online contributions ? thank you

# Answer
If you set up a Contribution page to require 'on behalf of organisation', and include a Profile on the page that is set to 'require user creation' then the outcome is that John fills in the form, creates a contact record and a user record for himself, creates an organisation record, is linked to this as a current employer with permissions to edit that record.

If you want to create the individual and organisation contacts prior to him going to the form, ie at the backend, then you will need to eg, create the user and the individual via the 'create mode' of a Profile, then send him a link to login, or an email with a checksum so he can visit the page and have it prefilled.
> 4 votes

---
Tags: drupal, contributions, user
---


title: How to map sales team to all my contact

text:
# Question
Title: How to map sales team to all my contact
Happy Evening !

CiviCRM in Drupal 7 - XAMPP

1) I was trying to connect each contact into a other contact(Sales Team) and to create a relationship as "(Contact of Sales Person 1)".

2) Created a even registration - I want to display sale(s) person contact and in a field called "Company contact" and all these sales person will be listed in the registration form itself...

Any help would be great full

# Answer
Do I understand the intention here, ie John has relationship to Mary, Bob, Harry, then on an Event registration page automatically fill the form with Mary and/or Bob and/or Harry (as well as John or not?).

There won't be any way to do this out of the box in civicrm afaik. Since you are on Drupal you are more likely to be able to get close.

John can go to a form and use an autocomplete/dropdown to find contacts he has 'permission' to see, which you can provide by making your Relationship between John and the others Permissioned (see this Extension if you want to make those types of relationships always permissions)

You can then set up the webform to allow John to add multiple of his sales team, or probably have them all load automatically

And yes the Webform-civicrm can be used to add these contacts to an Event, and accept payment depending on the type of payment processor you use.

Webform\_civicrm is very well documented so i would suggest you read, try and come back with more detailed questions
> 2 votes

---
Tags: contacts
---


# Question
Title: Is CiviCRM compatible with OU Campus (OmniUpdate) CMS
I have a client currently using civiCRM and Drupal. They are interested in migrating their site content into OU Campus while still maintaining use of CiviCRM. Has anyone had any success with getting these two working. Is it possible?

Thank you, -n

# Answer
> 2 votes
They can still run CiviCRM on a subdomain separate from the site, likely under Drupal since they already have that installed. See another answer to a recent question that asked something similar about a different system.

---
Tags: cms-integration
---


# Question
Title: Error after Installing CiviCRM 4.6.4 on Drupal 6, drupal attempts to reinstall at localhost/drupal
I have recently installed Drupal 6 on WAMP, then I downloaded CiviCRM 4.6.4 for Drupal 6. I followed the installation offered on wiki.civicrm.org and everything went very smoothly. When I attempted to follow the final step of "Return to Drupal and enable the CiviCRM module http:///admin/build/modules. Check the box next to CiviCRM, then scroll to the bottom of the page and click the "Save configuration" button.". I punch in localhost/drupal into my browser and Drupal attempts to install itself again. I pressed "Install Drupal in English" and it timed out and showed me this "Fatal error: Maximum execution time of 120 seconds exceeded in C:\wamp\www\drupal\includes\file.inc on line 1078". Help please!!

# Answer
Unless there is a good reason why you have chosen to use Drupal 6, I would suggest that you use Drupal 7 instead. As Laryn points out Drupal will reach end of life soon. Things are more likely to go smoothly if you are using Drupal 7 and you also find it easier to get help.

I would also recommend that you use the latest version of CiviCRM - currently 4.6.12 (or 4.7.1).
> 1 votes

---
Tags: drupal, installation, drupal-6
---


# Question
Title: How can I track down a script or form that's generating empty contact records?
Every 10-15 minutes a new, (almost) blank contact record is being generated in civi. The only clue I have is that the blank record is subscribed to our mailing list. Any ideas?

# Answer
Is it always exactly the same number of minutes? If yes: could be cron related

If no: sounds more like a spammer. I would first look in apache/nginx logs and try to find at the time the user is created what exactly happened, which requests are done. First try to get the IP address of the visitor that entered the webform, then search through logs with that IP address and see what it does exactly. Is it the same IP address doing all the submission or not. That could lead to clues of what to do.

It definitely makes sense to apply anti-spam techniques to your site.

Are all techniques that can be applied to drupal and webforms
> 2 votes

---
Tags: drupal, webform-civicrm, groups, security
---


# Question
Title: parse error in civicrm_handler_relationship_relationship.inc since upgrade to 4.6.11
Since upgrade the site is broken with the following message:

Parse error: syntax error, unexpected ';', expecting ')' in /home/ablaze/public\_html/sites/all/modules/civicrm/drupal/modules/views/civicrm/civicrm\_handler\_relationship\_relationship.inc on line 58

Line 58 looks as though it is properly closed and removing the semi-colon just introduces another error.

As an emergency repair I've dropped in the file from the last version and it is working again.

Differences in files:

Line 25

old:

```
$options = array(0 => 'Any');

```

new:

```
$options = array();

```

Line 53

new line inserted:

```
 '#multiple' => TRUE,

```

Murphey's law being what it is I've broken my develoipment environment so can't work out anything else for a while.

# Answer
> 3 votes
I just hit this error, too. It's in 4.6.11 and 4.6.12. It appears to be fixed in 4.7.1.

Line 56 in the file is the culprit. It should be

```
'#description' => t('Choose to limit this relationship to one or more specific types of CiviCRM relationship.'),

```

Here's the commit that fixes it.

---
Tags: drupal-views
---


# Question
Title: Changing hosts for CiviCRM -without current host cooperation
We need to change our civi hosting to another company. We have already moved our website, but the civi hosting still seems to be with the original company. The tricky part is that our current hosts aren't cooperating with us because of legal issues around termination. How should we go about taking this account to another site without any aid from our hosting company?

# Answer
*How can we extract the data of our CiviCRM install without support from the hosting provider?*

## MySQL via network / phpMyAdmin / DB backups

If your hosting company provides CPanel, remote MySQL, or a web interface like phpMyAdmin, then you may be able to take a snapshot of your database. This is the core of your CiviCRM data.

You'll need your hosting provider login credentials to access this. You may have multiple login/password combos to access various services.

This would not include customisations stored in code, nor media (eg uploaded PDFs relating to contact activities), but it would give you the core CRM dataset.

## FTP / SFTP / web upload

If you can edit the codebase on your server, you can upload tools which would let you make a backup of your DB. You can also copy down a copy of your site codebase. You could upload a copy of phpMyAdmin or a CMS plugin like Drupal's Backup & Migrate. Some CMS will let you upload backup plugins within the CMS admin section.

Again, you'll need your login details (to work).

## Exports

If you don't have access methods like the above, but you can still log into CiviCRM, you can search for contact data and then select the Export option. This method of export will probably not retain the full dataset, and you'll need to aspect each core type (Contacts, Memberships, Contributions, ...) separately. I'd only look this way if a full DB export isn't an option.

## API

CiviCRM has an API. Building an exporter wouldn't be trivial, but it's another possible route so worth mentioning.

## "Other technical approaches"

Ever locked yourself out of your car? It happens to site owners too ... There may be means to obtain access even when you're "locked out"; this requires technical chops. (Remember, to get into your locked car you call a car technician, not a car thief!)
> 6 votes

# Answer
Does the CMS have a backup plugin, like Drupal Backup which can create a SQL dump or Duplicator for WordPress? Or can you install via the interface? I've even had instances, where I've had to create a PHP page on Drupal, which generates a backup file in the directory for download (This required PHP code drupal module enabled). If you can get the MySQL dump and files you can transport anywhere! There are a few ways to get them, depending on the access you have.
> 0 votes

---
Tags: hosting, migration
---


# Question
Title: Message: "Fatal DB error, exiting, seems like your schema does not have civicrm_setting table"
Running WordPress 4.4.2 and CiviCRM 4.6.11

Haven't done an upgrade recently and have been using CiviCRM all day with no problems to suddenly encounter:

> Fatal DB error, exiting, seems like your schema does not have civicrm\_setting table

We did migrate servers yesterday and disabled Cloudflare but it just suddenly stopped!

Where to start looking?

# Answer
I would start looking at corrupt tables.

If you have access to phpMyAdmin, you can select all tables at the bottom and then choose "repair tables".

If you do not have phpMyAdmin, but you have access to ssh then you can use mysqlrepair (or mysqlcheck -r), see more at http://linuxcommand.org/man\_pages/mysqlcheck1.html

If you have neither you should ask your hoster to do a repair for all tables.
> -1 votes

---
Tags: wordpress
---


# Question
Title: Is there a way to preserve paragraphs when importing Event descriptions using API csv Import?
First of all - the API csv Import extension is terrific. It's going to really help me out with something.

I am importing webform submissions in order to create Events in CiviCRM, and it's working wonderfully with one minor exception. Paragraphs in textarea webform fields are getting turned into a single paragraph. It's not the end of the world, but I was wondering if anyone had any ideas on how to preserve the paragraphs.

Thank you.

Drupal 7.41 CiviCRM 4.6.11

# Answer
I was able to fix this using this module:

https://www.drupal.org/project/webform\_html\_textarea

Used an html textarea field on my form instead of plain text. The field gets submitted with html markup which preserves the paragraphs.
> 4 votes

---
Tags: drupal, webform-civicrm, import
---


# Question
Title: Tracking/Reporting Invitees vs Attendees (CiviEvent)
We want to find an easy way to track how many people from our invitee list actually signed up for or donated to our event. I was planning on putting all invitees into a 'group', and then tracking RSVP's in CiviEvents. We do physical mailings instead of e-mails right now, so if we can trim the list of people we know don't attend or donate it could save us on postage. Would anyone know of a way to pull a report on this somehow?

# Answer
You could create custom Event participant Status called Invited. In the settings set the Class to Waiting and leave the Counted checkbox unchecked. When you mail out the invitations register all the people to the Event with the status of Invited. As you receive the confirmations go in and set each to attended. Then you can do Event reports based on who has attended or not.
> 4 votes

---
Tags: civievent, civireport
---


# Question
Title: How can I add the "automated mailer task cron job"?
I'm sorry guys, I have really no idea what I'm doing. I'm just trying to learn as I go. I've been checking out forums and videos and it all leads me to this: I need to know the command so I can add the cron job from my cpanel, so that my civiCRM starts sending the emails. I have already enabled the option "process\_mailing" on scheduled jobs settings. Sorry I'm so lost... hope any of you can help me.

# Answer
> 1 votes
There is some general information about scheduling jobs and running cron here User and Administrator Guide.

You will find links to more details in both the guide and the link (Job parameters and command line syntax documentation…) on the Administer=\>System Settings=\>Scheduled Jobs. Here is that link Managing Scheduled Jobs.

There a number of different ways to run the jobs from cron and a number of examples in the second link, which should take you to the command line syntax part of the page.

This command line should work in most situations; though, there can be better options for security, etc. depending on your environment.

```
*/15 * * * * /path/to/php /path/to/civcrm/module/bin/cli.php -s site -u user -p password -e Job -a execute

```

The -s parameter is the site name, and defaults to 'localhost'. It should be set the FQDN (fully qualified domain name) of your site (eg, 'example.com') Some jobs rely on this being set (in certain cases, the CiviMail mailing scheduler uses this FQDN to generate absolute URLs when relative URLs are in the email).

For the crontab challenged folks (most of us at some point), the \*/15 says to run it every 15 mins.

---
Tags: civimail, cron-job
---


# Question
Title: insufficient permissions during upgrade 4.5.5 to 4.6.10
Following the directions on this page. WP 4.3.1, standard LAMP install. All plugins up-to-date except CiviCRM. The plugin is obviously active. Using putty.exe, I remove the civicrm directory and untar the 4.6.10 directory in its place. When I use the `wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1` upgrade URL, I get the insufficient permissions notice. I'm logged in as the user 1 administrator. Settings file is where it should be. No files have wonky read-write or owner perms. I'm at a loss as to why I am unable to get past the upgrade URL step. I'd be grateful for suggestions.

# Answer
Andrei has not responded, so I will state the answer here. The problem was that I downloaded the .gz file for Drupal rather than the .zip file for WordPress. Once that was addressed, the install went as flawlessly.
> 2 votes

# Answer
Can I check if you replaced the civicrm.settings.php file? (In Drupal, the settings file is in a different folder from the CiviCRM module, but in Wordpress it remains in the plugin folder, so it gets deleted/overwritten when you unpack the new version.)

Alternatively, can I check whether it's your own server or a hosted server? I've had problems installing CiviCRM on a shared server because the permissions I assigned to the database user weren't actually being saved - for some reason it didn't affect the WP installation, just CiviCRM. I know it seems unlikely the permissions would change after you've already installed CiviCRM, but if you're not running the server yourself, it's worth double checking.
> 0 votes

# Answer
Use drush command to upgrade civicrm

drush civicrm-upgrade
> 0 votes

---
Tags: upgrade, permissions
---


title: Install problem civicrm with wordpress

text:
# Question
Title: Install problem civicrm with wordpress
Using civicrm 4.7.0 on the latest wordpress. could not setup cron to run scheduled jobs because the settings file is missing. did a fresh install of wordpress in a different path on the server and a fresh install of civicrm to try to see if it would create a settings file after the installation steps were complete. it did not.

so i took the settings template file and created a settings file from that by hand, then with that in place it is possible to setup cron for scheduled jobs.

now, when i go to the civicrm dashboard nothing is displayed and the civicrm menubar in wordpress is missing. i can make it work again by deleting my settings file but then cron doesn't work.

do you have any suggestions what in settings would cause civicrm not to work but cron to work? thanks in advance.

# Answer
> 0 votes
In looking at this further, it appears on any external call or via cron, in version 4.7.0 CiviCRM looked for the settings file ONLY in the directory wp-content/plugins/civicrm if the CMS was WordPress.

In 4.7.1, this was changed to look in both '/*/uploads/civicrm' and '/*/plugins/civicrm'

Therefore on 4.7.0 with the civicrm.settings.php file in wp-content/uploads/civicrm you could get the failure on cron that you describe.

I would try updating to CiviCRM 4.7.1

---
Tags: settings, cron
---


title: Formatting tags shown in activity view

text:
# Question
Title: Formatting tags shown in activity view
It seems that any activity created in 4.7.1 (not sure about earlier 4.7 versions) sometimes shows all formatting tags when viewed.

I reproduced this both in Wordpress and Drupal demos by creating a new case. When viewing the "Open case" activity, the \< p\> tag was shown, as were tags for strike-through, italics and bold, as well as h2 heading. Same happened when adding and then viewing a single activity added to a contact.

What is strange is that adding or editing an activity to an existing case went fine, no tags were shown in the subsequent view.

As I was able to reproduce this on the demo, I believe it is a bug in CiviCRM. It can be rather big issue, since it can render activities with more formatting nearly impossible to read. I'd report this as a bug to jira directly, but instructions say first post here, so here I post.

edit: The affected activities also show all tags on their print versions (of the single activity).

edit2: I would even try to somehow fix this myself with my limited php/html knowledge, but I can't even find the file responsible for this. :(

edit3: Just a small update, issue is still present in 4.7.2, possible related/same issue on Jira

# Answer
> 1 votes
This sounds like a duplicate, or at least new variation in 4.7.1 of, Formatting of formatted text in print case and activiy audit

---
Tags: civicase, activities, issues
---


# Question
Title: Randomly Generated user Passwords, Local Cron Logs and Cron for CiviCRM
Wordpress 4.4.2 | CiviCRM 4.7.1

One thing I noticed about CiviCRM cron and one question...

**Observation:** Cron won't run if there are some escape characters randomly generated by Wordpress.

I was getting this in my cron daemon emails:

```
/bin/sh: W_!1IUHzMR: command not found
ERROR: Invalid username and/or password

```

I changed my password to something less random and it now works. This might frustrate some users who are using Wordpress's own random generator. I didn't see anything about it in the CiviCRM cron installation documentation, so it frustrated me for a while.

**My question:** I'd like to do log my cron task like this:

```
*/15 * * * * /usr/local/bin/php /home/me/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s mydomain.org -u me -p myrandompassword -e Job -a execute >> /home/me/cronlog/mydomain.log 2>&1

```

to log my errors instead of emailing them, but cron refuses to install:

```
/usr/bin/crontab: installing new crontab
"/tmp/crontab.XXXXax8Prq":3: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit? n
/usr/bin/crontab: edits left in /tmp/crontab.XXXXax8Prq

```

Is there a way around this?

# Answer
The Wordpress random password generator seems to create passwords that contain characters that have a special meaning in linux/unix. If you use that in a cron command it will be interpreted by linux based on that meaning in stead of seeing it as a password.

I think your solution is the most clean, make sure the password does not contain the special characters. If for some reason that is not possible you should try "escaping" the special characters. More information at https://serverfault.com/questions/413582/how-to-escape-in-password/413583

Hmm, there seems not that much wrong with your cron command. (except the password should start immediately after the -p, without a space).

The following I could find about your error message: https://www.dougv.com/2006/12/fixing-a-bad-minute-error-message-when-trying-to-use-crontab-with-certain-unix-text-editors/

> This problem most often occurs because you’re using a text editor, such as pico, that fakes word wrapping by adding a newline when it reaches a certain column position.
>
> Crontab delimits jobs with line breaks (newlines). Each job occupies one line. Therefore, if crontab sees anything other than an integer in the first column of a line, it throws the “bad minute” error, since the minute argument is the first one crontab encounters.

Could that be the cause?
> 1 votes

---
Tags: cron-job
---


# Question
Title: After upgrade to 4.7 on Drupal 7, Can't edit a contact
I get the following error and backtrace. If I disable the Formal title option in Admin Display Settings then I dont' get the error.

Exception: "Unsupported html-element "

```
#0 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Contact/Form/Edit/Individual.php(81): CRM_Core_Form->addField("formal_title", (Array:0))
#1 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php(766): CRM_Contact_Form_Edit_Individual::buildQuickForm(Object(CRM_Contact_Form_Contact))
#2 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Core/Form.php(540): CRM_Contact_Form_Contact->buildQuickForm()
#3 /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#4 /home/saintfran/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contact_Form_Contact), "display")
#5 /home/www/www/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "display")
#6 /home/www/www/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#7 /home/www/www/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#8 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1))
#9 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#10 /home/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#11 /home/www/www/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
#12 [internal function](): civicrm_invoke("contact", "add")
#13 /home/www/www/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#14 /home/www/www/index.php(21): menu_execute_active_handler()
#15 {main}

```

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

# Answer
> 4 votes
Similar issue is being filed here https://issues.civicrm.org/jira/browse/CRM-17831.

This has been fixed in 4.7.2 at https://github.com/civicrm/civicrm-core/pull/7770/files.

Update: As xml files are not included in the downloaded Civi. For the time being, can you please make the following changes at `fields()` function in `CRM/Contact/DAO/Contact.php`.

```
'formal_title' => array(
   'name' => 'formal_title',
   .
   .
   .
   'export' => true,
   'html' => array(        <--- include this
     'type' => 'Text',
   ) ,
 ) ,

```

---
Tags: contacts, error
---


# Question
Title: Contribution Widget Not Displaying Properly
I am running Drupal 7 and CiviCRM 4.7.1. Since upgrade, my contribution widgets are not displaying properly, they just show placeholder. I was able to recreate the issue in the sandbox.

Console shows the following error: ReferenceError: jsondata4 is not defined

At a loss of where to search next. Thought it might be related to modsecurity or .htaccess, but since the sandbox experienced the same issue, not so sure anymore.

Suggestions please...

# Answer
Thanks to Marty Wright for reporting the bug and providing a solution.

https://issues.civicrm.org/jira/si/jira.issueviews:issue-html/CRM-17965/CRM-17965.html

The widget code generated for a contribution page fails trying to retrieve the json page data from the server. The output from http:///sites/all/modules/civicrm/extern/widget.php is:

Fatal error: Call to undefined function drupal\_add\_http\_header() in //sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 789

This happens because Drupal is not booted when extern/widget.php runs, and CRM\_Core\_Page\_AJAX::setJsHeaders() calls CRM\_System\_Utils\_Drupal::setHttpHeader() which attempts to call drupal\_add\_http\_header().

To reproduce on the demo site: Enable the widget on the "Help Support CiviCRM!" contribution page. Find the javascript source url at the bottom of the generated code: http://dmaster.demo.civicrm.org/sites/all/modules/civicrm//extern/widget.php?cpageId=1&widgetId=1&format=3 Copy and paste the url into a browser to view what should be the json output, but instead: Fatal error: Call to undefined function drupal\_add\_http\_header() in /srv/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 789

To fix the problem, I added a call to loadBootStrap() in CRM\_System\_Utils\_Drupal::setHttpHeader()

```
  public function setHttpHeader($name, $value) {
    self::loadBootStrap(NULL, FALSE);
    drupal_add_http_header($name, $value);
  }

```
> 0 votes

---
Tags: civicontribute
---


# Question
Title: Unable to add file to event with Attachment api
I am new to CiviCRM and did not find any answer to this.

I have a form on a Drupal page, and want to give ability to upload an image file in both Drupal and CiviCRM from within this form.

I use the "Attachment" api function. When saving the Drupal node, I call civicrm\_api3('Attachment', 'create', params) and pass file params as well as entity\_id and custom field\_name as explained in the api explorer. The CiviCRM field is a file custom field and the entity is an event.

Here is the code I use :

`$result = civicrm_api3('Attachment', 'create', array(
 'debug' => 1,
 'sequential' => 1,
 'name' => $file->filename,
 'mime_type' => $file->filemime,
 'entity_id' => $event_id,
 'field_name' => $field_name,//custom_14
 'url' => file_create_url($file->uri),
 'path' => drupal_realpath($file->uri),
));`

I finally catch this error (look at {main} at the end):

`20 {main}
 [is_error] => 1
 [error_message] => Failed to run permission check: Unrecognized target entity table (civicrm_event)
 )`

Guess I missed something, but what ? Any suggestion ?

Thanks for your help

Philippe

# Answer
Do you have created the custom field on event?

I would suggest you to add manually (via the UI) an attachement and check how it looks like (using the api explorer and get the file(s)), it will be easier to understand what civi expects by looking at what it does
> 1 votes

---
Tags: civievent, api, attachments
---


# Question
Title: Civicrm - Use profile create mode only works 50% of the time
I'm using CiviCRM 4.6.10 with Joomla 3.4.8

I have a profile form setup for public view for volunteers to register.

50% of the time the form works great, submits the new contact to the database, sends an email, and forwards the submitter to the thank you page.

The other 50% of the time, once submitted, it does not send an email, does not submit the contact to the database and does not forward to the thank you page. It actually just redirects to the main page of the website.

Does anyone have any idea why this might be happening? It seems pretty random. Any help would be appreciated. And of course let me know if I left out any essential details.

Thank you in advance for your help!

# Answer
> 1 votes
I was actually able to correct this issue. The problem was: if someone accessed the site with www. in the url it worked fine. If they did it without the www, the form would not submit, but also gave no error.

On the registrar end, I just had it redirect traffic that does not enter www. to the site with www.

I hope that's clear. Thanks

---
Tags: profile, joomla, issues
---


title: Adding Guests to Count - CiviEvent

text:
# Question
Title: Adding Guests to Count - CiviEvent
The agency I am utilizing CiviCRM for has been doing excel sheets for years for event invitations and RSVP's. Typically, households are invited personally but I only have the head of household name. We also will get RSVP's with just the head of household name and number of tickets they want (no information on guests). From my research I understand that CiviEvent runs on the basis of every guest having a profile, which doesn't work with our model.

Some people have suggested making a custom field for number of additional guests, but this number will not count against the final total, which is not ideal if there is a cap for the event. I was curious what some people have done to get around this, as having unnamed guests is common practice, and will obviously affect final count for ticket sales.

# Answer
with Price Sets you can add a field that is an integer that you can set so that those people are counted as 'attendees' for the sake of counting the number of registrations. You should find some helpful instructions here but I am not seeing images currently.

You should then be able to use either the front or back end to make a registration for the 'head of household' and then e.g. put 6 in that price set field to have that registration be counted as having 6 attendees.

That may go some way to what you need.
> 2 votes

---
Tags: civievent
---


# Question
Title: CiviContribute & Paypal Business Account
I'm running Civicrm 4.7.0 on Wordpress and a paypal business account. I'm having problem configuring the payment processor with paypal. 1) is not possible add paypal button in html, 2) configuring live and test parameters civicrm save test parameters same as on live 3) standard and pro paypal version not working. What's the solution?

Thanks

# Answer
> 1 votes
You should setup Paypal in CiviCRM (via Admin \> System Settings \> Payment Processor ie at path civicrm/admin/paymentProcessor?reset=1) and then use Contribution pages with the paypal payment provider.

---
Tags: civicontribute, paypal
---


# Question
Title: Add/Update form actions(context?) detection from hook_buildForm
Is it possible in hook\_buildForm to define which "$action" link (view/add/update/delete/etc) opens the form? We need to set different $defaults depending on "context". There is such kind of detection/check in TPL files, but what about hook\_buildForm?

# Answer
This should be it:

```
    $mode = $form->getVar('_mode');
    // civicrm mumbo jumbo below targets EDIT form mode
    if (in_array($mode, array(CRM_Profile_Form::MODE_EDIT)))
    {}

```

But it doesn't work for all forms, so, for example, for Relationship add/edit form, we should check if **$form-\>getVar('\_relationshipId')** isset/empty : thus no Relationship has been created yet: we are in Relationship ADD "mode".
> 1 votes

---
Tags: hooks
---


title: Receipt not CC-ed for offline donations

text:
# Question
Title: Receipt not CC-ed for offline donations
Why is a receipt not sent to the email addresses set in the Contribution Page for an offline receipt. For instance, online donations to the "Shoe" contribution page are all cc-ed to "bookkeeping". But when an offline donation is processed and the "Shoe" contribution campaign is chosen, no cc happens. Is this because it doesn't run through these page settings when sending the email?

Based on Ken West's comment here Why is offline contribution sending an online receipt? I'm guessing that's the case??

> "CRM\_Contribute\_BAO\_ContributionPage::sendMail(). So there's an assumption that a Contribution Page is involved."

Is there not a way to simply set a CC, even if to say if no contribution page is involved, default the CC to bookkeeping? Even if it can't pick up the info on a page by page basis a default email is a better solution than no email.

# Answer
Coming from a different angle, perhaps you could use CiviRules (along with the added extension Email API to enable CiviRules to send emails) so that any time a contribution is added, you could send an email to your bookkeeping address. (And thus you wouldn't need the CC or BCC for the contribution pages).

Out of the box, you can set conditions for different financial types. Another option: if you didn't want to go to use CiviRules for *every* contribution, just the off line ones, you could create a custom field for contributions indicating off line, and then use a CiviRules condition of Field Comparison for your new custom field, so emails get sent via CiviRules only when the back office is filling it out.
> 1 votes

---
Tags: civicontribute, receipts
---


# Question
Title: Setting a custom invoice date in CiviCRM
Does anyone have an elegant solution to setting a custom invoice date in CiviCRM? One of our clients likes to create invoices for the future, and would like to mark the invoice as such.

Currently, we're using a custom field and replaced the $invoice\_date token with the custom field token as the date.

We're wondering if anyone else has come up with a different way?

# Answer
> 3 votes
I guess you are doing it correctly - to set a future date on the Invoice - I would recommend creating an New token and displaying the date - which you are already doing it - so i don't think their is any other work around

# Answer
> 2 votes
Scheduled Reminders is the way I suspect many users provide this. Ie they create a Scheduled Reminder to go to members say 30 days before due date, with a link to the renewal page. Even if this is only set up to use Pay Later at least that way they get the data in the system that a payment is due. And of course the Contribution page then sends out the 'receipt/invoice' which if you set it up with an 'if=pay\_later' to say Invoice then hey presto they generate their own invoice.

Not a solution for everybody, but definitely a standard civicrm workflow.

---
Tags: civicontribute, invoice
---


title: Tracking expenses with Civi

text:
# Question
Title: Tracking expenses with Civi
Some time ago I saw a post about how one organization was or was considering using Civi to track not only income but to also track expenses (e.g., to track expenses against a campaign so that revenue less expenses would give true campaign net). We are interested in this, so that our board could use Civi to see revenue and expenses and not have to worry about any access to QuickBooks and reduce me having to prepare financials for them from QuickBooks. My thought would be that an expense might be a specific financial type such that a user could exclude that financial type to get revenue only, include it along with other revenue financial types to get the total picture, or include only the expense financial type to see expenses.

All that being said, I have searched high and low and can't find that post. I can't recall if it was from the CiviCRM blogs (again - looked/searched but couldn't find) or some other blog. I also searched here on Stack and couldn't find it. I did find a post about tracking scholarships disbursed (How to manage a scholarship fund?). That helps some, but curious about the entry itself (which was mentioned in the post I can't find).

Anyone recall seeing that post? Or, anyone using Civi to track expenses as well as revenue? If so, I would love to know how you are handling (i.e., how recording in CiviContribute, etc. -- presumably to get net raised as revenue less expenses the expenses must be entered as a negative amount, and whether a "generic" contact was created for payments \[i.e., used as the "vendor"\]). FWIW, I'm on Civi 4.6.11 and WP, but since this is not CRM specific, this is a more global question and more of a way of thinking out-of-the box on how Civi is setup and typically used.

# Answer
> 3 votes
The post can be found here: https://civicrm.org/blogs/chrischinchilla/using-civicrm-project-management-and-budgeting

The description how the budgeting/expense tracking is done is quite short and it only mentions that they are using negative contributions for expenses. They are also using CiviCampaign to assign the expenses to "projects".

The poster Chinchilla is describing an implementation on Drupal using drupal-views, if you are using wordpress I am trying to collect recommended plugins here: What is the recommended Wordpress equivalent for drupal-views

# Answer
> 1 votes
I agree that CiviCRM does not (and should not) aim to provide full accounting functionality. However, with campaigns it makes sense that the system is aware of expenses to compare them against revenue. Here is an extension that does this: https://civicrm.org/blogs/niko-bochan/civicrm-strategic-fundraising-and-campaigning-gsoc-completion-report

This extension, *Campaign Manager*, emerged from last year's Google Summer of Code and is not recommended for productive use as of now. But if it basically does what you need you might be interested in implementing in a pilot project (full disclosure - it was developed under mentorship of SYSTOPIA, my company).

Here is a public demo: https://campaignmanager.systopia.de/

# Answer
> 0 votes
CiviCRM isn't aiming to provide full accounting functionality. It does provide a schema that can record expenses (e.g. grants, also premiums as a cost of goods sold) and functionality to export them to Quickbooks (as .IIF files) and other acconting packages (as .csv files).

As Martin Peth comments, there was a Google Summer of Code project in 2015 that created a working prototype of an extension that would record expenses of CiviCampaigns to allow calculation of campaign ROI.

FWIW, JMA Consulting (full disclosure-my company) provides check printing and control functionality in our Grant Programs extension.

Most relevant in some ways, but still unstarted so far as I know: CiviHR has had support for expense tracking on its roadmap since the first blog post, and it is currently scheduled for v1.8 (https://wiki.civicrm.org/confluence/display/HR/CiviHR+-+Version+1.8).

# Answer
> 0 votes
We have also had a desire of linking data of cost towards data of income.

What we have tried so far is a simple extension which enables us to create a link between the data of the cost and the data of the income.

What it basically does is to give you an UI where you could search for activities in a certain time span, or contacts that have specific reasons for creation in a certain time span (custom fields). In this UI you could enter a number/text of any kind. In our case we input the invoice number of the cost.

Then we are able to link the SQL-tables of the income, with the SQL-table of the activities, with the non-CiviCRM SQL-table for the cost. Then we are able to make a report, where you could search for an activity, and report on income and cost together.

The extensions is found here:

Cost Invoice Link

---
Tags: civicontribute
---


# Question
Title: Network Error when pushing CiviCRM button
I’m having the same issue as what appears to be listed here:

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

I get the same "Network Error" message every time I press the CiviCRM button on the WordPress 'new page' screen when using Chome, FF, and Safari. Perhaps it is an admin or setup error on my part, and not a CiviCRM issue.

I took a screen shot that includes the browser console log if it might be helpful.

# Answer
Your page edit screen shows (I think) a URL of the form 'http://domain.ca/civicrm/wp-admin...' whilst the 404 error is looking for 'http://domain.ca/wp-admin/admin.php'. This suggests to me that you're using WordPress Multisite with CiviCRM active on a site that is not the main site. This is not supported at present - CiviCRM is only functional on the main site of a multisite instance.

Edit: this URL schema could also be the result of installing CiviCRM in a sub-directory. This is also unsupported, though it's an issue that's being addressed.
> 2 votes

---
Tags: wordpress
---


# Question
Title: Would like to know how difficult customise CIVICRM ? did anyone contacted the partners ?
I am looking into customising CIVICRM for thinkForward UK. However I would like to know how hard and complicated customising the solution would be.

Does anyone contacted the partners and contributors? does it worth it or it can be done with some technological help. The charity can get that from a few graduates not working full time though.

Think forward definately needs Civicase and core civicrm as well as reports

Many thanks and regards Nada Kartouch

# Answer
That's like asking how difficult it is to customise your car: it depends on multiple factors but primarily what you want to do and your skills. If you just want to add a fluffy steering wheel cover - go right ahead, anyone can do that. If you want go-faster stripes painting on, then you might do that yourself depending on your artistic abilities. Tinkering (safely!) with the suspension or engine is a specialist job beyond most of us.

Many people do work with partners and contributors but they are all different so the experience of working with one doesn't tell you how that might work out with another one. Each practitioner has their own unique set of experiences, skills and interests so you might want to talk to more than one to find someone who is a good fit for your organisation.

There is a lot of documentation around and there's no "external magic" - all the code is right there on your server, so if you or your graduates have the time, inclination and skill then they can learn. That will give them knowledge but not experience although you can benefit from the experience of others as Pete has already described. All of us started sometime from the point of knowing nothing about Civi!
> 3 votes

# Answer
not sure how to answer this. Members of the core team, and many contributors including Partners are very active on StackExchange. There is also the IRC channel, and you can also put issues in JIRA and have the core team or other developers provide the patches. this post might help clarify the community around civicrm.
> 2 votes

---
Tags: civicase
---


title: What changed in 4.4.21?

text:
# Question
Title: What changed in 4.4.21?
The security advisory that came out today referred to a set of issues, all of which appear to have been fixed by 4.4.20 if present in the 4.4.X version at all. I don't see any separate patch notes / changelog anywhere for 4.4.21, other than the standard "a variety of non-security issues" language.

So, does anyone know what ACTUALLY changed in 4.4.21?

# Answer
This was asked on IRC last week, see https://irc.civicrm.org/logs/%23civicrm.log.2016-02-04.txt :

```
[09:16] <bails> Hi all, slight confusion here: Is 4.6.12  / 4.4.21 a security release?
[09:18] <bails> I ask as https://civicrm.org/advisory says 4.6.11 but thast was released 2016-01-06 rather than yesterday and we didn't get any emails saying a security release was released...
[09:33] <yashodha> bails: some of the security issues were fixed in 4.6.11 but we somehow ended up not tagging it as a security release - hence all we did a security release which includes all the security fixes in the previous version as well
[09:34] <bails> Hi Yashoda, so 4.6.12 is a security release, but has other security patches not in 4.6.11?
[09:41] <yashodha> bails: all the 3 security patches are already in 4.6.11

```

So my impression is that 4.4.20 and 4.6.11 were actually the security releases but weren't tagged as such; 4.4.21 and 4.6.12 were then tagged as security releases so that people would be prompted to upgrade.
> 1 votes

# Answer
https://github.com/civicrm/civicrm-core/compare/4.4.20...4.4.21

Nothing that looks security-sensitive to me. Are the three 2016 flaws also present in 4.4.20/4.4.21?
> 2 votes

# Answer
I guess one way would be to look at the commits on 4.4 in between "Update version to 4.4.20" and "Update version to 4.4.21":
> 0 votes

---
Tags: lts
---


# Question
Title: CiviCRM on Joomla: How to allow multiple users to add contcts, etc?
I'm new to CiviCRM and am setting it up for the first time. I've got it installed on Joomla 3.4, and most of it seems to be working OK.

What I'd like to be able to do is to provide logins to a group of people so that any one of them can log in and add contacts and contributions, run reports, etc. However, the only interface I've found to this functionality is through the admin back end to the Joomla site, logged in as the Joomla admin.

I've tried adding a CiviCRM menu item for logged-in front-end users, but there's no menu item type that provides the CiviCRM access I'm looking for. I was hoping that Dashboard would be it, but it's just a report of parameters specific to the logged-in user.

I've created an administrators group and assigned the admin ACL to it, but logging in as one of those users is no different.

I'm probably going about this the wrong way, but it seems like the kind of functionality that should be available... I'm just not sure how. :/ And I don't want everyone to log in as the Joomla admin!

Thanks!

# Answer
With CiviCRM on Joomla you do need to use the administrator backend for that functionality (unlike on Drupal). The frontend functionality is limited as you've discovered.

You can create a Joomla user group for these CiviCRM users and assign them the ability to login to the Joomla backend, but grant access only to the CiviCRM component. The steps would be something like:

* Create a Joomla user group for these users, with group parent "Public" (Users \> Groups \> Add new group)
* Give the group "Special" access (Users \> Access levels, click Special) This step in setting up Joomla permissions doesn't make sense to me, but without it users will see an empty Joomla administrator dashboard - it's a bit of a gotcha
* In System \> Global Configuration, Permission tab: select the CiviCRM group and change "Site login" and "Administrator login" to Allowed
* While still in the Permission tab, change from global to the CiviCRM component (select CiviCRM under COMPONENTS on left side) and grant permissions as required to the group (there are a lot of them)
* Create users and add them to the group

Now this group will be able to log in to the Joomla backend but will have a limited menu (System, Components \> CiviCRM, Help) like you see at http://joomla.demo.civicrm.org/administrator/

These are the basic steps to get you started; you can also look at using CiviCRM roles.
> 2 votes

---
Tags: joomla, admin, user
---


# Question
Title: Howto extend a civi db field's size (maxlength, varchar)
We are facing a problem with CiviCRM's default field length for organization names.

Background: In our setup we handle big departments or organizational units as distinct contacts. Since the sole department's name isn't sufficient for naming the contact and due to some limitations of CiviCRM (as discussed here) we've decided to compose the the name from the base organization name and the department's name.

Example:

```
Contact A: Base Organization named "University of Bielefeld",
Contact B: Department of A named "University of Bielefeld || Faculty of Physics"
Contact C: Department of A named "University of Bielefeld || FooBar Institute"

```

This leads in come cases to names exceeding the maxlength of contact name fields which is 128.

Setting those in the database is easy but adjusting CRM/Contact/DAO/Contact.php's column definitions makes core updates harder :/

How would you handle this? @Civi developers: Any chance to make field size configurable or increase size to 255 in general?

# Answer
> 1 votes
Interesting one. I would probably add a custom field at Organization level with the full name and use an abbreviated version in the display name. Possibly add an extension to show the custom name in forms with the buildForm hook and the summary hook. Also add an apiWrapper hook to add the longer name to the API.

---
Tags: database, fields, core
---


# Question
Title: Migrating IPN's from Ubercart to Civicrm, OR syncing membership payments from Ubercart to membersips/contributions in Civi
This is a copy of this thread from the forum, since the forum is deprecated for answering questions.

Similarly to this thread (see the above forum post for the link, I can't post it b/c of stack exchange limitations), which describes bringing ARB information from Authorize into Civicrm in order to have Civicrm manage memberhips and renewals on existing recurring payments, I am wanting to switch from Ubercart, which has a bunch of existing recurring Paypal payments for membership roles on the site, to Civicrm. Would it be possible to, in a similar way, migrate the IPN data into CiviCRM and have Civi listen for IPN's? Or is the ipn url entered in Paypal on a per-transaction basis in a way that's difficult to change? (Or, more deviously, if it's too difficult to change the url, could CiviCRM override the notification url provided by Ubercart so that it can read them too before passing along to ubercart?)

-- or --

Another approach was to just use code to sync membership payments to Civi from Ubercart. It seems this might be easier. A more recent response from petednz, http://forum.civicrm.org/index.php/topic,32376.msg153915.html#msg153915 , was to use Rules to do the same thing. However, as I am trying to sync membership payments from ubercart to CiviCRM until people's cc's have expired and they sign back up with Civi, and the Drupal 6 versions of the Rules-related modules don't seem to have the actions necessary to create contribution records or update memberships, I wonder if writing module code is the best way to go.

What do people think is the best approach to this problem? Am I missing something in Rules that would allow me to enter a contribution towards a membership in Civicrm when Ubercart gets notified of a recurring payment (and, for that matter, create the membership in Civi if it doesn't exist yet)? Thanks.

# Answer
> 1 votes
I've been trying to reverse engineer this problem also, and here's my partial answer so far:

1. It seems like the IPN is a post back to a url specified in the initial request. I don't see any way to change that postback url for an existing recurring contribution.
2. The Ubercart postback url looks like `/uc_recurring_hosted/paypal/ipn/<id>`
3. The CiviCRM postback url looks like `<path to civicrm module directory>/civicrm/extern/ipn.php`

So .. part one is to set up an apache rewrite rule to redirect that POST to the civicrm one.

Having done that, the next trick will be for civicrm to actually handle that IPN - to do that, you'd need some records in civicrm (i.e. the contribution\_recur table) that allow civicrm to handle the ipn.

If you inspect a successful Paypal recurring contribution in CiviCRM, it should give you enough clues about what you need to add for the 'migrated' recurring contribution.

Of course, this will only work if the contents of the POST are not specific to ubercart vs. civicrm. The fact that the ubercart postback includes an id, but the civicrm doesn't is a little bit of a flag, but we'll have to see ...

---
Tags: civicontribute, civimember, ubercart, paypal
---


# Question
Title: Network Error - Unable To Reach The Server - Change Payment Details on Recurring Contributions
I am having a problem on CiviCRM 4.6.7 - I get Network Error - Unable to Reach the Server when attempting to "Change Payment Details". Additionally the email sent out, "Recurring Contribution Notification" contains a link,

```
https://www.mydomain.com/index.php?q=civicrm/contribute/unsubscribe&reset=1&crid=35&cs=2cca06426fd09762c341ef901c4c54d0_1440702135_inf

```

And it goes to a blank page

After enabling back-trace/debugging and I right-click and open Change Payment Details in a New Tab, a blank page loads, the error on console says

```
Failed to load resource: the server responded with a status of 500 (Internal Server Error)

```

Using Paypal Website Payment Pro.

Could this be a permissions issue? Or what?

The links in the email sent out to update / cancel contribution work fine.

Update:

Apache error log entry

```
[Thu Aug 27 15:25:35 2015] [error] [client 67.189.24.160] PHP Fatal error:  Cannot use object of type CRM_Core_Payment_PayPalImpl as array in /srv/www/www.mysite.com/public_html/sites/all/modules/civicrm/CRM/Core/Payment/Form.php on line 220, referer: https://www.mysite.com/civicrm/contact/view?reset=1&cid=4687

```

Code referenced:

```
  /**
   * @param array $paymentProcessor
   * @todo it will be necessary to set details that affect it - mostly likely take Country as a param. Should we add generic
   * setParams on processor class or just setCountry which we know we need?
   *
   * @return array
   */
  public static function getPaymentFields($paymentProcessor) {
    $paymentProcessorObject = CRM_Core_Payment::singleton(($paymentProcessor['is_test'] ? 'test' : 'live'), $paymentProcessor);
    return $paymentProcessorObject->getPaymentFormFields();
  }

```

Update two: this is related issue it looks like: Error when updating billing details for admins and contributers

I haven't re-created on demo, because its not set up for recurring contributions AFAIK.

# Answer
> 2 votes
This is from a bug introduced in 4.6.x series, fixed in 4.6.9, as per

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

Solution: update CiviCRM to the most recent 4.6.x

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


# Question
Title: Why do CiviCRM URLs have 'reset=1' in the query string?
Most CiviCRM URLs have `reset=1` in the query string.

E.g. `http://[yoursite.com]/civicrm?reset=1`

What does this do and does it matter if you don't include it?

I only ask because URLs look nicer without it.

# Answer
`reset=1` clears the current local session variables as well as the smarty cache.

For instance, if you have a form that is getting reused, `reset=1` will clear the form's fields (whereas, without it, the form may contain values carried over from it's prior invocation).

If you don't use it, and it's a public, anonymous facing page, I suspect you may get away with it. Try it and see how it works for you.

If the parameter is necessary, you could add it as a redirect to your installation. For instance, in your .htaccess file include something like:

`Redirect 301 /contribute https://[yoursite.com]/civicrm/contribute/transact?reset=1&id=5`

Which would allow `https://[yoursite.com]/contribute` as a valid link to the ultimate contribution page.
> 9 votes

---
Tags: urls
---


# Question
Title: How can we have recurring related fields on custom report?
I want recurring related fields on the custom report, but there is only one field available as per the civicrm i.e. **Recurring contribution ID**.

The fields that I was looking for are **Recurring Units**, **Recurring Intervals**, **Offer Installments**. I am quite unsure if there is some configuration available on civicrm with which we can achieve this. Also please help if there is any API hooks that I can use it to make this happen.

# Answer
> 2 votes
If you're using CiviCRM 4.6, there's now a CiviCRM report template that uses the recurring contribution table as a base and gives you access to a bunch of those related fields.

I've got a custom extension here: https://github.com/adixon/ca.civicrm.contributionrecur which backports that report to earlier CiviCRM versions, and also adds a few more fields.

I notice in your picture you are actually trying to export records, presumably to generate a report in a separate piece of software. You can do something similar from any (CiviCRM) report, i.e. it has a csv download option, and the ability to select which fields to show.

# Answer
> 0 votes
You can get the recurring units and recurring interval from civicrm\_contribution\_recur table (looking at it in phpMyAdmin is likely easiest, or you can examine the code's xml schema definition at https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Contribute/ContributionRecur.xml#L61 and https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Contribute/ContributionRecur.xml#L78.

I'm not sure what you mean by 'Offer installments' but if it is the installments paid so far, then you can retrieve all of the records in civicrm\_contribution table where civicrm\_contribution.contribution\_recur\_id = civicrm\_contribution\_recur.id (https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Contribute/Contribution.xml#L345).

---
Tags: civireport, contributions, recurring-contributions
---


title: Autocomplete database or cleansing

text:
# Question
Title: Autocomplete database or cleansing
As I begin entering the city St. Paul, the helpful hint pops up with St. Paul, but with a street address following. Is there a way to eliminate the street address. (Find autocomplete contact metadata?)

# Answer
Go to Administer \> Customize Data and Screens \> Search Preferences, and beside Autocomplete Contact Search and/or Contact Reference Options disable Street Address and possibly other fields.
> 2 votes

---
Tags: civimember, contacts
---


title: InnoDB is default, but can't install

text:
# Question
Title: InnoDB is default, but can't install
Innodb IS default engine, but can't install. Error message is Unable to create InnoDB tables. MySQL InnoDB support is required for CiviCRM but is either not available or not enabled in this MySQL database server.

I've checked my.conf and made sure that InnoDB is the default engine. The drupal database is in Innodb. I've gone through memory allocations and settings. I've been trying to install civicrm on drupal6 for three days! I've used drupal6 and civicrm for another client for more than a decade! But, now, on this new install, I can't get it to work.

I have tried MANY different versions of CivicRM and they all hang at this same error message. What do I troubleshoot next? Anyone else have this problem?

# Answer
As it turns out, this appeared to be a file ownership problem (at least for me) and after changing the ownership to the appropriate account, I was able to continue. I'm not sure why the error message was like that ... everything else was set correctly ... and I wish the error message was more clear. But if anyone else is searching on this topic, it's worth a shot to make sure that every file in the civicrm directory has the same user. If not, chown with recursion.

I had some files with the account username and some with root. My bad.

Thanks to the commenter above for your willingness to help!
> 1 votes

---
Tags: database, installation
---


title: adding extra info to relations

text:
# Question
Title: adding extra info to relations
I'm setting up CiviCRM for an animal charity organisation. Beside some problems to set up animal master data derived from an individual (e.g. animals usually don't have last names, etc.), I'm stuck with certain events which are related to both an individual and an animal (e.g. adoption or handover):

I wanted to create relations for such events, but I need to add further data to such relations, e.g. for the event "handover" the contract date, date of handover, reason for handover, and other.

Is there a way of storing such data assigned to an event, and assigning this event to both an individual and an animal? Relation doesn't seem to fit such a need ...

Regards

Bernhard

# Answer
I would make "handover" an action rather than an event. Actions are things like meetings and phone calls, natively include two or more contacts and a timestamp, and you can add action types of your own by going to Administer \> Customize Data & Screens \> Activity Types. Play around with that and see if it works for you.
> 2 votes

---
Tags: data-model
---


title: User Contact View at log-in

text:
# Question
Title: User Contact View at log-in
I would like users to see their own CiviCRM Contact View straight away at log-in. I could create a Drupal module to do this, but what if I want the solution to be CRM independent. Can it be done in CiviCRM itself?

# Answer
> 2 votes
We have done this for Drupal in the past just with a Views Block on the /user page, or wherever they go when they log in.

There is a write up about such a View (to show the users Membership details) in this blog

# Answer
> 0 votes
I don't know how to do it in a way that's CMS independent, but for the sake of thoroughness for those who might see this later... if you want a Drupal Rules solution, see here: https://civicrm.stackexchange.com/a/8727/105

---
Tags: drupal, contact-view, urls
---


# Question
Title: What is the recommended level of PHP for CiviCRM? There seems to be some inconsistencies
See the wiki which says the minimum level is 5.4+

But see this linked page from the wiki which recommends 5.6 with a bare minimum of 5.3.10.

See also the system status for release 4.7 which says the minimum recommendation is 5.5

Which is it?

# Answer
CiviCRM PHP requirements *recommends* PHP5.5 **or greater**, and notes PHP5.3.10 is the bare minimum *required*. As well as this, you want to be sure your PHP version is actively getting security updates, and also consider what PHP versions CiviCRM is tested with.

As of Feb 2016, **I recommend PHP5.6** -

* Support ended for PHP5.3 in 2014, and for 5.4 in 2015.
* PHP 5.5 is getting only security fixes until mid 2016.
* PHP 5.6 is actively supported until Dec 2017, with security fixes until Dec 2019.
* CiviCRM doesn't run on PHP7 *yet ...* (CRM-17789: Support PHP7).

NB: Distributions may backport security fixes for older versions after those dates; please do your own diligence on whether your PHP version is secure :)
> 6 votes

# Answer
Chris' answer is correct. However, a coworker reported at least one instance of an extension that did not run correctly on PHP 5.3 (I'm afraid I don't know which), so this answer applies to core CiviCRM only.
> 1 votes

---
Tags: 4.7, php, 4.6.10, coding-standards
---


# Question
Title: CiviMail - Prevent images from being blocked by Outlook
How do I embed images in the email body using CKEditor such that they are loaded automatically in email clients such as Outlook and they and not blocked, with the user having to righ-click to download. Our organization is currently using a separate email client (Sendinblue) to send mass emails, since all emails with embedded images sent from Sendinblue are not blocked by Outlook or other email clients. This is a real disadvantage as we now need to maintain an email list in Sendinblue and manually sync this with contacts and donors in CiviCRM. I have read that you need to use Content-ID to embed images into the email, but how do we achieve this with CiviMail and the CK Editor? We are desperate for a solution here! So any help resolving this, is very much welcomed.

# Answer
> 7 votes
Outlook (and most of the mail clients), block loading external images, because otherwise, the server hosting them would know that you have opened the email (in fact, it's what we do to track the open rate, add a transparent 1x1 pixel image and count when it's displayed)

So to avoid being blocked, you need to send the image as part of the email, not unlike an attachment *(with a defined Content-ID:somekey)*, and as the source of the image *(src="cid:somekey")* in the mail.

Both of these are not that difficult to implement at the technical level, but might be slightly more tricky in the CKEditor (eg. because it doesn't know it's used to compose an email).

Unfortunately, no one having that need have contributed the code or funded the development.

Would you be able to step up and make it happen? it would be a nice addition to civimail.

# Answer
> 3 votes
This is a really helpful article that goes over the options: https://sendgrid.com/blog/embedding-images-emails-facts/

Basically it goes over your 3 options;- CID Embedded Images (Inline Images), Inline Embedding (Base64 Encoding) and Linked Images with the pros and cons of each. In the end pretty much says none of the options have much impact on whether or not your images get blocked, so you choose which one works best for your other priorities.

# Answer
> 3 votes
Actually, you don't want to embed images in your email. It is much more likely to be blocked. Email spam filters don't like embedded images regardless of size.

The current method used by Civi is the recommended method. In that case the popular "show images" option in an email gives readers the ability to see the image (and trigger the open pixel!)

# Answer
> 2 votes
You CAN do this in CKEditor in CiviMail by dragging the image on to the editing window. As others have pointed out though, this is very bad for deliverability rates.

---
Tags: civimail
---


# Question
Title: WP-CLI using GMT/UTC Timezone on cron jobs
Not sure what exactly broke, but upgrading to CiviCRM 4.7.1 on CentOS 6 required adding PHP 5.4 via the SCL repo. Something in that process broke the cURL/wget/php cron job calls. (Invalid username/password despite logs showing it correctly. See https://issues.civicrm.org/jira/browse/CRM-17981) So, I created a cron job with: scl enable php54 "wp --user= --url= --path=/path/to/wp/ civicrm api job.execute auth=0" It runs, and everything seems fine. However, when I go to Scheduled Jobs, everything reports as using a GMT/UTC timezone. If I click to run manually, it reports the local time. I've check the php.ini file and it has the correct timezone declared, as does the site's Settings page. Anybody got a clue?

# Answer
wp-cli doesn't bootstrap the settings, so doesn't load the timezone.

Because of this exact issue, I wrote a patched version of the CiviCRM extension for wp-cli to add timezone support. It's available here. As far as I can tell, the original author has abandoned the project, because they haven't merged any pull requests (including this patch) in over a year.

You can also use wget-based cron - but then you're subject to your webserver's PHP timeouts, as opposed to the CLI PHP timeout, which is usually higher (or non-existent).
> 2 votes

---
Tags: wordpress, cron-job, timezone, cron
---


title: Default localisation

text:
# Question
Title: Default localisation
Can you please tell me if you can set the default localisation to one country, so that language/currency/address country are already set?

Many thanks

Paul

# Answer
Defaults for localisation you can set :

Go to,

CiviCRM-\>Administer-\>Localization-\>Language,Currency,Locations

You can set,

a) Preferred languages Options b) Date formats c) Addresses settings under Administer menu.
> 4 votes

# Answer
You don't have a single localisation per country, but per civicrm installation.

The various defaults you can set (eg language, currency, list of available countries, date format...) are in various screens under the administer menu.

We tried to group them more based on the feature you try to set rather than based on the region it's used because you can have different "locale" settings within the same country (eg the default language can be french or english in Canada), or have a us-english language, use euro as the default currency and dd-mm-yyyy as the date format...

After an installation, you have a list of the most common settings you'd want to adjust, it should cover the localisation items you want to tune.
> 2 votes

---
Tags: localisation
---


# Question
Title: How to link to a stored invoice pdf with civicrm api
I can see that the invoices I have created are in the civicrm/custom map as invoiceID.pdf, but how can I link to them using Civicrm api?

# Answer
> 3 votes
Invoices can be send via email or can be downloaded. Both create an activity (of type "Emailed Invoice" or "Downloaded Invoice"). The invoice pdfs are attached to that activity.

When you first get the activity via the API and collect the Activity ID, you can get information about the attachment via the "Attachment-Get" API function, where "entity\_table" then should be "civicrm\_activity" and "entity\_id" should be the activity id.

For example in php:

```
$result = civicrm_api3('Attachment', 'get', array(
  'sequential' => 1,
  'entity_table' => "civicrm_activity",
  'entity_id' => #activity_id#,
));

```

---
Tags: api, invoice
---


# Question
Title: How to include price field data in a Contribution Thank You letter
We have a need to display price field information in a contribution Thank You letter. As the token system can't handle the price set data, I've pulled the relevant Smarty code from the receipt template, which very nicely presents all of the price fields that were selected for the contribution.

Of course when I make PDFs, its not working : )

I have Smarty enabled for email in the settings.php, and I can use Smarty logic to display content in the Thank You - so Smarty is actually working. But the beginning loop "{foreach from=$lineItem item=value key=priceset}" seems to return nothing and thus no price fields are added to the letter.

Is this possible to do? What is needed to activate processing of price fields in a letter?

# Answer
It doesn't work because `$lineItem` is not set in the template, you'll have to loop thorough `$contribtuions` and use the API:

```
{foreach from=$contributions item=contribution}
{crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id}
  {foreach from=$result.values item=lineitem}
    {$lineitem.label} // Price field label
  {/foreach}
{/foreach}

```

**Please note**: this works fine generating ThankYou's with one contribution per individual.

Related topics for more details:

Let me know if that helps.
> 3 votes

---
Tags: contributions, message-templates, smarty
---


# Question
Title: Social sharing issues: OG and title metas - WP
I work with an organization that recently implemented CiviCRM on its WP site. Since then, social share information/open graph tags on certain pages are scraped from here: http://vector-space.org/civicrm/. The same is true for the title. When I checked FB's debugger, I realize processes a redirect and scrapes OG tags from the aforementioned page. For example, debugger results for an event:

> The following will be treated as a redirect by the crawler:
>
> ```
> A HTTP redirect
> A <link rel="canonical" href=".." /> tag
> A <meta property="og:url" content=".." /> tag
>
> ```
>
> Wordpress SEO didn't resolve the issue since browsers/crawlers are pointed to the CiviCRM header.

I found the parse code on the basepage template, but my coding skills are limited. Is there a way to resolve this so that we can display our own header/OG tags or Wordpress SEO OG info in social shares?

Thanks!

# Answer
> 1 votes
It looks like the same behavior occurs on the official CiviCRM/WP demo site. The browser title for this demo page: http://wpmaster.demo.civicrm.org/civicrm/?page=CiviCRM&q=civicrm/event/info&reset=1&id=3

Does not match the generic title being scraped by FB: https://developers.facebook.com/tools/debug/og/object/

Meanwhile, the CiviCRM/Drupal demo site is scraped as one would hope: http://dmaster.demo.civicrm.org/civicrm/event/info?reset=1&id=3

Is this just a WordPress issue that is yet to be resolved?

---
Tags: wordpress, redirect, social-media
---


# Question
Title: Registering someone who had a friend buy the tickets
I have someone who purchased three tickets and I know the names of their guests and they are in the contacts. But, the ticket prices are discounted due to the group rate and was purchased by one person. What is the best way to make sure I have record of someone attending an event if someone else paid for their ticket and the purchase already affected the total count for the event? I thought of maybe adding them in as a comp, but that would affect the guest count. I want to be able to record in a way that I can make sure they are included on an attendee report.

I am not sure if there is a way to tag additional contact in a particular registration somehow?

# Answer
you can add "free" participants from the backoffice to get them on the list. I'm not sure I understood your need about the number of seats, but you could create a status "paid elsewhere" that you set as not counted as taking a seat.

In theory, you can link these participants to the paying "main" participant, but I don't think you can do it from the user interface, you'll have to use the api explorer or code.

Does it solve the problem?
> 4 votes

---
Tags: civievent, best-practice
---


# Question
Title: What's the best way to code for extensions to work for multiple civicrm versions?
For some extensions, we need to have a different behaviour for different civicrm versions.

I can either manage two branches, but I'll have to backport some fixes and that seems a big overhead. For most of our extensions, I'm tempted for a lighter approach with a single code base

# Answer
We have used the domain in some extensions, like so:

```
$civiVersion = CRM_Core_BAO_Domain::version();

if (version_compare($civiVersion, '4.5', '<')) {
  //in CiviCRM 4.4 the invoke function has 5 arguments maximum
  return $hook->invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, $fnSuffix);
} else {
  //in CiviCRM 4.5 and later the invoke function has 6 arguments
  return $hook->invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, CRM_Utils_Hook::$_nullObject, $fnSuffix);
}

```
> 1 votes

# Answer
So what about keeps the same code but adds a few extra tests to handle the differences more easily:

* if it's a new feature we need, test if it exists (eg if function\_exists) and include a local copy or workaround of that function if it doesn't (for older versions)
* call the new api and check the is\_error return, and add a new api/v3 folder in the include path that contains a copy of the missing function and call the api again
* if it's a missing library (eg. angular or underscore), it's a bit trickier as when you realise that the library is missing, it might be too late as the page is already built and sent to the browser.

For that, I'd like to test what civicrm version we have, is

```
civicrm_api3("domain",get",array("sequential"=>1))[values][0][version] the best way to do that?

```

Can I use the helper functions to compare versions safely with that?
> 0 votes

# Answer
at least from 4.4 you can use

> ```
> $result = civicrm_api3('System', 'get', array(
>   'sequential' => 1,
> ));
>
> ```

which contains the CiviCRM version in the result.
> 0 votes

---
Tags: api, developer
---


# Question
Title: How can you set up CiviCRM multisite with Wordpress multisite?
This question arose from this discussion.

# Answer
> 4 votes
There is documentation covering setting up multisite CiviCRM on multisite Wordpress here.

Additionally, this is an example of the code I put into civicrm.settings.php to set the base URL based on the domain:

```
  $multi_site_path = explode("/", $_SERVER[REQUEST_URI]);
  if ($multi_site_path[6] == "cron.php") {
      $multi_site_choice = $_GET["site"];
  } else {
      $multi_site_choice = $multi_site_path[1];
  }

  switch ($multi_site_choice) {

  case 'hcnmd':
    define( 'CIVICRM_DOMAIN_ID', 2 );
    define( 'CIVICRM_DOMAIN_GROUP_ID', 74);
    define( 'CIVICRM_DOMAIN_ORG_ID', 67459);
    define( 'CIVICRM_UF_BASEURL'      , 'http://hcn.local/hcnmd' );
    $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://hcn.local/hcnmd/wp-content/plugins/civicrm/civicrm';
    break;

  case 'hcfat':
    define( 'CIVICRM_DOMAIN_ID', 3 );
    define( 'CIVICRM_DOMAIN_GROUP_ID', 65);
    define( 'CIVICRM_DOMAIN_ORG_ID', 82031);
    define( 'CIVICRM_UF_BASEURL'      , 'http://hcn.local/hcfat' );
    $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://hcn.local/wp-content/plugins/civicrm/civicrm';
    break;

  ...more multi-site config here...

  case 'wp-admin':
  case '':
  case false:
  default:
    define( 'CIVICRM_DOMAIN_ID', 1 );
    define( 'CIVICRM_DOMAIN_GROUP_ID', 84);
    define( 'CIVICRM_DOMAIN_ORG_ID', 1);
    define( 'CIVICRM_UF_BASEURL'      , 'http://hcn.local/' );
    $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://hcn.local/wp-content/plugins/civicrm/civicrm';
    break;

```

---
Tags: wordpress, multisite
---


# Question
Title: End-user fillout form dropdown instead of checkbox for Group(s)
Using Civicrm version 4.6.11, WordPress 4.4.2 I've created a fill out form that allows our site visitors to sign up for an email newsletter. One of the required fields is the Group (core) field (using the predefined Goup(s) from backend Profile set up. The selection option defaults to check boxes allowing users to choose more than one group. We need them to be able to select one and only one group membership. The group field is one of the core fields rather than a custom field. Is there a way to either change the check boxes to select or radio or is there a way to use a custom field that will populate the core field of Group(s)? We need the user selection to apply to the primary group(s) that we have set up in the civicrm backend that we then use for specific email lists. Thanks!

# Answer
> 1 votes
I found a solution. Not sure if it's the best way, but it works. I use a script and put the checkboxes inside a table with the using the class called in the script:

```
<td class="example">
<input type="hidden" name="group[11]" value="" />
<input class="example"  skiplabel="1" id="group_11" name="group[11]" type="checkbox" value="1" />
Utility Advocate
</td>
</tr>
</table>

<script>
jQuery(":checkbox").on('click',function(){if(jQuery(this).is(':checked')){jQuery('td.example :checkbox').prop("checked",false);jQuery(this).prop("checked",true);}});
</script>

```

If anyone has a more elegant solution, please, I would love it hear it. : )

---
Tags: groups, forms, newsletter
---


title: Add another profile link not working

text:
# Question
Title: Add another profile link not working
None of the "add another profile" links on the Event/Online Registration tab are working. The page just refreshes. This is the first time I have tried to edit an Event with this version of civicrm -- I recall this this worked previously. As shown below, my form lacks quite a few buttons.

Example from demo site:

Example of my form:

# Answer
Thanks to Kevin in the comments section. It was a plugin called Kadence Slider causing the problem. This plugin and the Kadence themes are not compatible with CiviCRM.
> 1 votes

---
Tags: civievent, wordpress, 4.7
---


title: CiviCase Use Examples for Donor/Grant

text:
# Question
Title: CiviCase Use Examples for Donor/Grant
I was wondering if anyone would mind sharing some screen shots of your setup of CiviCase to track donor and/or grant interactions. The only samples I can seem to find are affiliated with more traditional case management. I have been reading a lot of different threads but I feel like I am missing a piece of the puzzle, and cannot seem to find a guide specific to these areas for setup. And image should help, unless you know where a guide specific to this can be found. Thanks!

# Answer
> 1 votes
This screenshot shows one variation but of course everyone's use case is a bit different

# Answer
> 0 votes
I realized I was looking at this wrong, and that activities are the best way to accomplish what I wanted to track.

---
Tags: civicase, evaluating-civicrm
---


# Question
Title: Error messages galore from contact.php and mailing.php, but eveything works? Should I worry? how do I fix it?
I've just migrated a civiCRM instance from Joomla! to Drupal. Everything I've tried so far works and it's the best thing ever. I find everything we want to do so much easier to get around in Drupal.

One problem:

When a user makes a new account, using a civiCRM profile I've made, I get all these errors:

> Notice: Undefined index: contact\_sub\_type in CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2010 of \[redacted\]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php). Warning: in\_array() expects parameter 2 to be array, null given in CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2011 of \[redacted\]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php). Notice: Undefined index: contact\_sub\_type in CRM\_Contact\_BAO\_Contact::formatProfileContactParams() (line 2012 of \[redacted\]/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 763 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 767 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 777 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 781 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).

They are filling in custom fields at this point of registration, and some of them are multi valued if that has any bearing on anything.

Also when updating details of a user I get:

> Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 781 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 767 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 777 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php). Notice: Trying to get property of non-object in CRM\_Mailing\_BAO\_Mailing-\>getTemplates() (line 763 of \[redacted\]/sites/all/modules/civicrm/CRM/Mailing/BAO/Mailing.php).

Again, we are updating those custom multi valued fields using a profile. No, I tell a lie, there are still custom fields, but not multi valued ones here.

This does not happen updating user details using the civiCRM administrative interface. Everything is fine there.

Any hints what the issue could be? does it matter? I'm yet to find anything that does not work, it just regularly throws these errors up. It does matter from a user experience point of view, I at least want to hide these messages. I have not quite finished testing everything though.

This is also on new hosting, so databases have been restored and such. Possibly there is something this host is not doing? but I can't think what it could be.

\[edit\] Found something that does not work. Removing contacts from a group. When I remove a contact from a group they are immediately added back with a status of "Added (by API)" Date added being the time you removed the group. You see this immediately in the administrative interface. Not sure that this is possibly related. \[edit again\] no, only some groups. Some groups remove just fine, I think this is group thing is a drupal group sync thing (greatest thing ever by the way!)\[edit again\] yes, group sync thing, I had an extra rule making a bit of an infinite loop: not related to the above problem. ignore this please.

# Answer
> 1 votes
To suppress these messages, add the following code to your `settings.php` or `civicrm.settings.php`

```
ini_set('error_reporting', E_ALL & ~E_DEPRECATED & ~E_NOTICE);

```

Long answer on Drupal Answers.

CiviCRM generates a substantial number of `E_NOTICE` messages - these are *notices*, which is less severe than *warnings*. If they bother you, submitting patches to address them is a great way to start contributing code to CiviCRM!

---
Tags: drupal, joomla, migration
---


# Question
Title: Can my extension know when other extensions become enabled or disabled?
My extension makes reports based on the Civisualize extension. I'd like to make dashlets out of the reports, but I only want it to be available when Civisualize is also enabled.

It's easy to see if Civisualize is already enabled when my extension becomes enabled, but I don't see a way to find out when Civisualize becomes enabled or disabled after my extension has become active.

My extension does not depend on Civisualize, it works perfectly without, but it only gives some extra nice reports.

So I would like to use some kind of hook\_extension\_enabled which will be fired when other extensions become enabled so I can add my dashlets to the system when Civisualize becomes active and remove the dashlets when it gets inactive.

# Answer
> 2 votes
Looking at the Civi API Explorer, you could reference the Extension entity.

The help text for the Key parameter (API explorer uses full\_name in the code) says "Fully qualified extension name". If you got the Key parameter `full_name="eu.tttp.civisualize"`, you could load your dashlets conditionally based on whether CiviVisualize is enabled.

# Answer
> 2 votes
An alternate approach to checking for the enable/disable status is to use `function_exists()` to check if any of the functions CiviVisualize defines are in PHP's list of defined functions, which implies that CiviVisualize is installed and enabled.

```
if (function_exists('civisualize_civicrm_config')) {
  // Yay! Provide dashlets.
}
else {
  // Recommend installing CiviVisualize
}

```

If the extension isn't enabled, you can still provide placeholder content that will be replaced when the extension is enabled.

Using `function_exists()` should have relatively little performance impact and therefore may allow you to check the currently enabled status of that extension, rather than watch for enable/disable "events".

This also has the benefit of not failing when (e.g) the other extension is removed from the filesystem without being disabled first. It also has an issue of being sensitive to function naming within the other extension, but if `civisualize_civicrm_config` was renamed you'd probably be looking at a whole new version of the extension you integrate with.

---
Tags: extension, hooks, civisualize
---


# Question
Title: prefix Mister Misses in another language
I want to import french customers. In french we say Chère for women, Cher for men instead of misses and mister.

but it is not possible to import the contacts and choose theese salutations. Always the error that the salutation is unknonw:"Invalid value for field(s) : La salutation par courriel doit etre l'une des salutations pre-configurees."

In civi there is the french salutation and as default.

Do you have a solutions for that? Thanks

# Answer
I think it should be possible to import prefixes (such as Madame or Monsieur) but you need to make sure that the prefixes are created in CiviCRM before you import the data (/civicrm/admin/options/individual\_prefix?reset=1).

Also, the Labels in CiviCRM need to be exactly as those in the column of your import file.

Or do you want to import greetings (email or postal greetings)? I am not sure, if this is possible because they are usually generated.

You could try to use something like this for generating a greeting depending on the prefix (just enter it here: /civicrm/admin/options/email\_greeting?reset=1):

```
{capture assign=c}{contact.communication_style}{/capture}{capture assign=p}{contact.individual_prefix}{/capture}{if $p=="Madame"}Chère{else}Cher{/if}{ }{if $c=="Familiar"}{ }{contact.first_name}{else}{$p}{ }{contact.formal_title}{contact.last_name}{/if}

```

CiviCRM would the create an appropriate greeting depending on the communication style (formal or familiar) and the prefix. Please note that for this approach you need to have smarty enabled.
> 1 votes

---
Tags: contacts
---


# Question
Title: Available countries list won't appear when set in Localization
We just upgraded to version 4.7.1, which reset our localization values.

Our forms need to display a list of all possible countries for our contact address fields.

However, when I go to Language and Currency Localization and remove all options from "Available countries," which leaves the field blank, our forms display a squashed box with only one option: the United States.

When I then go back to the Language and Currency Localization page in CiviCRM, I see that the United States has been added back into the Available countries field.

How can I include a list of all countries without manually adding them one by one, which looks to me right now like my only option?

# Answer
> 1 votes
If I understand your question correctly you are asking how you can select all countries in one go.

You can do this by clicking on the first country, then scroll down, press shift and click on the last country. Now press "Add".

If you want to add or remove countries from the selection press Ctrl and click.

Edit: please note that this only works in CiviCRM 4.6 and before. It is not possible to do this in CiviCRM 4.7. See related question - How can I select all countries to be available for address fields in CiviCRM 4.7?

---
Tags: localisation, 4.7, settings
---


# Question
Title: Install CiviCRM without installing the database. And install the database without installing CiviCRM
What madness is this? Sorry for the daft title. Let me explain.

I'm trying to create a docker image for CiviCRM which separates out the web server, database server, and program data itself. In theory, I believe such a container could be very useful to the community. Yes, we have several docker images which do this. I even built one myself using the CiviCRM buildkit. However, none of them really follow the docker principles:

* We can't choose our own web servers in separate containers (i.e. they are not composable)
* We can't use standard docker tools for e.g. managing the SQL database (i.e. they do not conform to established principles).
* Some of them do not even install programatically!

So the plan here is actually quite simple but my lack of knowledge of the CiviCRM install process is hampering me a bit. First, we define a docker-compose file which sets up sensible defaults for the SQL serverand web server containers, allowing the user to swap out other ones if they so desire. It also defines a data container which grabs CiviCRM program code in the build stage, then installs the database in the run stage, then quits.

Like this:

docker-compose.yml:

```
server:
    image: richarvey/nginx-fpm (or any other sensible default)
    container-name: "Civi Webserver"
    volumes-from: app
db:
    image: mysql
    container-name: "Civi DB"
    volumes-from: app
app:
    build: app
    container-name: "Civi App"

```

app/Dockerfile

```
from debian:jessie
# 1: download the build tool
RUN curl -Ls https://civicrm.org/get-buildkit.sh | bash -s -- --full --dir /buildkit
# OR install drush/composer/some other equivalent tool

# 2: download the CiviCRM program code
RUN /buildkit/bin/civibuild create dmaster --no-init-db /var/www/html
# OR some other equivalent command using drush etc.

# 3: prepare to initialise the db
COPY initialize-civicrm-db.sh

# 4: When the container is run it will initialise the database, then quit.
CMD intialize-civicrm-db.sh

VOLUME /var/www/html

```

**To summarise:** I'm looking for a way to install CiviCRM in such a way that the build tool does not also try to install the database. Then I also need a way to install the database without installing the program code.

# Answer
From the excellent interactive documentation here -- https://buildkit.civicrm.org/#/tutorials (which is almost impossible to find unless you know where to look):

```
## Download application (with civibuild)
civibuild download "mytestbuild" \
  --civi-ver "master" \
  --type "drupal-clean"

```

There are a number of interesting gotchas. For example, civibuild download does not download dependencies for civi, it only downloads civi and the CMS. So you may wish to run composer install and npm install between these two stages. Otherwise, both will be run automatically next.

Then install the DB and the rest of the application:

```
## Install application (with civibuild)
civibuild install "mytestbuild" \
  --url "http://localhost:8000" \
  --admin-pass "n0ts3cr3t"

```
> 3 votes

---
Tags: installation, civicrm-buildkit, drush
---


# Question
Title: Configuring cron using wp-cli on local server with Mamp Pro
I'm testing CiviCRM 4.7 in a WordPress 4.4.2 installation. I'm running this on a local server with Mac OSX 10.11.2 using MAMP Pro.

I'm trying to configure cron using the wp-cli method. I've installed, renamed and moved wp-cli and running `wp --info` in /Applications/MAMP/bin gives

PHP binary: /usr/bin/php PHP version: 5.5.30 php.ini used:
WP-CLI root dir: phar://wp-cli.phar WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.22.0 Phils-MacBook-Air:bin phillip$

`wp help` shows the WordPress commands

I'm now trying to implement

```
/path/to/wp --user=<cron> --url=<http://example.com> --path=</path/to/wp> civicrm api job.execute auth=0

```

In my case I'm trying

```
/users/phillip/Sites/thetestsite.dev --user=<philnicholl> --url=<http://thetestsite.dev:8888> --path=</users/phillip/Sites/thetestsite.dev> civicrm api job.execute auth=0

```

but I get

-bash: philnicholl: No such file or directory

(philnicholl is my WordPress administrator username)

I know I'm missing something obvious.

I'm have experience with WordPress and Mamp Pro but am new to both CLI and CIVICRM. Any help would be much appreciated.

Thank you.

# Answer
> 1 votes
Here's an example wp-cli command I use that works:

```
/home/ubuntu/wp-cli/wp-cli --require=/home/ubuntu/wp-cli/civicrm.php --path=/var/www/wordpress civicrm api job.execute > /dev/null

```

I hope that helps!

UPDATE: I see your problem! "/path/to/wp" means, "path to wp-cli, including wp-cli". I completely looked past that part at the beginning, since that's not generally where the problems are found.

Usually, "wp-cli" is aliased to "wp" so it can automatically include the CiviCRM extension - but with cron, I usually just use the require directly.

So log into your computer and type `which wp-cli`. Let's say it returns `/usr/bin/local/wp-cli`. Replace ONLY the first path to WP with that, so it looks like:

To forestall your next question about why it doesn't work - the is a placeholder, and the angle brackets should NOT be included in the actual statement. Angle brackets are a common way in documentation of command-line programs to say, "insert your value here". So instead of `<philnicoll>`, just write `philnicoll`.

You should be left with something like:

```
/usr/bin/local/wp-cli --user=philnicholl --url=http://thetestsite.dev:8888 --path=/users/phillip/Sites/thetestsite.dev civicrm api job.execute auth=0

```

---
Tags: cron, cli, mamp
---


# Question
Title: How to have the Civi Contact deleted when the Drupal User is cancelled?
When a user cancels his registration in Drupal, the pertaining Civi Contact remains.

How can I have both deleted simultaneously ?

# Answer
You could implement this with the Rules module if you have the CiviCRM Entity module installed.
> 2 votes

# Answer
I, personally, wouldn't want the contact deleted. Maybe tag or group them differently but I'd want the history that is contained within the contact record.
> 0 votes

---
Tags: contacts, user-account
---


# Question
Title: Symbunt Report: I need Advanced time period option
I want to track who has donated to our non-profit through a time period (2010-2013) but want to exclude donors who have given since 2014-present.

# Answer
> 3 votes
First create 2 groups, one for donors for time period 2010-2013 and the second for period 2014-present.

Then go to Search - Custom Searches - Include / Exclude Search

Then choose group 1 as "include group" and group 2 as "exclude group" and click Search.

The result will contain exactly the people you want. It would make sense to add them to a third group, so you can send them a Mailing or whatever you want with them.

# Answer
> 1 votes
Catorghans has one correct answer, and I think this is preferable to using a CiviReport. However, if there's a reason you want to use a CiviReport that works like the Sybunt report but with date ranges you can define on your own, it's called the "Repeat Contributions Report".

---
Tags: civireport
---


# Question
Title: Wordpress Compatibility with a Civi system currently installed on Drupal
We are currently working with a company using Civi on a Drupal site (CiviCRM 4.4.1) and will be developing a secondary site through wordpress to link into the same Civi Account, we were wondering would there be any compatibility issues? Would these systems all work flawlessly together?

# Answer
What you're describing is difficult - but not impossible - to do. CiviCRM has a table (`civicrm_uf_match`) that matches a CiviCRM contact to the corresponding CMS user id - which is pretty difficult to line up if you have multiple CMSes! There's also settings in `civicrm.settings.php` that define the CMS, which is necessary for, e.g, creating a URL that's correctly formatted for the CMS in question.

You might want to see if just passing form data from Wordpress to CiviCRM meets your needs. If you're absolutely committed to the path you're suggesting, a good place to start is here.
> 2 votes

---
Tags: wordpress, drupal
---


# Question
Title: Where should I place PayPal auto-return parameters?
Is there a suggested place or method by which to insert PayPal auto-return parameters, so as to guide PayPay to return users to a thank-you page following a transaction?

I have created a pretty standard CiviCRM contribution page to handle membership signups for a small non-profit. The sign-up process works great, but once users are done clicking the "Agree and Pay" button on PayPal, they now have to click a "Return to ..." button (still on PayPal) before being redirected back to the CiviCRM thank-you page.

As I understand it, one can use a return parameter to tell PayPal where to send users once their transaction is done, but I'm not quite sure how to implement it. Any advice?

For context, if it matters, this PayPal Business account is used both for CiviCRM and a separate web store.

A couple references that have guided me so far (but not far enough :-) are...

# Answer
> 1 votes
The auto-return can be setup in your Paypal account.

* Login and click on your **Profile** (upper right), click on **Profile and Settings**.
* In the box on the left, click **My Selling Tools**.
* Under the Selling Online section, update your **Website Preferences**.
* On that page, make sure to **turn on Auto Return** and then **set your return URL** per the instructions.

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