# Question
Title: Creating a public Member organisations directory with CiviCRM in Wordpress
i'm new to CiviCRM but i've been trying to Create a public Member organisations directory with CiviCRM in Wordpress.

i've tried to configure a public report of members but it appears empty when i'm not logged in see here... http://phils07813188309.esy.es/?page=CiviCRM&q=civicrm%2Freport%2Finstance%2F37&reset=1

I don't know if this is a permissions issue, something to do with privacy settings or that i'm approaching the problem from entirely the wrong angle

And advice or pointers would be appreciated...

Ta

phil

# Answer
The best practice for this is to create a profile (**Administer menu \> Customize Data and Screens \> Profiles**). Check out this page in the section labeled "Displaying information on public pages", and also "Making directories with Profiles", further down that same page.
> 2 votes

---
Tags: civimember, civireport
---


# Question
Title: Can I override core classes or PHP files with custom versions?
Can I override core behavior of CRM/SMS/Providers.php by creating the file with the changes in my civicrm\_custom\_php directory?

# Answer
The answer is "yes" but...

Overriding an entire file means upgrades will become difficult, as you'll have to manually diff the contents of that file with the one in the new version, and reapply your changes.

If possible, try accomplishing your goal using a hook.
> 4 votes

# Answer
The answer is yes, you can do that. I tested it and it worked.
> 1 votes

---
Tags: custom-templates
---


# Question
Title: How do i list upcoming events publicly using CiviCRM in Wordpress
I've created a couple of events and a public info pages for them in Wordpress

How do i create a page / public report that lists all these upcoming events?

Cheers phil

# Answer
I suggest you install the CiviEvent Widget.
> 7 votes

---
Tags: civievent, wordpress, cms-integration
---


# Question
Title: Why am I unable to set organization name?
CiviCRM 4.4

I am trying to set the organization name and address details but the form is not displaying correctly. There are no input fields, only a white screen.

I added some debug stuff to wp-config.php. I then got: `Fatal error: Smarty error: [in CRM/common/formButtons.tpl line 38]: [plugin] unknown tag - 'crmGetAttribute' (core.load_plugins.php, line 118) in /home/vietfeir/public_html/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1094` Where do I go from here? I searched for this error in forums.civicrm.org but could not find any reference to this error.

# Answer
`crmGetAttribute` is not in 4.4, that only exists in later versions of CiviCRM. So either:

* You are using an extension that is not compatible with 4.4, or
* You have copied a template file from a later version of CiviCRM onto your install, or
* You have somehow managed to get your 4.4 files mixed up with code from a later version

The best solution for any of these situations would be for you to upgrade to the latest version of CiviCRM. If you follow the upgrade procedure correctly, this will ensure you have a clean copy of the latest source code.
> 1 votes

---
Tags: wordpress
---


# Question
Title: How do I limit the number of ticket to be sold in events
We have a event created, where the maximum participants are set to 120. But since a single participant can buy a multiple ticket, I am not able to find a way to limit ticket to be sold to 120.

# Answer
You can use price sets to track purchased tickets instead of just registrants.

