# Question
Title: Integrating Wordpress account and CiviCRM contact details self-maintenance
Still pretty new to CiviCRM so apologies if I am on the totally wrong track here.

We are embedding profiles into Wordpress pages to allow users to self-administer their contact details. To do this they need to be logged in as wordpress users. Would also like to be able to include "change password" as one of the fields they could change when administering their contact details ***without*** sending the user into the wordpress dashboard/backend.

Has anyone tackled this by means of a plugin or other mechanism that might easily allow placement of wordpress account administration alongside civicrm profile details? Or am I stuck dealing with all the WP stuff using plugins/hooks for it separately from the CiviCRM data.

Put another way - I never want an end user to see the "back end" of either WP dashboard or CiviCRM interface, just keep them on the website itself. How do I do this? Make sense?

# Answer
> 5 votes
The only way we have done this is with a WP plugin. WP User Front end allows editing of a WP user's profile from the front end. https://wordpress.org/plugins/wp-user-frontend/.

If you are on CiviCRM 4.6.3 you can mix WordPress and CiviCRM content on the same page, so two shortcodes could be used. While I have not tried this, it may be possible.

I also recommend https://wordpress.org/plugins/civicrm-wp-profile-sync/ for keeping key data in sync between WP and CiviCRM (this requires CiviCRM 4.6)

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


# Question
Title: Joomla Backend (Admin), CIVI White Page after installation
I have a fresh Installation of joomla and civicrm: civiCRM = civicrm-4.6.2-joomla.zip

The Installation went well, however I just receive a white (blank) page calling civicrm from the admin\_\>Components-\>CiviCRM

the related link: http://mywebsite.com/administrator/index.php?option=com\_civicrm

I have tried already certain suggestions from the old "CiviCRM Community Forums", but could not find a working solution. Database and PHP Version is \>5.

May be someone can give me a hint where to start to investigate. Thank you!

B ert

System Information

PHP erstellt für Linux Thot03 2.6.32.12 #5565 Mon May 11 02:12:06 CST 2015 armv5tel Datenbankversion 5.5.42-MariaDB Datenbankzeichensatz utf8\_general\_ci PHP-Version 5.5.25 Webserver Apache PHP-Interface für den Webserver fpm-fcgi Joomla!-Version Joomla! 3.4.1 Stable \[ Ember \] 21-March-2015 20:30 GMT Joomla!-Plattform-Version Joomla Platform 13.1.0 Stable \[ Curiosity \] 24-Apr-2013 00:00 GMT Browsererkennung Mozilla/5.0 (X11; Linux x86\_64; rv:38.0) Gecko/20100101 Firefox/38.0

# Answer
A white screen (WSoD or "white screen of death") indicates that PHP is configured not to display errors, and has hit an error which it can't recover from. The result is an empty page.

Your next step is not to fix the error but to give yourself enough information to identify the source of the error.

**Viewing errors in logfiles**

The webserver can be configured to display errors to screen, but it also logs errors to files on disk. These files vary depending on your hosting environment, so you might consult your webhost's documentation to locate them. You might look for errors in some of these locations depending on webserver/php config -

```
/var/log/nginx/*err*log       # NginX webserver error logs
/var/log/apache2/*err*log     # Apache webserver & mod_php error logs
/var/log/*php*log             # PHP-FPM & PHP-CGI error logs
/var/log/php5/*log            # PHP-FPM & PHP-CGI error logs
/path/to/site/err*log         # Some hosting environments

```

And a CiviCRM specific file - location varies depending on hosting environment AND CMS -

```
path/to/site/path/to/civicrm/files/ConfigAndLog/CiviCRM*log

```

*(The `*`s above represent a wildcard, not an actual filename. Eg the last entry might be public\_html/error\_log on Bluehost.)*

Once you've located these files, you can download them to view, or you can use tools like `tail` or `less +F` to follow the files. I prefer to follow logfiles because you can watch the error appear each time.

**Displaying errors to screen**

You may prefer to display errors to screen. This is probably disabled on your site because it's a security risk to some degree - an attacker can see more information when errors are visible, so the default configuration is often to restrict visibility to people with server access (via the logfiles above).

To enable errors, either configure your PHP to display errors for your site via `php.ini` / `.htaccess` (see How can I get PHP errors to display OR add this code (you can add it in `civicrm.settings.php` or the top of the `index.php` of your host CMS).

```
<?php
  error_reporting(E_ALL);
  ini_set('display_errors', TRUE);
  ini_set('display_startup_errors', TRUE);

```

**Making sense of what you see**

Once you've taken one of the above approaches, try reproducing the actions which lead to a white screen. If all's gone well, you should see an error (on screen or in your terminal / SSH session).

This is where you can start debugging meaningfully. There's a good chance you're exhausting server resources (timeouts, memory exhaustion) or hitting some coding error, but once you have the relevant error message at hand you'll be much better equipped to track down the source of the problem affecting your site.

**Further reading**

**Notes**

If this is the first time you've looked, there may be other errors visible which don't relate to the problem at hand. You may need to discern what the actual problem is still.

If you're not familiar with UNIX, this may seem like a lot of effort. It's a lot of effort to guess your way through debugging a problem though!
> 7 votes

---
Tags: joomla, wsod
---


# Question
Title: Use Drupal views to generate contact Reports in Civicrm
I have several different types of report's layouts/formats to print for Civicrm contacts. I know that, we can generate reports by 'Report' menu in Civicrm.

But i want some suggestion about how much it will be easy to generate reports using Drupal Views. Because here, we have an option to override the reports templates easily. Isn't ?

Please let me know if it will cause any error in future.

# Answer
> 6 votes
If you prefer a solution which is editable via a web GUI, then Drupal Views are a great flexible approach. We use them extensively. You may hit the occasional limitation (either a "Views-ism" or a lack of support for some minor feature) but that's rare. If you are comfortable with Views, you'll be right at home :)

If you prefer writing SQL and are comfortable with PHP, a CiviCRM Report is a solution which offers you a lot of customisation, and building extensions is much easier now with `civix`.

# Answer
> 2 votes
Absolutely. It's very common to use Drupal Views to display contacts' information, either to the public (as in a directory) or internally. You'll see CiviCRM contacts as a option when creating your view, and you can create relationships to contributions, memberships, etc. Modules that extend Views will help, too.

Read more about it at book.civicrm.org

---
Tags: drupal, civireport, drupal-views
---


# Question
Title: Honoree Information - notify another person
I have a use-case for the Honoree section and I am unsure of whether it can be accomplished with the default functionality.

We'd like to add additional fields to the "Honoree Individual" profile to allow the donor to enter the name of someone to notify regarding the donation. (For example, if the donation is in memory of someone, they may wish a notification be sent to a certain living relative.) It's easy enough to add address fields to the profile:

However, this doesn't allow entry of the name of the contact to be notified, and I believe it attaches the address to the honoree. Is there a way to do what we want in the core contribution page, or should I set up a Webform with multiple contacts for this functionality?

# Answer
> 3 votes
You can't do it without doing some custom work. The profile is going to create one contact for the honoree, and unfortunately, that's that. One approach is to have a custom field for the information of who to notify, and then have a report of folks where that's set. A staff member (who would presumably need to mail things anyway) could check that report and set up a new contact manually.

We have a client who wanted something like this, including automatically sending an email to the other person. We built a custom extension to do it, and it might be a good starting point for abstracting it into an extension for others.

# Answer
> 1 votes
A drupal webform can certainly accomplish what you're requesting. Set up:

* Contact 1: Contributor
* Contact 2: Honoree
* Contact 3: Notification recipient

It has the added benefit of being able to create relationships between these three contacts if you wish.

---
Tags: civicontribute, honoree
---


# Question
Title: Drupal custom module civicase is creating but it is returning null value?
In my drupal custom module I am creating a case object via

$result = civicrm\_api3('case', 'create', $params);

This function on debugging api.php file is returning the case id but in my module it is returning the null value

I want it to return the case id. How would i do so? Here code Snippet

```

function form_test_form_submit($form, &$form_state)
$params = array(
    'subject' => 'Test case',
    'contact_id' => 64771,
    'case_type' => 'test',
);

$case = testcase_create($params);

function testcase_create($params){
    civicrm_initialize();
    require_once 'api/api.php';

    try{
        $result = civicrm_api3('case', 'create', $params);
    }
    catch (CiviCRM_API3_Exception $e) {
        $errorMessage = $e->getMessage();
        $errorCode = $e->getErrorCode();
        $errorData = $e->getExtraParams();
        return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
    }
    return $result; // the value of $result is NULL, where as in api.php it was not NULL as seen in debugging
 }

```

# Answer
This may be a permissions issue, depending on who is the logged-in user when your code runs and whether they have permission to create cases. If you want your code to run anyway regardless of who is logged-in, you could add `'check_permissions' => FALSE` to your api $params.
> 1 votes

---
Tags: drupal
---


# Question
Title: Mass hosting best practices for source code management of CiviCRM platforms?
I manage CiviCRM installations on various servers (typically 1 client = 1 VPS). This usually includes roughly the same Drupal core and contrib modules, CiviCRM core and extensions, and translation files. While each client has their own specifics, I try to standardize as much as possible.

I was wondering what tools are recommended to 'build' the platform for production environments? Is buildkit recommended? If yes, any examples on how to use it with custom platforms? (my set of drupal modules + civicrm extensions)

I have been using "drush make" until now, but I find myself fighting with it more often that I should. For example, it cannot download "civicrm.mo" files (because it does not recognize the mime type). It also does not run composer automatically on projects, and I find it useful to use composer in extensions, to avoid bundling third-party libraries in my git repo. Custom build scripts become clunky shell scripts that re-invent the wheel.

Ideally, I would also like to manage the source code of CiviCRM itself in git, which means running composer/npm install on the code base. This makes it easier to backport patches when necessary, track local changes, and have the same tool chain in dev and prod.

