# Question
Title: How to sort a varchar numerically using the api
I'm trying to find the activity\_type with the highest value, so I can ++ that value and insert a new activity type. I thought this would be easy.

I cannot sort on the "value" column of the `option_value` table because it is a varchar column containing (in this case) numbers. Take the following api call:

```
civicrm_api3('OptionValue', 'getsingle', [
  'option_group_id' => 'activity_type',
  'options' => ['sort' => 'value DESC', 'limit' => 1]
]);

```

This ought to return the activity type with the highest value. However, it returns "9" because I guess mysql thinks the string "9" \> "62" (which is the actual max in my sandbox).

Anyone have a good approach to suggest?

# Answer
> 2 votes
I see if we try to modify the sort col with any sql defined functions, it gets returned with the Error Message. For Eg - `['sort' => 'CAST(value AS decimal) DESC']` returns

> Unknown field specified for sort. Cannot order by 'CAST(value AS decimal) DESC'.

Maybe, there should be some modification in `CRM_Utils_Rule::mysqlOrderBy()` to either handle such cases.

Or we can simply use `get` instead of `getsingle` and then order the returned result values using array functions.

---
Tags: api
---


# Question
Title: How do I make a CiviEvent accessible to the public?
After I create an event in CIVI where does it then go? How can outsiders find out event? I participated in a class the other day and was successful at the application but now that I have created the event I am unsure how to find it and how others can find it to register. Thank you kindly.

# Answer
By default CiviCRM events aren't publicised online. To make the event public you need to tick the box for online event registration.

See the user guide for more details: Online event registration
> 1 votes

---
Tags: civievent
---


# Question
Title: Any organisation in London that would be willing to show us funtionalities of CiviCRM ?
I am trying to promote civiCRM at my governmental organisation in London and I would be very grateful if I could visit another organisation that uses several functionalities to see how it works live. Mailing and campaigning are the most important features for us. Thank you all for your time. Romina.

# Answer
> 2 votes
Pleased to hear that you want to promote CiviCRM!

This may not be the best place to ask this question. You may have better luck on the CiviCRM chat site.

Alternatively you could search for a CiviCRM partner based in London and ask if they can help.

You may also be interested in the CiviCRM meetup in London.

Of course there are also the demo sites if you want to try it out for yourself.

I hope that helps. Good luck!

---
Tags: civimail, civimember, evaluating-civicrm, civicampaign
---


title: CiviEvent, group by relationship

text:
# Question
Title: CiviEvent, group by relationship
I'm currently setting up CiviCRM for a dance institution. They want to create an event for each lesson (weekly) and use CiviMobile on an iPad or something similar to manage attendance.

Now there's a need to group dance partners together. To this end I've set up an extra relationship called 'Dancepartner of' to tie them together.

An example:

* Marie dances with Peter
* Kate dances with Micheal
* Emma dances with Adam

I would like the event participants view to look like:

* Marie
* Peter
* Kate
* Micheal
* Emma
* Adam

I think an SQL join for the relations and a GROUP\_BY would do the trick but I have no idea where to begin coding this.

Can anyone point me in the right direction of am I going about this all wrong and should I perhaps use groups ?

Thanks in advance,

# Answer
CiviMobile (new version) works nicely for checking people into an event, but I think it's going to do its own sorting regardless of anything you display in the normal Civi GUI.

If you're on Drupal then a view using the DancePartner relationship with a VBO might do what you need to display the partners and register attendance.

Do you want to register and check in individuals or couples?

If you are more interested in couples, then you could potentially repurpose/abuse 'household' as 'dance partnership' since you can register households as event participants. You could then use CiviMobile and check in the 'Marie & Peter partnership' household. You would need to check the rest of your workflow but it fits the objective of checking in a couple via CiviMobile.
> 2 votes

# Answer
Thank you all for helping me. I've decided to go a different route and started messing with reports and I was able to group dancepartners together using a SQL join.

I duplicated an existing report (attendee list) and modified the SQL WHERE clause to this:

```
  public function from() {
    $this->_from = "
        FROM civicrm_participant {$this->_aliases['civicrm_participant']}
             LEFT JOIN civicrm_relationship contact_a_relation
                        ON (participant_civireport.contact_id = contact_a_relation.contact_id_b )
             LEFT JOIN civicrm_relationship contact_b_relation
                        ON (participant_civireport.contact_id = contact_b_relation.contact_id_a )
             LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']}
                    ON ({$this->_aliases['civicrm_event']}.id = {$this->_aliases['civicrm_participant']}.event_id ) AND
                        {$this->_aliases['civicrm_event']}.is_template = 0
             LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
                    ON ({$this->_aliases['civicrm_participant']}.contact_id  = {$this->_aliases['civicrm_contact']}.id  )
             {$this->_aclFrom}
             LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
                    ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND
                       {$this->_aliases['civicrm_address']}.is_primary = 1
             LEFT JOIN  civicrm_email {$this->_aliases['civicrm_email']}
                    ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
                       {$this->_aliases['civicrm_email']}.is_primary = 1)
             LEFT  JOIN civicrm_phone  {$this->_aliases['civicrm_phone']}
                     ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
                         {$this->_aliases['civicrm_phone']}.is_primary = 1
      ";

```

After that, I disabled to GROUP BY statement and that gave me the reports I want. I'm fairly confident that this will also work with the CiviMobile pages.

I've used this blogpost to get me started: https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/

Thanks again!
> 2 votes

# Answer
Does this have to be the actual event participants view, or just available somewhere? You could create a report (use the "Relationship Report" template under "Contact Reports") which would then show the names side by side.

You could filter it to just the event participants either by creating a smart group, or by setting up the event registration process to automatically put the attendees in a group.

(You might get duplication though, because both members of the couple are participants)
> 1 votes

# Answer
You might consider a participant custom field for partner. It would be a contact reference, and you could fill it with the partner's name. The field isn't reciprocal, so you'll need to manually confirm that if Marie's partner is Peter, Peter's partner is Marie. However, you should be able to get this into a stock participant report without much difficulty.
> 0 votes

---
Tags: civievent, groups, relationships
---


# Question
Title: How to create a custom field for a file upload, and make it private
We would like to create a custom field in CiviCRM for a file upload, and link it to the CiviCRM Webforms Integration module while at the same time keeping it "private" and is not publicly accessible.

Is there a way to do this in CiviCRM? Or maybe this is a default behaviour and files uploaded to CiviCRM are kept private? (Not accessible from the web directly etc..).

Thanks in advance for any help,

# Answer
CiviCRM files are never directly web-accessible. If you are also using Webform integration to submit the file, then a copy of the file is also stored in Drupal. You could either make your Drupal files private (this is a Drupal setting) or you could implement a hook to delete the files from Drupal after they are uploaded.
> 5 votes

---
Tags: custom-fields, webform-civicrm, files, filesystem
---


# Question
Title: Add Civilcrm member detail in third party tcexam
I was working in a drupal civicrm. I made a contribution for the course and succeed in a payment, but I have to update the data in the third party like tcexam. Is there a way that we can add a member details in the tcexam after success payment process in civicrm.

# Answer
> 1 votes
You can do this, but you need to be a programmer, or hire one.

CiviCRM is well suited to this, TCExam is not because it has no API. If they both live on the same server, that's not too bad though.

Write an extension for CiviCRM that uses hook\_civicrm\_post. When a completed contribution is added, make a connection to TCExam's SQL database and insert a new user record.

Instructions for writing an extension are available here and here.

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


title: CiviCRM Webform membership Payments

text:
# Question
Title: CiviCRM Webform membership Payments
I have multiple contacts in a webform (a family). Each contact can have a membership type with an associated fee. I want each contact to be have their membership renewed and the fee associated with their contact record and membership. What's happening at the moment is that the sum of membership fees is being charged to the primary contact (the one submitting the form). All individual memberships are being correctly renewed but without the associated membership fee attached to the membership record. I have soft credit set to none.

I have been unable to see where I am going wrong.

# Answer
> 2 votes
I think Webform is behaving correctly. The memberships are being renewed and a single payment is being recorded - that accurately reflects what happened when the form was submitted (it was one payment by one person, not several).

---
Tags: civimember, webform-civicrm
---


# Question
Title: In civivolunteer, is it possible to allow multiple users for 1 email?
Quick info:

* Wordpress: 4.7.1
* CiviCrm: 4.7.15
* CiviVolunteer 4.6-2.2.1

We are working with a group of often older volunteers that may only have one email address for two or more people. Is there a way to allow them to register under this same address? Currently, the system automatically replaces the name for anyone that has the same email address, making it difficult to sort the volunteers out.

# Answer
The short answer: Yes, it's possible.

You're asking about the "Unsupervised Dedupe Rule" - that is, the test to determine whether a contact who fills out a public-facing form is a duplicate of someone already in the database.

Documentation can be found here, and I definitely suggest reading it before making changes. However, the general idea is to make up a different dedupe rule (e.g. "same email AND same first name" might be better in your case). Then go to **Contacts menu » Find and Merge Duplicate Contacts**, create the new rule, and make it the new "Individual Unsupervised" dedupe rule.
> 3 votes

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


# Question
Title: Contribution count does not reflect number of contributions
I have just noticed that the contribution count does not equate to the number of contributions. I have not been able to narrow down the circumstances.

# Answer
From the screenshot, it seems like the first contribution is done via test mode.

FYI, test contributions are not included in the count on the tabs. Though not sure why the second one is not included. Can you add a little more information for the second row of how it is done, civi version etc ?

Update: Also make sure the `financial_type_id` used for the contribution is enabled from `Administer -> CiviContribute -> Financial Types`.

Path - `civicrm/admin/financial/financialType?reset=1`.
> 3 votes

---
Tags: contributions
---


# Question
Title: Add/Edit Email field not shown when editing a contact
I have created a drupal civicrm site using version 4.7.14 and noticed for some reason when editing a contact I don't have the option to edit the contact's email address nor do I have the option to add an email. I can't even find the contact's email when viewing their contact info. Normally the email is found above "website" and below "source". I'm missing this necessary field. I have created multiple drupal civicrm sites before and I have never encountered this problem until now, is it possible that because I installed the latest Civicrm version this might be a bug? The other Civicrm sites I created are older than version 4.7.14. I hope someone can help me in figuring this out soon.