See this reference (down the page to 'complex event fees with price sets'

http://book.civicrm.org/user/current/events/creating-an-event/
> 4 votes

# Answer
I had written a comment to set the max participants in the Event settings , but you have already done that. So, never mind.
> 0 votes

---
Tags: civievent, registration
---


title: CiviMail: "DB error" alert pop-up

text:
# Question
Title: CiviMail: "DB error" alert pop-up
During creation of a mailing with 10k contacts, frequently, getting black pop-up alerting "DB error" with no other information. Please advise.

```
mysql> SHOW VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 200   |
+-----------------+-------+
1 row in set (0.00 sec)

```

**PHP Built On:** Linux host.alcoholjustice.org 2.6.32-042stab094.8 #1 SMP Tue Dec 16 20:36:56 MSK 2014 i686
**Database Version:** 5.5.42-cll
**Database Collation:** latin1\_swedish\_ci
**PHP Version:** 5.3.27
**Web Server:** LiteSpeed
**WebServer to PHP Interface:** litespeed
**Joomla! Version:** Joomla! 3.4.1 Stable \[ Ember \] 21-March-2015 20:30 GMT
**Joomla! Platform Version:** Joomla Platform 13.1.0 Stable \[ Curiosity \] 24-Apr-2013 00:00 GMT

# Answer
Looks like this could be the same as or related to issue CRM-16277, which has been fixed for 4.6.3.
> 2 votes

---
Tags: civimail, joomla, 4.6.2
---


# Question
Title: How To Manage a Webform and a Contribution page?
I currently have a webform set up so that an individual, while renewing a membership for an organisation, is required to update the organisations details at the same time as processing a payment.

From my interpretation of CiviCRM (4.4.14) there are two different methods of achieving this:

1. Renewing the Membership as part of the webform. The user completes the detail update and then the contribution page appears as "page 2 of 2"
2. Updating the form and then putting the URL of the contribution page as the confirmation page, so essentially it saves all the updated details before accepting payment.

I am trying to work out though; which it better practice? I know that essentially both payment pages are the same, but are there any advantages (ie security, etc) to directing the user directly to the contribution page?

# Answer
As far as Civi and the payment processor are concerned, both methods are the same. It's the same contribution page, just presented 2 ways (full-screen, or embedded in a drupal webform). So it just comes down to your preference about the user experience. The first option would present fewer screens to the user, since the 2nd option involves 1 page of webform + 2 pages of contribution form.
> 1 votes

---
Tags: civimember, best-practice, contribution-page
---


title: Autoresponder for filling out profile

text:
# Question
Title: Autoresponder for filling out profile
I have a volunteer profile set up and it's working just fine. I need to send an email response with additional info to users who sign up.

I can't find any info on how to do this. Any help appreciated.

Thank you!

PS: Running Joomla 3.4 and the latest version of Civi Edit: The profile in question was created by \>\>\> Administer\>\>\> Customize Data and Screens \>\>\> Profile. It's run as a mailing list and stand-alone form on the site.

I did not use CiviVolunteer Extension although I do have it installed.

# Answer
I've managed to solve problems like this by generating custom activities, and then creating scheduled reminders which trigger on these activities. This is better than using sendmail directly, because the email more easily managed from the front end. For more information on automated reminders, see the docs.

For generating activities on forms submits, you could use hook\_civicrm\_postProcess to trap the form submit. For generating activities on new contact creation, you could use hook\_civicrm\_post. For more information on hooks, see the docs.

From within the hooks, you can create new activities like so:

```
civicrm_api3('Activity', 'create', array(
    'source_contact_id' => $id,
    'activity_type_id' => $activity_type_id,
    'subject' => "Participant $id Status Changed to $pstatus",
    'status_id' => 2,
    'assignee_id' => $member_org_poc_id,
    'details' => "Participant #{$id} Status Changed to $pstatus",
));

```
> 2 votes

# Answer
1. You can add all the users who sign up via the profile to a group
2. periodically you can send an email to all the members of the group who have not yet recd the mailing. This is fairly easy to accomplish early on, by excluding all the recipients of previous mailings
3. This method does not scale beyond a few weeks. You'll need to keep track of the last mailing sent and send new mailings to new folks only. I cant think of an easy method off hand. This blog post might be helpful

https://civicrm.org/blogs/dahndy/drip-campaigns-drip-marketing-welcome-series
> 1 votes

---
Tags: profile, email
---


# Question
Title: How do I add Javascript to pages using Core functions?
I'm calling this from a hook but it's not working. Am I doing something wrong?

CRM\_Core\_Resources::singleton()-\>addScript("alert('hello');");

I confirmed that it's running by adding debug code to addScript.

# Answer
> 1 votes
The syntax you gave is correct. I suggest you:

1. Ensure your code is actually running (add a debug statement or `exit();` in your code).
2. Clear your caches. If your page is being cached by the cms then that might be why you're not seeing it.

---
Tags: hooks
---


# Question
Title: Can I use different financial types for membership registrations and renewals without losing functionality?
This page http://book.civicrm.org/user/current/contributions/setup/ mentions

> Be careful when editing core Financial Types or adding new types, because CiviCRM has useful built-in functionality that depends on the core Financial Types.

Does anyone know more details ?

More concrete question: my client uses different accounting codes for membership registration and membership renewal. Can I use a different financial type for membership registration (other than 'member dues') without losing functionality ?

# Answer
> 4 votes
As a member of the CiviCRM documentation team I will follow up on that quote, as I am not sure what it means myself. It may be left over from earlier times and no-one has been brave enough to modify or delete it.

From experience I can tell you that you can create the new financial types for income that you need.

My organisation also uses different accounting codes for new memberships and for renewals and I have created a different financial type for each.

For historical reasons we use a different contribution page for our renewing members than the one set up for our new members. You would not need to do that if you are prepared to have two price sets on the same page, one for new members and one for renewals.

In terms of reporting, you may need to use the line-item report from the Extended Reports Extension to give the income broken down by financial type.

---
Tags: civicontribute, financial-types, accounting
---


title: CiviCRM Rules extension

text:
# Question
Title: CiviCRM Rules extension
What is the status of the CiviCRM rules extension? I have read a few blog entries but not sure when it will be ready.

From what I have read, it is supposed to work much like the Drupal rules module but works from within CiviCRM

# Answer
Big part of the "engine" of CiviRules is finished, with the rest being completed this month already. As with many other open source development, the rest is depending on funding.

The extension then needs to be populated with specific events, conditions and actions, just like Drupal Rules. We then hope many more will participate in adding those. @ErikH is the one to talk with.

Check: https://civicrm.org/blogs/erikhommel/civirules-sprint-january-and-march-2015 and/or http://redmine.civicoop.org/projects/civirules/wiki

(CiviRules should not be confused with the CiviCRM Rules extension, which simply syncronizes CiviCRM with Drupal Rules. This is the extension Eileen is referring to: https://www.drupal.org/project/civicrm\_entity)
> 5 votes

# Answer
There is an inbuilt rules extension - which exposes some drupal rules (through the Drupal rules UI). You can enable that and it does work.

However, it is more common to use the civicrm\_entity module - https://www.drupal.org/project/civicrm\_entity \- (use the 2.x-dev version) which exposes CiviCRM entities as if they are drupal entities, allowing crud actions through Drupal Rules.

Also note that the CiviCRM entity module allows you to use entity reference fields - ie. to link drupal entities to CiviCRM entities. Depending on your use case entity reference fields can obviate the use for rules (e.g if you are going to use rules to replicate the data on both entities for the purpose of views the linkage will allow you to display both entities in views without duplicating the data.
> 3 votes

# Answer
The CiviRules extension is not yet stable enough for common use. What we have developed so far is a framework for the rules. This framework is ready but what is missing are what we call Events (which is a trigger to a rule), conditions and actions.

As Flying explained to get more conditions and actions we need more funding to complete those. If you don't have funding but you need some conditions and actions which arent implemented you are more than welcome to implement those.

There is a wiki explaining on how you could do this. See http://redmine.civicoop.org/projects/civirules/wiki

If you want to try out the CiviRules you could see a demo at https://civirules.edeveloper.nl and the source code of the module is at https://github.com/CiviCooP/org.civicoop.civirules

At this moment the CiviRules extension has been developed and tested with CiviCRM versionb 4.4.x, which is the LTS version.
> 3 votes

---
Tags: extension, civirules
---


# Question
Title: Creating memberships in batches after payment
I have sent out membership fee by postal mail to contacts that are not members (i.e. they don't have a membership registered in CiviCRM). If the contacts have responded by paying, they are in fact members. The payments are automatically recorded using our bank importer.

So, I have a bunch of contacts who have payed their membership fee, but have no membership recorded. How do I create memberships other than manually one by one?

# Answer
My interpretation of your question is that the payments are already recorded in CiviCRM. I am also assuming you can have some way of searching for the contacts who have paid membership fees but have no membership. (If not, edit your question to make that clear and I will amend my answer accordingly).

Once you have obtained a list of the contributions (via an Advanced Search displaying results as contributions or a Find Contribution search) you should export the results. You will need at least the contact id, and probably the date of the payment (which I assume will become the start date for the membership).

Create a CSV for importing that contains at least the contact Id, the membership type and the membership start date (refer to the Import Membership section of http://book.civicrm.org/user/current/common-workflows/importing-data)

Import the membership file (**Memberships \> Import Memberships** )

Note: this will create memberships for the contacts, but the memberships and the contributions will not be linked. That linking cannot be done via the GUI.

As a suggestion, next time it may be more efficient to send people the URL for an online membership page so that the membership is created at the time the payment is recorded.
> 2 votes

# Answer
Did you try creating a membership batch for data entry? There is a bit about it here http://book.civicrm.org/user/current/contributions/accounting-integration/ but there is a lot of other accounting stuff in there too...
> 1 votes

---
Tags: civimember
---


# Question
Title: which scheduled job handles email confirmations?
When contacts add themselves to a mailing list group, they get a confirmation mail, saying

> You have a pending subscription to the \[xxxx\] Mailing list. To confirm this subscription, reply to this email or click here.

The click works, the reply doesnt. It gets send to an email address that is otherwise set up correctly to handle mailing bounces (its an address like \[foo\]+c.3.3.cde2e639840a9457@\[mydomain\] )

Which scheduled job should I enable to pick up this confirmation ?

# Answer
The bounce processor is in general the one handling, well, the bounces. Check the job log if something is written (but in general, the jobs aren't very good at returning the problems they encounter)

How often is your bounce processor running?
> 1 votes

---
Tags: email, groups, cron-job
---


title: Online receipt not being send to donors

text:
# Question
Title: Online receipt not being send to donors
we are creating two contribution pages for both new members and donnors and we are experiencing some problems with email receipts. We would be very grateful with any ideas on where to look or what to try next as we've ran out of them.

The issue is that receipts (emails) for donnors are not being sent when a donation is complete (new member emails are beign sent). We have checked the following:

* Send receipt is checked on Thanks and Receipt emails on the admin page for contribution
* It is not a problem of the payment processor (we've tried with 2 different ones, and the donation is marked as complete but the email is not beign send)
* The log says no email is beign sent. Meaning, is not a problem of the email getting lost on its way, but rather, that it is not sent at all.
* Email template is the default one.

Something odd is, new members who choose pay later get the New member email, where new members who use a payment processor get the Contribution mail.

Ideas? Thanks!

# Answer
> 2 votes
You should check CRM-15629 and see if it sounds like the problem you're having.

# Answer
> 1 votes
It might be that the payment processor(s) are the issue. Unfortunately, the code on how to handle a successful payment was not really in a common place but duplicated, with potential differences (and bugs) into each of the payment processors.

The situation has improved, but it takes time to get all the payment processors using the new (common) features.

Could you test the following: use paypal as the payment processor and make a simple contribution page (eg. with an amount of 0.10) and confirm that you receive the email.

As for the sepa I'm not that sure the payment should be considered as valid until we get the confirmation from the bank (5 days after you submit, that can be weeks after the donor filled the form), the payment is not really completed, so I don't find it that unexpected that the mail isn't sent

---
Tags: email, contribution-page, receipts
---


# Question
Title: Error "No payment information found for this record" when connecting multiple participants to a single payment via API
I've been working on a camp registration page where an adult registers one or more children for one or more events, with a single Pending contribution to tie it all together (per Xavier's advice here). My API calls successfully create the adult, contribution, children, relationships, participants, and participant payments (a connection to my contribution) without error. However the participants still don't seem to be connected to the payment. When I view a participant record, the total paid shows the full amount with a balance of $0, even though the contribution is $0. When I click View Payments from here, there are no payments to display. When I click Record Payment, I get the error "No payment information found for this record".

Here is a Gist showing just the relevant parts of my code. Any advice is greatly appreciated.

# Answer
when you create the "non main" participants, do you link them with the main participant registration?

As written, try to register multiple participants via the normal web interface and use it as a template, but it seems that you need to set participant\_registered\_by\_id to the id of the first participant (BAO/Participant.php getAdditionalParticipantIds function should give you more hints)
> 1 votes

---
Tags: civievent, api
---


title: Improve the speed of civimail

text:
# Question
Title: Improve the speed of civimail
I'm trying to be able to send as much emails as possible. Beside doing more stuff in parallel (eg run several cronjobs in parallel on separate batch of contacts), I'm trying to find a way to improve civimail

One easy win seems to use the smtp delivery mechanism and keep the smtp connection open for the duration of the batch. The library we use offers this option with keepConnection=true but I don't see it used in civimail

Am I missing something? Is this a path that has been explored?

# Answer
> 3 votes
I think at some point we did do that. However, we also noticed that some smtp mailers are not very good at reporting back errors and jobs would hang / not deliver email. We put in some code to get around that and periodically check for the connection to be alive and valid

We do check the 'persist' flag in the mailer library.Check

CRM\_Core\_Config::getMailer

for more details

---
Tags: civimail
---


# Question
Title: How to distinguish "Contacts with the same name" when assigning an activity?
A couple of people have exactly the same name in CiviCRM: John Smith. When assigning an activity you select a person by starting to type its name. However in case that people have exactly the same name, Civi shows both names. How can i distinguish between the two? Showing an emailaddress behind the name, or showing a nickname would be very helpful but I don't see any way to configure this field.

Any ideas of tips?

We're working in CiviCRM 4.4.8

# Answer
You could upgrade your CiviCRM version (4.4) to the latest version (4.6+), which will display contact emails along with their names in the autocomplete, making it easier to distinguish between similar contacts.
> 4 votes

# Answer
One way of resolving this might be for all the contact auto-complete widgets to reuse the same format as quick search (in the top menu bar). The setting is user configurable here:

http://d45.demo.civicrm.org/civicrm/admin/setting/search?reset=1 (search for Autocomplete Contact Search)

This probably is a good change to be made in core
> 3 votes

# Answer
I have been looking into this and for technicall people the assignee field in activities shows the sort\_name of a contact. This sort\_name could be build with some tokens but they are a bit limitted.
> 1 votes

---
Tags: activities, duplicate-contacts
---


title: Test Emails Not Working

text:
# Question
Title: Test Emails Not Working
Suddenly, CiviMail test emails are not working. Note that the emails themselves are going out without problems, just not the tests.

Any idea of the problem and how to troubleshoot?

CiviCRM version: 4.4.14 CMS: Drupal 7.36

# Answer
> 3 votes
Can you check on the log of your mail server if they are really not going out?

Usually when I have this problem, it's because the test emails are flagged as spam and discarded somewhere between civicrm and the inbox of the tester

# Answer
> 2 votes
I think that test emails go out a different mechanism than the non-test ones (assuming you're talking about civimail). So you might want to check your local server, assuming your non-test civimail is going out via a different smtp.

---
Tags: civimail
---


title: Paypal Express No Button

text:
# Question
Title: Paypal Express No Button
When using PayPal Express as my payment option, there is no button appearing to take the user to PayPal. I've checked everything I can imagine, cleared caches, etc. and feel that I must be missing some little thing. But, for the life of me, I have no idea.

Please help!

# Answer
> 5 votes
Two settings that can cause this issue are:

1. The link to the button image is missing in the payment processor settings. The setting is called "Button URL" and it should normally point to https://www.paypal.com/en\_US/i/btn/btn\_xpressCheckout.gif.
2. The page is configured for membership signups and has the option turned on to allow "Separate Membership Payment" in the contribution page's membership tab. This setting is currently incompatible with Paypal Express. In some versions of CiviCRM this setting causes the Paypal Express button to be hidden. In others an explicit error is given when clicking on the button. See: https://issues.civicrm.org/jira/browse/CRM-8221

---
Tags: civicontribute
---


title: Special search problem

text:
# Question
Title: Special search problem
I have input around 1000 contacts from a specific country. Most of these are already in groups. I want to create a group for contacts from that country that are not yet in a group. How can I do that? I could not find a way to search for them.

# Answer
I've done this sort of thing by using the Include / Exclude custom search (Search =\> Custom Searches =\> Include/Exclude Contacts in a Group/Tag)

Include a group that has all the contacts that you're looking at. In your case you may need to create a smart group that has all the people in the country. Then in the exclude list all the groups that they should be/could be assigned to. Search. You'll be left with all the people in the country to don't belong to any of the groups you listed in exclude.
> 6 votes

---
Tags: search, groups
---


title: Captcha on Contribution forms

text:
# Question
Title: Captcha on Contribution forms
I know that there is a Captcha function available for Profiles, but it seems that we have need for Captcha on contribution forms that do not use Profiles. Is this possible?

# Answer
> 2 votes
Profiles on contribution pages that contain an e-mail address will have that e-mail address suppressed. So if you create a profile with just an e-mail address and add a CAPTCHA, you should get the results you're looking for.

---
Tags: civicontribute
---


# Question
Title: Reasons for restricting changing contribution statusses?
When we try to handle backend contributions sometimes we need manually change contribution statuses. Unfortunately some contribution status changes are restricted. From 'pending refund' we cannot change back to 'pending' or to 'in progress'. But even a more basic change like from 'pending' to 'in progress'.

I checked the wiki at http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Data+Flow#CiviAccountsDataFlow-Otherchangestocontributionstatus but that does not seem totally up to date (pending refund / progress status)

Is there further documentation on an underlying reasoning and workflow logic of these restrictions? What would go wrong if this wasn't restricted? Could the check be a little too harsh?

BTW. They are handled by checkStatusValidation in CRM/Contribute/BAO/contribute.php

# Answer
> 3 votes
The state changes from one status to another prompt the creation of accounting transactions that reflect that flow. I don't think there is a definiton of what it means from an accounting perspective to implement some of the state transitions you mention. If that is agreed on then we could allow those transitions. The main thing is that we need to maintain the integrity of the financial information in several tables in the database.

FWIW, there is a GSoC project this summer that may fill in more refund functionality possibly along the lines of the cheque writing done by the grant programs extension, though it would likely also use refunds through online payment processors if they and their plugins support refunds.

---
Tags: civicontribute
---


# Question
Title: When the smart group cache is regenerated, are disabled smart groups regenerated?
I work with a CiviCRM install with about 400 smart groups - but only about 30 of them are enabled. I'm seeing slow performance - I'm wondering if anyone knows definitively whether my disabled smart groups are affecting performance?

# Answer
> 4 votes
Pretty sure that we only consider active groups to regenerate the cache:

CRM/Contact/BAO/GroupContactCache.php

also most smart groups are regenerated on demand. The scheduled job invokes the loadAll function with groupsIDs as null, which in turn restricts the query to is\_active groups

---
Tags: smartgroups, cache
---


# Question
Title: Set membership end date to today for cancelled status
How can I set the membership end date to today in the status rules for a cancelled status? I can only adjust in month/day/year relative to a discrete event member since/start end. Thanks!

To clarify, when I change a membership to cancelled, I would like the end date for the membership to inherit automatically today's date, but I can't figure out how to specify that in the status rules. Is that not the place to do it?

# Answer
You have to manually override the status to set a membership to Cancelled and that is when you set the End date to the value you want.

If you are doing this one record at a time either type in the date directly or Clear it then click on the calendar to see the current date highlighted for easy selection.

If for some reason you are cancelling memberships via batch update, then include the end date in that profile. Click on the X beside the date in the first line and then on the calendar. The current date will be highlighted and you can select it, then copy it to all the memberships you are cancelling.

If you are still wondering why you can't set "Now" as the end date for the cancelled status, that may suit your use case, but won't suit everyone. If we receive a request to cancel a membership we set the end date to the day we received the request, even if we don't actually change the status in the database until some days later. (Our membership admin only works part time, so sometimes it could be a week before she is able to make that change.) As manual intervention is required to cancel the membership, manual intervention at the same time to set the end date makes sense to me.
> 5 votes

---
Tags: civimember
---


title: Sent SMS via Twilio failed

text:
# Question
Title: Sent SMS via Twilio failed
I am using our shiny new Twilio Test account for the first time via CiviCRM and it doesn't go out.

"The From phone number +12395995225 is not a valid, SMS capable inbound phone number or short code for your account. For more information, see https://www.twilio.com/docs/errors/21606"

The receiving phone number has been verified and using API calls via Twilio site works.

What would be a good way to troubleshoot this?

# Answer
Found the solution at the page mentioned: Turns out out it works with +15005550006 which means, there are still the test credtentials in the CiviCRM SMS Provider settings. Once they were replaced by the Live API information the earlier number also works.

Makes perfect sense to me.
> 1 votes

---
Tags: sms
---


# Question
Title: Should civicrm_participant.registered_by_id be an FK to civicrm_contact?
While troubleshooting for a different question, I noticed that `civicrm_participant.registered_by_id` is an FK back to `civicrm_participant.id`. Since it's a common use case for one contact to register others and not him/herself (e.g. buying event tickets as gifts for friends), should this be an FK to `civicrm_contact.id`?

# Answer
CiviCRM uses the registered\_by\_id to link multiple participants together. Since the CiviEvent registration page doesn't allow you to register others without also registering yourself for an event, an fk to participan\_id makes sense.

However, some use cases (e.g. summer camps) have different requirements, where a parent registers 1 or more children (but not themselves). Implementing this today in CiviCRM presents 2 challenges:

1. The UI doesn't support this use case
2. The schema doesn't support it either

If you're using Drupal, Webform-CiviCRM Integration solves the first problem very well. I've used a custom contact reference field to work around the 2nd.

Going forward, I agree the schema needs to be more flexible, but it's not as simple as changing that field to point to contact\_id. Yes we need a better way to point directly to the registering contact, but we also need to keep the functionality of being able to group participants together in a single registration. Possible solutions could be:

* Alter the registered\_by\_id field to point to the registration *activity* instead of the participant record.
* Add a second field to point directly to the registering contact, and leave the existing one as well.
> 1 votes

# Answer
I think there is some of the code related to payment processing that assumes the registered\_by\_id is the participant under whom payment has been made. Any changes to the schema would need to account for that. Thats probably the primary reason the FK is to civicrm\_participant
> 1 votes

---
Tags: database, architecture
---


title: Creating CiviMail cron job in CPanel

text:
# Question
Title: Creating CiviMail cron job in CPanel
I am on shared linux hosting and using the CPanel cron job setup page. Set to run every 1/2 hour. I just need the command line, and I consulted the books for more info. The command line I came up with is:

/usr/bin/php -q /home/acct123/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -j -s mydomain.org -u Paul -p password -e Job -a process\_mailing

This doesn't work. Cron returns (via email):

PHP Fatal error: cli.php can only be run from command line. in /home/acct123/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php on line 86

# Answer
What I did to fix:

1. My php path was wrong. Should have been:

/usr/local/bin/php -q /home/acct123/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -j -s mydomain.org -u user -p password -e Job -a process\_mailing

2. Then I created a new wordpress role using a role plugin, "civimailrole" with the only privilege "Access CiviMail".
3. Then created new wordpress user "civimailusr" and assigned only the role "civimailrole".
4. Used the new user and password in the command for CPanel cron job editor.
5. Sent test mailing to myself, worked.

I would appreciate any comments on any security issues for this setup.
> 2 votes

---
Tags: civimail, wordpress, 4.5.6
---


# Question
Title: My Subscribe to mailing list only works with logged in users
I've made a Profile that allows me to add someone to a mailing list from a html snippet.

But only users that are logged into civicrm can finish the form, when you attempt to submit i get this error: "Sorry but we are not able to provide this at the moment. The requested Profile (gid=13) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance."

The form asks for; First name Last name Email Mailing list to be added to.

I have set everything i think i need to to public page.

# Answer
There are some permissions with profiles and you have to set those permissions for the anonnymous user. Those permissions are calles profile listsing.

If you are using Drupal you could try to create a webform with the webform and civicrm integration.
> 2 votes

---
Tags: profile, groups
---


# Question
Title: How to add custom fields to membership report display columns?
We have a set of custom data for memberships. One field is 'radio' type for newsletter delivery preference: online, paper, both, none. We can filter on this custom field in membership reports no problem, but cannot add it as a column in the report. I suspect this is an area related to custom report programming, and I'm not at all sure how to go about this. When I search on "custom field report column" I get a few hits in the forum that are a bit cryptic to me.

Update: To fix this all I had to do was upgrade to 4.6.2.

# Answer
> 3 votes
After reading your comments, I have a new answer. Please check the custom field in question and ensure that the "Searchable?" checkbox is checked.

# Answer
> 2 votes
You haven't specified which membership report you're referring to, so it's difficult to say for certain. However, the general approach should be:

* Create a PHP override. There are many ways to do this, but the easiest would be to set a custom PHP path directory (**Administer menu \> System Settings \> Directories**).
* Copy the PHP file that generates your report to the folder. E.g. if this is Membership Detail, copy `<civicrmroot>/CRM/Report/Form/Member/Detail.php` to `<custom PHP folder>/CRM/Report/Form/Member/Detail.php`.
* At this point, I find I haven't quite done steps 1-2 correctly, so I edit the custom Detail.php to make sure my changes are reflected on the Membership Detail report. E.g. I go into the section called `$this->_columns` and change the title of a field, then reload the page to see that it worked.
* Once you're convinced you have the override set up correctly, find the line that starts with: `protected $_customGroupExtends`. Add the entities that have the custom group in question to that line.

---
Tags: custom-fields, civireport
---


title: How do I find a message template?

text:
# Question
Title: How do I find a message template?
A lifetime member notified me that they received an automated message their membership had expired (typically sent to those with annual memberships). (As they are not dead) this user type should not have received a message that their (lifetime) membership expired.

1. How can I remove "Lifetime" members (as a group) from receiving general (annual) membership expiration notices.
2. How can I find this message template? I looked in "Home › CiviCRM › Administer CiviCRM \> Message Templates \> User-driven Messages & User-driven Messages" as well as "Headers, Footers, and Automated Messages" and do not find a mailing with the subject header.

Thanks

# Answer
> 3 votes
Check if you have any Scheduled Reminders based on Memberships and ensure your 'lifetime' Membership Type is excluded from that.

# Answer
> 1 votes
I think you are trying to do the wrong thing. It's not the template you want to change, but the fact that the email is sent at all.

It sounds like your lifetime membership is not correctly configured.

If/when you do want to edit a template, it's there, but in a System messages tab that's not as obvious as it might be.

# Answer
> 1 votes
I have to agree with @Alan-Dixon that it sounds like your lifetime member is set to renew annually whereas there is an option for a "whole lifetime" duration.

I would take a look in your membership types which for me is found in Administer \> CiviMember \> Membership Types - you can change the duration from there regardless of whether there are any members associated with it.

---
Tags: message-templates
---


title: Activity iCal : Start time = End time

text:
# Question
Title: Activity iCal : Start time = End time
I work with CiviCRM 4.6 and Drupal 4.7 When I create an activity in CiviCRM, a iCal file is also created and sent. But in this iCal file, Start time = End time. So when I import the file in my calendar the activity doesn't have the right duration. Any idea ? Maybe I can modify a template, but how ? Regards, Hashkey

# Answer
Check:

templates/CRM/Activity/Calendar/ICal.tpl

I just took a quick look there and seems like the duration is not taken into account at all, which is a bug :(

Can you take a look and see if you can fix it. If so, please do submit a PR against the CiviCRM github repo. I'm pretty sure the activity object will be sending in the duration field. You should also file an issue for this on the CiviCRM issue tracker
> 1 votes

---
Tags: civimail, activities
---


# Question
Title: How do I find all my Smart Groups, as a type?
I can search by Group name under Contacts -\> Manage Groups -\> Find but that does not find Smart Groups unless 'smart' is part of the name I created for the Group. How can I find all Groups of type Smart Groups?

# Answer
> 3 votes
Curious as to what your use case for this is.

This is currently not part of group search. I suspect its an easy modification to add a checkbox to group search to include (or exclude) smart groups (along with any other criteria mentioned)

The DB query changes to enable this is relatively easy (column saved\_search\_id is NULL / NOT NULL)

lobo

# Answer
> 2 votes
It's not part of group search currently. As Lobo said, adding it would be a fairly quick task if you are a developer or wish to hire one.

One workaround would be to use the api explorer (in the menu, **Help \> Developer \> API Explorer**).

## Input like this:

## Will give output like this:

---
Tags: groups, smartgroups
---


# Question
Title: Avoiding automatic creation of civi contact upon drupal account creation
How can I avoid contact creation when a drupal account is created?

My problem is:

Sometimes the contact already exists as an organization. If I add a drupal account, that contact gets duplicated as an individual.

# Answer
> 2 votes
There is no way via the standard config to do this afaik. In theory, if the drupal contact that is created matches a unique email for a civi Individual (that has no drupal user yet) then the match should be made. Otherwise you have to drive that type of clean up via your dedupe workflow. Also just spotted you said Organisation. So in theory, again, Drupal users can only be Individuals - since organisations find it hard to use the keyboard. Perhaps that is part of the issue you are needing to resolve?

---
Tags: drupal
---


title: Is CiviCRM 4.6 Bootstrap Compatible

text:
# Question
Title: Is CiviCRM 4.6 Bootstrap Compatible
On a 4.5 site running the most recent Drupal, I have to use the themekey module to make CiviCRM public facing pages use a different theme from the site default because of Bootstrap compatibility problems. (For admin stuff I'm using a non-bootstrap admin theme.)

The client really wants the public-facing part of the site to use the same bootstrap theme for all pages.

Is 4.6 have any better Bootstrap compatibility than 4.5?

# Answer
4.7 should be, but not 4.6 as is. There was a GSoC student who worked on making CiviCRM more Bootstrap-friendly, unfortunately the patches were not merged in for 4.6.

I've started working on it again, based on Amilineni's work, but I'm slowly moving forward. If anyone beats me to it, I will be more than happy :)

So far, I've been trying to add a few classes to core forms (CRM/Core/Form.php), and try to see if we can override the CSS on buttons using Saas/Less, and perhaps moving a bit of CSS out of civicrm.css so that we can make it optional (to avoid loading extra CSS rules if we are using Bootstrap).
> 5 votes

---
Tags: ui
---


title: Adding value conditions to dedupe rules

text:
# Question
Title: Adding value conditions to dedupe rules
It's possible to specify on a dedupe rule that 'Contact Subtype' must match. Is there any way of attaching specific values to that, for example, 'and they must both be Student'?

Some of this could be done by having, say, a group of students and a group of teachers, and choosing the students group when I run the rule. I only have this option when running it manually (Find and Merge)- what about for rules I want to be Supervised and Unsupervised?

In this case I want to deduplicate students against students (subject to the other conditions in the rule), but not students against teachers, or teachers against teachers. We are looking to run a survey of a large number of contacts and they tend to object if they receive it several times!

# Answer
You can potentially do this by implementing the hook:

CRM\_Utils\_Hook::dupeQuery

Check: CRM/Dedupe/BAO/RuleGroup.php

to see places where the hook is invoked
> 1 votes

---
Tags: contacts, duplicate-contacts
---


# Question
Title: CiviMail adds call to onbeforeunload function then throws "Illegal Characters" error over and over again
I recently upgraded to 4.6.2...All's well until I try to create a new mailing. Every time I start to compose a message from scratch, or use a template a javascript call to the 'onbeforeunload' function is inserted into the bottom of the message which causes an error box to pop-up reading

"Error Illegal characters in input (potential scripting attack)"

What is going on? I've tried using different wysiwyg and no wysiwyg with the same results. It doesn't happen in any other HTML field I can find in CiviCRM or Drupal, only when creating a new mail message but I can't save or send a message because every attempt causes the script to be added and the error to be triggered.

HELP!! This wasn't happening before the upgrade. But I'm stumped for a cause.

# Answer
> 1 votes
Because this doesn't exhibit on the demo sites and hasn't been reported by anyone else, my first suggestion is to disable extensions/plugins/customizations because this may not be originating from CiviCRM.

If that doesn't work, try the more detailed troubleshooting javascript in CiviCRM guide.

---
Tags: civimail
---


# Question
Title: Automatically create scheduled reminders for recurring events?
I modified an event template to include a scheduled reminder, but when I repeat the event (using the new recurring events feature), the scheduled reminder does not carry over.

Is it possible to create recurring events and all of them have the same scheduled reminder?

# Answer
The phase1 of "recurring events" didn't include cloning scheduled reminders, probably because scheduled reminder (repeat tab) itself was being used for generating the recurring set. However both of them are different and there is no reason why scheduled reminder tab can't be cloned in the recurring set. Its just that no one explored them in phase1. Just added it to - phase2 wiki doc.

The workaround for you is using "Administer\>\>Communications\>\>Scheduled Reminders" screen, to make a new reminder based on "Event Name" assuming all of events in your recurring set have same title. Otherwise you could base them on some "Event Type" meant only for that recurring set.
> 3 votes

# Answer
Rather than create a scheduled reminder based on "Event Name", create it instead on "Event Type". If you don't want to apply scheduled reminders to all events of this type, create a second type with a very similar name to use with events you want a scheduled reminder on - then attach scheduled reminders to only that event.

I can also see in the API explorer that there's a "cascade type", which seems to suggest that perhaps you could change the default cascade type to cause scheduled reminders to be cloned as well. I'll let someone else speak to the feasibility of that.
> 3 votes

---
Tags: civievent
---


# Question
Title: How to force styles in CiviMail templates?
When a basic user uses a template to write an email, is there any way to force the styles in the message? For example, the most common case is when the user creates links in the message body and these are set to default blue color links. OK, when the template includes CSS styles in the message body these are applied correctly, but then, when you send it, there are some mail clients that do not display these styles and because they require inline CSS styles.

Any ideas or tricks?

# Answer
> 5 votes
You can force inline CSS with this extension.

---
Tags: civimail, templates
---


# Question
Title: WordPress user account registration issues using membership contribution page
**SUMMARY:** I am using CiviCRM 4.6.2 on WordPress 4.2.1 for a membership sign and renewal site and keep hitting this wall on this *DB Error: already exists* related to user registration on a membership contribution page.

It's worth noting that this is a relatively fresh install with no contacts (besides the administrative account and the membership organization contact), authorize.net set up and some custom fields added via a custom profile (the profile forces user registration).

**Here is the log and backtrace: (email removed..)**

```
May 06 15:28:46  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id']
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id']"]
)

May 06 15:28:46  [info] $backTrace = #0 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
#4 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
#5 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -5, NULL, NULL, "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...", "DB_Error", TRUE)
#6 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-5, NULL, NULL, NULL, "1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id'")
#7 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
#9 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
#10 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
#11 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
#12 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFMatch.php(56): CRM_Core_DAO->save()
#13 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CMSUser.php(247): CRM_Core_BAO_UFMatch::create((Array:3))
#14 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(478): CRM_Core_BAO_CMSUser::create((Array:53), "email-5")
#15 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1526): CRM_Contribute_BAO_Contribution_Utils::createCMSUser((Array:53), "4", "email-5")
#16 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(120): CRM_Contribute_Form_Contribution_Confirm::processContribution(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), NULL, "4", Object(CRM_Financial_DAO_FinancialType), TRUE, TRUE, FALSE, (Array:1))
#17 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(1338): CRM_Contribute_BAO_Contribution_Utils::processConfirm(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), (Array:33), "4", "2", "membership", (Array:0), FALSE, TRUE)
#18 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1903): CRM_Member_BAO_Membership::postProcessMembership((Array:47), "4", Object(CRM_Contribute_Form_Contribution_Confirm), (Array:33), (Array:0), (Array:0), (Array:11), (Array:1), TRUE, NULL, FALSE, "2", (Array:0), TRUE)
#19 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1019): CRM_Contribute_Form_Contribution_Confirm->processMembership((Array:47), "4", (Array:0), (Array:0), (Array:33), (Array:0), TRUE)
#20 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(345): CRM_Contribute_Form_Contribution_Confirm->postProcess()
#21 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()
#22 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
#23 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#24 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#25 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next")
#26 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#27 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#28 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#29 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm.php(1133): CRM_Core_Invoke::invoke((Array:3))
#30 /home/cac2member/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(134): CiviCRM_For_WordPress->invoke()
#31 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#32 /home/cac2member/public_html/wp-includes/plugin.php(571): call_user_func_array((Array:2), (Array:1))
#33 /home/cac2member/public_html/wp-includes/class-wp.php(622): do_action_ref_array("wp", (Array:1))
#34 /home/cac2member/public_html/wp-includes/functions.php(877): WP->main("")
#35 /home/cac2member/public_html/wp-blog-header.php(14): wp()
#36 /home/cac2member/public_html/index.php(17): require("/home/cac2member/public_html/wp-blog-header.php")
#37 {main}

```

# Answer
This issue is logged here: https://issues.civicrm.org/jira/browse/CRM-16234 The fix is implemented in this PR: https://github.com/civicrm/civicrm-core/pull/5645

You can apply the fix now, CiviCRM 4.6.3 will have this included.
> 5 votes

---
Tags: wordpress, contribution-page, user-account
---


# Question
Title: Connecting existing contribution to pledge
This Sunday was the first day for our church to receive payments in a financial campaign we are running. Some people have made pledges, and we have used CiviPledge to record those pledges.

I was under the assumption that when we recorded the donations to the same financial type as the pledge that CiviPledge would automatically figure out that that gift should count as a pledge payment.

However, it did not. I have since discovered the "Pledge" tab on an individual contact page which allows me to record a pledge payment, but that adds a completely different workflow to our record keeping.

Therefore, I have two related questions:

* Is there some way to connect a contribution to a pledge when the contribution is entered using the standard contribution entry form?
* How can I connect an existing contribution to a pledge after the contribution has been entered? (I am comfortable using the CiviCRM API, but have never programmed for the pledge component before.)

Any help will be appreciated.

# Answer
Indeed, different workflow. with pledges, you create "expected" contributions for each time the donor said she'd contribute. You can then alter them via the api (eg with the api explorer)

The entity you want to change is pledgePayment. you can update the contribution\_id, the amount and the status and it should then be working as expected

```
"values":[{
    "id":"1",
    "pledge_id":"1",
    "contribution_id":"10",
    "scheduled_amount":"500.00",
    "actual_amount":"500.00",
    "currency":"USD",
    "scheduled_date":"2009-07-01 00:00:00",
    "reminder_count":"0",
    "status_id":"1"
},

```
> 2 votes

---
Tags: contributions, pledges
---


# Question
Title: Can I use a CIviCRM Webform URL in place of the required action.unsubscribeUrl?
I created a nice un/subscrube form using the excellent CiviCRM Webform module for Drupal. Now I would like to send mailings with CiviMail and include a link to my webform as the unsubscribe option.

However, CiviMail refuses to send my mailing unless I include the token `action.unsubscribeUrl` or `action.optOutUrl` in the content of my mailing.

What is the proper way to set my webform URL *as* my `action.unsubscribeUrl`?

Background discussion here. I realize there is a change that will be committed soon that will allow a token to exempt a mailing from this requirement. https://issues.civicrm.org/jira/browse/CRM-16062

# Answer
> 2 votes
You can already disable the setting so the tokens aren't mandatory, then use add your url to the webform (with the contact id and token checksum so they are "logged")

It's under Administer\>civimail\>civimail component setting http://d46.demo.civicrm.org/civicrm/admin/setting/preferences/mailing?reset=1

# Answer
> 0 votes
Currently there isn't an "easy" way to create a token for unsubscribe webforms. As X said you can turn off the unsubscribe requirement but this is a blunt instrument and requires you to still manually construct the checksum link to the webform each time.

If you're up for a little coding exercise, how about submitting a Pull-Request to the Webform-CiviCRM project implementing hook\_civicrm\_tokens?

---
Tags: civimail, drupal, webform-civicrm, tokens
---


# Question
Title: Why won't the "Employee of" field autocomplete when used as part of a edit profile form in Wordpress
I am really new to CiviCRM and so this question may just display my lack of understanding of some basic concepts. I serve a membership driven organization whose members are themselves almost all employees of larger organizations.

I am trying to test out how new contacts can identify themselves as part of an existing organization. I created a simple profile that I embedded in a wordpress page in "create" mode. On it I use the Individual fields First name, last name, email and "Employee of."

When you edit a contact on the back end of the site, the "Employee of" field autocompletes if an existing employer is there. But used as a front end form element, it does no such thing on my installation. Am I missing something? How do I allow new members to enter and select from an existing set of organizations?

# Answer
> 4 votes
It's on purpose, to protect privacy of your contacts. What this autocomplete does is to provide the list of all the organisations that you have in your CRM.

I could easily imagine quite a few organisations that are in the database, for instance of your "opponents" that would look weird, or even embarrassing in the list of suggested organisations.

And even it if weren't the case, it's not us, as the software provider, to decide what contacts in your database can or can't be displayed to anonymous visitors, so the only safe option is to remove that feature

I have written a while ago an extension to let you add an autocomplete, but pretty sure it doesn't work with the latest version of civi (that has switched to a more modern autocomplete jquery module)

If you have dev skills or budget, I could dig it out so it could be used as a basis for the feature (and so you could only provide your members in the autocomplete for instance)

---
Tags: wordpress, profile
---


title: Notification upon email change

text:
# Question
Title: Notification upon email change
This is a question that came up during yesterday's training: "Does CiviCRM offer the feature of sending email change notices? If I go online and change my email address at my bank or broker, notice is sent both to my old and new emails. This gives not only a notice of change but also the chance for me to discover if I've entered the new email address incorrectly."

Any thoughts? If it's not possible now, would this be a good feature request?

# Answer
> 4 votes
Not out of the box, no. As far as a feature request - I think that this would be a good extension, but might not make sense in core CiviCRM - most CiviCRM installations don't even have uses where their contacts log in, let alone change their e-mail addresses.

To implement as an extension, a developer should use the `hook_civicrm_pre` hook on the Email entity - it's important to use "pre" and not "post" because otherwise the old e-mail address is already overwritten! Confirm that the change is driven by that person, not a back-end staff person (my comparing the logged-in user ID to the contact ID that owns the email), and if so, send a custom message to both addresses. I have an extension somewhere that lets you specify a CiviCRM template to send - the advantage being that a staff person can change the e-mail. Let me know if you need that posted on Github and I'll track it down.

---
Tags: email
---


# Question
Title: Cannot Select Recipients in CiviMail in 4.6.2
I'm experiencing the same issues as shown in this thread: http://forum.civicrm.org/index.php/topic,36343.0.html

Fields appear duplicated, I can't select any recipients, etc. In fact, when I select a group (autocomplete search does not work), the field label goes red as if I've missed selecting any recipients.

I've got an urgent mail to get out for this client, but can't do it through CiviMail. I've tried all versions of the layout (standard, unified, unified2 and wizard).

Joomla 2.5.28 CiviCRM 4.6.2 Browsers used: Safari 7, Chrome 42.x, Firefox Developer's Edition

# Answer
Thanks. It's helpful to report these kinds of issues along with details of the configuration (like you did) and any steps required to reproduce in a new installation.

For a temporary work-around, you might try using the old, deprecated UI by editing `civicrm.settings.php` to include `define('CIVICRM_CIVIMAIL_UI_LEGACY',1);`

FWIW, we still have a couple issues that are getting reported by multiple people but which we cannot reproduce yet. Based on the data-points so far, the use of Joomla with Civi 4.6.2 seems to be a common theme, but that could be coincidence. More reports/debugging is greatly appreciated.
> 1 votes

# Answer
The new CiviMail UI is written purely in javascript. If your website has plugins/customizations/extensions that crash or otherwise interfere with javascript, it's not going to be pretty.

As a first step troubleshooting, I recommend disabling all plugins, etc. on your website. You can find more tips in the troubleshooting CiviCRM javascript guide.
> 0 votes

---
Tags: civimail, 4.6.2
---


# Question
Title: Is there any simple way to replicate sections in CiviMail message templates?
Is there any simple way to replicate sections of email templates (for example, a section corresponding to one story) without having to copy and paste and guard to catch all the tables and other elements in the section?

MailChimp solves it with a property repeatable http://templates.mailchimp.com/getting-started/template-language/

# Answer
At this year's Denver sprint or con, Veda consulting demoed a working extension. The core stuff is supported by the upstream editor itself, so I don't think any smarty hacks were required. That's the limit of my knowledge though — I wasn't there. Hopefully we'll get to see it for 4.7 if not before.

Here is the code: https://github.com/veda-consulting/uk.co.vedaconsulting.quickbulkemail

It also seems to simplify bulk mailing, but does not appear to be compatible with 4.6.

In 2016, they developed an extension to integrate mosaico.io into civicrm. See more about it here: https://civicrm.org/blogs/parvez/a-new-beginning-for-civimail%E2%80%A6
> 2 votes

# Answer
You should be able to do this in Smarty via either the "assign" or "capture" custom functions. Check:

http://www.smarty.net/docsv2/en/language.builtin.functions.tpl#language.function.capture

http://www.smarty.net/docsv2/en/language.custom.functions.tpl#language.function.assign
> 1 votes

---
Tags: civimail, templates
---


title: CIVI Volunteer data

text:
# Question
Title: CIVI Volunteer data
Where do I find the Volunteer Signup Data?

I created a new event, used CiviVolunteer to schedule volunteer slots.

But when I go to Manage Events \> My Event \> Participants, there's nothing there.

I can't find a record of it anywhere except in the contact's Activity list.

# Answer
I found that you can go to \>\>\> Contacts \>\>\> Contact Reports \>\>\> Volunteer Reports.

That'll give you a table listing all of the volunteers and the events that they've signed up for.

Also, when that reports table opens up, there's a toggle button at the top - "Access"

If you hit that, you can add this report as a menu item which is handy. I added mine to the Events main menu.
> 2 votes

# Answer
You can go to the **Volunteers** tab of your event to view, manage, and record hours for the registered volunteers. Note that volunteers and participants are different (although it's possible for one person to both volunteer *and* participate, in which case they'd show up in both places).
> 1 votes

---
Tags: civivolunteer
---


# Question
Title: GitHub repository location for Import scripts via Kettle
In post: http://forum.civicrm.org/index.php?topic=35438.0

JonGold states that he'll share the import scripts for using Kettle to import via cli.php and then tag the new imports, again using cli.php. Unfortunately I haven't found a link. Anyone have that link? (I've sent a PM to JonGold, but also said I'd create the question so that he could reply to the now locked post.)

# Answer
check the repo located here, you might need to search the repo further: https://github.com/PalanteJon/civicrm\_kettle\_transforms
> 4 votes

---
Tags: import
---


# Question
Title: Why are my contacts' name and email empty?
I have many contacts with no first name, last name, or email. I don't know what my client has done to this site.

I viewed the records and they contain only id and sub-contact type.

Edit: I also tried the suggestion by Heather O. and looked at the Change Log.

I added one contribution where the external id there is not in my system but no new records have been created.

Do you have any idea?

# Answer
> 4 votes
I'd recommend clicking on one of the records and seeing what information is there. Presumably there is something, custom data or an activity or relationship.

I have seen this happen on imports that haven't been thought through. So for example, if you're using an external id to match contacts records on an activity import and there isn't a matching external id in CiviCRM, a new records will be created with only the external id on and activity.

# Answer
> 1 votes
I get this using import contacts to update contacts, usually to update addresses after we get back the results from NCOA. As far as I can tell it created the contact record and nothing else. They aren't connected to anything. My suspicion is the file has both households and individuals in it, so I run it twice since even for update you have to specify individual or household. I just tried it and, of course, didn't duplicate the issue.

# Answer
> 1 votes
thanks to all,

i have found , the cause is : i try to update contacts via import ( update ), with the contacts data i will import only have external identifier.

actually we can import contact by update ( contact -\> import contact -\> select update ) which do not have first name and last name.

regards, henro

# Answer
> 0 votes
I had that kind of problem when synchronising contacts with users (CiviCRM/Drupal). Some user accounts seems to be wrecked and it generated empty contacts.

---
Tags: contacts
---


title: Confusion over Contacts and Profiles

text:
# Question
Title: Confusion over Contacts and Profiles
I am sure I am just confused about profiles and was hoping someone could clarify a few things for me. We run a non-profit that assists foster children in our community. I am attempting to set up profiles for:

Foster Parent: First name Last name etc

Foster Child: First name Last name etc.

These should be 2 different contacts with a relationship between the 2.

I thought I did it correctly, however, I am now setting up an event where the foster parent would register the child. I am using both profiles on the form but the form (and added contact) use the first and last name of the foster parent and list it as the same name as the child. It's as if both profiles are combining to make one person when they should be separate. What am I doing incorrectly?

# Answer
The design of profiles is that they will only collect information about a one contact. (Even when you use multiple profiles, everything is updated on one contact)

Your question about how to collect information about multiple contacts at once has already been answered at: How to allow parents to register children but still record their own info
> 3 votes

# Answer
I assume you are using Wordpress or Joomla and so need to use profiles? If you are using Drupal I would recommend you use the Webform CiviCRM module to build the required forms.
> 0 votes

# Answer
I am using Joomla. While working with it, I figured out the custom fields portion of it to capture the information from the parent. I had hoped to capture both profiles as separate contacts as there will likely be future registrations from the same people. I just wasn't sure if I was properly grasping "profiles". I can work with the custom fields as a work around. Thank You for the answers and guidance.
> 0 votes

---
Tags: contacts
---


# Question
Title: CiviMail html format splits images and text
On the preview the email looks as it should, with pictures and formatted text, when i test email all of the pictures will appear above the text completely separated.

# Answer
Most email clients only accept a limited subset of html tags, and many do not respect `style` attributes. If your image markup looks like `<img style="float:right"...` try changing it to `<img align="right"...`
> 3 votes

---
Tags: civimail
---


title: Problem with navigating search results

text:
# Question
Title: Problem with navigating search results
Working on a site running civicrm 4.4.11

Using Find Contacts to find contacts of type "organisation"

Returns 1206 contacts paged over 25 pages.

We can use forward and back to navigate between results pages, but when using the option go to page x/25. Sometimes the search results disappear and it returns to the find contacts page with the error message

> No matches found for: Contact Type - 'Organization'
>
> Suggestions:
>
> check your spelling try a different spelling or use fewer letters if you are searching within a Group or for Tagged contacts, try 'any \>group' or 'any tag' add a New Individual, Organisation or Household make sure you have enough privileges in the access control system

I've tried flushing the drupal and civicrm caches, and still get the error.

Anyone got any suggestions?

Cheers

Craig

# Answer
> 2 votes
This is a known bug in 4.4 (CRM-16056). I fixed this in Civi 4.6. If you can't upgrade for whatever reason, it's a very simple fix.

# Answer
> 0 votes
As Jon said it's a known issue in 4.4, fixed in 4.6. You can backport the fix to a previous version by applying the following patch:

https://patch-diff.githubusercontent.com/raw/civicrm/civicrm-core/pull/5365.diff

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


# Question
Title: Custom code that sets custom field value stopped working in 4.6
I have some code in a custom module (in the civicrm\_pre hook) that sets a custom field value, using the function `CRM_Core_BAO_CustomValueTable::setValues`

Here's a print\_r of the parameters it is passed in an example case:

```
(
    [entityID] => 1202
    [custom_133] => foo
)

```

The field is not being set. Before upgrading to 4.6, it was working. There is definitely still a custom field with id 133 on the entity. Here's the documentation - is it outdated now, or should it still work?

http://wiki.civicrm.org/confluence/display/CRMDOC/Setting+and+getting+custom+field+values+from+within+hooks

Edit: The output of `CRM_Core_BAO_CustomValueTable::setValues` is:

```
(
    [is_error] => 0
    [result] => 1
)

```

So it thinks it has worked, but it hasn't. The new value is not written to the database table.

# Answer
I don't believe that the document you referenced is current best practice - it should probably be rewritten! Using the BAO rather than the API to set values greatly increases the chance that an upgrade will break someone's custom extension.

You can troubleshoot the BAO code. There's certainly something that could be done to make it work (assuming the issue is the code, and not that the hook is no longer firing). However, I'd suggest rewriting the BAO call as an API call instead. Something like this (assuming the custom field is attached to a Contact entity, otherwise change appropriately):

```
$params = array(
  'version' => 3,
  'custom_133' => 'foo',
  'id' => 1202,
);
$result = civicrm_api('Contact', 'create', $params);

```
> 3 votes

---
Tags: hooks, 4.6.2, custom-fields
---


# Question
Title: New CiviMail does not use the 'CMS editor' set in 'Display settings'
We recently upgraded to 4.6.2 but CiviMail does not present the Joomla Default WYSIWYG editor like it did in previous versions but only displays the CKEditor.

We are using JCE editor and it's ability to more easily upload and manage images worked well.

Also, the CKEditor is throwing a 404 error when I try to 'Browse Server' for an image, (Send it to the server doesn't work either).

This all means that it is a bit difficult for users to add images to mailings.

Is there any way of getting the new civimail to use the default CMS WYSYWIG like before?

Cheers,

Dave

# Answer
My understanding is that the new CiviMail approach necessitated disabling the "use CMS default" option for WYSIWYG. The new preferred approach is CiviCRM extensions to implement other WYSIWYG editors - it took about an hour to create the first WYSIWYG extension for CiviCRM, and others can build even quicker, using that extension as a guide. You can find it here: https://github.com/relldoesphp/com.aghstrategies.tinymce
> 2 votes

---
Tags: civimail, joomla, wysiwyg
---


# Question
Title: Recurring Donation Email Issues with iATS payment processor
I'm trying to get our recurring donations up and running and I've run into some difficulties. When an admin sets up a recurring donation, Civi send the receipt for the first donation in the series just right, however it doesn't include the recurring donation management information. If we set up a donation through the online form, the series is created, and it works, but no email is sent. Any future processed donations don't send an email either. Email is working through Civi for everything else. Here are the site details:

WordPress 4.2.1
CiviCRM 4.5.8
Payment Processor: iATS using the iATS extension (CiviCRM iATS Payment Extension)
Using Mandrill as SMTP sending agent

# Answer
> 4 votes
It's because iATS does not do IPNs. It's not specific to iATS (it affects all processors that don't do IPNs - and that number has been growing).

---
Tags: email, receipts, recurring-contributions
---


# Question
Title: What's the difference between a pledge and a recurring donation?
What's the difference if I set up a recurring payment for $100/month versus a pledge for $100/month?

Why should I use one method versus the other?

# Answer
> 4 votes
CiviCRM allows pledges to be recorded for promises of future payments. This is commonly done for future expected donations for capital campaigns. In most cases, 'pledges' are not things that people are obligated to pay, and so they should not be recorded as accounts receivable for bookkeeping purposes. The courts in some US states are starting to recognize pledges as contracts that can be enforced, but this is not case in Canada or most states (see http://drache.ca/articles/unpaid-pledges/). Only when a payment is received against a pledge is the amount recorded as revenue to the appropriate account (eg Donations or Campaign Contributions) and as having been deposited into the appropriate asset account (eg bank account or payment processor account or cash and cheques on hand).

By contrast, when a recurring payment is set up, the contact authorizes the organization using CiviCRM to be paid those future payments, eg from a credit card, a bank account associated with a debit card, or some other payment instrument. This makes it reasonable to record the future income from recurring payments as accounts receivable immediately, which will be the case starting in 4.7. When those payments are received, accounts receivable will be reduced by the payment amount and the appropriate asset account will have the funds credited to it.

Simplifying a bit, if you have an automated method of receiving payments, then you should set this up as a recurring payment. But if you may or may not receive the payments (for example, you are dependent on the donor to send in a cheque each year), then you should setup a pledge.

While it is true that a donor can cancel a recurring payment (whether setup through ARB, ACH, etc.), this doesn't change the fact that they have made a legal agreement to pay the monies. If they do ask to cancelling a recurring payment, then CiviCRM will reverse the accounts receivable at that point in 4.7. (If the recurrence does not have an end date, then the system keeps the accounts receivable accurate for the coming 12 months, and those 12 months will be reversed at the time of a cancellation.)

# Answer
> 4 votes
In simple terms, if the person is planning to pay by an unknown or manual process (check, cash, bookkeeper manually recording payment as they see it on a bank statement) then you will use a pledge in CiviCRM.

If the person is going to pay using a CiviCRM payment processor that offers recurring (such as credit cards/ACH via iATS or Authorize.net, etc) then you will need to use a recurring contribution in CiviCRM.

In theory, the legal obligation for the donor/member to make all payments should be considered. However, in practice the mechanism of payment is what determines the use of pledge vs recurring contribution. (at least in all stable versions of CiviCRM)

---
Tags: civicontribute, pledges, recurring-contributions, accounting
---


# Question
Title: How do I add custom fields to Personal Campaign Pages
I bet that's a question that some people have asked before!

The answer is you can't currently.

But how would someone add this capability?

# Answer
This diff is against 4.5.0 . It doesn't display the custom field values on the PCP view page, but it adds the capability to create custom field groups on PCP entities, and save values on add/edit pages.

```
diff -r original/civicrm/CRM/Core/BAO/CustomGroup.php new/civicrm/CRM/Core/BAO/CustomGroup.php
1102a1103,1104
>       case 'Pcp':
>         $tableName = 'civicrm_pcp';
1168a1171
>       case 'Pcp':
1521a1525
>
1698a1703,1704
>       case 'Pcp':
>         return 'civicrm_pcp';
1721a1728
>
diff -r original/civicrm/CRM/Core/SelectValues.php new/civicrm/CRM/Core/SelectValues.php
179a180
>       'Pcp' => ts('Personal Campaign Pages'),
diff -r original/civicrm/CRM/Custom/Form/CustomData.php new/civicrm/CRM/Custom/Form/CustomData.php
54c54
<   ) {
---
>   ) {
145c145
<     }
---
>     }
diff -r original/civicrm/CRM/PCP/BAO/PCP.php new/civicrm/CRM/PCP/BAO/PCP.php
85c85,92
<
---
>     //start custom field code addition
>     //store custom data
>     if (!empty($params['custom']) &&
>       is_array($params['custom'])
>     ) {
>       CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_pcp', $dao->id);
>     }
>     //end custom field code addition
diff -r original/civicrm/CRM/PCP/Form/Campaign.php new/civicrm/CRM/PCP/Form/Campaign.php
63a64,87
>
>     //start custom field code additions
>     //check for custom data type.
>     $this->_cdType = 'Pcp';
>     $this->assign('cdType', FALSE);
>     if ($this->_cdType) {
>       $this->assign('cdType', TRUE);
>       $this->set('type', 'Pcp');
>       $this->set('entityID', $this->_pageId);
>       $this->set('cgcount', 1);
>       CRM_Custom_Form_CustomData::preProcess($this);
>     }
>     //end custom field code additions
>
>         // when custom data is included in form.
>     if (!empty($_POST['hidden_custom'])) {
>       $this->set('type', 'Pcp');
>       $this->set('entityID', $this->_pageId);
>       $this->set('cgcount', 1);
>       CRM_Custom_Form_CustomData::preProcess($this);
>       CRM_Custom_Form_CustomData::buildQuickForm($this);
>       CRM_Custom_Form_CustomData::setDefaultValues($this);
>     }
>
70c94,99
<
---
>     //load only custom data defaults.
>
>     if ($this->_cdType) {
>      $defaults = CRM_Custom_Form_CustomData::setDefaultValues($this);
>     }
>
93c122
<
---
>
103a133,140
>     $this->assign('customDataType', 'Pcp');
>     $this->assign('entityID', $this->_pageId);
>
>     if ($this->_cdType) {
>       CRM_Custom_Form_CustomData::buildQuickForm($this);
>     }
>     //lets assign custom data type and subtype.
>
229c266,274
<
---
>
>        //process custom data.
>     $customFields = CRM_Core_BAO_CustomField::getFields('Pcp', FALSE, FALSE);
>     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
>       $customFields,
>       $this->_pageId,
>       'Pcp'
>     );
>
232d276
<
Only in new/civicrm: groupcountsearch.txt
diff -r original/civicrm/templates/CRM/PCP/Form/Campaign.tpl new/civicrm/templates/CRM/PCP/Form/Campaign.tpl
97a98,120
>
> {* load the custom data *}
> {if $cdType}
>     {include file="CRM/Custom/Form/CustomData.tpl"}
> {else}
>
> {* include custom data js *}
> {include file="CRM/common/customData.tpl"}
>
> {literal}
> <script type="text/javascript">
>   CRM.$(function($) {
>     {/literal}{if $customDataSubType}
>       CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
>     {else}
>       CRM.buildCustomData( '{$customDataType}' );
>     {/if}
>     {literal}
>   });
> </script>
> {/literal}
>
> {/if} {* load custom data *}
99a123
>

```
> 5 votes

# Answer
Since you have a working patch for this feature, you can share your changes with the rest of the community by submitting a Pull-Request to CiviCRM:

1. Use buildkit to create a local sandbox site for yourself, based on the master branch.
2. Create a new branch
3. Apply your patch
4. Push the branch to your fork on github
5. Click the "Compare & Pull-Request" button on github.
> 0 votes

---
Tags: custom-fields, personal-campaign-pages
---


# Question
Title: CiviMail pull-downs not displaying correctly
After upgrading to 4.6.2, the pull-down menus are not displaying correctly in the Define Mailing window. Each pull-down is displaying as two separate elements.

I have attached a screen shot and the section of HTML which corresponds to the template selection window.

By the way, I implemented the PRs relating to issue CRM-16277.

Any ideas? Thanks.

Screenshot:

HTML:

```
    <div ng-controller="MsgTemplateCtrl" class="ng-scope">
   <div class="select2-container ng-pristine ng-untouched ng-valid ng-isolate-scope" id="s2id_crmUiId_5">
      <a href="javascript:void(0)" class="select2-choice select2-default" tabindex="-1">   <span class="select2-chosen" id="select2-chosen-6">Message Template</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen6" class="select2-offscreen">{{crmUiField.title}}*</label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-6" id="s2id_autogen6">
      <div class="select2-drop select2-display-none crm-container select2-with-searchbox">
         <div class="select2-search">       <label for="s2id_autogen6_search" class="select2-offscreen">{{crmUiField.title}}*</label>       <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-6" id="s2id_autogen6_search">   </div>
         <ul class="select2-results" role="listbox" id="select2-results-6">   </ul>
      </div>
   </div>
   <select crm-ui-id="subform.msg_template_id" name="msg_template_id" crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Message Template')}" ng-model="mailing.msg_template_id" ng-change="loadTemplate(mailing, mailing.msg_template_id)" class="ng-pristine ng-untouched ng-valid ng-isolate-scope" id="crmUiId_5" tabindex="-1" title="{{crmUiField.title}}*">
      <option value=""></option>
      <!-- ngRepeat: frm in crmMsgTemplates.getAll() | orderBy:'msg_title' -->
      <option ng-repeat="frm in crmMsgTemplates.getAll() | orderBy:'msg_title'" ng-value="frm.id" class="ng-binding ng-scope" value="133">

[removed list of options]

  <!-- end ngRepeat: frm in crmMsgTemplates.getAll() | orderBy:'msg_title' -->
   </select>
   <a crm-icon="disk" ng-click="saveTemplate(mailing)" class="crm-hover-button ng-isolate-scope" title="Save As"><span class="icon ui-icon-disk"></span> </a>
</div>

```

# Answer
I suggest you start by going through the steps for troubleshooting javascript in CiviCRM.
> 1 votes

# Answer
Thanks Coleman. I guess that I did something wrong when making the Pull Request changes for issue CRM-16277, but I can't find the problem. I wasn't even sure which of the six PR changes to make, so it's maybe not surprising that it didn't work. Looks like we will have to abandon CiviMail until 4.6.3.
> 0 votes

---
Tags: civimail
---


# Question
Title: Why are donations left as "pending" in CiviCRM when they went through in Paypal?
Sometimes when we get an online donation, the record remains in the "pending" state in CiviCRM even though the payment went through successfully in Paypal. This happens for maybe 1/3 - 1/2 of donations. Is there a solution for this, a way to make sure they are always marked "Completed"?

# Answer
The way it works with paypal standard is that paypal informs civicrm that the payment has been done in the background via IPN (instant payment notification)

It means that paypal is sending information to a specific page on civicrm with the proper data (eg this payment has been successful) then your server sends these information back to a specific page on paypal to check it's a genuine confirmation and paypal returns a page that confirms it's one

Something in the chain isn't working sometimes. It might be a firewall, your site too loaded, connection issue...

Did you check the log? are you using drupal?
> 4 votes

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


# Question
Title: Does CiviCRM VERP work with a mailbox on Microsoft Small Business Server 2011?
If an organization is using Microsoft SBS 2011, can they configure it to support Variable Envelope Return Path (VERP) for the required CiviMail mailbox(es)? What implications will this have on bounce handling if not?

# Answer
> 2 votes
No version of Exchange supports subaddressing.

# Answer
> 1 votes
It shouldn't be too complicated to modify civicrm to be able to process bounces without VERP:

We've added the same information that the VERP contains (basically who was the intended recipient) into the header of the message.

Most (but **not** all mail servers return these into the bounce notification message).

So if:

* you add a config "no VERP"
* you modify the smtp code to not add the VERP (so instead of bounce+blabla@example.org, just bounce@example.org)
* you modify the parsing code for bounce messages to read the blablabla both from the mail address or from the header

It should work for **most** recipients mail servers, from the (dis)comfort of your exchange server.

PR welcome and all that

---
Tags: civimail
---


# Question
Title: What is the default data encoded in the Bar Code / QR Code?
What is the default data encoded in the Bar Code / QR Code?

Is it possible to modify this data to use for event check in? i.e. on quick scan event participant status changes from registered to attended.

# Answer
It contains a single number: 42. At least on all the civicrm installation that have a "DON'T PANIC" on the cover

On the others it's contact id + participant id + url to the participant view in your civicrm

There is a hook to alter what's encoded in the QRcode alterBarcode that you can implement from an extension and put something else (eg the name of the participant in clear)

Beware that there is a limit of how much text that you can put in a QR. Last time I checked, the proper way of formatting the content (eg. vcard if you want to put the contact details) so it was understood by all smartphones was a bit of a hit and miss.

Would be great you update us on the state of the art and what works or doesn't
> 2 votes

---
Tags: civievent
---


# Question
Title: How to create a custom action within context of the current record
My goal is to display a link or button for a given participant record on the Events tab of a contact record (or possibly within the More link in participant search results). On click, it will open a screen with an editable message template pre-loaded that can be emailed or printed to PDF. The template would contain a token to be filled based on a parameter that is the value of a custom participant field. The token's data is based on a SQL query, from whose results I'll create an HTML table to display a participant invoice.

I'm guessing I'll need to write a custom token, but there are several other components at play required to make this happen. SQL is my thing, so that part is done. But I'm middling in PHP, and fairly novice in Civi extensions. What is the "right" way for me to attack this problem? Are there any complete examples of the parts involved in this, i.e. creating a contextual link, loading a screen with a message template, having a participant context for my custom token in order to get proper query results, anything else I'm forgetting?

# Answer
civix is a cli tool that will help you a lot to write that extension. you will have to:

* write a hook to get that extra token
* add a page to let the user add the custom message (civix generate:page once you have generated the extension)

Instead of a token, it might be easier to generate the html and merge your html table, the custom message and a template and send it as a mail (or generate the pdf)

As for the custom link, it depends on which screen and how you want to add it, we might have already a hook to add an extra action, or you can use a hook when the form/page is generated to add the needed buttons/links.
> 1 votes

---
Tags: api
---


# Question
Title: How to allow multiple values on a civicrm contextual filter in drupal views
I have a drupal view that shows aggregated totals grouped by user from civi contribution pages.

The view has a contextual filter that takes the contribution page id as an argument.

The view works well if I pass in one argument.

I would like to be able to pass in multiple arguments, so, display contributions from contribpageID1 AND contribpageID2.

On contextual filters with drupal fields I am able, in the "more section", to select "Allow multiple values". This option isn't available on the `CiviCRM Contributions: Contribution Page` field.

Is this a limitation of the civi views integration? Or a setting I can't find.

Below is the query being run:

`SELECT SUM(civicrm_contribution.total_amount) AS civicrm_contribution_total_amount
FROM
{civicrm_contribution} civicrm_contribution
WHERE (( (civicrm_contribution.contribution_page_id = '12') )AND(( (civicrm_contribution.financial_type_id IN ('1')) AND (civicrm_contribution.contribution_status_id IN ('1')) AND (civicrm_contribution.is_test = '0') AND (civicrm_contribution.receive_date >= '2014-12-31 00:00:00') AND (civicrm_contribution.receive_date <= '2015-12-31 00:00:00') )))
LIMIT 20 OFFSET 0`

On line 5, I want it to say ...`_page_id = '12,15')`...

Aggregation is turned on but the option is not there when this is turned off either.

# Answer
It's a limitation in CiviCRM views implementation.

If you are a developer and know views api, i encourage you to propose a patch for this. You can find all the code in `drupal/modules/views/civicrm.views.inc` or `https://github.com/civicrm/civicrm-drupal`

More precisely, the function `civicrm_views_get_argument` return a `views_handler_argument_numeric` for all numeric data type. You might want to try changing that to `views_handler_argument_many_to_one`. But it's really a guess : i don't know if it will work and even less if it will work for every fields.

Otherwise, still with some programming knowledge, you could do a drupal module that implements hook\_views\_query\_alter but it's more a drupal question.
> 1 votes

---
Tags: civicontribute, drupal, drupal-views
---


# Question
Title: constituent detail report not working (timeout)
I am using CiviCRM 4.5.8, an instance with 18,328 contacts.

No matter how long I set the max execution time of a page, I am getting a timeout when trying to view the constituent detail report (instance 2). The other reports all work fine.

Has anyone ever experienced this? Can anyone think of a reason this might be happening? The PHP error logs are showing nothing but a timeout, and the CiviCRM log is showing nothing.

**Update:** It seems to be related to Activities. If I create a new report based on constituent detail, and uncheck all the activity columns from being used, then the report is produced ok. If I check one column to do with activities again, then it stops working and times out.

# Answer
1. How many activities do you have (i.e. the number of rows in the activity table)
2. Where are you hosting the site
3. Is your database on the same server as the web server

If i had to guess, i suspect your activity table is quite large and the left join with the contact tables is basically causing the query to take forever and hence the timeout
> 1 votes

---
Tags: civireport
---


title: Localisation settings not saving

text:
# Question
Title: Localisation settings not saving
I'm running civicrm on a joomla 2.5 site and recently tried to update my localisation settings which at first appear to save but the new settings are not saved, it reverts to the default settings each time. I then clicked on enable multiple languages and since then I can no longer access CiviCRM at all in my admin panel - I just get the message: "Sorry but we are unable to provide for this at the moment. DB error: no such field. Return to home page"

Help!

# Answer
If you interrupt the process while CiviCRM is creating the multilingual mode, you could have a corrupted database.

If you don't have access to civicrm anymore, the best way is to reload a backup of the database as mentionned by Laryn.

If you don't have any backup, i guess you could try reset the database to a monolingual by calling the function :

```
CRM_Core_I18n_Schema::makeSinglelingual($locale_to_keep)

```

with `$locale_to_keep = 'en_US'` or `'fr_CA'`...

You need to build a standalone script for this.
> 1 votes

---
Tags: joomla, localisation, i18n
---


# Question
Title: Why are subsequent recurring contributions not recorded?
It seems that only the 1st contribution in a recurring series is recorded in CiviCRM, and the others have to be noticed and entered manually. Is there any way that someone has found to fix this problem?

# Answer
You need to set an IPN. Instructions are here. Basically, PayPal needs to send a payment notification (an IPN) to CiviCRM every time they process a payment, so that Civi knows to update the record. You need to tell PayPal what URL to send those IPNs to. In my experience, PayPal does NOT automatically find the IPN address - so find the exact path to `civicrm/extern/ipn.php` in your path and supply THAT to PayPal for IPN. Also note that PayPal changes their interface all the time, so the place in the PayPal control panel where you enter the IPN URL might have moved.
> 3 votes

# Answer
There is a specific cron job for recurring contributions, which is filling in pending contributions as time progress.
> 0 votes

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


# Question
Title: Undefined offset: 1 in CRM_Utils_Check_Security->guessUrl()
```
Notice: Undefined offset: 1 in CRM_Utils_Check_Security->guessUrl() (line 330 of /home/saintfran/www/www/sites/all/modules/civicrm/CRM/Utils/Check/Security.php).

```

I found the following on the issue queue and the old forums but they say they are fixed and that it's related to windows. I'm not on a windows machine. I'm hosted on civihosting with 4.6.2.

https://issues.civicrm.org/jira/browse/CRM-15214 http://forum.civicrm.org/index.php?topic=32544.0

# Answer
So I think I found the fix.

I had my Images directory under Admin=\>Directories to the following: /home/my\_site/www/www/civi\_images

The Image Upload URL under Admin=\>Resource URLS to the following: https://saintfrancisocc.org/civi\_images

When I upgraded to 4.6.2 is when I started getting the error. I checked that line in the Security.php file and it referred to the uploadurl as samuelsov stated. So I thought I'd try changing that to something else and see if it fixed it.

I changed the Images director under Admin=\>Directories to the following: /home/my\_site/www/www/sites/default/files/civicrm/civi\_images/

And changed the Image Upload URL under Admin=\>Resource URLS to the following: https://saintfrancisocc.org/sites/default/files/civicrm/civi\_images/

I went and refreshed and no more error. So it appears that civi 4.6.2 doesn't like the upload directory to be at the root
> 3 votes

# Answer
The function `CRM_Utils_Check_Security->guessUrl()`, as far as i understand, is only used to check if there is security problem in the configuration of your upload path.

It's seems to be a bug, but not one that as any impact on CiviCRM functionality. I don't think it could lead to a problems like access denied or something like that.
> 1 votes

---
Tags: debugging
---