Would composer be a good option for that? For example, I stumbled upon Using Composer to build your Drupal 7 projects, which uses PHP packagist.

# Answer
I like that `drush make` or `composer` reduce the amount of code in your repository, and encourage IMO better development workflows (eg submitting and documenting patches rather than forked codebases).

However I am also running into challenges using Drush, which is quite Drupal-centric and requires some working around rather than with if you don't do what it expects (profile modules to profiles/ folder etc).

Best of both worlds if you build a deployment branch which is the complete codebase, but it does require that the whole team is OK with patchwork and building - this may be a factor.

Two nights ago I noticed that deploying CiviCRM codebase via Git had a cost of an extra 100MB per site (plus some). Not the biggest cost, but may be a factor if hosting many CiviCRM on a server.
> 3 votes

---
Tags: sysadmin, hosting
---


title: How do I print an activity?

text:
# Question
Title: How do I print an activity?
Civi used to have an option to print an activity and it would print the details of the activity. I'm in need of this and can't figure out how to print an activity now. Would be really nice if there was a print button at the bottom when viewing an activity.

What's the best way to get a nice print of an activity? We use an activity to record our meeting minutes and need to print them out to keep a hard copy.

# Answer
I agree it's a missing feature. I've created a patch which adds a print button to the dialog titlebar, hopefully this will make it into the 4.6.4 release.

For more details see https://issues.civicrm.org/jira/browse/CRM-16585
> 4 votes

# Answer
I think you're referring to the fact that viewing an activity now happens in a pop-up window, and that window is missing a print button.

I think this is probably an oversight and would be nice to fix. In the meantime here is a workaround:

* On the list of activities, instead of clicking on the "View" button, right-click it and select "Open in a new tab."
* This will display the activity in full-screen mode so the print button will be available.
> 6 votes

# Answer
Alternatively, but a bit overkill, there is a setting which turns off popup forms:

`Enable Popup Forms` at `Administer > Customize Data and Screens > Display Preferences` ( civicrm/admin/setting/preferences/display )

That seems to cover this use case, and also removes the frustrations I find with not having the URL in sight when the pop up is working.
> 4 votes

---
Tags: activities
---


title: Civimail does not save settings

text:
# Question
Title: Civimail does not save settings
I'm trying to save new settings in civicrm/admin/mail form. I click "save" and get the "Your changes have been saved" message but, when refreshing the page, the form is empty as it was before.

We're stuck at the 4.2.9 civicrm version, as our provider does not provide the php features new versions require

Please help, we need to change these settings in order to be compliant to our provider's smtp policy.

We are eventually able to change settings in db tables, if somebody could tell us where to find them (there are really a lot of tables to search from)

Thanks a lot!

# Answer
the table is most likely: civicrm\_mail\_settings

It depends on what specific field you want to change, but most of the fields in that form are from the above table
> 1 votes

# Answer
If you are using 4.2.9 you could at least upgrade to the latest in that series, which is 4.2.20. This may solve your problem.
> 0 votes

---
Tags: civimail, settings
---


# Question
Title: Does this view error mean CiviCRM has lost some MySQL DB perms?
The last CiviCRM upgrade I was running, I received a couple of the same DB errors. Sanitized, minimally, the error was as follows:

```
#7 /srv/www/sites/d1.orgname.org/www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /srv/www/sites/d1.orgname.org/www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")

```

Does that mean that CiviCRM has lost some of its MySQL DB permissions and I must rebuild the DB (according to these instructions) ?

I went looking for where in the CiviCRM source code that view is mentioned, and found:

```
$ grep -r civicrm_domain_view *
CRM/Core/DAO.php:      $dao->query('CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain');
CRM/Core/DAO.php:          $dao->query('DROP VIEW IF EXISTS civicrm_domain_view');
CRM/Core/DAO.php:          $dao->query('DROP VIEW IF EXISTS civicrm_domain_view');
CRM/Core/DAO.php:      $dao->query('DROP VIEW IF EXISTS civicrm_domain_view');

```

I tried running this via PHPMyAdmin:

```
SELECT *
FROM civicrm_domain_view;

```

And receive an error that the view does not exist. "#1146 - Table 'd1\_civicrm.civicrm\_domain\_view' doesn't exist"

Next I tried executing:

```
CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain

```

which told me the MySQL ID did not have permissions to create the view.

So I checked, what do you know that was not a permission I granted to the CiviCRM ID. I provisioned the MySQL account according to these instructions. They do not state that the Create\_view\_priv perm is required, if this is even the correct perm. (I just saw the word "view" and looked there first.)

Suggestions?

I am thankful,

Michael

# Answer
> 2 votes
You're on the right track--when you see a MySQL error and you can't see what's wrong with it, try it out manually. It seemed like a permission problem on the face of it, and the error you got was a lack of permissions. I think the wiki just threw you off with how it is written. It does say,

> Also, to enable CiviCase you should set CREATE VIEW permission.

That's just in this aside just before the main list.

Now, if you don't use CiviCase, you still might try granting that permission and trying it out--I wouldn't put it past someone to change Civi without updating the wiki! Many of us would never notice--I typically give that permission to the DB user as part of a standard setup, and I bet many others do too.

# Answer
> 0 votes
Thank you, Andrew.

To add this permission to the DB in question, I logged in with the master MySQL account and issued:

```
mysql> GRANT CREATE VIEW ON d1_civicrm.* TO 'ud1_civicrm'@'localhost';
mysql> GRANT CREATE VIEW ON d1_civicrm.* TO 'ud1_civicrm'@'127.0.0.1';
mysql> FLUSH PRIVILEGES;

```

Then went back to PHPMyAdmin, logged in as ud1\_civicrm, and successfully was able to execute:

```
CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain

```

and

```
SELECT *
FROM civicrm_domain_view;

```

At least in the latest (4.6.3) CiviCRM powered with Drupal 6 there is no separate "enable/disable" of CiviCase. It must be always enabled, thus this must be always a permission required. No?

I will similarly update the other CiviCRM instances I administer before applying the 4.6.3 update. I am relieved I did NOT have to rebuild the CiviCRM database this time to correct the error!

I am thankful,

Michael

---
Tags: drupal, mysql
---


# Question
Title: Custom CRM/Mailing/Info.php causes WSOD when installing extensions
I'm using the custom PHP feature of CiviCRM to apply patches etc I can't do with a hook.

I have a custom version of CRM/Mailing/Info.php which causes problems when installing an extension. I get the (redacted) error ...

```
PHP Fatal error:  Cannot redeclare class CRM_Mailing_Info in /custom-code-area/CRM/Mailing/Info.php on line 0, referer: https://example.org/civicrm/admin/extensions?action=add&id=nz.co.fuzion.accountsync&key=nz.co.fuzion.accountsync

```

When I remove that PHP file, all is well.

**Potential culprit**

I see that civicrm\_rules\_civicrm\_postProcess() in drupal/modules/civicrm\_rules/civicrm\_rules.module on line 132 has ...

```
  require_once 'CRM/Mailing/Info.php';

```

Could that be the cause? Assuming this is called before the custom code is included.

# Answer
> 1 votes
There are a few files across the system that cannot be over-ridden via the custom php directory. This is primarily because these files are included during the bootstrap process.

I dont think anyone has documented which files or tried to minimize the number of files that can be overridden. I suspect all component Info.php files fall in this bucket and hence you get the above error

Curious as to what custom code you are adding to the Info.php file

---
Tags: extension, drupal-rules
---


title: activity dashlet not showing results

text:
# Question
Title: activity dashlet not showing results
On the dashboard, the activity dashlet is not showing any results for me. I havent heard anyone on this system ever seeing results there.

There is no ajax error, but the snippet it calls is

```
civicrm/ajax/contactactivity?snippet=4&context=dashlet&cid=3

```

(3 is me) .. if I call that directly, it returns an error

> Sorry but we are not able to provide this at the moment.
>
> is not of the type Integer
>
> Return to home page.

anyone know whats wrong ? do I actually have to assign activity types to myself and if so, where ?

---

Powered by CiviCRM 4.5.3.

# Answer
> 3 votes
Yes, go try creating an activity on someone's record and assigning it to yourself. If it doesn't show up in the dashlet, you have a problem, because that's what the dashlet is for.

# Answer
> 2 votes
It sounds like what you are wanting is to create a dashlet from the activity *report*.

* Go to **Reports \> Contact Reports \> Activity**
* Set up your report with the columns you wish
* Check the "Available for Dashboard?" option.
* Save the report.
* Go back to the CiviCRM dashboard, click the configure button, and add your report.

---
Tags: activities, ajax, dashboard
---


# Question
Title: What is the best way to change the intro on a Contribution page based on URL?
I have a contribution page that uses values passed via URL to track specific information about the source of the contribution.

www.domain.org/civicrm/contribute/transact?reset=1&id=8&campaign=sponsorship&appeal=11&fund=child&amount=35.00

The `appeal` variable in the URL contains the nid (node id) for Drupal content. I would like to display image, first\_name, and description of the child, pulled from this node.

Would a profile be used here or use the code extension created for tracking the source?