Here are a couple screenshots.

No Email between source and website

No email found under contact details, also first and last name missing under "individual name fields"

-Mike

# Answer
I looked at the code and can tell you what you're missing, but not why.

Run the following SQL statement on your CiviCRM database:

```
SELECT cov.* FROM civicrm_option_value cov JOIN civicrm_option_group cog ON cov.option_group_id = cog.id WHERE cog.name = "contact_edit_options";

```

You should get a result that looks like:

```
+-----+-----------------+---------------------------+-------+--------------------------+----------+--------+------------+--------+-------------+-------------+-------------+-----------+--------------+-----------+---------------+------+-------+
| id  | option_group_id | label                     | value | name                     | grouping | filter | is_default | weight | description | is_optgroup | is_reserved | is_active | component_id | domain_id | visibility_id | icon | color |
+-----+-----------------+---------------------------+-------+--------------------------+----------+--------+------------+--------+-------------+-------------+-------------+-----------+--------------+-----------+---------------+------+-------+
| 137 |              18 | Custom Data               | 1     | CustomData               | NULL     |      0 |       NULL |      1 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 138 |              18 | Address                   | 2     | Address                  | NULL     |      0 |       NULL |      2 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 139 |              18 | Communication Preferences | 3     | CommunicationPreferences | NULL     |      0 |       NULL |      3 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 140 |              18 | Notes                     | 4     | Notes                    | NULL     |      0 |       NULL |      4 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 141 |              18 | Demographics              | 5     | Demographics             | NULL     |      0 |       NULL |      5 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 142 |              18 | Tags and Groups           | 6     | TagsAndGroups            | NULL     |      0 |       NULL |      6 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 143 |              18 | Email                     | 7     | Email                    | NULL     |      1 |       NULL |      7 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 144 |              18 | Phone                     | 8     | Phone                    | NULL     |      1 |       NULL |      8 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 145 |              18 | Instant Messenger         | 9     | IM                       | NULL     |      1 |       NULL |      9 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 146 |              18 | Open ID                   | 10    | OpenID                   | NULL     |      1 |       NULL |     10 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 147 |              18 | Website                   | 11    | Website                  | NULL     |      1 |       NULL |     11 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 148 |              18 | Prefix                    | 12    | Prefix                   | NULL     |      2 |       NULL |     12 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 149 |              18 | Formal Title              | 13    | Formal Title             | NULL     |      2 |       NULL |     13 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 150 |              18 | First Name                | 14    | First Name               | NULL     |      2 |       NULL |     14 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 151 |              18 | Middle Name               | 15    | Middle Name              | NULL     |      2 |       NULL |     15 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 152 |              18 | Last Name                 | 16    | Last Name                | NULL     |      2 |       NULL |     16 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
| 153 |              18 | Suffix                    | 17    | Suffix                   | NULL     |      2 |       NULL |     17 | NULL        |           0 |           0 |         1 |         NULL |      NULL |          NULL | NULL | NULL  |
+-----+-----------------+---------------------------+-------+--------------------------+----------+--------+------------+--------+-------------+-------------+-------------+-----------+--------------+-----------+---------------+------+-------+
17 rows in set (0.00 sec)

```

Note how all my options with a filter of "1" show are the items that appear in that list. My guess is you're missing the "Email" record.

I don't know why - and that would concern me, because who knows what else is missing? That said, you can fix this problem by inserting a row in the `civicrm_option_value` table for email. The values may be slightly different for you than me (the `option_group_id` isn't always the same) but you should be able to figure out the values easily enough by looking at the values that are present in the database.
> 2 votes

# Answer
It may be possible that `email` field is disabled from your Display Preferences. You can find this on `Administer -> Customize Data and Screens -> Display Preferences`.

Make sure `Email` field is checked `TRUE` on `Contact Details` Column of `Editing Contact` Section.

Demo Link - http://dmaster.demo.civicrm.org/civicrm/admin/setting/preferences/display?reset=1
> 2 votes

---
Tags: drupal, email
---


# Question
Title: How can I locate my extension directory?
This question surprised me a bit - but I have no clue about where to locate my extension directory!!

Is there a simple way to reliably locate it (either programatically or via the UI)?

# Answer
> 4 votes
You can find your extension directory by going to **Administer menu » System Settings » Directories** and checking the value for the "Extensions" directory. If there's a token like \[civicrm.root\], you can determine its value with this technique.

# Answer
> 3 votes
In PHP it looks like this is what I need:

```
return (new CRM_Extension_System())->getDefaultContainer()->baseDir;

```

So in `bash` I can use `cv`:

```
cv ev 'return (new CRM_Extension_System())->getDefaultContainer()->baseDir'

```

or better still, as pointed out be Tim:

```
cv ev 'return CRM_Core_Config::singleton()->extensionsDir'

```

which means this one liner will take you to the directory:

```
cd `cv ev 'return CRM_Core_Config::singleton()->extensionsDir;' --out=pretty`

```

---
Tags: extension, civix
---


# Question
Title: How do I install an extension directly from git?
Now that I have found my extension directory, is installing an experimental (or developmental) extension as simple as cloning it into there? eg:

```
# find extension directory
DIR=$(cv ev --out=pretty 'return (new CRM_Extension_System())->getDefaultContainer()->baseDir')
# change to extension directory
cd $DIR
# clone repo
git clone git@github.com:civicrm/api4.git
# flush cache
cv flush
# enable
cv ext:enable api4

```

(obviously some `git remote` voodoo required still but just wanting to confirm that this is the basics)

# Answer
Yes, that's all you need to do! In my experience, flushing the cache is unnecessary though.
> 1 votes

---
Tags: extension, developer
---


# Question
Title: Change CiviCRM Event notification emails
When participants register for events/trainings, notifications are sent automatically to a pre-specified email. How can I change so the notifications come to different email addresses? Newbie using CiviCRM 4.6

# Answer
> 3 votes
In the event settings under 'Online Registration' you will see a section for 'Confirmation Email'. If you select this CiviCRM will send a confirmation email to the participant. You can also send a copy (CC or BCC) to another email address.

See the user guide for more information: Registration confirmation

# Answer
> 2 votes
As it turns out we have a universal email that's been set-up through the creation of a profile which is then included on a particular event template that's being used. So even though the send confirmation email button on the 'online registration' page was set to 'no' in our case, emails were still being sent to an old email address. Changing the profile email address that's used in the template has solved this issue.

---
Tags: civievent, email
---


# Question
Title: How Can I Remove "CiviCRM - " From Page Titles?
Via the Change Wordpress Title question I found that the page with the "civicrm" slug is what is used for content replacement by CiviCRM.

If I want to remove the CiviCRM "prefix" to all the crm pages just simply removing the page title for the CiviCRM page in WordPress is not enough. Now I see " - Site Name".

Example URL: http://localhost/testsite/civicrm/?page=CiviCRM&q=civicrm/event/ical&reset=1&list=1&html=1

Page's title " - Test Site" (without quotes).

Is there a way to prevent CiviCRM from prefixing the " - "?

**Update**:

After doing a quick search in the plugin for "' - '" in all the PHP files I'm seeing code like this:

```
CRM_Utils_System::setTitle($displayName . ' - ' . $activityName);

```

I'm thinking it's not possible. That string looks pretty hard-coded to me.

# Answer
> 4 votes
If you just want the site name as the title, you can filter it:

```
// add filter only when basepage has been parsed
add_action( 'civicrm_basepage_parsed', 'my_override_civi_title' );

function my_override_civi_title() {
  // for themes that use wp_title()
  add_filter( 'wp_title', 'my_page_title', 200, 1 );
  // for themes that use add_theme_support( 'title-tag' )
  add_filter( 'document_title_parts', 'my_page_title_parts' );
}

function my_page_title( $title ) {
  return get_bloginfo( 'name' );
}

function my_page_title_parts( $parts ) {
  unset( $parts['title'] );
  unset( $parts['page'] );
  return $parts;
}

```

Your own theme's implementation will determine the final method used.

---
Tags: wordpress, admin, display
---


# Question
Title: CiviEvent - Confirmation takes a long time
CiviEvent takes a very long time (arounf 120 seconds) to confirm a registration.

From "Confirm Your Registration Information" to "Thank you for registering", the visitor can be lost. What's odd is that CiviCRM is pretty responsive in general.

We're not using any payment processor.

# Answer
When debugging issues like this, experience says "round" numbers in a delayed request (like 120s for two minutes, or 300s for five) are indicative of hitting a timeout somewhere in the hosting stack.

This might for example be -

* a reverse DNS lookup that is failing (server lacks working DNS)
* an HTTP or SMTP request triggered within CiviCRM or custom code which fails after some time (eg: email is timing out, server can't connect to your analytics engine, POSTs make connection to a spam analytics tool which isn't responding, ...)
* "things like that ..."

Something is wrong here; that's not how CiviCRM works out of the box (try it on a demo site). But from the details here I can't tell you *what's* wrong.

Making specific guesses risks leading you astray even as it is likely to be of assistance. That said: You might want to check if this bug affects all situations where CiviCRM sends an email, or where CiviCRM processes a form submission.

This may require some debugging expertise I think - check out civicrm.org/providers if you don't have an existing team to lean on for this.

Do report back on the solution you find!
> 1 votes

# Answer
It happens the culprit was the PDF receipt generated with the confirmation email. I disabled the PDF attachement in the confirmation mail (admin menu/system settings/ misc)

I saw there is a way to use an alternative PDF engine but since I don't really need the pdf, I simply disabled the feature

Thanks for the leads.
> 1 votes

---
Tags: civievent
---


# Question
Title: Need Legislative District Lookups for CiviCRM/WordPress
I've been using CiviCRM for WordPress for a few months now. We need to be able to populate both state and federal district fields. I found some relevant links.

https://civicrm.org/extensions/civicrm-congressional-districts-module https://developers.google.com/civic-information/

Sounds like there are extensions out there but all for Drupal? Please tell me there's one for WordPress???

I've been a geek all my life, but never got into web-based programming or PHP.

Thanks much...Jim

# Answer
> 8 votes
The Electoral API extension is what you're looking for.

# Answer
> 1 votes
Jim, what org are you with, are you on VAN, and involved with a civic engagement table? If so send me a private message. Also check out Progressive Technology Project's implementation of Cicero. See http://network.progressivetech.org/node/975

# Answer
> 0 votes
What is everyone doing now that Sunlight's API is dead? OpenStates has one that is active, but I'm not familiar with how to link into it.

---
Tags: wordpress, extension
---


# Question
Title: Contribution receipt has "display in honor roll" when personal campaign pages is off
After upgrading the CiviCRM to version 4.7.15 on Drupal Commons 7.50, I noticed that CiviContribute receipts are coming in with a field "Personal Campaign Page: Display in Honor Roll", however, personal campaign pages are turned off. Is this a bug or do I need to adjust my settings somewhere? See screenshots below.

**From Receipt**

**From CiviContribute Page settings**

Thanks!

# Answer
> 0 votes
Even though Personal Campaign Pages was off, Widgets had become enabled. Once I disabled Widgets, this went away from the donation receipt.

---
Tags: drupal, civicontribute
---


# Question
Title: Submit redirects to Home page, DB Error: syntax error
I am using CiviCRM 4.7.8 on Joomla Joomla! 3.5.1 Stable \[ Unicorn \]. When I go to my Donate (civicrm contribute page), the first time I submit the form, I am just redirected to the main front page. No error message or confirmation page. Subsequent form submissions, give me the following error and debug info. This happens even when I submit a blank form. How can I solve this issue?

DB Error: syntax error

Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1, 1064 Additional Details:

Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> handle )

```
[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]
[type] => DB_Error
[user_info] => INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]"]

```

)

# Answer
It was a redirect issue. Not all domains were redirecting to the domain that civi had listed as its base domain. example.com needed to redirect to www.example.com for instance.
> 1 votes

---
Tags: civicontribute
---


# Question
Title: Need to know how to print annual donation statements for our donors
We are a church using CiviCRM. We are at the time of year where we need to print out or email statements to our donors showing the tax deductible contributions they made so they can itemize these deductions on their tax returns. How do I print individaul statements for these donors? Is there a way to sort this report so it will print all individual statements or would I have to run each report one at a time? All donations have been properly input into the system and are ready to go.

# Answer
> 3 votes
Use a Thank-You Letter.

1. Run a contribution report for 2016.
2. Select the individual(s) you want to create reports for
3. In the Actions dropdown, select "Thank-You Letters for Contributions"
4. Select your Grouping (I use Contact)
5. Select Your separator-- Comma will put all information into groups separated by commas, Table Cell will separate each contribution into it's own row (Table Cell is buggy)

Here is a very helpful posting about this https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md

Somethings I have learned along the way: 1. The bugginess of the Table Cell option can be overcome with Foreach code. I can send you my code but we use LineItems with all our donations so it might not work so well for your setup. 2. There are limits of how many letters Civi can handle at one time. I think it is 600 and that may be due to the PDF generator limits.

---
Tags: contributions, custom-reports
---


# Question
Title: How do I use Table Cell Separator when creating Thank You letters?
Civi 4.6.18 using WordPress

I am working on creating a year-end statement for donors with all their donations for this year on it. I am using the "Thank You letter" to do so.
1. I select Group by = Contact 2. I select Separator = Table Cell.

My results are Comma Separated. How do I get them into separate table cells?

Here is my source code for the letter.

```
<p>Dear {contact.first_name}</p>

<p> </p>

<table align="left" border="1" cellpadding="2" cellspacing="0" class="table" style="width: 500px;">
    <tbody>
        <tr>
            <th>Date</th>
            <th>Amount</th>
            <th>Receipt Number</th>
        </tr>
        <!--
    {foreach from=$contributions item=contribution} {assign
    var="date" value=$contribution.receive_date|date_format:"%d %B
    %Y"}
  -->
        <tr>
            <td>{contribution.receive_date}</td>
            <td>{contribution.total_amount}</td>
            <td>{contribution.contribution_id}</td>
        </tr>
        <!--
    {/foreach}

 -->
    </tbody>
</table>

```

I got my original information from here. https://github.com/civicrm/civicrm-user-guide/blob/master/docs/contributions/manual-receipts-and-thank-yous.md

# Answer
A big Thank-You to Karen with Greenleaf Advancement for helping me out with this.

There is a bug in Civi that does not allow the Table Cell separator to function. Karen helped we with some base code that works around the issue, I was able to tweek it from there to work for our situation. Paste the code in the Source of the letter. We use Line Items with all our donations. You will have to re-work the code a little if you do not use Price Sets. You may also want some additional columns ore in a different order. Just edit the code to your liking.

```
    <table align="left" cellpadding="4" cellspacing="0" class="table" style="width: 700px;border: 1px solid #281c1d;">
    <tbody>
        <tr style="padding: 8px; border: 1px solid #281c1d;color:white; background-color: #70551F;">
            <th style="padding: 8px;">Date</th>
            <th style="padding: 8px;">Cont ID</th>
            <th style="padding: 8px;">Contribution Designation</th>
            <th style="padding: 8px;">Amount</th>
        </tr>
        <!--

    {foreach from=$contributions item=contribution} {assign
    var="date" value=$contribution.receive_date|date_format:"%B %d %Y"}
{crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id}
  {foreach from=$result.values item=lineitem}

  -->
        <tr style="padding: 4px; border: 1px solid #281c1d;">
            <td style="padding: 4px; border: 1px solid #281c1d;">{$date}</td>
            <td style="padding: 4px; border: 1px solid #281c1d;">{$contribution.id}</td>
            <td style="padding: 4px; border: 1px solid #281c1d;">{$lineitem.label}</td>
            <td style="text-align:right;padding: 4px; border: 1px solid #281c1d;">$ {$lineitem.line_total}</td>
        </tr>
        <!--
    {/foreach}{/foreach}

 -->
        <tr style="padding: 4px; border: 1px solid #281c1d;text-align:right;padding-top:20px;">
            <th colspan="3" style="padding: 4px; border: 1px solid #281c1d;text-align:right;padding-top:20px;padding-right:20px;">2016 Total Contributions</th>
            <td style="padding-right: 4px; border: 1px solid #281c1d;padding-top:20px;text-align:right;">$ {$contribution_aggregate}.00</td>
        </tr>
    </tbody>
</table>

```
> 2 votes

# Answer
This patch (which is now part of core in 4.7) adds a linebreak option which makes it simple to create such tables

https://github.com/civicrm/civicrm-core/pull/8804/files
> 1 votes

---
Tags: system-workflow-messages
---


# Question
Title: How do I set the value of external_id to be the same as a custom field?
Running Civi 4.7.13 with Drupal 7.52. I want to set the value of external\_id in the Contacts table to be the same value as a custom field (using the API explorer, it seems this field is called custom\_32). When I try to set the value from the SQL command line, nothing happens. I'm new with SQL and have little experience. I've tried the following. What do I need to change to get it to work? Is there an example I can follow (using the SQL command line or even API explorer)

```
SELECT civicrm
UPDATE civicrm_contact c
SET c.external_identifier = c.custom_32
WHERE c.custom_32 is not null

```

It appears as though custom\_32 is not part of the Contact table.

# Answer
> 1 votes
The Contact.get API will return custom fields if requested:

```
<?php

$contacts = civicrm_api3('Contact', 'get', array(
  'sequential' => 1,
  'return' => array('custom_32'),
  'options' => array('limit' => 0),
));

foreach ($contacts['values'] as $contact) {
  $res = civicrm_api3('Contact', 'create', array(
    'id' => $contact['id'],
    'external_identifier' => $contact['custom_32'],
  ));
}

```

You might want more parameters on the Contact.get (eg 'contact\_is\_deleted' =\> 0) and some error checking on the Contact.create. As noted in previous comments, there are restrictions around external id's which the custom field may not comply with.

If there are many contacts, you may need to change 'limit' and do it in chunks.

You can save the above to a file, and use cv to run it:

```
cv scr /path/to/file

```

# Answer
> 0 votes
so one way with the API lets assume your custom field is custom\_32

```
$contacts = civicrm_api3('Contact', 'get', array(
      'options' => array('limit' => 9999),
    ));
if($contacts['count']) {
  foreach($contacts['values'] as $contact_id => $value) {

        $result = civicrm_api3('CustomValue', 'get', array(
          'entity_id' => $contact_id,
        ));
        if(!$result['is_error'] && isset($result['values'][32]['latest']) {
          $custom_field_value = $result['values'][32]['latest'];

          $contact_result = civicrm_api3('Contact', 'create', array(
            'id' => $contact_id,
            'external_identifier' => $custom_field_value,
          ));
        }
}
}

```

Now this is not very efficient if you have a large number of contacts. SQL would be better and I'm sure someone will come along with query for you.

---
Tags: civimember, mysql
---


# Question
Title: outbound email settings failure to send test message
> Failed to connect to smtp.tipping.org.au:25 \[SMTP: Failed to connect socket: Connection timed out (code: -1, response: )\].

WE have an internal mail server. Can resolve externally. Requires username and password authentication.

Tried most things we can think of to set up outbound email but get the above error message after sending test message

Have tried using mail(), appears to send test message successfully, but never received.

Grateful for advice on how we might correct outbound email settings.

# Answer
Perhaps your internal mail server uses a different port for smtp? You can see that it's trying to connect to port 25, you might have it configured at a different port?