# Answer
> 2 votes
One way (if I understand correctly what you are after) would be to create a view that displays the node *(or node's fields -- image, first\_name, description)* as you want it using a Block display for the view. Set up a contextual argument for the node's `nid` which provides a default value using PHP code and pull the `appeal` variable from the URL, something like this:

```
check_plain($_GET['appeal');

```

Then simply display this block at the top of the `content` region in your default theme for the `civicrm/contribute/transact` path.

---
Tags: drupal, developer
---


# Question
Title: Drush error: "Command ... needs the following module(s) enabled to run: civicrm"
I am trying to use Drush to run a CiviCRM command (for example, `civicrm-sql-dump` and although CiviCRM is enabled and running fine, I get the following type of error:

```
> drush civicrm-sql-dump > ~/dumpfile.sql

Command civicrm-sql-dump needs the following module(s) enabled to run: civicrm.
The drush command 'civicrm-sql-dump' could not be executed.

```

What is causing the problem?

# Answer
> 7 votes
For some reason the Drush cache is not up to date (for example, if you've recently upgraded CiviCRM). If you clear the Drush cache as follows, the command should work as expected:

```
> drush cc drush

```

---
Tags: drupal, drush
---


# Question
Title: Is it possible to notify a staff coordinator for offline/backend contributions?
On online contribution page setup there is a the ability to send email notifications to different email address using CC & BCC. Using that, our coordinator receives the notifications for each donation submitted using contribution pages.

I am wondering is there a similar option for Offline/Backend contributions submitted by the users? If not, is there any way to facilitate that?

# Answer
> 6 votes
CiviRules is available and you can use it to do what you want. There is documentation as well :-)

If you want to use CiviRules to send an email you will also need the send email API (and please pull the civirules branch): https://github.com/CiviCooP/org.civicoop.emailapi

Once you have that you create a Rule, select the trigger for the rule as an event and come up with conditions. In your case the event will probably be 'new contribution' and the condition might be the source or the financial type, depending on how you are going to distinguish a back end contribution.

The action will then be 'send email', or could possibly also be 'create an activity'. It would make sense to me not to send lots of internal email but instead to create a specific activity type with a dashboard so the user can see his daily workload. But perhaps your end users have other preferences.

# Answer
> 3 votes
There is no equivalent option. The presumption is that the only people entering offline donations are the sorts of people who would get notified.

This is probably something that CiviRules (in development) might do for you. It's also something that you could write in a custom extension using hook\_civicrm\_post.

# Answer
> 2 votes
If you are using Drupal then CiviCRM Entities should allow you to use Drupal Rules to do the required.

---
Tags: civicontribute, email
---


# Question
Title: Possible error in Contributions and Membership Details report
When we run the Contributions and Membership details report for our organization, it reports 41 entries in the month:

Row(s) Listed 41 Total Amount $ 1,320.00(44) Average $ 30.00

However, when the 41 rows are exported as a CSV, the amounts total to $45 less.

What is the meaning of the "(44)" beside the total amount? I suspect it represents that the total is based on 44 rows instead of 41 which would account for why the total is erroneously high.

Is this a "feature" or a "bug"? If a feature, how can I figure out the three extra rows since they do not show up anywhere in the report

Incidentally, if I do the same as a "Find contributions" search, it returns 41 rows and the correct total dollar amount for those 41.

---

This is version 4.5.8, and the organization has not been using soft credits in its operations.

# Answer
You don't specify the version of CiviCRM you're using? Depending on CiviCRM version, you might be seeing one of these issues -

You could search https://issues.civicrm.org/ for other issues if none of those seems like your case (you'll know if you're using soft credits, contribution fees etc).

If you are seeing the issue on a version of CiviCRM that is marked fixed above, post a message on that issue URL - you may be able to assist by providing some (anonymised) example DB data for the core team.
> 3 votes

---
Tags: civicontribute, civireport
---


# Question
Title: Mailing list member received unexpected opt-out message
Using CiviCRM 4.3.4 (update necessary, I know) one of our mailing list members has received an opt-out message, that he was unsubscribed from all mailing lists. In fact this is not true. He is still member of all those groups and has never been removed. Now I'm wondering why he received this e-mail. Any ideas?

# Answer
> 7 votes
In civi, you have two ways to be removed from a mailing: unsubscribe from the group or opt-out (from any mailing).

The later doesn't remove the contact from any group, but change the status of the email and automatically exclude the contact from any mass mailing.

When you do to the contact summary, do you have a red icon next to his/her email?

If you want to have the contact receive mass mailing again, you need to edit the contact and uncheck the opt-out (beware, you should only do that for contacts that actually want to receive emails)

As for why she/he was opted out, it's likely the email was forwarded around, and one of the recipient that received the forwarded email clicked on unsubscribe. Obviously, instead of preventing friends to forward you emails, it did unsubscribe the original recipient, hence the opt-out message.

---
Tags: civimail
---


# Question
Title: After turning on Send Scheduled Reminders and setting up a Membership Renewal Reminder, why am I getting all zeros in my Scheduled Reminders log?
I am using CiviCRM 4.5.8 on Drupal 7. I get the feeling my scheduled renewal reminders are not going out. These are my settings:

Are there some other parameters or settings I need?

# Answer
You say you get the feeling...have you gone into Search \> Find Activities \> Activity Type of "Membership Renewal Reminder" to see what it lists? I always check to see if it has recorded the activity. That doesnt mean it has been emailed only that it was scheduled against that account. Additionally my reminders show up in the Recent Items on the left side of CiviCRM.
> 2 votes

---
Tags: civimember, scheduled-reminders
---


# Question
Title: Can I set a contribution page to have pledge selected by default with a default number of installments?
I would like to have my contribution page default to pledge instead of one-time and also have a default number of installments. Is this possible?

Thanks!

# Answer
> 1 votes
There isn't currently a setting to change this behavior. You will need to add JavaScript to your template file (or via an extension) to check if the donation page has pledge as an option, and if so, to select it.

---
Tags: civicontribute, pledges
---


# Question
Title: Recurring payments URL for Vanco payment processor
Could someone provide an explanation (with an example) for the recurring payments URL field found on the Add Payment Processor form when using Vanco Payment Processor? It is my understanding it is used for processing the Instant Payment Notification (IPN), a message service that notifies you of events related to your payment transactions.

# Answer
> 4 votes
Mike, that URL is not needed. Just complete the top 4 lines (userID, password, site URL, API URL)

You do need to send Vanco the URL of the VancoHistory.php file so that they can send recurring notifications on that URL.

Hope this helps

# Answer
> 0 votes
Mike, as pkeogan stated, the field does not need to be populated for Vanco.

I believe that some payment processors have different URL's to submit recurring payments to, thus the need for this field. In Vanco's case, all transactions should be submitted to the one, single URL.

If the Recurring URL is not specified, CiviCRM defaults to the API url.

---
Tags: payment-processor, recurring-contributions, vanco
---


# Question
Title: Cannot install extensions on a wordpress+civicrm install
I'm trying to install CiviVolunteers on a Wordpress site, and when i click the "download" link on the extensions list page, i get this error message:

Sorry but we are not able to provide this at the moment. Unknown extension

Any ideas on what might be the issue?

I'd be happy to provide wordpress admin access upon request, i'm not sure if it's common to put the login info here...

# Answer
> 1 votes
Eventually I ended up un-installing CiviCRM 4.6.2, and installing version 4.4.1 instead.

After Downgrading CiviCRM i was able to install CiviVolunteers.

# Answer
> 4 votes
After experiencing this same problem, I dug a bit deeper, and confirmed that this is a bug in CiviCRM 4.6. I've submitted it here: https://issues.civicrm.org/jira/browse/CRM-16590

UPDATE: this is fixed in version 4.6.4+.

# Answer
> 2 votes
It's hard to give a better answer without more information from you, like what you've already tried and what version of CiviCRM, CiviVolunteer, and Wordpress you're using. Please consider editing your question to include that information.

Broadly speaking, I would make sure that your extensions directory and URL are both set (**Administer menu \> System Settings \> Directories** and **Administer menu \> System Settings \> Resource URLs**). I'd also check to make sure that both those folders are writeable by the web server.

# Answer
> 0 votes
This error message is generated when an existing extension is no longer supported or otherwise unusable. Generally you'd see this after an upgrade. Try removing your existing extensions first, then re-add them one at a time.

---
Tags: wordpress
---


# Question
Title: Civisualize - How does it work and what are the charts showing?
I need your help. I am trying to figure how CiviVisualse works. We would like to improve its current styling etc. To do this, I need to fully understand how the dynamic filter works agains graph lines and what are the measurements for those charts. I have attached some print screens as points of reference for my questions.

1. What does the line chart represent? It says participant: is this "registrations by date?” for selected events or by event type?
2. What are the different lines on the line graph for Participant Overview chart? Is this event types or individual events based on the dynamic filter?
3. The filter and text at the top get out of sync, and also sometimes the line for event registrations goes out of sync (or there is a bug of some form, in which case how much would it cost to fix it?).
4. Is there any way to hide events that are “not selected” appear in a list at the bottom rather than making the number of their participants 0? Or at least do this if there is an event without any participants.

PART 2: Event detail report - When you want to see summary for specific event:

1. Chart Line: Is this the number of participant registrations at a particular date or something else? Is it the cumulative number of participants over the time so in the end of the line you can see for example a total 9 registered participants (cumulative -Trend of Participants for this event over the time based on registration date)?

# Answer
> 0 votes
We've decided to close the question as overbroad.

---
Tags: civievent, civireport, civisualize
---


# Question
Title: How to give a group by default to a new contact?
I'm a new user testing CiviCRM 4.6.2 with WordPress 4.2.2.

I have users U1, U2... belonging respectively to groups G1, G2...

I would like that when user U1 creates a new contact, this contact would automatically be added to group G1. Is there a simple way to achieve this?

# Answer
One option is to do it with profiles. You can automatically add contacts to a specific group when they are entered via profile. Create two different profiles for your two groups, and have your users enter all contacts through their own profile page in Profile-Create mode. However, if you find yourself needing to create a unique profile for *every* user, then it's time to re-assess the need. An extension would be better at that point.
> 3 votes

# Answer
You can create smart groups for this:

* Go into **Search \> Advanced Search** and then open the **Change Log** pane.
* Select the **Added** option and enter the first user's sort name (yes, this ought to be improved) like "Smith, John".
* Run the search, and you should see the contacts he or she has created. (Adjust the search if you need.)
* At the top of the results, select **All \__ results** and then select **New Smart Group** in the Actions drop-down.
* Give your new group a name and save it.

Now, everyone that person creates will be added to that group. Repeat this process for each of the users/groups you've got.
> 3 votes

# Answer
CiviRules isn't released yet, but this would be simple to implement as a rule. If you need it now, and the other answers don't suffice, it would also be a very quick extension to write.
> 2 votes

---
Tags: contacts, groups
---


# Question
Title: Can I use a custom style sheet (CSS) for user modifications?
I have noticed that the content of CiviCRM pages contain selectors such as:

* Type selectors `elementname`,
* Class selectors `.classname`, and
* ID selectors `#idname`.

I know these can be used to modify the style rules to alter a specific element (or elements) of a page.

What stylesheet do you use to alter page content?

# Answer
Usually I add a section to the theme's CSS rather than editing any core files in CiviCRM.

Note that there is also a "Custom CSS URL" that you can add, and you can also disable the core CiviCRM CSS if you want to. (**Administer \> System Settings \> Resource URLs**)
> 15 votes

---
Tags: theme, css
---


title: How do I use CiviDiscount for an event?

text:
# Question
Title: How do I use CiviDiscount for an event?
I want to apply a CiviDiscount to an event that uses a Price Set, but it doesn't seem to work the way I want.

The Administer CiviDiscount / New Discount Code form includes 2 fields ...

* 'Events'
* 'Price Field options'

The on-screen help for the Price Field options says 'If your form uses a price set, the discount will be applied to all options in the set by default. However, if you want the discount to be applied only to specific price options - select those options here.'

The implication is that I can just specify the Events for which I want the code to be valid.

But that's not how it works. I can only get the Discount Code to work if I specify both the Event and the Price Field. Am I missing something here?

# Answer
> 1 votes
Interesting. What version of Civi and the discount extension are you running? In an older version of the discount extension (2.1) you could specify each price set that you want the discount to be applicable to. But it seems the newest, 3.0, is much simpler and you only pick event.

---
Tags: cividiscount
---


# Question
Title: Trying to write a hook to add contribution page name to Main.tpl I'm super close
So I've almost got a hook working to add the name of the contribution page to the main.tpl part of a PCP.

This is what I have so far:

```
function wordpress_civicrm_buildForm($formName, &$form) {

  if (  $formName == 'CRM_Contribute_Form_Contribution_Main' ) {
        $ctid = $form->getVar('_contributionPageID');

        $cpagequery = mysql_query("
        SELECT *
        FROM civicrm_contribution_page
        WHERE civicrm_contribution_page.id = $ctid
        ");

        while ($cnamerow = mysql_fetch_array($cpagequery)){
                $cPageName = $cnamerow['title'];
        }

        $form->assign('cPageName', $cPageName);
    }
}

```

The part that's not working is using the $contributionPageID variable that is already exists on the page. I know the query works, because if I substitute a number for the $contributionPageID I get a result. Any idea how I can pull the contributionPageID variable for use in this hook?

# Answer
> 5 votes
Looks like you are trying to access a variable that's been assigned to the template, not the object. I'd say just access the variable `$form->_id` directly. Also, I suggest you do not use raw sql queries to retrieve a CiviCRM entity. Here's an example using the api:

```
function wordpress_civicrm_buildForm($formName, &$form) {
  $page = civicrm_api3('contribution_page', 'getsingle', array(
    'id' => $form->_id,
    'check_permissions' => FALSE,
    'return' => 'title',
  ));
  $form->assign('cPageName', $page['title']);
}

```

# Answer
> 1 votes
When faced with this situation, I usually examine `$form` to find it.

For quick and easy lookup, I use `CRM_Core_Error::debug` to write it to the civi log.

---
Tags: civicontribute, hooks
---


# Question
Title: Why doesn't the activity "send email" have a 'schedule follow up activity' option
I am using send email in civicase to send an email to a case resource (in this case a local council). At the time of sending the email I want to be able to schedule a reminder to check that I have received a response within 4 weeks. This schedule follow up feature is available in many of the other activity types but I can't see it in send email. It looks as if I have to manually create another activity to schedule the follow up. Have I understood that correctly? (and if yes is there a way I can change it?!)

# Answer
> 4 votes
Great question, and you're not missing anything: that feature just doesn't happen to exist at the moment. It would be both useful and consistent with other activities.

With CiviCRM (and many other mature open-source projects), there often isn't a grand product plan, or if there is, many features come from people solving specific problems they or their clients have. When the email feature was added, someone either didn't think about follow-up activities or decided it would be too much work.

On the flip side of this, however, it also means that there's nothing really stopping you or anyone from building that feature except for the time and expertise to write the code. If you, a coworker, or a consultant can build it, I'm sure the core team would incorporate it into an upcoming version. You could also persuade them to build it by raising a ruckus and/or funds.

Unfortunately, this is one of the few parts of open-source where you really get what you pay for: if nobody shared the feature, it won't be there, no matter how logical it would be.

---
Tags: activities, civicase
---


# Question
Title: Want to send Testmail for Mailing, but get Error.
I want to make a test for my mailing, but get this error:

```
Error in call to Mailing_send_test : Error in call to MailingJob_create : DB Constraint Violation - possibly mailing_id should possibly be marked as mandatory for this API.

```

Want could be the failure? I use CiviCRM Version 4.6.2. on Apache with MySQL

# Answer
> 2 votes
Try upgrading to 4.6.3. Several mailing-related bugs were fixed in that release.

# Answer
> 2 votes
After upgrading to 4.6.3 I added a new mailing and tried the test mailing again. Now it works!!! **Thanks for your answers!**

---
Tags: civimail
---


# Question
Title: What causes periodic database errors while using logging, and what should I do about it?
Running a Drupal site with CiviCRM Logging enabled. It seems like once a month we get a crash. On investigation one of the log tables is corrupted. Since the tables are type Archive MYSQL provides very limited tools.

The normal fix is to remove the data from the sick table or completely deleting the sick table and rebuilding. Any suggestions for preventing the issue or recovering from the problem

# Answer
> 3 votes
A few orgs who use logging on fairly high volume sites have modified the logging tables to either use MyISAM or InnoDB and have had fairly good success with it. Can you please report back if you adopt this approach and your success with it

# Answer
> 0 votes
Lobo, took your suggestion and converted to InnoDB. We were getting hit with about on failure a month. It has been about 3 weeks, we have not seen a problem. We moved the server to a solid state drive a number of months ago to improve reliability and response time. I don't have any statistics on performance but in general the online system does not write huge amounts of data to the log except when doing a batch operation like a mass mailing,

I would suggest making all new CiviCrm installations use InnoDB to improve reliability which is often much more important then time to log updates.

---
Tags: mysql, logs, db-logging, mysql-archive-format
---


# Question
Title: How do I correct mismatched Timestamps for MySQL and PHP without access to server?
I'm using civiCRM 4.6.2 under Wordpress.

The PHP and MySQL timezone settings are reported as incompatible, MySQL as 12:38 (which is the current clock time here in Zurich) and PHP as 10:38. However, according to my ISP, PHP is also correctly set to use Zurich time. Is there any way either to suppress the warning (which comes every time I start up civiCRM), or to correct the settings – NB: I do not have any programming access to my ISP.

I haven't noticed any problems cuased by this incompatibility.

# Answer
> 5 votes
With WordPress, 90% of the time it's just the WordPress timezone that needs to be reset. Make sure that's set right as a first step.

---
Tags: wordpress, mysql, php, timezone
---


# Question
Title: Label printing: how can I only combine people with relationship
There is an option to combine people at one address to get just one printed label, but this is no good for us as we have congregation members living in the same old person's home who should all get an individual mailing. What we really want is only to get combined labels when the members are linked by a relationship. Is there any way of adjusting the mailing label printer to do this without artificially messing around with the mailing addresses to avoid duplicates for the old person's home?

# Answer
> 5 votes
If you use households and have the spouses, children also have a relationship of member of household or head of household, then the check box "Merge labels for contacts belonging to the same household" will do what you want.

# Answer
> 2 votes
You could create two mailings one for people with a relationship and one for people without.

Use the relationship report to find all the people with relationships. Add them to a group.

Create another group with all the people in the congregation.

Then use the Search =\> Custom Search =\> Include / Exclude Contacts in a Group / Tag. You would include the group with all the people and exclude the ones with relationship. This will give you a list of congregation members who don't have a relationship. Create mailing labels for them without checking any boxes.

Then pull up the group of people with relationships and create labels for them checking combine addresses.

The downsides of this approach is every time you do a mailing you'll have to empty the groups and repopulate them.

---
Tags: civimail
---


# Question
Title: How to create file type custom data with API?
I was wondering how to do that. Didn't find it for that type of custom data.

If possible I want to do it via API, if not possible i'll try with CRM\_Core files.

# Answer
> 1 votes
You can create a custom group with the CustomGroup API, and custom fields with the CustomField API. Is that what you mean, or do you mean updating the actual data within a custom file?

# Answer
> 1 votes
You can do this using the Attachment api. Use the API explorer on your own Civi site to see available parameters for this api.

---
Tags: custom-fields
---


# Question
Title: Automatic filing of pdf letter activity within civicase
I am experimenting with "create printable letter" from within a civicase case as a mechanism for writing a letter to that particular client. However the resulting letter does not get automatically filed as a case activity, and there is no "file on case" button on the popup. It is possible to subsequently locate the activity and then file it on case but this is time consuming.

Is there a way to have the letter automatically filed within civicase in a similar manner to which e-mails are automatically filed?

Thanks in advance.

NB We are still using civicrm 4.5.5

# Answer
> 3 votes
Go to **Administer \> CiviCase \> Case Types** and add "Print PDF Letter" as an allowed activity to your case type. You will then be able to create a PDF directly from the "Manage Case" screen.

# Answer
> 3 votes
You're right this is a bug.

I've filed issue CRM-16596 with a PR to fix it in the next release (4.6.4).

---
Tags: civicase, pdf
---


# Question
Title: User registration checkbox in CiviEvent does not create new user and misses thank you screen
In CiviCRM I set up an event including registration but when I select the option to allow a user to register for the event and at the same time as a Drupal user, after you continue from the event confirmation page instead of going to the Thank You page it shows the entry page containing just a name/password box and a weird error saying 'Please enter your email'.

I have had my consultant take a look at it and he says "Checked the Drupal permissions - look fine, Checked some email settings - look fine, Turned on Drupal error reporting and completed the form again. Now got the message 'Notice: Undefined index: email-Primary in CRM\_Utils\_System\_Drupal-\>createUser() ' http://bdva.s803.sureserver.com/admin/reports/event/11578'

We have done a few searches but not found anything on this error and for the time being we have now turned off create Drupal user in all profiles attached to event registration.

What should we do to create Drupal users and show the Thank you pages on Event signups?

# Answer
> 2 votes
CiviCRM lets you have collect more than one address/email/phone for each contact and these are differentiated by the "location type" of each.

Standard location types are "Home", "work", "billing", "main" and "other", but you can add more if you want to.

One of these location types is then set as the default "primary" location type via a yes/no field attached to each location type. The address/email/phone designated as "primary" is the one that civicrm will use when producing labels or sending emails or SMS to that contact.

You can override the default "primary" designation on a contact by contact basis. For example you may have the location type "home" set as the default primary location type, but for Martha you choose to set "Other", containing a PO box address, as her primary address location.

This means that when you are creating a profile to extract information (say, a journal mailing list) from CiviCRM you need the ability to output whatever address/email/phone is designated as "primary" for each person, rather than be restricted to just the actual location types of "Home", "work", "billing" etc.

It sounds to me that you may have included the "primary" email "field" in the profile you are using to create the Drupal user. However, it is not actually a field, but rather a yes/no qualifier for true email location type. I think that may be why you are getting the error.

You should edit the profile and change the email field designation to be an actual email type ("home", "Work" etc.). I think that will solve your problem.

---
Tags: civievent, drupal, user-account
---


# Question
Title: Why does contribution verification display a numeral value rather than a text value
When a user submits a credit card for a recurring contribution, the verification page displays the following message:

I want to contribute this amount every 1 (s)

What do I need to do to replace the value '1' with the text 'month'?

Drupal 7, CiviCRM 4.4, Vanco Payment Processor

# Answer
> 2 votes
While it's still clear you've got a bug, I'm pretty sure your issue isn't that you have "1" but rather that the unit--week, month, year--is missing. The numeral is there in case you wanted to donate quarterly--it would say "3 month(s)". Again, not that this makes it any better.

However, it might help you or whoever diagnose the bug. Hopefully it's as simple as the payment processor extension not providing the unit back to the receipt/thank-you page.

# Answer
> 2 votes
This was a bug I introduced in an attempt to set is\_recur to true, so the checkbox would be checked.

Thank you for your help.

---
Tags: drupal, payment-processor, recurring-contributions
---


# Question
Title: When saved to activities, tokens inside emails are not evaluated
Is it normal that when a reminder email goes out and is saved as an activity that tokens are not evaluated and saved in the activity?

If that is normal, where is the best place to make a feature request? The value of the activities feature is significantly reduced when tokens are not evaluated when stored in activities.

If that is *not* normal behavior, any ideas on how I can troubleshoot this?

# Answer
yes, that is normal behavior. Feature requests can be made on the forums or if there is funding, via the paid issue queue.
> 2 votes

---
Tags: activities, tokens
---


# Question
Title: What is the easiest way to see the MySQL queries run by a CiviCRM page?
When debugging CiviCRM pages, is there a native way to emit the SQL statements being run, eg on a Search page? I'm looking for something easier than finding the code for the page and putting in a debug\_var kind of statement. I'd prefer to not have to rely on a Drupal module like cTools, since we work with other CMSes frequently these days.

# Answer
> 10 votes
If you want to see *everything*, you can enable MySQL logging as follows (don't do this on production!):

1. From the mysql console (or within an application like MySQL Workbench), run:

```
SET global general_log = 1;
SET global log_output = 'table';

```
2. Look at all queries run within the last 15 seconds

```
select *
from mysql.general_log
where
  command_type = 'Query' and
  event_time > now() - interval 15 second;

```
3. Try to find queries on the civicrm\_contact table

```
select * from mysql.general_log
where
  argument like '%civicrm_contact%' and
  argument not like '%general_log%'
order by event_time desc;

```
4. Clear the log

```
truncate table mysql.general_log;

```
5. Turn off logging

```
SET global general_log = 0;

```

# Answer
> 9 votes
Try setting:

define('CIVICRM\_DAO\_DEBUG', 1);

in your civicrm.settings.php file, this might work based on a quick glance at the code.

The output will appear onscreen and in the CiviCRM log file (eg `sites/default/files/civicrm/ConfigAndLog/CiviCRM*log` or `media/civicrm/ConfigAndLog/CiviCRM*log` or `wp-content/plugins/files/civicrm/ConfigAndLog/CiviCRM*log`)

# Answer
> 3 votes
If your page happens to be a report, you can install the Extended Reports extension which will display the full sql query being run.

# Answer
> 1 votes
I am not sure wether such a functionality exist in CiviCRM but something wich might be worth a look at is the logfiles

---
Tags: debugging, mysql
---


# Question
Title: CiviMember - Adding a premium when recording a membership payment
Our organization wants to be able provide gifts to members who sign up for a magazine subscription. We are using CiviMember to record those contacts who sign up for such a subscription. When we click on **Add Membership** in the contact record's "**Memberships**" tab and then select the "**Record Membership Payment**" checkbox, we would like to have the ability to select a premium through the administrative interface like the way this is available on a front-facing donation page.

For qualifying members, we want to present them with gifts based on the subscription amount and also record this for future reference. This type of recording of a subscription is done offline by our staff. Is this somehow possible via an extension or is there some coding/hook required to make this functionality work?

# Answer
If these are new subscriptions only then you can create a price set where one price field contains the subscription fee and another the gifts on offer. The back office staff would select the premium at the same time as they record the subscription payment.
> 4 votes

# Answer
If you want to be able to record this information for renewing as well as new memberships then you could create a custom field (radio would be my preference) containing the gifts on offer. Provided you make the custom field searchable this will let you search for "all contacts who are getting Gift A" and create mailing labels if gift A in actually something you need to post out.
> 2 votes

# Answer
You could have your staff use the front-end form. Append `&cid=0` to the end of the url and they will be able to create & pay for a membership for someone else.
> 2 votes

---
Tags: civimember, premiums
---


title: Draft mailings appear as scheduled?

text:
# Question
Title: Draft mailings appear as scheduled?
4.6.2: Wordpress 4.1

If I save a new mailing as draft by clicking the Save Draft button, the mailing appears in both the scheduled and unscheduled lists. Seems to me it should not appear anywhere in the scheduled list.

# Answer
can you upgrade to 4.6.3 and try again. Quite a few bugs were fixed including one that sounds similar to the above

https://issues.civicrm.org/jira/browse/CRM-16251
> 2 votes

---
Tags: 4.6.2
---


# Question
Title: MySQL Tuning: Is Defragmenting Tables safe?
I like using **MySQLTuner** to check on things from time to time. It's as easy as:

> $: sudo apt-get install mysqltuner (CentOS: sudo yum install mysqltuner)
>
> $: sudo mysqltuner

Also, besides **'top'** which is the default monitor for the server's processes and hardware, install **'mytop'** exclusively for monitoring MySQL. Excellent tool to watch all your databases at once.

I have never performed **OPTIMIZE\_TABLES** to defragment for a CiviCRM installation before. Is it safe? Of course, do a robust backup first, but want to know before to expect if there is likelihood of failure. No one wants more work or downtime than necessary. Also, please advise on the other two suggestions. All noted with arrows. *Thanks in advance.* Here are the results:

```
General recommendations:

    =>Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    =>Adjust your join queries to always utilize indexes
Variables to adjust:

    =>join_buffer_size (> 128.0K, or always use indexes with joins)

```

**Full Report:**

```
 >>  MySQLTuner 1.0.1 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.38-1~dotdeb.0
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 17M (Tables: 203)
[--] Data in InnoDB tables: 53M (Tables: 841)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 0B (Tables: 10)
[!!] Total fragmented tables: 861

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1h 25m 6s (7K q [1.402 qps], 270 conn, TX: 11M, RX: 1M)
[--] Reads / Writes: 64% / 36%
[--] Total buffers: 192.0M global + 2.7M per thread (151 max threads)
[OK] Maximum possible memory usage: 597.8M (29% of installed RAM)
[OK] Slow queries: 0% (21/7K)
[OK] Highest usage of available connections: 5% (8/151)
[OK] Key buffer size / total MyISAM indexes: 16.0M/2.9M
[OK] Key buffer hit rate: 98.8% (10K cached / 121 reads)
[OK] Query cache efficiency: 51.1% (1K cached / 3K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 417 sorts)
[!!] Joins performed without indexes: 151
[OK] Temporary tables created on disk: 16% (127 on disk / 788 total)
[OK] Thread cache hit rate: 97% (8 created / 270 connections)
[OK] Table cache hit rate: 96% (234 open / 242 opened)
[OK] Open file limit used: 9% (102/1K)
[OK] Table locks acquired immediately: 99% (3K immediate / 3K locks)
[OK] InnoDB data size / buffer pool: 53.8M/128.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    Adjust your join queries to always utilize indexes
Variables to adjust:
    join_buffer_size (> 128.0K, or always use indexes with joins)

```

# Answer
The suggestion to increase the join\_buffer\_size is a good one if your server can afford the 128K. The number of queries with joins on unindexed fields, which need more cache, is not insignificant.

(Background: There are write performance downsides to putting an index on every field that might have a join put on it. I believe in a few places in CiviCRM there have been some deliberate decisions to not put indexes on fields, I bet where the record count on the join is small so the performance hit on reads wouldn't be significant. However, adding and updating indexes is also an area where there may have been some oversights over the years, especially in the code that updates the schema from version to version.)

If you follow the suggestion to turn on the slow query log make sure you:

1. logrotate it,
2. don't set the threshold too low (maybe 2 or 5 seconds), and
3. monitor it.

If you do find there are some queries that would benefit from an additional index being added to a table, please open an issue in CiviCRM. It's often helpful to know what the original version of the database was so we can track down if the error was in the original tarball or in an upgrade script.

If you are deleting a fair bit regularly from your CiviCRM database it's a good idea to run OPTIMIZE\_TABLES regularly. But since most CiviCRM installations don't delete much, you won't likely see significant benefit from doing it more than every several months or year or two. Sometimes the full workflow of migrating a database may include mass deletes, so that can juatify it too. Larger databases with hundreds of thousands or more of contacts and transactions will see the biggest benefits.

If you do want to do this, then make sure to take CiviCRM offline beforehand in order to avoid deadlocking your DB.

Running OPTIMIZE\_TABLES will result in each table having a write lock put on it, then it will be recreated and reindexed. After the reindexing any changes to its records that have been queued will be applied, before the next table is optimized. It is possible for a database deadlock to occur (for example, if a row in a table is locked by another process while it waits to acquire a lock on a second row). Normally InnoDB is good at automatically detecting deadlocks and dealing with them with row level locking. However, InnoDB is not able to automatically detect deadlocks in the case of a table level lock. I don't foresee issues otherwise with the database defragmentation of table rows and index entries, especially if you've done your backups first.
> 7 votes

# Answer
Yes, running `OPTIMIZE TABLES` on a regular basis is beneficial. I don't think there is significant risk with it. I'd run it on a copy of the DB first.

If you have the memory on your database server increasing the cache and buffer sizes of MySQL is a good thing, IMO.

In the past, I've found the Percona blog quite a useful resource. Also some folks (NYSS) have been using the Percona distribution for improved performance.
> 9 votes

---
Tags: 4.6.2, database, mysql
---


# Question
Title: The cron job "Activity processor (Hourly)" fails
The cron job "Activity processor (Hourly)" has started failing for no apparent reason with the message "Failure, Error message: Process Activities failed" in the job log, although the message coming from cron is "Failed Processing: . Reason: DB Error: syntax error". Neither message is much help.

We are running CiviCRM 4.5.8 under WordPress 4.2.2.

Has anyone experienced this? Where do I start to find and fix the problem?

Thanks, Jim

# Answer
If you turn on debugging (**Administer menu \> System Settings \> Debugging and Error Handling**) you should get a more verbose error from cron, which should in turn allow you to troubleshoot - or at least update your question with more info!
> 1 votes

# Answer
I had the same problem. I tried to change the password of an email account, and the problem is solved. In the old password I had a question mark.
> 0 votes

---
Tags: civievent, cron-job
---


title: CiviCRM not sending mails

text:
# Question
Title: CiviCRM not sending mails
We've updated CiviCRM to 4.6.3. Since then, CiviMail has stopped working. When we log in, the following warning pops up:

"Warning: Outbound email is disabled in system settings. Proper settings should be enabled on production servers."

We set it up correctly in Email settings both mail() and SMTP, and in both cases the test mail is sent OK according to the popup window (view attached file). But it does not get delivered so we believe it isn´t really sent.

We´ve checked if we've been blacklisted or anything but we haven't.

Afterwards, we've tried writting random letters and numbers in SMTP server and SMTP user, and the popup stills says that the mail has been sent.

We would appreciate any help to find a solution.

Thank you!!

# Answer
> 8 votes
It may be that you have set your email to go to a file. Check your civicrm.settings.php (mine's in sites/default under the Drupal root).

Look for the lines referring to CIVICRM\_MAIL\_LOG and make sure the define statement is commented out.

The comment on CIVICRM\_MAIL\_LOG says ...

> This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues. Enabling this setting will not send any email, ensure this is commented out in production. The CIVICRM\_MAIL\_LOG is a debug option which disables MTA (mail transport agent) interaction. You must disable CIVICRM\_MAIL\_LOG before CiviCRM will talk to your MTA.

---
Tags: civimail, email
---


# Question
Title: Why is test email but not mail campaigns working with Amazon SES with CiviCRM?
I have configured Amazon SES with CiviCRM, after configure outbond setting in CiviCRM I got mail from my CRM via amazonses.com with Subject "Test for SMTP settings" and body "SMTP settings are correct.". But if I try to send a email campaign I'm not getting any mails from my CRM, and the Amazon console is also not showing any mail details.

I have followed the documentation below.

documentation URL : https://hq.palantetech.coop/projects/commons/wiki/Amazon\_SES\_for\_CiviCRM

I have used SMTP direct from CiviCRM.

# Answer
Ashwin - your latest update showing the error reveals the problem. Either a) your SES account is still in sandbox mode, or b) you skipped the steps about verifying your sender address/domain. From my instructions:

* Log onto AWS, select SES. Note that you only have sandbox access at this time.
* Click on "SMTP Settings" on the left, record the server info, generate SMTP credentials and record those too.
* Click on "Verified Senders: Domains". Click "Verify a new Domain". Enter the client's domain name; also click "Generate DKIM settings". Remark: *the bounce address must be also verified*.

If you've already done this, then request to be moved from sandbox mode into production mode: Instructions here.
> 5 votes

# Answer
Silly questions perhaps, but since your outbound email settings in CiviCRM are correct, have you switched on the scheduled job that sends the mailings?
> 1 votes

# Answer
Could you try going to your own contact record and sending an email from there to see if the individual mail is being sent properly? Also, since your problem is with the CiviMail campaign, could you go to Mailings \> Scheduled and Sent Mailings and report back the status of the mailing that was unsuccessful?
> 1 votes

---
Tags: civimail, amazon-ses
---


# Question
Title: Is it possible to customise report export file names?
Is it possible to automatically name Report downloads (PDFs or .csv files) to reflect the report title?

(This strikes me as being an obvious thing to do, so apologies if I've missed some equally obvious solution)

# Answer
The code currently puts all pdf's under CiviReport.pdf (and similar for csv)

Would be good to use the report title as the file name. The code to make the change is here:

CRM/Report/Form.php

search for CiviReport.pdf

If you can make the change, please file an issue and submit a PR against master so it can be included in the next release.
> 4 votes

---
Tags: civireport
---


# Question
Title: How do I set up CiviMail on Wordpress CiviCRM plugin?
I'm using CiviCRM as a Wordpress plugin on localhost. I'm trying to configure outbound email service. I'm using Linux system.

I go to Administer \> System Settings \> Outbound Email (SMTP/Sendmail), select the mail() option and then when I send a test mail, I receive the following error.

It would be great if someone could help me with this.

# Answer
> 2 votes
I would recommend testing if you have sendmail configured properly on your server by trying to send from the commandline (http://tecadmin.net/ways-to-send-email-from-linux-command-line/). Follow general sysadmin approaches to solve that problem, not least of which is to get the ISP support to help you. Once you know your sendmail is delivering from the commandline, you will want to make sure that the PHP run by Apache or Nginx for this site is using the same sendmail.

Hope these pointers help. Sorry it isn't a step-by-step recipe but OS environments vary significantly.

Another alternative worth exploring a bit before going too far down the rabbit hole of setting up sendmail on the server is whether one of the other mail sending options available on that CiviCRM page works.

# Answer
> 1 votes
This is mostly because Sendmail/Postfix hasn't been properly configured on the server. One can check it by sending a mail from the command line or the mail() function in PHP. Once properly configured, you should be able to send a test mail using the outbound email service.

---
Tags: civimail, configuration
---


title: CKEditor dialogue can't close with IE11

text:
# Question
Title: CKEditor dialogue can't close with IE11
When sending an email and if I insert a link or insert an image, I can't close the dialog when using IE11.

This works perfectly with IE9, Firefox and chrome browsers.

Has anyone experienced this?

# Answer
> 5 votes
I'm afraid this is a known bug (at least by me), which I reported a while ago at https://issues.civicrm.org/jira/browse/CRM-14860. I think it is related to the CKEditor version, and to the CKEditor upstream bug http://dev.ckeditor.com/ticket/10604.

# Answer
> 2 votes
It's a known bug in CKEditor, which should be fixed in CiviCRM 4.7 as part of a general overhaul of wysiwyg editors.

---
Tags: civimail
---


# Question
Title: WP "Call to Action" plugin causes JS errors
I found that I am getting js errors when I have the Call to Action wordpress plugin enabled. My hunch is that it is because CTA also includes Select2 but I did not test this. The error in particular I was looking at was $.fn.select2.defaults is not defined. (everything before "defaults" is defined). At least when in Common.js. In the console it appears to be defined.

I did not find CTA on the incompatible plugin list. http://wiki.civicrm.org/confluence/display/CRMDOC/WordPress+plugins+incompatible+with+CiviCRM

Does it need to be added? is there a known work-around? Can someone point me to a model for resolving this conflict?

civicrm 4.5.8 WP 4.2.2 CTA 2.3.6

# Answer
This is a known bug in Select2 which we have worked around as of CiviCRM v4.6.0.
> 1 votes

---
Tags: wordpress
---


# Question
Title: Drupal single user, multiple civicrm memberships, editable details: What's a good logical approach to integrating them?
Drupal 7 site, and each Drupal user could have more than one civicrm 'membership'.
Each membership is for a business and
each business with a 'type1' membership is entitled to a listing on a directory node (public) in drupal with filters.

What would be a good approach, as ideally it would be good if users (contacts) can log into Drupal and edit each membership's details (for the listing) from their one Drupal contact account?

OK, so I can create a profile to be pulled into each Drupal user. But I can't display different 'profile' types on the same user?? So how do I pull profiles for each business, of that contact, back to their Drupal account for them to edit/maintain?

I understand it involves various components re edit forms and membership forms etc. but I want to get the wireframe layout right before building a range of webforms etc.

# Answer
> 1 votes
If you set up your membership type so that it provides an 'inherited membership' via the 'employee for' relationship, then the Employee will have a permissioned relationship over the Business, and can therefore access the address details etc for the Organisation via their Contact Dashboard. Secondly if they are logged in then the employee (or primary contact or whatever you need it to be) can have 'permission' on a webform to update more details about the Organisation if you can't give them enough access to fields via Contact Dashboard. Does that move you towards your goal?

---
Tags: drupal, civimember, profile
---


# Question
Title: Using Wordpress Event Registration forms on Multisite
Thought this would help someone else.

I have one CiviCRM on a multi site installation and was obtaining "You do not have permission to access this page" when displaying a form on a second multi site.

This appears the second site doesn't have the anonymous role setup per: https://civicrm.org/blogs/haystack/working-civicrm-46-wordpress

I will post the next post as the solution.

# Answer
> 1 votes
Place this in your functions.php file

register\_activation\_hook( **FILE**, 'civicrm\_activate');

// Assign minimum capabilities for all wordpress roles and create anonymous\_user' role civicrm\_wp\_set\_capabilities();

This only needs to run once per site to create the role.

# Answer
> 1 votes
If you receive domain redirects, try something like this in your CiviCRM configuration:

if (!defined('CIVICRM\_UF\_BASEURL')) { define( 'CIVICRM\_UF\_BASEURL' , 'http://' . $\_SERVER\['SERVER\_NAME'\] . '/' ); }

I would probably only allow the domain in an array for security.

---
Tags: wordpress, multisite
---


# Question
Title: CiviCRM does not have permission to write temp files
Two users are trying to access the temp files (where, for instance, the compiled templates are stored): www-data (when it's accessed from the website) **and** the sysadmin that run drush commands

By default, all these temporary files can only modified by the user that created it, so sometimes it's the sysadmin, sometimes it's the webserver user

Is there a way so all the temp files can be created/modified/deleted by only the admin user(s) and www-data?

One possible fix is a patch on drush, so it uses a separate templates\_c folder than the one used by www-data. Could you test if it works in your environment/workflow?

https://github.com/civicrm/civicrm-drupal/pull/286

# Answer
There's no single perfect solution to this, but there are several adequate solutions. To highlight some trade-offs among the approaches raised so far:

* *For each security principal, use separate data-directories* (like bgm's answer).
    + **Pro**: Portable -- works in many different environments. Doesn't require any special tools or root permissions.
    + **Con**: Only works when data can be split apart by user. For example, it could potentially work for logs/caches (because they don't really need to be shared) but is more problematic for uploads/attachments (because both users should have read/write on the same objects).
* *Create a cronjob or daemon to adjust permissions* (like Chris's answer)
    + **Pro**: Portable -- you can design the daemon or cronjob to build on the traditional POSIX UGO/RWX triplets. Works with all data (logs/caches/attachments).
    + **Con**: Requires installing/running a new root-permissioned service. Watch out for symlinks/hardlinks.
* *Use the operating system's ACL features* (like amp's linuxAcl and osxAcl policies)
    + **Pro**: Works with all data (logs/caches/attachments). Doesn't require daemon or regularly running as root.
    + **Con**: Not standardized -- technical steps depend on the environment (OS/distro/filesystem). Sometimes applications try to be clever and override the permissions -- which breaks ACLs for specific files/use-cases.
    + (Note: `amp` tries to abstract this, but as with any abstraction, it's probably not worth the overhead unless you buy into the general vision.)
> 5 votes

# Answer
Setting directories group-setuid might get you part of the way (with chmod g+ws templates\_c), but maybe we should consider something like this in the CiviCRM drush module?:

```
$config = CRM_Core_Config::singleton( );
$config->configAndLogDir = $config->configAndLogDir . 'drush/';
$config->templateCompileDir = $config->templateCompileDir . 'drush/';

```

i.e. create templates in a sub-directory of templates\_c/drush/, this way the web server (www-data) will not have trouble writing in the templates/logs later on.

This is what Aegir did for a long time, but due to a regression it has not been working for a while and since then I run into that issue as well.
> 3 votes

# Answer
Tim describes a solution based on linux ACL:

https://github.com/totten/amp/blob/master/doc/perm.md

But it requires amp, that I (might be wrongly) see a dev only tool. Does someone use something like that in production?
> 2 votes

# Answer
Our solution to mixed access to CiviCRM's cache files (and other situations where permissions issues arose) has been a daemon which monitors filesystem entries and "corrects" permissions immediately on file creation/modification.

There are still some issues with this approach (eg issue linked in comment on bgm's answer), but it seems to work out better than just relying on setgid (which I'd hope *could* be a complete solution).

I'm still a bit unsure of our taking this route - I'd prefer for UNIX permissions to work for people! They are simple and well-tested after all ... - but at least it's no longer a support headache :)
> 2 votes

---
Tags: configuration, sysadmin, drush
---


# Question
Title: How can i match CiviCRM ID on two installations?
I have two instances of CiviCRM, not all the CiviCRM ID's match. How can i get the contacts on both databases to have the same CiviCRM ID (ie CiviCRM ID of contact A in db1 = CiviCRM ID of contact A in db2)?. The use case is as follows:

I have two civi dbs (I will refer to them as A and B, and they are not in sync), B is a copy of A, A is open to public for events registration, B is restricted only to internal network and is used for projects. Data in B is seen as more up to date and reliable because it is entered by staff. I don't want to sync B to A because they have unrelated activities. I want to pull data from A for reporting and if some fields are empty in A (e.g. date of birth), get this data from B if CiviCRM ID A = CiviCRM ID B

# Answer
> 5 votes
Depending on your end goal, one solution is to set the External ID of a record in instance B, to the Internal ID from instance A.

The Internal ID (civicrm\_contact.id) is a primary key; the database engine assigns that field, and you risk data corruption by trying to keep it in sync yourself. The reliable way to keep them in sync is to have instance B act as a Replication Slave of instance A, where data changes in A are copied to B (but not vice versa).

If you can tell us more about what you are actually trying to achieve (*as a new question*), perhaps we can help you with the greater goal.

# Answer
> 0 votes
Agree with Nicholai. Another option might be to create a custom group with a field that holds the key in the 'other' CiviCRM? We have used that to sync with another package. But more detail might help? Should the CiviCRM ID's be the same on both installations or should you be able to sync? Does make a difference...

---
Tags: contacts, mysql
---


# Question
Title: "Groupings" of Option Values: are they actively used?
When editing an Option Group directly (from Administer / System Settings / Option Groups) (but not when editing the options for a custom field), I can fill in a "Grouping". There is a corresponding column "grouping" in civicrm\_option\_value.

The grouping isn't displayed when looking at a list of option values in the option group, or when editing a custom field on a contact.

Is there anything that makes use of the grouping within core? I'm encountering a situation in my work where it may be useful, depending on what it actually does (long list of school subjects, grouping by qualification system).

# Answer
Feel free to use it, some other extensions (eg. CiviHR) are using the grouping field as well as the core

```
+-----------+-----+
| grouping  | t   |
+-----------+-----+
| NULL      | 872 |
| Absence   |   3 |
| Avery     |  11 |
| Closed    |   1 |
| Opened    |   2 |
| Timesheet |   9 |
| Vacancy   |  11 |
+-----------+-----+

```
> 2 votes

---
Tags: custom-fields
---


# Question
Title: Set drupal taxonomy terms in the civicrm custom option fields
I have created a civicrm custom dropdown field in Drupal 7. I have a excel spreadsheet contains some data in three columns. To which i need to import into civicrm and then the first column should be display in the custom dropdown field.

So, i have two opinions at this stage

1) I can create a custom table for Civicrm and then import the values from spreadsheet. OR

2) I can create taxonomies terms having 3 fields in Drupal.

After, that it should show it's values in the civicrm's custom dropdown field.

But i couldn't able to find out the correct way to implement any of the approaches. Please suggest me the steps to implement either of those approaches or any new approach which will be quite easy to implement.

# Answer
> 1 votes
You should describe more these 3 columns as it's not clear what type they are and how you need to use them, but I would create them as either options on a custom field or as tags

tags have 2 "usable" columns (the name and a description), optionvalues have 4 (label, value, name, description)

you can import them from the command line using the api or use an extension.

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


# Question
Title: How to include Email address checking in event registration page to avoid multiple contacts entries?
many time it so happened that individuals made spelling mistake, specially typing email address and therefore multiple contact was created.

Just thought is there a chance to include a 2nd email address field in the registration page and notify the attendee when they make mistake spelling their email address?

# Answer
> 4 votes
you mean asking the user to type twice their email and check it's the same?

I can't find it right now, but recall reading that it wasn't that optimal as a UX (ie. people are not good enough to type without typo, but skilled enough to do a copy/paste of the email with typo ;)

One more elegant solution seem to compare the email against a set of existing common domain names (eg yahoo.com, gmail.com) and suggest a fix if the error is on the domain name, eg. if I type "xavier@gmal.com", suggesting "did you mean xavier@gmail.com"?

you could write an extension that add this feature by using this library https://github.com/Kicksend/mailcheck (I used it for a drupal extension long time ago, worked well, and shouldn't be too complicated to write a native civicrm one)

---
Tags: civievent, email
---


# Question
Title: Creating a report listing contacts grouped by an employer-group
How can I create a report that lists contacts & their employer, but groups them by a employer group?

I.e.

# Sports

* John - Adidas
* Jane - Nike

# Food

* Jim - Kraft
* Jack - Nestle

And so on.

# Answer
If you are using Drupal and are familiar with or willing to explore Views then I would expect a grouped display like this based on a 'tag' or whatever characteristic 'food' is would be do-able. Happy to explain more if that is a solution you can use.
> 2 votes

---
Tags: civireport
---


# Question
Title: How can I search for all employees of several (a limited set of) employers
Can someone tell me how I can easily search for all employees of several employers, ideally using a single search string - i.e. something like:

employee of: 'employer A' OR 'employer B'? Ideally the results are displayed as a list from which I can select some or all for action.

Thanks!

# Answer
> 5 votes
You could tag the Employers, then search for them, but set 'display results as' (top right of Adv Search pre-4.6, bottom of first section in 4.6) to 'show as related contacts' which you would set to 'employees of'

---
Tags: search, search-results
---


# Question
Title: Is this expected that civiHR removes lots of features (eg activities and cases)?
So I'm trying to use civiHR. I understand that some features are still beta and some new custom screen don't work so well and I'm prepared to live with that

What I don't understand is that civiHR disable existing features, eg: \- list of the cases "recruitement" isn't displayed n the case tab \- activity tab removed

Is this on purpose or a bug? I don't see the point of removing features that would still have a sense because HR introduces different workflows too.

Is there a way to let the existing features of CiviCRM enabled, even when using civihr?

# Answer
(Note: My comments are focused mostly on CiviHR \<=1.4; for 1.5+, I haven't followed as closely.)

CiviHR is broken down into several different extensions. Each extension defines a different piece of the data-model/UI (eg for tracking job contracts or tracking qualifications). If you pick and choose these individually, it should be possible to load them onto a CiviCRM site without disabling/removing features.

One extension, `org.civicrm.hrui`, is particularly opinionated and aggressive about reworking the UI. Its primary purpose is to reshape the overall user-experience for standalone CiviHR deployments -- emphasizing HR-specific elements, de-emphasizing fundraising-specific elements, tweaking phrases/word-choices. It fills a role similar to Drupal's *installation profiles*.

If you're an experienced Civi implementer/consultant looking to add some HR elements to an existing Civi site, then you've probably used most of the same tricks as `hrui` (eg toggling components and toggling display preferences), and you'll probably disagree with some of the opinions in `hrui`. So skip it; you're not the target audience for that extension. Browse the list of extensions and pick the ones which are relevant.
> 8 votes

# Answer
We were told that CiviHR should be a completely separate install to CiviCRM and that is being designed to work quite independently, so this is no surprise.
> 2 votes

---
Tags: civihr
---


# Question
Title: Changes not saving when using other contact's address
In our Joomla 3.4.1/CiviCRM 4.6.3 setup, we heavily depend on setting up households and linking people to them. For instance, if you become a contributor, the entire family is entitled to discounts, so we link the contribution to the household rather than individual people. Furthermore it helps us with duplicate entry of address information for people of the same household.

The situation is so that we create a household, then create contacts and link the contacts to the household using the "Use another contact's address" feature.

Recently however, after having done our initial data-entry and linking contacts to households in the above manner, I noticed that I could no longer edit most of my contact's information once their address was linked to another one.

In order to test this, I logged onto the demo site and created a fresh household and a contact. Set the contact's (home) address to that of the household using the "Use another contact's address" option and saved the contact. Next I tried to edit the contact (using the 'Edit' button) and tried to enter an external ID. Upon clicking 'Save', CiviCRM says it has updated the contact, but in fact no change is visible. I currently employ one of two workarounds: 1) For fields where it is possible to get an in place 'Ajax' edit-field, I use those because when I use that the change does get saved. 2) I temporarily uncheck 'Use another contact's address', make all my changes and save, go to Edit again and re-check (and select) the household address.

Of course, workaround 2 is kind of cumbersome, but unfortunately the only solution for fields that don't have an Ajax-type edit option such as External ID and contact photo.

Considering that the demo site behaves the same as my own installation, I'm inclined to submit a but-report to the Jira-tracker, but I would like to know if anyone else is seeing this same issue.

# Answer
> 2 votes
This has been confirmed as bug CRM-16588. Please consider marking this as the accepted answer, so that future Stack Exchange users with this issue can find the bug status to identify when the bug has been fixed.

---
Tags: contacts, households
---


# Question
Title: How can I generate a custom PDF using CiviCRM?
I'm writing a small extension to display contributions in a format that is similar to our organization's invoices. I'd like to be able to export them as a PDF.

I found CRM\_Utils\_PDF\_Utils::html2pdf(), and I've been trying to use this to generate PDFs. However, when I download the PDF, my PDF reader tells me that the file is either not a PDF, or is corrupted.

The following is similar to the code I'm using:

```
CRM_Utils_PDF_Utils::html2pdf($html, $invoiceName, FALSE, NULL);

```

Where $html is the generated HTML string and $invoiceName is a string containing the concatenated participant name and event name.

I guess I'm not certain what the 3rd and 4th arguments do. Any insight would be appreciated.

Thanks!

# Answer
> 2 votes
The 3rd argument causes the output to be returned as a string rather than sending a file to the client if true (it defaults to false). The 4th param allows you to override the default pdf format.

In your use-case I think you can safely leave off both of those params.

# Answer
> 1 votes
You might want to make the invoiceName end with a .pdf

so:

$invoiceName = "{$participantName}-{$eventName}.pdf";

The third parameter return the pdf if set to true, else initiates a file download via the browser

the 4th parameter is optional and is used to send additional (or override the default) parameters to the pdf code

# Answer
> 1 votes
You could also implement the CiviCRM hooks for tokens:

http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_tokens

http://wiki.civicrm.org/confluence/display/CRMDOC/hook\_civicrm\_tokenValues

Then the user can use the standard CiviCRM "create PDF letter" feature, and click "Insert Tokens" to put in the financial data needed.

The user could use the same tokens when emailing invoices too.

# Answer
> 1 votes
If you create a custom template that is similar to your organization's invoices, you might be able to simply use code from the "Thank-you Letters for Contributions" functionality that you get in a Contributions search result to generate the PDFs:

---
Tags: extension, pdf
---


# Question
Title: Can CiviCRM limit the number of event registrations for each member?
Can CiviCRM limit the number of event registrations for each member?

We have an event where they receive an automatic discount (because they are a member). However, we don't want them to buy the tickets for others at that price.

So we only want them to be able to register for each event, once. Is this possible?

Jon-man

# Answer
> 2 votes
CiviDiscount has functionality that limits the number of times a discount can be used. So if you create one-use discount codes / member, that might meet your need.

The automatic discount for members probably does not have a limit functionality, though that might be a useful addition

---
Tags: civievent, civimember
---


# Question
Title: How to include "Same as Billing/Home address" in a payment processing page?
I know This can be easily done by webform. But Civicrm webform does not allow the price set to be included. So its a limitation...

We use paypal website pro service. A profile is included to the payment page to include donors home address. Is there a way to include a check box to state "Same as Billing/Home address" in the profile?

# Answer
I believe the checkbox should appear automatically on a core Contribution page as long as the profile with the home address is at the top of the page, not the bottom.
> 4 votes

---
Tags: profile, payment-processor, contribution-page
---


# Question
Title: How can I change the order of address field columns on screens and reports?
In Europe, the postcode mostly precedes the town name. I could not find any options for changing the order of the columns for these fields, particularly on the constituent report.

# Answer
Have you tried making adjustments under **Administer \> Localisation \> Address Settings**?
> 6 votes

# Answer
I guess there are 2 routes:

1. you switch on the address parsing setting that splits the address line into street\_name, number and unit. You then have to develop an extension that builds the street\_address into the sequence you want (which is then used throughout the system). We have done this for some Dutch installations, check https://github.com/CiviCooP/org.civicoop.streetformatnl
2. leave CiviCRM to do what it does but customize the report where you need it to be in a different sequence.
> 1 votes

# Answer
To modify the column order in the Constituent Report you will need to do some development (you can hire a CiviCRM partner to make these sorts of minor modifications for you).

The developer might want to override the function select() and move the fields around as desired, since these are later used to build an array in the same order.
> 1 votes

---
Tags: localisation, addresses
---


title: Broken Image Link (Menu)

text:
# Question
Title: Broken Image Link (Menu)
I have a fresh install of CiviCRM. Some of the menus show a broken image file. Can this be removed?

# Answer
There should be a small arrow there:

If I had to hazard a guess, I'd say your "CiviCRM Resource URL" may not be set correctly. Check in **Administer \> System Settings \> Resource URLs**.

If that URL is correct, check to see if this file exists on your server: `/sites/all/modules/civicrm/packages/jquery/css/images/arrow.png`
> 6 votes

# Answer
If resource file is correct you can try to rebuild menus and don't forget to clear the civicrm cache.

Drupal sites: http:///index.php?q=civicrm/menu/rebuild&reset=1

Joomla 1.5 sites: http:///administrator/index2.php?option=com\_civicrm&task=civicrm/menu/rebuild&reset=1

Joomla 1.6 sites: http:///administrator/index.php?option=com\_civicrm&task=civicrm/menu/rebuild&reset=1

Wordpress sites: http:///wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1
> 1 votes

---
Tags: menu
---


# Question
Title: Is there a way to customize Activity Type screens?
Trying to customize individual Activity Type displays but couldn't find any info on the proper procedure.

I'd like to hide certain fields from certain activity types. For instance, for our food bank activity, I'd like to have the end user enter only the date and names of all households that came. I can't use a profile or a webform because we may have 100 families that use the pantry that day so we are trying to set it up for one activity per day with multiple households. This activity has no need for follow-up, assignees, etc.

I have custom templates up and running and can successfully alter the basic Activity display but would like to get control of each individual type.

Thanks

# Answer
I've handled this with a .extra.tpl file with some jQuery in it. I also used a template override for one or two customizations, but shied away from them because of the overhead of upgrading them. However, the project in question was in many ways a customized activity form, so I went ahead and did it.
> 3 votes

---
Tags: activities, custom-templates
---