Alternatively, if you have some kind of command line interface to the machine running the civicrm code, you could try a direct connection using, for example, telnet (details here https://www.port25.com/how-to-check-an-smtp-connection-with-a-manual-telnet-session-2/).

And finally, you might also look at the dns on the civicrm code machine to make sure your domain for the smtp server is resolving like you expect, and/or trying putting in the ip of the mail server instead of its name.
> 1 votes

---
Tags: email
---


title: DB error: No such field (Civi 4.7.15)

text:
# Question
Title: DB error: No such field (Civi 4.7.15)
I've gotten No such field errors for no apparent reason since my first Civi installation, but one that I haven't been able to shake is preventing creation of any payment processors. It looks like this:

On the Add Payment Processor form, I submit the completed form and this appears ...

```
CiviCRM_API3_Exception: "DB Error: no such field"
#0 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/PaymentProcessor.php(430): civicrm_api3("PaymentProcessor", "create", (Array:28))
#1 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/PaymentProcessor.php(383): CRM_Admin_Form_PaymentProcessor->updatePaymentProcessor((Array:20), 1, FALSE)
#2 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(435): CRM_Admin_Form_PaymentProcessor->postProcess()
#3 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#4 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_PaymentProcessor), "next", "Next")
#5 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_PaymentProcessor), "next")
#6 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_PaymentProcessor), "next")
#7 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#8 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(384): CRM_Core_Controller->run()
#9 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(168): CRM_Core_Page_Basic->edit(1, NULL)
#10 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/PaymentProcessor.php(117): CRM_Core_Page_Basic->run()
#11 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(310): CRM_Admin_Page_PaymentProcessor->run((Array:3), NULL)
#12 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#13 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#14 /PATH-REDACTED/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::i

```

Where should I begin?

# Answer
The solution was to upgrade the database following my CiviCRM version update. Detailed instructions for doing this are at https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress#UpgradingCiviCRMforWordPress-4.RuntheUpgradescript

Once I had completed this relatively simple process, I was finally able to add payment processors without throwing errors. And just as exciting, the System Status in the Civi admin footer finally switched from "Critical" to "OK."
> 0 votes

---
Tags: database, payment-processor
---


# Question
Title: How do I get my contribution form fields on the same line
I have bootstrap Joomla theme and it is changing the format of form fields. I understand that this is a CSS issue but my question is how can I get my live contribution page to look like the test page within civicrm?

# Answer
> 1 votes
I'm still finding my way around civicrm so it looks like no style was applied to civicrm or the template css file takes precedence. I used some of the style setting from civicrm.css in the custom css section of the template and this fixed the issue. There is problem a cleaner way to use the civicrm style sheet but for now this worked for me.

---
Tags: joomla, forms, css, bootstrap
---


# Question
Title: Why do I get fatal error, memcached set failed?
Suddenly my dev site is throwing a fatal error whenever I try to use a drush command, even including `drush version` or `drush cc all`. I'm on Drupal 7.50 and CiviCRM 4.7.15, Drush 7.0.0 and I am unaware of any differences between Dev and Production.

What might be causing this? Here is the error message and backtrace:

```
root@web:/var/www/html/example/docroot# drush status
Drush command terminated abnormally due to an unrecoverable error.                   [error]
Sorry. A non-recoverable error has occurred.
memcached set failed, wondering why?, _b7e34e2ca56a7e5553b56f61bcdd1b97civiroot
Array

#0 <drupal_root>/sites/all/modules/civicrm/CRM/Utils/Cache/Memcached.php(121): CRM_Core_Error::fatal("memcached set failed, wondering why?, _b7e34e2ca56a7e5553b56f61bcdd1b97civiroot", (Array:0))
#1 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Container/Basic.php(222): CRM_Utils_Cache_Memcached->set("civiroot", (Array:0))
#2 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Container/Basic.php(132): CRM_Extension_Container_Basic->getRelPaths()
#3 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Container/Collection.php(169): CRM_Extension_Container_Basic->getKeys()
#4 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Container/Collection.php(145): CRM_Extension_Container_Collection->getKeysToContainer()
#5 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Container/Collection.php(111): CRM_Extension_Container_Collection->getContainer("org.civicrm.module.cividiscount")
#6 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Mapper.php(185): CRM_Extension_Container_Collection->getPath("org.civicrm.module.cividiscount")
#7 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Mapper.php(224): CRM_Extension_Mapper->keyToInfo("org.civicrm.module.cividiscount")
#8 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Mapper.php(302): CRM_Extension_Mapper->keyToPath("org.civicrm.module.cividiscount")
#9 <drupal_root>/sites/all/modules/civicrm/CRM/Core/PseudoConstant.php(1788): CRM_Extension_Mapper->getActiveModuleFiles(FALSE)
#10 <drupal_root>/sites/all/modules/civicrm/CRM/Utils/Hook.php(266): CRM_Core_PseudoConstant::getModuleExtensions()
#11 <drupal_root>/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(102): CRM_Utils_Hook->requireCiviModules((Array:0))
#12 <drupal_root>/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(81): CRM_Utils_Hook_DrupalBase->buildModuleList()
#13 <drupal_root>/sites/all/modules/civicrm/CRM/Utils/Hook.php(1767): CRM_Utils_Hook_DrupalBase->invoke(1, (Array:152), NULL, NULL, NULL, NULL, NULL, "civicrm_entityTypes")
#14 <drupal_root>/sites/all/modules/civicrm/CRM/Core/DAO/AllCoreTables.php(51): CRM_Utils_Hook::entityTypes((Array:152))
#15 <drupal_root>/sites/all/modules/civicrm/CRM/Core/DAO/AllCoreTables.php(277): CRM_Core_DAO_AllCoreTables::init()
#16 <drupal_root>/sites/all/modules/civicrm/CRM/Core/DAO/OptionGroup.php(179): CRM_Core_DAO_AllCoreTables::invoke("CRM_Core_DAO_OptionGroup", "fields_callback", (Array:8))
#17 <drupal_root>/sites/all/modules/civicrm/CRM/Core/DAO.php(455): CRM_Core_DAO_OptionGroup::fields()
#18 <drupal_root>/sites/all/modules/civicrm/packages/DB/DataObject.php(411): CRM_Core_DAO->table()
#19 <drupal_root>/sites/all/modules/civicrm/CRM/Core/DAO.php(1082): DB_DataObject->find(TRUE)
#20 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/Manager/Report.php(42): CRM_Core_DAO::getFieldValue("CRM_Core_DAO_OptionGroup", "report_template", "id", "name")
#21 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/System.php(209): CRM_Extension_Manager_Report->__construct()
#22 <drupal_root>/sites/all/modules/civicrm/CRM/Extension/System.php(195): CRM_Extension_System->getManager()
#23 <drupal_root>/sites/all/modules/civicrm/Civi/Core/Container.php(365): CRM_Extension_System->getClassLoader()
#24 <drupal_root>/sites/all/modules/civicrm/CRM/Core/Config.php(111): Civi\Core\Container::boot(TRUE)
#25 <drupal_root>/sites/all/modules/civicrm/drupal/civicrm.module(218): CRM_Core_Config::singleton()
#26 <drupal_root>/sites/all/modules/civicrm/drupal/modules/views/civicrm.views.inc(68): civicrm_initialize()
#27 <drupal_root>/profiles/commons/modules/contrib/views/includes/cache.inc(93): civicrm_views_data_alter((Array:293))
#28 <drupal_root>/profiles/commons/modules/contrib/views/includes/cache.inc(75): _views_fetch_data_build()
#29 <drupal_root>/profiles/commons/modules/contrib/views/views.module(1293): _views_fetch_data(NULL, TRUE, FALSE)
#30 <drupal_root>/profiles/commons/modules/contrib/entity/views/entity.views.inc(320): views_fetch_data()
#31 <drupal_root>/profiles/commons/modules/contrib/views/includes/plugins.inc(414): entity_views_plugins()
#32 <drupal_root>/profiles/commons/modules/contrib/views/includes/cache.inc(145): views_discover_plugins()
#33 <drupal_root>/profiles/commons/modules/contrib/views/views.module(1304): _views_fetch_plugin_data(NULL, NULL, FALSE)
#34 <drupal_root>/profiles/commons/modules/contrib/views/views.module(100): views_fetch_plugin_data()
#35 <drupal_root>/includes/theme.inc(536): views_theme((Array:656), "module", "views", "profiles/commons/modules/contrib/views")
#36 <drupal_root>/includes/theme.inc(689): _theme_process_registry((Array:656), "views", "module", "views", "profiles/commons/modules/contrib/views")
#37 <drupal_root>/includes/theme.inc(325): _theme_build_registry(Object(stdClass), (Array:1), "phptemplate")
#38 [internal function](): _theme_load_registry(Object(stdClass), (Array:1), "phptemplate")
#39 <drupal_root>/includes/theme.inc(277): call_user_func_array("_theme_load_registry", (Array:3))
#40 <drupal_root>/includes/theme.inc(411): theme_get_registry()
#41 <drupal_root>/includes/theme.inc(395): ThemeRegistry->initializeRegistry()
#42 <drupal_root>/includes/theme.inc(335): ThemeRegistry->__construct("theme_registry:runtime:example", "cache")
#43 [internal function](): _theme_load_registry(Object(stdClass), (Array:1), "phptemplate", FALSE)
#44 <drupal_root>/includes/theme.inc(277): call_user_func_array("_theme_load_registry", (Array:4))
#45 <drupal_root>/includes/theme.inc(1020): theme_get_registry(FALSE)
#46 <drupal_root>/sites/all/modules/contrib/seo_checklist/seo_checklist.module(54): theme("image", (Array:3))
#47 [internal function](): seo_checklist_checklistapi_checklist_info()
#48 <drupal_root>/includes/module.inc(957): call_user_func_array("seo_checklist_checklistapi_checklist_info", (Array:0))
#49 <drupal_root>/sites/all/modules/contrib/checklistapi/checklistapi.module(66): module_invoke_all("checklistapi_checklist_info")
#50 <drupal_root>/sites/all/modules/contrib/checklistapi/checklistapi.module(120): checklistapi_get_checklist_info()
#51 <drupal_root>/sites/all/modules/contrib/checklistapi/checklistapi.module(98): checklistapi_menu()
#52 [internal function](): checklistapi_init()
#53 <drupal_root>/includes/module.inc(957): call_user_func_array("checklistapi_init", (Array:0))
#54 <drupal_root>/includes/common.inc(5334): module_invoke_all("init")
#55 <drupal_root>/includes/bootstrap.inc(2523): _drupal_bootstrap_full()
#56 /usr/local/src/drush/lib/Drush/Boot/DrupalBoot7.php(70): drupal_bootstrap(7)
#57 /usr/local/src/drush/includes/bootstrap.inc(308): Drush\Boot\DrupalBoot7->bootstrap_drupal_full()
#58 /usr/local/src/drush/includes/bootstrap.inc(461): drush_bootstrap(5, 7)
#59 /usr/local/src/drush/includes/bootstrap.inc(407): drush_bootstrap_max()
#60 /usr/local/src/drush/lib/Drush/Boot/BaseBoot.php(54): drush_bootstrap_to_phase(-2)
#61 /usr/local/src/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#62 /usr/local/src/drush/drush.php(11): drush_main()
#63 {main}

```

# Answer
The fact that the error appears suddenly suggests that a *memcached* server was used by your system, but is not available anymore. The purpose of this server is to make the PHP execution faster (it stores values in memory that otherwise must be retrieved from the database).

The cache is configured in the *civicrm.settings.php* file. Look for the variable *CIVICRM\_DB\_CACHE\_CLASS*. The default value *"ArrayCache"* is useful for configurations that have no cache server running. The cache server connection details are found in the variables *CIVICRM\_DB\_CACHE\_HOST* and *CIVICRM\_DB\_CACHE\_PORT*.

More information about memcached can be found at http://memcached.org/.

Maybe the unix command

```
sudo systemctl start memcached

```

is enough to get it running again.
> 2 votes

---
Tags: drupal, drush
---


# Question
Title: Why can't I save search preferences? Specifically 'Autocomplete Results'
On my 4.6.14 system I'd like to change the 'Autocomplete results' to (say) 15, but it won't save. This is in 'Administer/Customise Data and Screens/Search Preferences'. I've can change the 'Smart Group cache timeout' OK but the Autocomplete results resolutely stays at 10. I tried the demo system and it works ok, but on my test system at 4.6.14 and another system at 4.6.12 this problem is there. Have I found a bug? *Update 4 Jan 17 - I still have this problem on 4.7.14 and it appears to be a privilege problem* I extracted this line from the backtrace:

> {1227 \** Access denied; you need (at least one of) the PROCESS privilege(s) fo..."}

Here's the full backtrace from 4.7.15:

```
12 17:59:43  [info] $backTrace =
0 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Error.php(932): CRM_Core_Error::backtrace("backTrace", TRUE)
1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
2 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
3 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
4 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, NULL, NULL, "\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", "DB_Error", TRUE)
6 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
7 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
8 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL,"\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", "DB_Error", TRUE)
9 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, NULL, "1227 ** Access denied; you need (at least one of) the PROCESS privilege(s) fo...")
10 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
11 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
12 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/DataObject.php(2438): DB_common->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
13 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
14 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/DAO.php(354): DB_DataObject->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
15 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/DAO.php(1297): CRM_Core_DAO->query("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...", TRUE)
16 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(187): CRM_Core_DAO::executeQuery("\n      SELECT i.name as index_name\n      FROM information_schema.innodb_sys...")
17 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(225): CRM_Core_InnoDBIndexer->findActualFtsIndexNames("civicrm_address")
18 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(242): CRM_Core_InnoDBIndexer->dropIndexSql("civicrm_address")
19 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(131): CRM_Core_InnoDBIndexer->reconcileIndexSqls("civicrm_address")
20 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/InnoDBIndexer.php(96): CRM_Core_InnoDBIndexer->fixSchemaDifferences()
21 [internal function](): CRM_Core_InnoDBIndexer::onToggleFts(FALSE, "0", (Array:13), 1)
22 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(363): call_user_func((Array:2), FALSE, "0", (Array:13), 1)
23 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(272): Civi\Core\SettingsBag->setDb("enable_innodb_fts", "0")
24 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/Core/SettingsBag.php(169): Civi\Core\SettingsBag->set("enable_innodb_fts", "0")
25 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(213): Civi\Core\SettingsBag->add((Array:9))
26 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/api/v3/Setting.php(276): CRM_Core_BAO_Setting::setItems((Array:11), (Array:1))
27 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_setting_create((Array:11))
28 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/API/Kernel.php(161): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
29 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/Civi/API/Kernel.php(92): Civi\API\Kernel->runRequest((Array:7))
30 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("setting", "create", (Array:10), NULL)
31 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Admin/Form/Setting.php(218): civicrm_api("setting", "create", (Array:10))
32 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Admin/Form/Setting.php(172): CRM_Admin_Form_Setting->commonProcess((Array:11))
33 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Form.php(435): CRM_Admin_Form_Setting->postProcess()
34 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
35 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Setting_Search), "next", "Next")
36 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Setting_Search), "next")
37 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Search), "next")
38 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
39 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
40 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Search", "Search Preferences", NULL)
41 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
42 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
43 /home/powyscon/public_html/acivi.org.uk/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
44 [internal function](): civicrm_invoke("admin", "setting", "search")
45 /home/powyscon/public_html/acivi.org.uk/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
46 /home/powyscon/public_html/acivi.org.uk/index.php(21): menu_execute_active_handler()
47 {main}

```

# Answer
This is a MySQL permissions issue.

When I received a similar error, it was because the MySQL version was 5.7.6 or higher. In these newer versions of MySQL, you need the REFERENCES privilege to make use of foreign key constraints. See here. Note that the CiviCRM MySQL Permission Requirements page has been updated to reflect this. Please speak to your hosting provider (if shared hosting) or your sysadmin (if VPS/private hosting) about adding this permission to the CiviCRM MySQL user.
> 1 votes

# Answer
This is a known bug. See

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

If your environment lacks the privilege to alter the MySQL full-text index setting, saving any settings on that screen will fail.

If you've got command-line access, you can use the following wp-cli or drush commands (you might need to provide additional parameters to supply the CMS user or site URL):

```
wp cv api Setting.create sequential=1 search_autocomplete_count=25

```

or

```
drush cvapi Setting.create sequential=1 search_autocomplete_count=25

```

In CiviCRM 4.6, you can update the setting by directly updating the CiviCRM database. In the civicrm\_settings table, look for the key "search\_autocomplete\_count" in the `name` column. I don't recommend this. (It looks like those options aren't in the civicrm\_settings table any more in 4.7 and above.)
> 1 votes

---
Tags: mysql, configuration
---


title: Exporting multi-record set data

text:
# Question
Title: Exporting multi-record set data
Hi I am trying to export data held in a multi-record set. A end users would prefer to do this through the Civi interface rather than on the back-end database

The multi-value import link is buried in the help tips pop up... hoping the export is exists and is just similarly buried

We using v4.6.2

# Answer
Unfortunately, at this time (CiviCRM 4.7.13) it's not possible to export multi-record custom fields through the CiviCRM interface.

This question: How do you export a multi record set? suggests an alternate method that may work, but it would take someone experienced at writing custom CiviReports.
> 1 votes

# Answer
If you're running CiviCRM on a Drupal instance, I've managed to export a multi-value field with the Drupal Views and Views Export modules.
> 1 votes

---
Tags: export, multi-record
---


# Question
Title: How can I find an expert CiviCRM WordPress developer?
I want to hire a CiviCRM WordPress to perform various tasks in our Civi site. We have a list of needs, but the most pressing is the following. We have registration pages for our events. When you look at the registration pages on desktop, the form looks acceptable. But when you look at it on mobile, the form looks horrible and I can't image anyone filling out this form on mobile.

We need you to immediately step in and make whatever CSS or form tweaks are necessary to make the mobile view look good.

This is only one of several tasks that we need done. We are ultimately looking for continuous and long-term support.

Thank you, Steven

# Answer
A great place to find a CiviCRM expert is on CiviCRM.org! There's a list of CiviCRM providers at https://civicrm.org/providers

You can use the filters on that page to identify a good match by (for example) services offered, CMS expertise, language and location. Here's a listing of CiviCRM / WordPress implementors.

Being an open source project, much of the work happens out in the open. Other places you can identify good people to work with are places like Stack Exchange (this site), CiviCRM chat, the CiviCRM bug tracker, and other community resources.
> 2 votes

# Answer
JMA Consulting would love to help you with this... we have a fair bit of experience with integrating CiviCRM and WordPress and are listed on the CiviCRM providers list. The premier WordPress shops in the Civi community, however, are likely Tadpole and Christian Wach (https://github.com/christianwach).
> 0 votes

---
Tags: wordpress
---


# Question
Title: Can we have a "week" option for the membership type duration unit?
I'm doing some work to enable the purchase of auto-renewing memberships, using the UK-focussed GoCardless direct debit system. So far so good. One thing we've noticed is that the GoCardless API understands intervals in weeks, months, and years (with 1 year being the maximum). However CiviCRM's membership type duration unit doesn't offer 'week' as an option.

What would be involved in order to add 'week' as an option here?

# Answer
> 1 votes
We could do an extension for you, consistent with LExIM strategy, to implement this, Graham. Ping me at joe dot murray at jmaconsulting dot biz.

---
Tags: civimember, payment-processor, recurring-contributions, auto-renew
---


# Question
Title: How do you update the contact information of someone in CiviCRM?
According to CiviCRM API documentation, the .create() function with a specified contact ID should modify the records within CiviCRM; however, even after trying that, I still can't seem to properly push changes to CiviCRM.

In the code below, I'm trying to change Jane Doe's gender from "1" to "2", and when I change that by setting val.gender\_id="2", it prints out the right result. However, when I try to "get" Jane Doe's information afterwards, it prints her gender\_id as "1". So, it doesn't actually update the CiviCRM database.

Is there a way to fix this?

//TESTING FOR UPDATING CONTACT INFORMATION OF 'JANE DOE' in CIVICRM DATABASE

```
crmAPI.create('contact', {id:'12966'},
  function (result) {
      console.log(result);
      val=result.values[0];
      val.gender_id='2';
      console.log('UPDATED CONTACT: '+ val.display_name + " " + val.gender_id + " " + val.country_id);

crmAPI.get('contact', {id:'12966'},
  function(result) {
    console.log(result);
    for (var i in result.values) {
      val=result.values[i];
      console.log(val.display_name + " " + val.gender_id + " " + val.country_id);
    }
  }
);

```

});

# Answer
> 2 votes
EDIT: I figured out what went wrong. The gender\_id change must be specified as a parameter in the .create() function. It shouldn't be changed in the callback.

The correct code is:

```
crmAPI.create('contact', {id:'12966', gender_id:'2'},
   function (result) {
       console.log(result);
       val=result.values[0];
       console.log('UPDATED CONTACT: '+ val.display_name + " " + val.gender_id + " " + val.country_id);
});

```

---
Tags: contacts
---


title: Civievent - Billing fields

text:
# Question
Title: Civievent - Billing fields
Is it possible to change the labels for the billings fields when people are signing up for an event.

In the swedish translation of the fields: "First name, middle name and last name" they are called the same. Which makes it difficult for users to know what to write.

Example (translated from Swedish) Billing adress 1 (mandatory) Billing adress 2 Billing adress 3 (mandatory)

I have searched a lot of forums to find out how to change this. But it seems impossible. Should the translation be updated in Transifex or should it be made in the local installation?

# Answer
> 1 votes
Welcome to CiviCRM StackExchange Kim!

If you think that the translation should be changed for all users that use Swedish as a language in CiviCRM (e.g. because it is wrong or yours is better) you should update the strings in transifex.

This would imply that you create a free account there and ask to become part of the Swedish translation team. Once you changed the translation in transifex you will need to update your translation locally. You can find information on transifex in the CiviCRM Wiki.

If you only want to change the translation for yourself, you should use the function for word replacement in CiviCRM, which you can find at yourdomain.org/admin/options/wordreplacements?reset=1

On the left side you will need to enter the original (English!) string, on the right side, the one you want to use (in Swedish).

---
Tags: civievent, localisation, translation
---


title: What does LExIM stand for?

text:
# Question
Title: What does LExIM stand for?
I've heard a few developers refer to `LExIM`. What on earth is it?

(Other than "Reading" in Albanian or an on-line learning company?)

# Answer
LExIM is the new overall release and extension strategy:

# LEAP BY EXTENSION. ITERATE BY MONTH.

> It basically means that:
>
> * CiviCRM development will now happen mostly through extensions, enabling the users to individually turn these new features on or off by enabling these new extensions
> * Releases are going to be published on a predictable monthly schedule, facilitating planning and execution of regular updates by CiviCRM service providers (from here)

See also: blog post and wiki article.
> 6 votes

---
Tags: extension, developer
---


title: Force user to confirm signup CiviEvent

text:
# Question
Title: Force user to confirm signup CiviEvent
Is it possible in some way to force users to confirm their signup before closing the window or leaving the page when they are on the confirmation page.

We've had to many persons missing doing that.

# Answer
There is a little piece of javascript that kicks in on the contribution page to warn a visitor if they try to leave before submitting the form. It sounds like you want to have something like that for the confirmation page? I think that would be a useful feature. Forcing the user to do anything is going to be a non-starter of course ...

Alternatively you could also configure your contribution to skip the confirmation page.
> 1 votes

---
Tags: wordpress, civievent
---


title: Contact mail action fails

text:
# Question
Title: Contact mail action fails
Drupal 7, CiviCRM 4.6.25/4.7.15

When I try to send an email to an individual contact using the 'send mail' action, the triangle spins and nothing happens. Affects our production and test site.

mail() configuration check out fine, and mailings 'send test' works. Haven't extensively checked this as we haven't gone live with the site.

The log/backtrace points to /civicrm/CRM/Utils/Token.php, line 1190:

```
     if (empty($contactIDs)) {
      // putting a fatal here so we can track if/when this happens
      CRM_Core_Error::fatal();

```

I've blown out our test database and re-initialized it with sample data -- no fix.

I've also upgraded our test site to 4.7.15 and am getting the same problem, stemming from the token.php function

Stranger still, if we use the 'send now (to less than 50 people)' selection from the contact search page, email works, just not from the contact record directly.

Works:

```
civicrm/contact/search?_qf_Email_display=true&qfKey=2b01f498b92b4b919c45446ae38d6c5d_3790

```

Doesn't:

```
civicrm/activity/email/add?action=add&reset=1&cid=202&selectedChild=activity&atype=3

```

# Answer
I notice that the first line of your backTrace is line 1190 in the Token.php file, which is this:

```
   if (empty($contactIDs)) {
      // putting a fatal here so we can track if/when this happens
      CRM_Core_Error::fatal();
    }

```

Judging from the fact that it appears to happen when you are the only recipient, I'd guess that it's because of something funny about your own contact record. For example - perhaps your contact record (i.e. the one that is connected to your login) is deleted?
> 0 votes

---
Tags: contacts, mailing
---


# Question
Title: Network error when trying to view a contribution, caused by "Expected one PriceSet but found 25"
I am using CiviCRM 4.7.15 and the latest version of Drupal 7. I am experiencing a 'Network Error - Unable to reach the server' when I try to view a contribution in the contact record. I have followed the suggestions in the forum post by Coleman Watts entitled 'Troublshooting popups, autocompletes, or other javascript problems' without having resolved the problem

What happens:

* I have created a civicrm webform which contains a single contact to allow the contact to renew their membership. This appears to function correctly insofar as it updates the membership record and creates a contribution attached to the contact and the membership record.
* I then logout, login as admin user, go to the relevant contact record and select the contributions tab. If I try to edit the contribution it displays correctly. However if I try to view the contribution I get the Network Error.
* I can perform this same set of steps for at least two other users on this particular webform without incurring the same issue.

I have attached below the error details for the situation which fails.

```
There was a CiviCRM error at The Harlequin Club, Incorporated.

```

Date: 2017-01-25T13:05:57+11:00

***ERROR***

```
message:            Expected one PriceSet but found 25
code:
exception:          CiviCRM_API3_Exception Object
(
    [extraParams:CiviCRM_API3_Exception:private] => Array
        (
            [count] => 25
            [is_error] => 1
            [error_message] => Expected one PriceSet but found 25
            [error_code] => undefined
        )

    [message:protected] => Expected one PriceSet but found 25
    [string:Exception:private] =>
    [code:protected] => 0
    [file:protected] => /var/www/html/sites/all/modules/civicrm/api/api.php
    [line:protected] => 45
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php
                    [line] => 158
                    [function] => civicrm_api3
                    [args] => Array
                        (
                            [0] => PriceSet
                            [1] => getsingle
                            [2] => Array
                                (
                                    [id] =>
                                    [return] => is_quick_config, id
                                )

                        )

                )

            [1] => Array
                (
                    [file] => /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php
                    [line] => 531
                    [function] => preProcess
                    [class] => CRM_Contribute_Form_ContributionView
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [2] => Array
                (
                    [file] => /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php
                    [line] => 92
                    [function] => buildForm
                    [class] => CRM_Core_Form
                    [type] => ->
                    [args] => Array
                        (
              ...

```

***LAST ERROR***

***LOGGED IN USER***

```
contact_id:         1
display_name:       Mr. Harlequin Webmaster
email_id:           2
email:              webmaster@quins.com.au
id:                 1

REMOTE_ADDR: 1.136.96.213
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

***SERVER***
REDIRECT_protossl:  s
REDIRECT_HTTP_AUTHORIZATION:
REDIRECT_HTTPS:     on
REDIRECT_SSL_TLS_SNI:www.quins.com.au
REDIRECT_STATUS:    200
protossl:           s
HTTP_AUTHORIZATION:
HTTPS:              on
SSL_TLS_SNI:        www.quins.com.au
SSL_SERVER_S_DN_OU: Domain Control Validated
SSL_SERVER_S_DN_CN: *.quins.com.au
SSL_SERVER_I_DN_C:  BE
SSL_SERVER_I_DN_O:  GlobalSign nv-sa
SSL_SERVER_I_DN_CN: AlphaSSL CA - SHA256 - G2
SSL_VERSION_INTERFACE:mod_ssl/2.4.7
SSL_VERSION_LIBRARY:OpenSSL/1.0.1f
SSL_PROTOCOL:       TLSv1.2
SSL_SECURE_RENEG:   true
SSL_COMPRESS_METHOD:NULL
SSL_CIPHER:         ECDHE-RSA-AES128-GCM-SHA256
SSL_CIPHER_EXPORT:  false
SSL_CIPHER_USEKEYSIZE:128
SSL_CIPHER_ALGKEYSIZE:128
SSL_CLIENT_VERIFY:  NONE
SSL_SERVER_M_VERSION:3
SSL_SERVER_M_SERIAL:1121698500FC96BF666F1B30663DE1324AC8
SSL_SERVER_V_START: Jun 24 06:15:42 2015 GMT
SSL_SERVER_V_END:   Jun 24 06:15:42 2018 GMT
SSL_SERVER_S_DN:    CN=*.quins.com.au,OU=Domain Control Validated
SSL_SERVER_I_DN:    CN=AlphaSSL CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE
SSL_SERVER_A_KEY:   rsaEncryption
SSL_SERVER_A_SIG:   sha256WithRSAEncryption
SSL_SESSION_ID:     f3a8f70a6aea5aa15c236bc37e1e701166071402a5356d67b3069294bd1f990b
SSL_SESSION_RESUMED:Resumed
HTTP_HOST:          www.quins.com.au
HTTP_CONNECTION:    keep-alive
HTTP_ACCEPT:        application/json, text/javascript, */*; q=0.01
HTTP_X_REQUESTED_WITH:XMLHttpRequest
HTTP_USER_AGENT:    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
HTTP_REFERER:       http://post.flyingenvelope.com/f/a/Ybra47iN3HGx_WwoNS9lIA~~/AABaNgA~/RgRaaTuHP0EIAKxD50iNdStXA3NwY1gEAAAAAFkGc2hhcmVkYQ5mbHlpbmdlbn    ZlbG9wZWANNTQuMjQ0LjQ4LjEzMEIKAAIHCIhYmGR2C1IWd2VibWFzdGVyQHF1aW5zLmNvbS5hdQlRBAAAAABEPGh0dHBzOi8vd3d3LnF1aW5zLmNvbS5hdS9jaXZpY3JtL2NvbnRhY3Qvdmlldz9yZ    XNldD0xJmNpZD04NEcCe30~
HTTP_ACCEPT_ENCODING:gz    ip, deflate, sdch
HTTP_ACCEPT_LANGUAGE:en    -US,en;q=0.8,en-AU;q=0.6,en-GB;q=0.4
HTTP_COOKIE:        Dru    pal.tableDrag.showWeight=0; webform-    4580[1485308168]=1485308168; webform-4580[1485309881]=1485309881;     SSESS1a6aea6ec131844971    20f080e47a50a5=CDWCF1NwTZEVPOMhCqJw-    eyecyJdC2vGR5ul6s90_Fc; adaptive_image=1280; has_js=1
PATH:               /us    r/local/sbin:/usr/local/bin:/usr/sbi    n:/usr/bin:/sbin:/bin
SERVER_SIGNATURE:   <ad    dress>Apache/2.4.7 (Ubuntu) Server a    t www.quins.com.au Po    rt 443</address>

SERVER_SOFTWARE:    Apache/2.4.7 (Ubuntu)
SERVER_NAME:        www.quins.com.au
SERVER_ADDR:        172.31.15.76
SERVER_PORT:        443
REMOTE_ADDR:        1.136.96.213
DOCUMENT_ROOT:      /var/www/html
REQUEST_SCHEME:     https
CONTEXT_PREFIX:
CONTEXT_DOCUMENT_ROOT:/var/www/html
SERVER_ADMIN:       webmaster@quins.com.au
SCRIPT_FILENAME:    /var/www/html/index.php
REMOTE_PORT:        16143
REDIRECT_QUERY_STRING:reset=1&id=4189&cid=84&action=view&context=contribution&selectedChild=contribute&snippet=json
REDIRECT_URL:       /civicrm/contact/view/contribution
GATEWAY_INTERFACE:  CGI/1.1
SERVER_PROTOCOL:    HTTP/1.1
REQUEST_METHOD:     GET
QUERY_STRING:       reset=1&id=4189&cid=84&action=view&context=contribution&selectedChild=contribute&snippet=json
REQUEST_URI:        /civicrm/contact/view/contribution?reset=1&id=4189&cid=84&action=view&context=contribution&selectedChild=contribute&snippet=json
SCRIPT_NAME:        /index.php
PHP_SELF:           /index.php
REQUEST_TIME_FLOAT: 1485309956.761
REQUEST_TIME:       1485309956

```

***BACKTRACE***

```
#0 /var/www/html/sites/default/files/civicrm/extensions/ca.bidon.reporterror/reporterror.php(251): reporterror_civicrm_generatereport("The Harlequin     Club, Incorporated", (Array:3), NULL, (Array:0))
#1 /var/www/html/sites/all/modules/civicrm/CRM/C    ore/Error.php(439): reporterror_civicrm_handler((Array:3))
#2 /var/www/html/sites/all/modules/civicrm/CRM/C    ore/Invoke.php(55): CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))
#3 /var/www/html/sites/all/modules/civicrm/drupa    l/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#4 [internal function](): civicrm_invoke("contac    t", "view", "contribution")
#5 /var/www/html/includes/menu.inc(527): call_us    er_func_array("civicrm_invo    ke", (Array:3))
#6 /var/www/html/index.php(20): menu_execute_active_handler()
#7 {main}

```

***POST***

***FULL BACKTRACE*** **next call**

```
file:               /var/www/html/sites/default/files/civicrm/extensions/ca.bidon.reporterror/reporterror.php
line:               251
function:           reporterror_civicrm_generatereport
args:               Array
(
    [0] => The Harlequin Club, Incorporated
    [1] => Array
        (
            [message] => Expected one PriceSet but found 25
            [code] =>
            [exception] => CiviCRM_API3_Exception Object
                (
                    [extraParams:CiviCRM_API3_Exception:private] => Array
                        (
                            [count] => 25
                            [is_error] => 1
                            [error_message] => Expected one PriceSet but found 25
                            [error_code] => undefined
                        )

                    [message:protected] => Expected one PriceSet but found 25
                    [string:Exception:private] =>
                    [code:protected] => 0
                    [file:protected] => /var/www/html/sites/all/modules/civicrm/api/api.php
                    [line:protected] => 45
                    [trace:Exception:private] => Array
                        (
                            [0] => Array
                                (
                                    [file] => /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php
                                    [line] => 158
                                    [function] => civicrm_api3
                                    [args] => Array
                                        (
                                            [0] => PriceSet
                                            [1] => getsingle
                                            [2] => Array
                                                (
                                                    [id] =>
                                                    [return] => is_quick_config, id
                                                )

                                        )

                                )

                            [1] => Array
                                (
                                    [file...

```

**next call**

```
file:               /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php
line:               439
function:           reporterror_civicrm_handler
args:               Array
(
    [0] => Array
        (
            [message] => Expected one PriceSet but found 25
            [code] =>
            [exception] => CiviCRM_API3_Exception Object
                (
                    [extraParams:CiviCRM_API3_Exception:private] => Array
                        (
                            [count] => 25
                            [is_error] => 1
                            [error_message] => Expected one PriceSet but found 25
                            [error_code] => undefined
                        )

                    [message:protected] => Expected one PriceSet but found 25
                    [string:Exception:private] =>
                    [code:protected] => 0
                    [file:protected] => /var/www/html/sites/all/modules/civicrm/api/api.php
                    [line:protected] => 45
                    [trace:Exception:private] => Array
                        (
                            [0] => Array
                                (
                                    [file] => /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php
                                    [line] => 158
                                    [function] => civicrm_api3
                                    [args] => Array
                                        (
                                            [0] => PriceSet
                                            [1] => getsingle
                                            [2] => Array
                                                (
                                                    [id] =>
                                                    [return] => is_quick_config, id
                                                )

                                        )

                                )

                            [1] => Array
                                (
                                    [file] => /var/www/html/sites/all/modules/civicrm...

```

**next call**

```
file:               /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php
line:               55
function:           handleUnhandledException
class:              CRM_Core_Error
type:               ::
args:               Array
(
    [0] => CiviCRM_API3_Exception Object
        (
            [extraParams:CiviCRM_API3_Exception:private] => Array
                (
                    [count] => 25
                    [is_error] => 1
                    [error_message] => Expected one PriceSet but found 25
                    [error_code] => undefined
                )

            [message:protected] => Expected one PriceSet but found 25
            [string:Exception:private] =>
            [code:protected] => 0
            [file:protected] => /var/www/html/sites/all/modules/civicrm/api/api.php
            [line:protected] => 45
            [trace:Exception:private] => Array
                (
                    [0] => Array
                        (
                            [file] => /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php
                            [line] => 158
                            [function] => civicrm_api3
                            [args] => Array
                                (
                                    [0] => PriceSet
                                    [1] => getsingle
                                    [2] => Array
                                        (
                                            [id] =>
                                            [return] => is_quick_config, id
                                        )

                                )

                        )

                    [1] => Array
                        (
                            [file] => /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php
                            [line] => 531
                            [function] => preProcess
                            [class] => CRM_Contribute_Form_ContributionView
                            [type] => ->
                            [args] => Array
                                (
                                )

                        )

                    [2] => ...

```

**next call**

```
 file:               /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module
 line:               448
 function:           invoke
 class:              CRM_Core_Invoke
 type:               ::
 args:               Array
 (
     [0] => Array
         (
             [0] => civicrm
             [1] => contact
             [2] => view
             [3] => contribution
         )

 )

```

**next call**

```
function:           civicrm_invoke
args:               Array
(
    [0] => contact
    [1] => view
    [2] => contribution
)

```

**next call**

```
file:               /var/www/html/includes/menu.inc
line:               527
function:           call_user_func_array
args:               Array
(
    [0] => civicrm_invoke
    [1] => Array
        (
            [0] => contact
            [1] => view
            [2] => contribution
        )

)

```

**next call** file: /var/www/html/index.php line: 20 function: menu\_execute\_active\_handler args: Array ( )

Martin Fuggle 1:20 PM (38 minutes ago)

to Site

```
There was a CiviCRM error at The Harlequin Club, Incorporated.
Date: 2017-01-25T13:20:31+11:00
SSL_SESSION_ID:     ea0aba40d7bbba6208e30995e64d1f67cf35193cf38c5775b89d086c1308098f
SSL_SESSION_RESUMED:Resumed
HTTP_HOST:          www.quins.com.au
HTTP_CONNECTION:    keep-alive
HTTP_ACCEPT:        application/json, text/javascript, */*; q=0.01
HTTP_X_REQUESTED_WITH:XMLHttpRequest
HTTP_USER_AGENT:    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
HTTP_REFERER:       http://post.flyingenvelope.com/f/a/RrIwh7O2i0LtT9ImrpKuaA~~/AABaNgA~/RgRaaT7xP0EIAmxDryS9WixXA3NwY1gEAAAAAFkGc2hhcmVkYQ5mbHlpbmdlbn    ZlbG9wZWANNTQuMjQ0LjQ4LjEzMEIKAAlxC4hYCTVrVVIWd2VibWFzdGVyQHF1aW5zLmNvbS5hdQlRBAAAAABEPGh0dHBzOi8vd3d3LnF1aW5zLmNvbS5hdS9jaXZpY3JtL2NvbnRhY3Qvdmlldz9yZ    XNldD0xJmNpZD04NEcCe30~
HTTP_ACCEPT_ENCODING:gz    ip, deflate, sdch
HTTP_ACCEPT_LANGUAGE:en    -US,en;q=0.8,en-AU;q=0.6,en-GB;q=0.4
HTTP_COOKIE:        Dru    pal.tableDrag.showWeight=0; webform-    4580[1485308168]=1485308168; webform-4580[1485309881]=1485309881;     webform-4580[1485310058    ]=1485310058; webform-4580[148531010    4]=1485310104;     SSESS1a6aea6ec131844971    20f080e47a50a5=SbI-oLpmvbwaJSCa8w5vB    b9KbmHjvI3SfKOD    31CqbfM; adaptive_image=1280; has_js=1
PATH:               /us    r/local/sbin:/usr/local/bin:/usr/sbi    n:/usr/bin:/sbi    n:/bin
SERVER_SIGNATURE:   <ad    dress>Apache/2.4.7 (Ubuntu) Server a    t www.quins.com    .au Port 443</address>

SERVER_SOFTWARE:    Apache/2.4.7 (Ubuntu)
SERVER_NAME:        www.quins.com.au
SERVER_ADDR:        172.31.15.76
SERVER_PORT:        443
REMOTE_ADDR:        1.136.96.213
DOCUMENT_ROOT:      /var/www/html
REQUEST_SCHEME:     https
CONTEXT_PREFIX:
CONTEXT_DOCUMENT_ROOT:/var/www/html
SERVER_ADMIN:       webmaster@quins.com.au
SCRIPT_FILENAME:    /var/www/html/index.php
REMOTE_PORT:        5354
REDIRECT_QUERY_STRING:reset=1&id=4190&cid=84&action=view&context=membership&selectedChild=contribute&compId=23&compAction=4&snippet=json
REDIRECT_URL:       /civicrm/contact/view/contribution
GATEWAY_INTERFACE:  CGI/1.1
SERVER_PROTOCOL:    HTTP/1.1
REQUEST_METHOD:     GET
QUERY_STRING:       reset=1&id=4190&cid=84&action=view&context=membership&selectedChild=contribute&compId=23&compAction=4&snippet=json
REQUEST_URI:        /civicrm/contact/view/    contribution?reset=1&id=4190&cid=84&action    =view&context=membership&selectedChild=contribute&compId=23&compAction=4&snippet=json
SCRIPT_NAME:        /index.php
PHP_SELF:           /index.php
REQUEST_TIME_FLOAT: 1485310831    .199
REQUEST_TIME:       1485310831

```

# Answer
> 1 votes
Yes, I have this error also, from a very similar setup. It's due to the line items in CiviCRM not getting correctly created by CiviCRM Webform. I have been working around it with some sql that looks like this for me:

```
update civicrm_line_item set price_field_id = [something], price_field_value_id = [something], financial_type_id = [something] where entity_table = 'civicrm_contribution' and isnull(price_field_id) and label = '[something]' and unit_price = '[something]';
```

In other words - the good new is that there should be enough information in Civi to fix the price field id and price field value id, but it's an ugly work around at this point.

I posted an issue here:

https://www.drupal.org/node/2840851

and a tentative patch to fix the issue in the webform civicrm code, here:

https://www.drupal.org/node/2840851#comment-11906821

---
Tags: webform-civicrm, contributions
---


# Question
Title: Security Vulnerability in Dashboard CiviCRM 4.6 for Drupal 7
I am currently testing the dashboard feature before enabling it on a production site. There seems to be a vulnerability in the Dashboard where a contact who only has "View my contact" permission and not "Edit my contact" is able to **Edit** a relative's contact (for which he has Dashboard access) even though he can only **View** his own contact.

Can someone confirm that this isn't only on my installation? I cannot test this on the Demo site as there is no access to Drupal.

Permissions User's Dashboard User's CiviCRM ProfileThe Spouse's ProfileSpouse's Profile Edit Screen

# Answer
You should look at the comment by cividesk, and make sure that if you uncheck the setting on Evan's relationship record to be able to edit the spouse contact, that Evan can't edit the spouse record. If that works as expected then:

Discussed this issue with CiviCRM Security Team. The consensus is that this is not a bug, more like a feature, or one way to look at it is that CiviCRM is just flexible/configurable in this manner. If you don't want to have the contact be able to their spouse from that form you either need to not enable the setting on the contact's relationship record to allow editing, or possibly use ACLs(Access Control Lists) or some custom code in an extension to modify this behavior.

Also as a side note, the permissions "edit my contact" and "view my contact" when enabled for a Drupal user role can cause performance issues in installations with large numbers of contacts.
> 1 votes

---
Tags: dashboard, security
---


# Question
Title: Add 'Non-deductible amount' to Contribution Receipt template
I am trying to add the non-deductible amount to my Automatic Contribution receipt but it is not printing the value. Any tips? I am using Civicrm 4.6.19 with Drupal 7

```
  <tr>
    <td {$labelStyle}>
      {ts}Non-deductible Amount{/ts}
    </td>
    <td {$valueStyle}>
      {$nonDeductAmount|crmMoney:$currency}
    </td>
  </tr>

```

# Answer
> 2 votes
There seems to be a bug that does not fill the civicrm\_contribution table non-deductible\_amount column. Until that is fixed this will continue not printing a value. For now you can use the API csv Import to update that column for existing donations.

There is another thread started about this. Non-deductible contribution amounts are always $0

---
Tags: smarty
---


# Question
Title: SQL to unlink contacts and drupal accounts
1) In what table/field of the CiviCRM database is the Drupal User ID stored?

2) What is the SQL statement to delete all rows in that table except User1?

Due to the way we imported contacts and generated Drupal users, all our contact/user links are mismatched (on a development site). And I just can't get phpMyAdmin working on this server, so need to do it via mysql CLI.

# Answer
The table you are looking for is `civicrm_uf_match` with the following structure

```
CREATE TABLE `civicrm_uf_match` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'System generated ID.',
  `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain is this match entry for',
  `uf_id` int(10) unsigned NOT NULL COMMENT 'UF ID',
  `uf_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'UF Name',
  `contact_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Contact ID',
  `language` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'UI language preferred by the given user/contact',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_uf_name_domain_id` (`uf_name`,`domain_id`),
  UNIQUE KEY `UI_contact_domain_id` (`contact_id`,`domain_id`),
  KEY `I_civicrm_uf_match_uf_id` (`uf_id`),
  KEY `FK_civicrm_uf_match_domain_id` (`domain_id`),
  CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_civicrm_uf_match_domain_id` FOREIGN KEY (`domain_id`)  REFERENCES `civicrm_domain` (`id`)
 )

```

So the SQL statement to delete every link except the admin user is:

```
delete from civicrm_uf_match
where uf_id !=1

```

The batch found at *Administer -\> Users and Permissions -\> Synchronize Users to Contacts* brings them back. But better try this first on a test instance.
> 3 votes

---
Tags: drupal, mysql
---


# Question
Title: Automatic mail after user registration (voucher)
not the civi-guru, but with some basic knowledge ;-). I would like to send an automated mail when a new user registers.

I have created a profile for that, see http://www.centcom.net/civicrm/index.php,

in the advanced settings, there is an option for sending a mail after registration, but i would need to send a email template, which i have created in Administration/CiviMail/Templates.

Any idea how to accomplish this? Via Administration/System/planned Jobs?

Thank you,

Gerald Modify message

# Answer
If you can't do this through civi native, take a look at CiviCoop's CiviRules extension.
> 1 votes

---
Tags: contacts, system-workflow-messages
---


# Question
Title: Cron Wordpress 4.7.14 - will not send scheduled emails
I schedule a job through mailings. The Cron job looks like it picks it up, and the mailing is marked as running, but it never gets sent out until someone manually runs scheduled jobs (administer\>system\>scheduled jobs).
The process is running every 15 minutes on schedule, the jobs logs, has two entries at the time it should pick up the scheduled job. The first just has the time/date and
Summary Starting scheduled jobs execution the second has the date/time the jo Entity: Job Action: process\_mailing Summary Starting execution of test job schedled - Details Parameters parsed (and passed to API method): a:1:{s:7:"version";i:3;} Full message: Starting execution of test job schedled but once it picks up a scheduled job it never completes, it will just generating the starting execution message. Also as a result of this I get the system message that Cron is not running after a bit. I've tried Civihosting support and they said to post it here.

# Answer
> 1 votes
Is there any output from the cron job? (On Civihosting, you can configure the cron job to mail you the output.) If it is starting but not completing, it could be running out of memory.

---
Tags: civimail
---


# Question
Title: Looking for a Dutch CiviCRM basics manual or book
Is anyone aware of a book, document, customer manual or other Dutch material that could help customers in understanding and using the basic functionality (like searching, basic concepts ...) ?

# Answer
Unfortunately not Paul, but if you start writing let me know :-)
> 2 votes

---
Tags: documentation
---


# Question
Title: "Site can't be reached" error during CiviCRM Joomla install
When I try to "Install from folder" (CiviCRM 4.7.15) on Joomla (3.6.5) I get the error "Site can't be reached." I've tried the troubleshooting tips listed here: https://wiki.civicrm.org/confluence/display/CRMDOC/Installing+CiviCRM+for+Joomla#InstallingCiviCRMforJoomla-5.Trouble-shootingResources

But to no avail! I've also noticed that if I have my FTP client open and connected to my server, it gets disconnected at the exact same time that the install fails (about two minutes into the process). I then usually have com\_civicrm folders in my Components and Admini/Components folders and a civicrm folder in my media folder, and one time I had civicrm in my plugins folder and it was working, but because I didn't get a confirmation screen I tried to reinstall properly and now nothing works!

Thanks for any help! John

# Answer
> 0 votes
It turns out that I needed more privaleges on my MySQL account, ones that my host did not give me the option of enabling. Here is the list of requirements: https://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+MySQL+Permission+Requirements

My host wouldn't let me do Triggers or create routines, so I had to switch hosts and it now works. In case anyone is reading this with the same problem, I looked for hosts on CiviCRM.org to find one that was compatible, and they were able to transfer me over and assist with the install for free with a new registration.

---
Tags: joomla, installation, install
---