# Question
Title: Outgoing Mail Settings, CiviSMTP & PHP 5.6.x Problem
After upgrading CiviCRM from 4.3.8 to 4.7.15 on Drupal 7, our outgoing mail is giving an error after sending a test email. I'm on a Debian server running PHP 5.6.x and we use CiviSMTP for our outgoing mail.

**Error:**

```
authentication failure [SMTP: STARTTLS failed (code: 220, response: Go ahead with TLS)]

```

Have we decided as a community what the recommended action is to address this issue? I.E. downgrade PHP to 5.5, or this CiviCRM core hack or apply this patch to `packages/Net/SMTP.php` (below), or something else?

CiviSMTP made an announcement to apply the following patch to disable TLS. There doesn't seem to be another option:

```
$this->_socket_options = $socket_options;

```

to

```
$this->_socket_options = array('ssl' => array('verify_peer'=>false,'verify_peer_name'=>false,'allow_self_signed'=>true));

```

I prefer not to downgrade PHP or hack core and to apply the least invasive fix possible.

**Observations:**

* This problem is on CiviSMTP (not affiliated with the CiviCRM dev community) and seems to be specific to anyone using that SMTP service.

# Answer
The recommended and least invasive fix is to **resolve the underlying SSL issues**.

It was intentional that PHP5.6 tightened security here. If your hosting environment doesn't validate the SSL certificate you're communicating with, one of these things is probably true -

* The hosting environment has a misconfigured certificate chain. (Fix varies by hosting environment - for Debian, `apt-get install ca-certificates` \- there's probably already a Stack Exchange answer for any other specific OS/environment a site is hosted on.)
* The remote service requires that you install a custom CA chain before their certificate validates. (Perhaps your SMTP provider uses a self-signed SSL certificate, or a cert from a certificate authority not installed on your hosting environment.)
* The remote service has a misconfigured/bad SSL certificate. (Ask remote service to fix SSL.)
* The connection between the two is being interfered with. ( )

Identify whether it's your hosting environment or the remote site's SSL which is failing, by testing multiple remote sites from multiple client environments. This SE answer shows how to test with `openssl` command from CLI and has links to web services for same.

Then resolve the SSL issues at whichever end they are occurring, until SSL validates and your CiviCRM is able to connect again.

This assumes that you *can* resolve the underlying SSL issues! If the remote site offers SSL without a valid chain, or uses a certificate which your server can't make sense of (ex: this libressl bug \- as opposed to a valid CA you just don't have installed), then you just can't have SSL validation.

### Alternative solutions (not recommended)

Unless you're running CiviCRM for local development and with fake contact data,
> 11 votes

# Answer
\[Don't upvote this - Chris' answer is far better! I wouldn't have written this had I seen his. I'm leaving it here for folks who need an (over-)simplified explanation of why this happens, so they can better implement Chris' solution.\]

This error generally indicates an issue with the SSL certificate bundle on your end and/or the mail server's end.

Without getting deep into how SSL certificate authorities work (Wikipedia has a much better explanation than I can provide): There's a handful of "root" certificate authority (CA) companies. Symantec, GoDaddy, Comodo, also many governments/militaries. Every SSL certificate is either:

* a root certificate owned by a root CA;
* "signed" (cryptographically verified as legit) by someone who has a root certificate;
* signed by someone who's got a signed certificate themselves. In this case, you have a root cert, one or more intermediate certs, and the cert on (in this case) the mail server;
* A cert that can't trace its lineage back to a root cert. These are known as "self-signed" certs. Your data is encrypted - but you can't guarantee the person on the other end is who they claim.

The problem here is, "Who gets to call themselves a root cert? And how do we know that the intermediate certs have been signed by a root cert?"

The answer to "who is a root cert?" is determined by whatever software you're using. Every web browser includes all the root certs they recognize in their installer. Each web browser company has their own (intense) process. E.g. here's the list Firefox currently uses. This list changes all the time!

So that leads to two more situations:

* The mail server's cert can trace its lineage back to a newer root CA, but one that your older software can't recognize because it didn't ship with the newer root cert.
* The mail server's cert was signed by a legit intermediate cert, but is failing to tell your CiviCRM about it (incomplete "certificate chain").

Your web server has a stack of root certs installed - PHP uses the ones provided by OpenSSL. Chances are, you update OpenSSL a lot less frequently than your web browser!

So most likely, your web situation is the fifth one - your openSSL is too old. If you're running Linux, update to the latest version of your distribution.

It's also possible that your situation is the sixth one - in which case you need to tell the mail administrator to fix their certificate chain.

Chris gives much better answers on how to figure out which of these is true!
> 1 votes

# Answer
I encountered the same email problems after upgrading to PHP 7.0.30 from 5.5.38. My client's server uses TLS.

Go to the following website: http://www.checktls.com/

and enter you email address and press the CheckTLS button and review the output.

In my case, it highlighted that the mail server was using expired and self-signed certificates
> 0 votes

---
Tags: civimail, drupal, upgrade, smtp
---


# Question
Title: PHP is being updated from version 5.5 to 5.6
My host is upgrading php from version 5.5 to 5.6 next week. I am running wordpress v 4.5.3 and civicrm v 4.7.10. Should I be concerned about anything going wrong with the running of my site after the upgrade? They offer a 'PHP CGI' installer that can be used to install an older version of PHP onto my site if needed.

I'm a bit of a newbie so sorry for my ignorance on this matter.

Pete

# Answer
CiviCRM runs great on PHP 5.6 - better than it does on PHP 5.5! I make that upgrade regularly without thinking - assuming CiviCRM is up-to-date, which in your case it is.

Note that upgrading to PHP 7 is not yet supported, though it will be imminently.
> 2 votes

# Answer
Run the following to ensure SMTP will work properly. Bad certificates will cause mail not to send and the "CRON not Running" Error. Go to the following website: http://www.checktls.com/

and enter you email address and press the CheckTLS button and review the output.

In my case, it highlighted that the mail server was using expired and self-signed certificates.
> 0 votes

---
Tags: wordpress, php
---


# Question
Title: What are the minimum and recommended changes to CiviCRM to support PHP 7?
To pragmatically help CiviCRM step-by-step to support PHP7 I would like to know what the minimum and recommended changes to CiviCRM to support PHP 7?

This will help developers to identify areas of interest in order for issue https://issues.civicrm.org/jira/browse/CRM-17789 (PHP7 support) to be available.

PHP7 is significantly faster and PHP 5.6 will lose support august 2016 so it is wise to slowly work towards getting CivCRM ready for PHP7 :-)

# Answer
> 4 votes
None any more - as of 4.7.12, CiviCRM supports PHP7

# Answer
> 0 votes
**Check the certificates on your mail server.**

Run the following to ensure SMTP will work properly. Bad certificates will cause mail not to send and the "CRON not Running" Error. Go to the following website: http://www.checktls.com/

and enter you email address and press the CheckTLS button and review the output.

In my case, it highlighted that the mail server was using expired and self-signed certificates.

---
Tags: php, php7
---


# Question
Title: Joomla! log in error on http vs http://www
I've got a client with a bizarre Joomla/CiviCRM issue.

When the client is logged in at http://www.site.com, when they perform certain CiviCRM actions, they are redirected to http://site.com, which they are not logged in at. However, when they log in a second time at http://site.com they are able to function normally. However, if they log out at http://site.com, they are still logged in at http://www.site.com

Confused? The kicker is that I updated the CiviCRM baseurl to be http://www.site.com. But even clearing caches hasn't helped that bleed through.

What is happening here?

1. Is the http://www vs http:// login distinction a Joomla! only one?
2. Is there anything else I need to do to clear CiviCRM's caches regarding stored http://site.com addresses?
3. I deleted civicrm\_cache session entries, but they seemingly aren't being regenerated. Any ideas why?

# Answer
> 1 votes
Consider picking either `www.site.com` or `site.com` as the canonical domain. Then:

* Setup an httpd redirect (in Apache or nginx) from one domain to the other domain.
* Ensure that the configuration files (e.g. both of Joomla's `civicrm.settings.php` files) and "Resource URLs" consistently point to the same domain.

(Alternatively, you could dig further into how the URL settings work, but *usually*, when you consider SEO and marketing consistency, it's higher-value to use the same domain consistently.)

---
Tags: joomla
---


title: Phantom contact record

text:
# Question
Title: Phantom contact record
I have a view that displays civiCRM contact records according to Contact Type. The displays needs to change every Fall, and the way we do this is by changing the contact type (but keeping the record). There is a particular contact record, however, that displays on the view but is missing from our civicrm records. I have looked under his name, email, and contact id, but nothing comes up. This should not be possible: the view displays the contact record's name, bio, university, and image. So how is this person's record displaying if I cannot find him in a search?

# Answer
Most likely, the contact is deleted, but your view isn't filtering out deleted users. You may want to check that in your view.

You can search for deleted contacts from **Search menu » Advanced Search** by checking the "Search in Trash" checkbox.
> 4 votes

---
Tags: contacts, drupal-views
---


# Question
Title: Localization Settings DB Error: insufficient permissions
Civicrm 4.7.24 Drupal 7 EC2 Server Amazon RDS DB

Hey guys I am trying to set the localization settings in my CIVICRM instance but whenever I go to civicrm/admin/setting/localization?reset=1

I get the following error

`Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
DB Error: insufficient permissions
Return to home page.`

The user has `GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, TRIGGER, CREATE ROUTINE, ALTER ROUTINE ON att2.* TO 'att'@'10.0.%.%' IDENTIFIED BY 'password';`

here is the backtrace

```
#0 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Error.php(187): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/html/att/sites/all/modules/civicrm/packages/PEAR.php(921): call_user_func((Array:2), Object(DB_Error))
#3 /var/www/html/att/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: insufficient permissions", -26, 16, (Array:2), "CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain [n...")
#4 /var/www/html/att/sites/all/modules/civicrm/packages/PEAR.php(575): DB_Error->__construct(-26, 16, (Array:2), "CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain [n...")
#5 [internal function](): PEAR->_raiseError(Object(DB_mysqli), NULL, -26, NULL, NULL, "CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain [n...", "DB_Error", TRUE)
#6 /var/www/html/att/sites/all/modules/civicrm/packages/PEAR.php(224): call_user_func_array((Array:2), (Array:8))
#7 /var/www/html/att/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#8 /var/www/html/att/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -26, NULL, NULL, "CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain [n...", "DB_Error", TRUE)
#9 /var/www/html/att/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-26, NULL, NULL, NULL, "1142 ** CREATE VIEW command denied to user 'att'@'10.0.10.196' for t...")
#10 /var/www/html/att/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#11 /var/www/html/att/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")
#12 /var/www/html/att/sites/all/modules/civicrm/packages/DB/DataObject.php(2446): DB_common->query("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")
#13 /var/www/html/att/sites/all/modules/civicrm/packages/DB/DataObject.php(1635): DB_DataObject->_query("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")
#14 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/DAO.php(362): DB_DataObject->query("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")
#15 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/DAO.php(1949): CRM_Core_DAO->query("CREATE OR REPLACE VIEW civicrm_domain_view AS SELECT * FROM civicrm_domain")
#16 /var/www/html/att/sites/all/modules/civicrm/CRM/Admin/Form/Setting/Localization.php(88): CRM_Core_DAO::checkTriggerViewPermission(TRUE)
#17 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Form.php(564): CRM_Admin_Form_Setting_Localization->buildQuickForm()
#18 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#19 /var/www/html/att/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Admin_Form_Setting_Localization), "display")
#20 /var/www/html/att/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Localization), "display")
#21 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#22 /var/www/html/att/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#23 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Localization", "Languages, Currency, Locations", NULL)
#24 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#25 /var/www/html/att/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#26 /var/www/html/att/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#27 [internal function](): civicrm_invoke("admin", "setting", "localization")
#28 /var/www/html/att/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
#29 /var/www/html/att/index.php(21): menu_execute_active_handler()
#30 {main}

```

# Answer
Figured it out, needed to give the SQL user CREATE VIEW rights
> 2 votes

---
Tags: settings, administer
---


title: Twilio - how to disable inbound SMS

text:
# Question
Title: Twilio - how to disable inbound SMS
My client has asked me to disable Twilio handling replies from users - anyone know how this is done? i.e. outbound only, no inbound. The number I am renting says it can send/receive SMS - So I want it to send only, but can't see any settings for this. I removed the mo=1 parameter in Civi settings for Twilio but it made no difference. I'm on 4.7.21 and Drupal. Ideas?

# Answer
The install instructions at https://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=86213770#SettingupaSMSProviderforCiviSMS-twilio say

In Twilio account settings, go to Numbers and click on the number you want CiviCRM to "listen to". That will open configuration settings for that phone number. Under Messaging, change Request URL to http://yoursiteurl/civicrm/sms/callback?provider=org.civicrm.sms.twilio with HTTP POST

So if you remove that url it should stop posting inbound to CiviCRM.
> 3 votes

---
Tags: sms, civisms, twilio
---


# Question
Title: Civi CRM Sparkpost - pesc.sparkpost - Error Sending Group Subscription Welcome Emails
So, I'm using the com.pesc.sparkpost CiviCRM/Sparkpost integration extension. It is working really well so far for just about everything except for the welcome email for mailing list group subscriptions. I've tried through a drupal webform and through a Civi profile (using checkmark boxes for public subscriber groups). In both cases, the double-opt-in email gets sent properly, and the link in the double-opt-in email works properly. Upon clicking the link I am sent to a confirmation page with an error message (bellow), but the welcome email is never sent, and the transactional email is shown as pending on the user's profile in Civi.

So, Transactional emails and Mass mail are definitely being sent fine through Sparkpost, and the subscription mechanism is working as intended. So I'm pretty sure that my sparkpost smtp settings are working as intended, contrary to the error message. So far it seems to be just these welcome emails that aren't sending properly.

---

> An error occurred when CiviCRM attempted to send an email (via SMTP). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt.
>
> The mail library returned the following error message: Failed to send data \[SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM \>\> Global Settings \>\> Outbound Email (SMTP). (code: 550, response: 5.7.1 Unconfigured Sending Domain )\]
>
> This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:
>
> * Your SMTP Username or Password are incorrect.
> * Your SMTP Server (machine) name is incorrect.
> * You need to use a Port other than the default port 25 in your environment.
> * Your SMTP server is just not responding right now (it is down for some reason).
> * The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.
>
> (i) Name (email@example.com) has been successfully subscribed to the mailing list.

# Answer
> -1 votes
Put

define('CIVICRM\_MAIL\_LOG', '/whereever/you/want/the/log');

in civicrm.settings.php and this will log what it's trying to send. If the from address appears incorrect then whatever it is appearing as might lead you to the problem.

---
Tags: email, sparkpost
---


title: Comparing Duplicate address

text:
# Question
Title: Comparing Duplicate address
I have set of name, addresses, phone number etc in CiviCRM. These are slightly outdated. I have an excel sheet for the same people with their new addresses. I have a unique external identifier for most of them.

If the excel sheet address is new, I want CiviCRM to add it as a second address and if it is same as old address, then I don't want to update.

How can I achieve this?

# Answer
> 3 votes
The most reliable way to do this is to not import addresses that are known matches.

I regularly use Pentaho Kettle to create import files for me. I'll separate addresses into their own CSV, then use Kettle to look up whether the address matches the contact's address in Civi. I'll filter out those that do, leaving only remaining addresses. However, Kettle has a high learning curve.

You could do the same with just LibreOffice Calc or Microsoft Excel - but it requires some Excel/Calc knowledge.

* Export all CiviCRM addresses (with external identifier) to a CSV.
* Open the CSV in Calc/Excel, and concatenate all the fields you want to compare into a new column (make this Column A). Label this column "Unique lookup".
* Create a concatenated "Unique lookup" column in the new address spreadsheet as well, using the same fields.
* On the *new* address sheet, Use the `VLOOKUP` function in Excel, using exact matching. Use the *existing* addresses as your lookup sheet. Return a value in a new column for matching addresses.
* Sort by the `VLOOKUP` field in your new addresses. Delete any address that has a match in the existing addresses.

---
Tags: contacts, duplicate-contacts, addresses, upgrade
---


# Question
Title: How to hide the "If you have a coupon code, enter it here" option, in an online registration form to an event?
How to hide the "If you have a coupon code, enter it here" option, in an online registration form to an event?

# Answer
If there is no code that applies to either the event or a price line item that is used in the event price set the discount code block should not appear.
> 1 votes

# Answer
You can remove it with CSS though you may need some JS if you want the "enter discount code" to appear on some event/contribution pages but not on others (so you need to examine the URL).
> 1 votes

---
Tags: cividiscount
---


# Question
Title: Failed to import contacts into groups (with csv import)
I have contacts belonging to different groups.

I made a first csv import successfully : I have all data of contacts and they are all in the same big group.

But then I tried to import them group by group with just their email address and the update option. The import seems to be successful. It mentions " Stratégie internet: One contact added to this existing group."

But when I go to group panel, the group has no new contact.

I tried many thing (import more than email for this 2nd import, change group visibility, use a new group, etc.) but it is still the same.

# Answer
To bypass this problem, I use Yes/No custom field to import the data "Belonging to A group". Then I use an advanced search to select those contacts and add them to the A group.
> 1 votes

# Answer
You haven't specified your CiviCRM version number, but there was recently a bug, CRM-20739, that caused this problem depending on your import settings. If you are using a version of CiviCRM less than 4.7.23, the solution is to upgrade.
> 1 votes

---
Tags: import, groups, data-import
---


# Question
Title: CiviCRM API V3 : Translate Two Digit State to State_Province_id?
I'm using civimigrate for a pretty intense migration into CiviCRM and I have hit something of a puzzler.

I have a table with addresses that I am matching to contacts, but I cannot seem to find a way to map a state abbreviation (AL,MD,FL) to an id for the api.

I was hoping to find something in the API explorer to paste into my import, but I can't seem to find out where the API calls for translating state abbreviations into ids live.

Any ideas?

# Answer
> 0 votes
Thanks for the response. I ended up doing something similar before seeing your response by creating a pre-processed source table with raw SQL queries. My actual use case involved a few thousand entries, not all of them US based.

I split up my address records into US/Non-US, then joined the US table on LIKE where country\_id=1228, and the non-us table on LIKE where country\_id \<\> 1228, ignoring state/province for non-us records, then recombined them both, now with proper country and state/province ids.

# Answer
> 2 votes
Try this:

```
$result = civicrm_api3('StateProvince', 'get', array(
  'sequential' => 1,
  'abbreviation' => array('IN' => array("AL", "MD", "FL")),
  'country_id' => 1228,
));

```

Note that you should specify `country_id` as state abbreviations are not globally unique.

---
Tags: import, data-import
---


# Question
Title: Can I run a Test Installation? If so, how?
I'm part of a non-profit organization - the Center for Jewish Nonviolence - that is looking to use CiviCRM. We are very impressed with what we've seen on your website thus far and want to move forward but have two outstanding questions.

First, can Civi be downloaded onto an individual computer and played around with? How so? The hope is to test out the system itself (outside the demos) and get started with our work.

Secondly, if we wished to start an account now then delete it, would that be possible?

I've read through the first part of the guide and can't locate an answer to my questions. Could you let me know how to proceed or point me in the right direction?

Thanks so much!

Sincerely, Michael D. Evers

# Answer
> 4 votes
I would add a few more specifics to petednz's answer, because we were in exactly the same boat a year ago. I got a free non-profit (we are the San Diego County Bike Coalition) account on Dreamhost, where I installed both Wordpress (clone of our mature website) and the latest (at that time) version of CiviCRM. This is a shared hosting account and NOT recommended for your final deployment, but it sure was a good test platform for us. If you want something more local, I also set up XAMPP environments on both a linux and windows laptop. XAMPP gives you a local Apache web server, PHP, MySQL (MariaDB), all on your laptop or desktop. That way I really couldn't break anything. Both these environments, temporary hosted website or local XAMPP website, are definitely DIY. If those are foreign to you, a CiviCRM partner would be recommended.

Having an actual hosting site like Dreamhost for the initial setup and test period was crucial if you have multiple people working on it, as you each need to have access to the evolving configuration through a browser. Now that we are fully hosted on a VPS, I still rely heavily on my local XAMPP instance(s) to test out new things and also to run updates locally first, as updating either Wordpress or CiviCRM always has the potential to zap your website. Realize that a local desktop/laptop setup, though, is only useful for ONE person.

I might add that it is quite easy to migrate/move your test configuration into a different location or different server. We follow religiously the steps at https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location.

I think you will love CiviCRM. We are amazed, nearly daily, at all the functionality it provides. By taking care of the administration on our own, we have saved the SD County Bike Coalition at least $5,000 annually by dropping commercial packages for contact database, transactions, mail management, event management, which all had monthly or annual fees and didn't integrate well together. The real savings, though not easily measurable but way more than the $5K material savings, was in eliminating staff time and frustration having to learn 4 different applications and constantly dealing with manual intervention because they were so poorly integrated. If your organization fully embraces it, don't forget to contribute to CiviCRM, because it does need to be supported to be sustainable.

# Answer
> 2 votes
CiviCRM is open source and can be downloaded and installed on to any machine that meets the requirements.

You can find instructions here or one of the other related pages depending on the CMS you are using.

In terms of 'start an account', you will need to work out what sort of hosting arrangement you want which may depend on whether you choose to work with one of the CiviCRM Partners to get yours system running well, or use one of the civicrm hosting providers. Alternatively you can host on other services provided they meet the requirements and you are happy doing the installation yourself.

---
Tags: evaluating-civicrm, demo-site
---


# Question
Title: Does CiviMail SMTP work with Amazon AWS SES?
Would like to use AWS SES as the SMTP service for CiviMail. The AWS SMTP is set up and authorized but not working with CiviMail.

Has anyone done this successfully? Are there any special requirements?

# Answer
The thread Lobo is referencing is out of date IMO. I've set up AWS SES with CiviMail multiple times in multiple configurations. My personal documentation is here.

I've also successfully set up Postfix locally on a VPS as a smarthost to relay to SES - this is nice because then all e-mail from your VPS (e.g. backup notifications, cron failures, etc.) go through SES. I don't have good docs for that, unfortunately.

Finally - note that my biggest pitfall with SES wasn't SES itself but EC2 - Amazon severely limits outgoing traffic on SMTP ports from EC2 unless you request they manually lift their throttle!

EDIT: A bunch of us discussed our mailing tool at CiviCon today. Mandrill seemed very popular, for a number of reasons - like subaccounts and the strength of the CiviCRM integration. I wasn't the only SES person - but there was a strong argument that if you do, you must relay through Postfix. If Amazon throttles you, CiviCRM won't retry - Postfix will. You could lose e-mails. Also you can lose e-mails when exceeding quota. So it works - but I may try Mandrill next time!

ANOTHER EDIT: Forget Mandrill, SparkPost is the third-party mailer of choice in Civi-world these days now that Mandrill jacked up the prices.
> 4 votes

# Answer
It was pretty easy to setup and use and have the sending rates increased by Amazon - my average bill for sending about 10k emails a month from 2 domains is about $1 and using the service with domain keys in place has improved my open rate over php mail of my web server- although the first month I had a few more unsubs then normal - I think because email was moving out of spam folder to inboxes.

One other interesting point - Those using tell a friend options in email will need to rethink this as SES only allows the from to be from the sending domain - not from the tell a friend person...
> 1 votes

# Answer
There is a pretty detailed thread (a few years old) about CiviMail and SES here:

http://forum.civicrm.org/index.php?topic=18279.0

Bottom line, it does work for some folks with a local mail relay but most folks seems to prefer mandrill or some other solution. Seems like some more work needs to be done to get it to work seamlessly
> 0 votes

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


# Question
Title: Search for contributions made in previous 4 months
I'm trying to search for contributions made in the previous 4 months.

Example - We are in October, but I want to be able to see if people have contributed since June 1.

I can search by previous month (Sept), previous 2 months (Aug), and the previous quarter (July), but am not sure how to search from the previous 4 months.

Any ideas?

Thanks!

# Answer
You can always search by selecting "Choose Date Range" and entering dates manually (see screenshot below).

If you're looking to use a relative date filter because you need this to be in a report or smart group, then that date filter doesn't currently exist.

**However:** I am actively working on making it possible to create your own date filters (CRM-16195)! I am waiting on someone to review some preliminary cleanup I did a couple of weeks ago. Once the cleanup is approved, I will submit a change so that custom date filters can be added by an extension. I already have an extension written that will handle your scenario.

If you absolutely can't wait, and you're comfortable patching CiviCRM, contact me on https://chat.civicrm.org (@junglebird) and I'll give you a patch so you can do this today.
> 2 votes

---
Tags: contributions, search
---


title: Joomla 3.8 errors with CiviCRM

text:
# Question
Title: Joomla 3.8 errors with CiviCRM
I am troubleshooting a development site and the contribution pages working under Civicrm 4.6.30 and Joomla 3.6.5 are not working under joomla 3.8 and Civi 4.7.23. Formatting of form is screwed up (alignment, form field lengths, etc.) are incorrect and most importantly, the total amount for selected options are not totaling. I have tried reinstalling Civi 4.7.23 and experimenting with changes to civicrm.css, but nothing works. I saw a post suggesting clearing civi caches and logs, which I have done, but still no go. URL is form url. Any ideas would help. Thanks, K.

# Answer
CiviCRM is not yet compatible with Joomla 3.8. See here. As you will see, there is a patch. The patch resolved all the issues I was aware of, but is not yet approved.
> 3 votes

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


# Question
Title: How to disable State/Province in billing address blocks
In the UK, the list of counties provided by Civicrm (and by the ISO) is mysterious to say the least to most UK dwellers. Many people think they live in a county which changed to something else years ago!

So, afaik it's best not to use counties in addresses with drop-down options - such as billing fields.

Therefore, how can one disable state/county in a billing address block? Or at least make it not required?

We use Authorize.net for most UK transactions.

Thanks for your help!

Drupal 7.56, Civi 4.7.22

PS - I see this: https://issues.civicrm.org/jira/browse/CRM-19688 But I don't think it helps in this situation?

# Answer
We also needed to disable some billing fields, including the state/province, so we wrote an extension for it: https://github.com/WeMoveEU/nobillingfields

It keeps only first name, last name and zip code, and this is a hardcoded thing, but you should be able to easily adapt to your needs if you have a developer. Note however that when we migrated to 4.7, the extension stopped working, and I patched civi core to make it work again. I reported the problem, and the suggested fix was to unset validation errors with a hook, but I have yet to try it.

I'm afraid there is no easier solution...
> 3 votes

# Answer
The address fields are defined in a file call CRM/Core/Payment.php. I approached this by overridding the file in a Custom PHP directory and commenting out the State/province field. Not ideal I realise, but fast.
> 2 votes

---
Tags: billingblock
---


# Question
Title: Javascript Contact API - how do I 'do something' with results
Through javascript, I was hoping to check what groups a user belongs to and then use that information to show / hide something. I can't use ACLs because I'd like the average internal user to be able to enter the information on intake but not be able to edit it in future.

Using the API, I can get an object that has a

```
    CRM.api3('Contact', 'get', {
  "return": "group",
  "id": 68525 // arbitrary number will need current user
}).done(function(result) {
  // do something
    console.log(result);

});

```

which returns this

```
Object { is_error: 0, version: 3, count: 1, id: 68525, values: Object }

```

The group info **is in** the values: Objects, how can I reference it?

# Answer
> 1 votes
To get the 'groups' result from the returned 'result' - I had to access the nested data. I referenced this great explanation here: https://stackoverflow.com/questions/11922383/access-process-nested-objects-arrays-or-json

I still struggled for a bit and realized that's because the groups result i was looking for was nested down two levels.

```
result Object { is_error: 0, version: 3, count: 1, id: 68525, values: Object }

   values Object { 68525: Object }

       68525 Object { contact_id: "68525", groups: "Administrators", id: "68525" }

```

On top of that to reference that last object by a number i had to enclose on quotes.

I still have work to do towards my ultimate functionality but my proof of concept holds true.

Here's what I ultimately used to get the contents of 'groups':

```
console.log(result['values']['68525']['groups']);

```

---
Tags: api, javascript
---


# Question
Title: CiviEvent - if registration date is is in the past, shouldn't be Online registration enabled?
These two doesn't seem to play well together. Mean, both options are mutually exclusive: we don't want Online Registration enabled if Registration End Date is in the past, do we? Even if (not sure) by "Registration End Date" we mean an offline registration end date.

# Answer
The checkbox that states "online registration is enabled" acts like a switch to enable online registration and allow you to configure the online registration parameters under the tab. If you uncheck this the fields will be hidden and online registration will be disabled.

The date fields set the start and end date that the online registration forms are available to visitors. This allows you to open and close registration at specific times automatically.

This all controls the public registration. nothing on this screen effects back end registrations.

Hope this helps.
> -1 votes

---
Tags: civievent
---


# Question
Title: When I imported new contacts, some contacts got error "record", what is that?
When I imported contacts using a CSV some rows were not imported even though their formatting was fine and matched all the other rows. When I downloaded the errors, the error was called "record". Anyone know what that means? I've now tried repeatedly re-entering the same six rows that were considered "record" errors and even though the data seems fine CiviCRM still won't import the contacts. Let me know what I'm doing wrong!

Thanks,

Evann

# Answer
> 2 votes
It's quite late now for the original poster but for those who are trying to solve this problem - it is likely that you simply need to enlarge the Excel row to show the full error. For example, it may actually be 'Record duplicates multiple contacts' which would explain why uploading is not working as expected.

---
Tags: import, error
---


# Question
Title: Why can't I see different financial types in contribution reports
With our contributions, one payment may contain 3 financial types ... e.g. an event fee, membership fee and donation. I have created "Price Sets" (of one Financial Type), which then contain 3 different "Price Fields" (which have separate Financial Types allocated) but when it comes to reporting on Contribution Detail, the filter / field "Financial Type" only pulls through "Event fees".

I can see that when creating an event I can choose 1 financial type When creating a Price Set I can choose 1 financial type But I can add multiple Price Fields to a Price Set, but these aren't being detailed / broken down when I go to the reporting on Financial Type.

Help! Are we setting up the price sets incorrectly? Do we need to create Custom Fields?

++ Added info: when running an Event Participant Report, if you select Fee Level as a column it groups all the different "Option Labels" from the various Price Fields within the Price Set. So the information is there and separated, I just can't see how the associated values for teach of those option labels listed for each participant.

Thanks so much for your help in advance.

# Answer
> 7 votes
You're looking for some advanced reporting: install this extension: fuzion extended reports -\> and then look for report template: Extended Report - Price Set Line Items.

---
Tags: custom-fields, contributions, price-sets, financial-types, percentage-price-field
---


# Question
Title: Webform: "not you" message - I can't find it!
I use webforms quite a lot including for data entry. Normally when I enter data I enter it when I am logged out so that the data gets added to the correct record and not to the record of the logged in user.

However I would like to enter data and use the private field option of webform - to do this I need to be logged in.

I see on the webform set up there is an option:

Prompt for users who are logged in as, or following a hashed link for, someone else.

Display message to known contacts? \[yes\]

I have enabled this however when I am logged in I do not see this message. When I view page source it is there "h2 class="element-invisible"\>Status message ul\>

- You are viewing this form as XXXXXXX. Please click here if that's not you.
- You have already submitted this form. View your previous submissions.
"

So I am wondering why the message has been rendered invisible?

I have had a look at form settings and so on but I cannot find a tick box which explains how I have managed to make it invisible!

Any tips as to where to look would be gratefully received! Thank you

# Answer
> 1 votes
In the CiviCRM section of your webform, the third section down is "Not You?" Message. There's a check box there for "Display message to known contacts?"

# Answer
> 0 votes
Another approach to something like this is to have a Drupal Views search block in a sidebar, search for your contacts there, and set their name up as a link to the Webform with their id attached to the url as ?cid=xxx

---
Tags: webform-civicrm
---


# Question
Title: Where is the record of Email --send now (50 or less)
I have been sending email queries to volunteers in the "contacts in the group" area by checking their names and using the " Email send now (50 or less) action. These emails do not show up in email reports. Can I pull up the record/history of these emails in any way? For example I want to send a new message to the same list. Thanks, probably a beginner question.

# Answer
Using the "quick email" function (aka "send now to 50 or less") bypasses CiviMail - so they won't show up on CiviMail reports. If you need CiviMail functionality (e.g. reply/click-through tracking, reporting, reuse, scheduled emails, etc.) you must use CiviMail.

However, you can still pull up a record of these emails, either via Advanced Search or Activity Report.

### Advanced Search

* **Search menu » Advanced Search**.
* In the "Activities" section, specify "Email" as the Activity Type, and some way of identifying the email in question - perhaps the subject line (see screenshot), or the date.
> 2 votes

# Answer
Also, if you want to track Bounces etc as you would for CiviMail, you can use the Transaction Email extension Fuzion created to help fill in this blindspot
> 1 votes

---
Tags: email
---


title: Report with calling form

text:
# Question
Title: Report with calling form
A user handed me a printed sheet from a previous database and asked me to recreate it. It contains contact information, a list of contributions, the most recent memo, and several blanks to be filled in during a renewal call (call response, pledged donation, written notes, some checkboxes, etc.). And it must be printed as a hard copy.

So I think what I'm looking for is a way to combine report data and fill-in-the-blank fields in one sheet. The "Constituent Detail" report works well for the former, but I'm stumped on getting the latter included on the same page. Anyone have a clever suggestion?

# Answer
> 1 votes
Go to Administer \> Communications \> Message Templates Add New Message Template Give your message a title Insert the tokens needed to get the donor info needed. Add the bottom fillable response card.

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

---
Tags: civireport, forms, reports
---


title: Wordpress User only to access CiviCRM

text:
# Question
Title: Wordpress User only to access CiviCRM
I would like allow a WordPress user only to have access to CiviCRM. I realise that it has to go through the WordPress interface, but we want the CiviCRM users to only be able to administer CiviCRM, and not the WordPress site. Some will need full rights to CiviCRM.

I have found some info regarding this, and this questions helped me a lot: How to display CiviCRM menu for non-admin role using WordPress?

Anyone can register is not selected in WP admin, and I have changed that a subscriber can access basically everything in in WordPress Access Control.

I am just concerned about security, and was wondering if perhaps there is a better way of doing this?

Thank you

# Answer
1. I find the plugin *User Role Editor Pro* to be very helpful with this. https://www.role-editor.com/ This makes it easier to setup the access control on the WP side.
2. Use CiviCRM \> administer \> Users & Permissions \> Permissions (Access Control) \> WordPress Access Control to control what parts of Civi different roles have access to.
3. I would NOT give Subscribers full access to Civi or WP. This is the role your basic donor is likely assigned. Yes this would create a serious security and liability issue if you give donors full access to Civi. Create/use another role besides Subscriber for anyone that needs some level of access beyond their donor dashboard.
4. Helpful tip. Create a user that is not your admin. Assign this user whatever role you are wanting setup with limited access. Login with one browser or computer as admin and in another browser or computer as the new user. Start editing Civi or WP Access Control settings as the admin, then refresh your other user tab and see what has changed.
> 1 votes

---
Tags: wordpress, admin, user, roles
---


# Question
Title: Custom Data Set - Saves but does will not display
I created a custom data set of type Tab with Table that accepts multiple entries, and I have added this to the New Individual form.

I can then create a new individual and hit save, after which time the Tab with the custom data fields is displayed. I can enter data into the custom data fields and save it. After I save, the count displays that it has been created, but nothing appears in the list/table except a message that says "No records of type '' found."

Is this a bug?

# Answer
> 2 votes
I was experiencing the same problem. My CiviCRM 4.7.25 *(sequentially upgraded from 4.7.18)* was on Joomla 3.8.1 *(also sequentially upgraded from 3.7.x)*. After doing some observation in the database, I noticed that the field named **in\_selector** *(table: civicrm\_custom\_field)* was **0**. When I manually changed the values from 0 to 1 using **PHPMyAdmin**, I got the **Tab with Table** listing to work. Upon further investigation, I believe the respective individual fields' setting **Display in Table** needs to be ticked/true.

# Answer
> 1 votes
Sounds like a bug, which version of CiviCRM are you using? Which version of which CMS are you using?

Can you repeat it on http://dmaster.demo.civicrm.org or http://wpmaster.demo.civicrm.org ?

---
Tags: custom-fields, error
---


# Question
Title: CiviContribute: show contributions without other contact details
Been using CiviCRM with the CiviContribute extension for a good portion of this year. Would like to allow users to see their contributions from their own logins without actually having access to other details, like the notes tab specifically.

Any ideas? Thanks!

# Answer
> 0 votes
CiviCRM offers a Contact Dashboard - which you can set to show eg Event, Member, Contribution, Pledges etc (I think via Admin \> Customise \> Display Preferences or /civicrm/admin/setting/preferences/display?reset=1) and then you should be able to use your CMS permissions to let logged in users access this.

In drupal they get that link showing at the bottom of /user

# Answer
> 0 votes
This answer is applicable for WordPress. If you are using a different CMS you will have to state which you are looking for.

1. Create a Page titled "Dashboard"
2. Insert this shortcode \[civicrm component="user-dashboard" hijack="0"\] & whatever else you want the donors to see.
3. Add plugin *WP Redirect After Login Plugin*. It is in the WP Plugin Library. https://wordpress.org/plugins/redirect-after-login/ I just change the Subscriber Role (or whatever Role your Members are defaulted to) to go to the dashboard url you just made in step 1. If you do not do this, they will land on the WP-admin dashboard.
4. Add a donor login link where you need it (yousiteurl/wp-admin/ or yoursiteurl/login/)

ps. I also use a plugin *ABD Dashboard Widget Manager* https://wordpress.org/plugins/abd-dashboard-widget-manager/ This allows you to edit what the donors see when they are in the WP Dashboard. Add widgets that redirect them back to their donation history, give them information, etc.

---
Tags: drupal, civicontribute
---


# Question
Title: New EU-DSGVO 2018 - Is a new agreement necessary?
Dear CiviCRM beta team,

we as the NGO "Wissenschaftsladen hannover e.V" would like to know whether we need a new agreement concerning the new DSGVO (Datenschutzgrundverordnung). According to the new privacy policy, which will come into effect at may 25th 2018, a lot of laws will change and therefore our question revolves around future changes in terms of our general agreement and different new things we should consider. An answer in german would be fine too / Eine Antwort auf deutsch wäre auch ok.

Yours faithfully, Wissenschaftsladen Hannover e.V
Denis Matthies

# Answer
I do not think there will be an easy answer to this GDPR question (also it is only party CiviCRM-related) but the following resources could be useful:

Also, you will be happy to know that there is a CiviCRM extension which focusses on the topic of GDPR / DSGVO: https://civicrm.org/blog/parvez/announcing-a-new-gdpr-extension
> 2 votes

---
Tags: database
---


# Question
Title: Multiple participants - multiple event registrations
I suspect I know the answer because I can't find it despite searching here & through the documentation but here goes.

We run a number of kids clubs (around 10 per week), with between 5 and 20 kids in each club. Clubs typically run for around 12 weeks each, some run more or less continuously.

I'd like to give the volunteers for each club a registration list of kids they can expect to turn up. All the clubs are free to the kids, but it's useful to know who should be there and also to track if any kids have 'dropped off the radar'.

I can register 5 kids on a single event (using smart groups & register group for event). I can do this for every club event instance, but that's very tedious.

I can't seem to register 1 kid on 5 events?

It would be awesome to be able to register 5 kids on 5 events but I suspect that's beyond scope at this point.

I know not every kid will attend every session, but it would be much easier to book them on and then cancel exceptions rather than having to book every single child-event combination by hand.

Any thoughts?

CiviCRM 4.7.17

WP 4.7.4

# Answer
I would take a look at the API csv Import. https://civicrm.org/extensions/api-csv-import-gui I could not tell you right off what fields you would need to have in your csv file to accomplish this, but I think you should be able to do it. You might have to have each child on the list 5 times to add them to 5 events (but not a big deal because you could still do it as one import). You could save some csv "templates" for each club so you do not need to recreate them every week/month.
> 1 votes

# Answer
I realize you're on Wordpress - but if the question is can a mom sign up 5 kids for 5 events on one single form then the answer is yes - you can do this if you have Drupal attached to your CiviCRM; no code required; 30min to set that up using Webform CiviCRM;

Those orgs that really want Wordpress for their front end (yourorg.org) - benefit from a Drupal/CiviCRM instance (secure.yourorg.org) - as it just lets you do way so much more with your CiviCRM giving you all the extras - while separating the Wordpress from your CiviCRM also helps to distance your CiviCRM data from potentially volnerable Wordpress plugins;
> 1 votes

---
Tags: civievent
---


# Question
Title: How to create a report for members with no email address
I would like to create a report of members that don't have emails. How would I go about creating such a list in CIVICRM

# Answer
Use Search Builder:

* Go to **Search menu » Search Builder**.
* Set your Search terms to "Contacts" "Email" "Primary" "Is Empty" (see screenshot).
* Press **Search**.
> 5 votes

---
Tags: reports
---


# Question
Title: Using API csv Import GU"I extension for Pledges
I have a number of Pledges that need to be loaded and was hoping the the extension would allow me to create a csv file and import the pledges in bulk. A separate line was created for each 'payment' of the pledge, the Contact ID was used as the key and a sequential number was allocated as the Pledge ID. The extension appeared to work as the returned message indicated that all records had been successfully imported. However, when I view the Contact record, or search pledges, none of the records loaded are visible. What am I doing wrong? Many thanks for any assistance!

# Answer
> 1 votes
If I'm understanding you correctly, you are importing pledges and the contributions relative to each pledge in the same import. You have to import pledges and their connected contributions separately. You must also add a couple of columns in order to have things connect correctly.

See https://civicrm.stackexchange.com/a/6380/105

---
Tags: extension, import
---


# Question
Title: installation canary Error Message upon installation
Can someone help me figure out what is going wrong? thanks\]

update: this is what it says inside the php file manager: public\_html/democratizetheentperprise/wp-content/plugins/civicrm/civicrm/civi/core/installationcanary.php

what do I do with it?

http://civicrm.org/licensing | +--------------------------------------------------------------------+ \*/

namespace Civi\Core;

use Civi\Core\Event\SystemInstallEvent;

/\** * Class InstallationCanary * @package Civi\Core \*/ class InstallationCanary {

/\** * Check whether the install has run before. * * Circa v4.7.betaX, we introduced a new mechanism for tracking installation * and firing a post-install event. However, it's fairly difficult to test the * edge-cases directly, so this canary should fire if there are any problems * in the design/implementation of the installation-tracker. * * This should not exist. It should be removed in a future version. * * @param \Civi\Core\Event\SystemInstallEvent $event * @throws \CRM\_Core\_Exception \*/ public static function check(SystemInstallEvent $event) { if (\CRM\_Core\_DAO::checkTableExists('civicrm\_install\_canary')) { throw new \CRM\_Core\_Exception("Found installation canary. This suggests that something went wrong with tracking installation process. Please post to forum or JIRA."); } \Civi::log()-\>info('Creating canary table'); \CRM\_Core\_DAO::executeQuery('CREATE TABLE civicrm\_install\_canary (id int(10) unsigned NOT NULL) ENGINE=InnoDB'); }

}

# Answer
> 2 votes
The message itself gives a quite bit of info that the installation wasn't done correctly or there would be something missing from the process. Make sure you followed the docs correctly while installing CiviCRM.

I've seen this on doing a page relaod while the installation is still in progress.

If you think the process is done correctly and just want to get rid if this error - try deleting `civicrm_install_canary` table from the database and reload the page.

# Answer
> 0 votes
I have an idea about what might be happening. I had the same canary error message trying to install civicrm on my testing server (which is set to display errors one may not see on a live server).

After the green 'successful installation' message appears CiviCRM apparently runs a cleanup and/or reset process before opening up the home CiviCRM admin page. That process takes a long time and may cause php to timeout if the default is set to 30 seconds in php.ini. If the process times out then the canary table is never deleted and you get an error message of this sort:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Users\Don\Documents\webs\Spectrumz\blog\wp-content\plugins\civicrm\civicrm\packages\DB\common.php on line 2202

My testing server is running on a laptop, so it is likely slower than most working servers, but some may be slow enough that the post-installation process times out. Increase max\_execution\_time in php.ini if you control your server.

Then see this post, which describes deleting the installation canary table and the uploads/civicrm folder, then reactivating and re-installing: Fatal error: Uncaught CRM\_Core\_Exception: Civi/Core/InstallationCanary.php on line 53

---
Tags: error, civicrm-home
---


title: Where to place triggerInfo php file

text:
# Question
Title: Where to place triggerInfo php file
Joomla/CiviCRM.

Neophyte Warning!

I've written a triggerinfo hook as per this article.

What I don't understand is where on the file system is one supposed to place the PHP file so that when one requests a trigger rebuild, the file will be found, and so that when an upgrade occurs the file will not be overwritten.

Can someone help me please?

Regards Simon

# Answer
You should create an extension. See the instructions for civix. One thing that civix can do is generate a skeletal extension. After running `civix generate:module` you would add your code to the main php file in your new extension. See also Extension Structure.
> 1 votes

---
Tags: extension, joomla
---


# Question
Title: How to create Drupal view to show CiviEvents and Drupal Events
I'm trying to create a view to show both CiviEvents and Drupal Events filtered by dates.

I can create a Drupal view to show Drupal Events fields, and I can create a view to show CiviEvent fields, but I can't create a view to show both.

Am I missing something obvious here or is it not possible due to the two databases?

We are using Drupal 7 and CiviCRM 4.7.24. We have separate databases and have the CiviCRM Entity module installed.

# Answer
> 1 votes
I don't think you are missing anything obvious. They are completely different Entity Types so you can't do this in a single view.

This is a constraint of Views.

If you were to create a Drupal node linked to each CiviEvent (using CiviCRM Entities) then you would be able to display all items as 'content' and provide links to the Info and Registration pages from that.

There has been some good documentation about doing that by skvare.com

---
Tags: civievent, drupal, drupal-views
---


title: CiviCRM/Wordpress "Page" Integration

text:
# Question
Title: CiviCRM/Wordpress "Page" Integration
I am using CiviCRM with Wordpress but I am having some trouble with getting pages in Civi to work in Wordpress.

For example, any time I try to view a contribution page, it takes me to a Wordpress page called CiviCRM that says "Do not delete this page. Page content is generated by CiviCRM."

No Civi content is actually there, just that text.

How can I get the actual contribute pages?

# Answer
> 3 votes
Well I figured it out... It turns out that I had forgotten to activate the shortcode in the CiviCRM Admin Utilities plugin. It was that simple... once I checkmarked the shortcode for posts and pages, I was able to manually add the contribution pages to WP pages.

I do still have a CiviCRM page that says "Do not delete this page. Page content is generated by CiviCRM." and CiviContribute still does link directly to that page for some reason... but I am able to use the shortcode now so it's not a problem.

# Answer
> 2 votes
I just create a page called 'Contribute' or something like that, then either use the shortcode button the CiviCRM supplies in the page/post editing interface as Kevin mentioned above. Or, depending on how you like to build your Wordpress site, use Wordpress's do\_shortcode method straight in your page template

# Answer
> 1 votes
I'd try the site using the default theme, we've seen issues in the past where custom themes were causing problems.

# Answer
> 0 votes
I had the same situation installing CiviCRM 4.7.25 on my testing server. WordPress is installed in a subfolder (wp), but the WordPress 'Site address' is just the website's domain.

Osarusan's last solution fixed the problem - I added a dummy page named with a url like mysite.com/wp and made the CiviCRM page a child page of the wp page.

It seems that CiviCRM is using the WordPress installation folder as the base for the url of the CiviCRM page when it should probably be using the WordPress 'Site address' as the base.

---
Tags: wordpress
---


# Question
Title: Problem with CiviMail Menu on Joomla 3.4.1 - CiviCRM 4.6.2
I upgraded to CiviCRM 4.6.2 on Joomla 3.4.1 last week. Everything seemed to work fine, however, when I tried to send out a New Email today, the CiviMail page did not display, the CiviCRM menu did not properly display nor can it be used to navigate.

I tried to see if the same problem occurs on the Joomla Demo, but CiviCRM is only on Version 4.6.0 there.

The following images reflect what I'm seeing:

All other menu items under mailings display and work properly: Just one example.

However, the new A/B test results in the same type of screen as in image 1:

I've cleaned out the Templates\_C directly, along with the site & browser caches, to no avail.

I've got to get this mailing out to our members within the next few days. Any assistance would be appreciated.

# Answer
In my case the issue was the K2 component (version 2.6.9), Joomla 3.4.1 and CiviCRM 4.6.2, specifically its system plugin, which is required for K2 to function correctly. This plugin monkeys with the HTML code and inserts Opengraph tags, but these are not escaped by CiviCRM, or they are inserted by K2 after CiviCRM has done its thing.

See plugins/system/k2.php - specifically this code section:

```
if (JString::strpos($response, 'prefix="og: http://ogp.me/ns#"') === false)
                    {
                            $searches[] = '<html ';
                                    $searches[] = '<html>';
                            $replacements[] = '<html prefix="og: http://ogp.me/ns#" ';
                            $replacements[] = '<html prefix="og: http://ogp.me/ns#">';
                    }

```

Change this to:

```
$app =& JFactory::getApplication();
            if ($app->isSite()){

                    if (JString::strpos($response, 'prefix="og: http://ogp.me/ns#"') === false)
                    {
                            $searches[] = '<html ';
                                    $searches[] = '<html>';
                            $replacements[] = '<html prefix="og: http://ogp.me/ns#" ';
                            $replacements[] = '<html prefix="og: http://ogp.me/ns#">';
                    }
            }

```

CiviRM bug tracker JoomlaWorks / K2 issue report (and patch)
> 3 votes

# Answer
The best place to start would be to go through the steps for troubleshooting javascript in CiviCRM.
> 2 votes

# Answer
I had something similar after an upgrade - if you have extensions - either disable them or update them to match the version of Civi you are running...
> 1 votes

# Answer
I was having the exact same issue. The wasy solution for me was to convert everything over to the new Joomla articles system that is built in (which works really well) and dump (uninstall) K2. That immediately solved it for me.
> 1 votes

# Answer
UPDATE: with the install of v4.6.6, the problem has been resolved. The new mail interface works fine.

Don't know if this is due to a change in teh CiviCRM coding, or something upgraded by the hosting company on their servers.

That said, I really don't care as long as its now working :)
> 1 votes

# Answer
Still getting same problem with civi 4.6.32, Drupal 7.56, php 5.4.45

Fixed by the workaround above of adding define('CIVICRM\_CIVIMAIL\_UI\_LEGACY', 1); to settings.civicrm.php
> 1 votes

# Answer
I turned on the debugging, and looked in the console, and found this:

> Empty string passed to getElementById(). jquery.min.js:2:0
>
> SyntaxError: missing } after property list administrator:185:28881
>
> TypeError: CRM.config is undefined administrator:5:2
>
> TypeError: CRM.angular is undefined crmApp.js:5:6 mutating the \[\[Prototype\]\] of an object will cause your code to run very slowly; instead create the object with the correct initial \[\[Prototype\]\] value using Object.create d3.min.js:3:7336
>
> TypeError: CRM.config is undefined administrator:110:28
>
> Error: \[$injector:modulerr\] Failed to instantiate module crmApp due to: \[$injector:nomod\] Module 'crmApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
>
> //errors.angularjs.org/1.3.15/$injector/modulerr?p0=crmApp&p1=%5B%24injector%3Anomod%5D%20Module%20'crmApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Fnomod%3Fp0%3DcrmApp%0AminErr%2F%3C%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A63%3A12%0Amodule%2F%3C%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1774%3A1%0Aensure%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1698%3A38%0Amodule%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1772%3A1%0AloadModules%2F%3C%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A4115%3A22%0AforEach%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A323%3A11%0AloadModules%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A4099%3A5%0AcreateInjector%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A4025%3A11%0Abootstrap%2FdoBootstrap%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1452%3A20%0Abootstrap%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1473%3A1%0AangularInit%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A1367%3A5%0A%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fangular%2Fangular.js%3Fr%3DIpysI%3A26304%3A5%0AjQuery.Callbacks%2Ffire%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fjquery%2Fdist%2Fjquery.js%3Fr%3DIpysI%3A3143%3A10%0AjQuery.Callbacks%2Fself.fireWith%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fjquery%2Fdist%2Fjquery.js%3Fr%3DIpysI%3A3255%3A7%0A.ready%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fjquery%2Fdist%2Fjquery.js%3Fr%3DIpysI%3A3467%3A1%0Acompleted%40http%3A%2F%2Fmysite.com%2Fadministrator%2Fcomponents%2Fcom\_civicrm%2Fcivicrm%2Fbower\_components%2Fjquery%2Fdist%2Fjquery.js%3Fr%3DIpysI%3A3498%3A3%0A angular.js:63:

I had to remove a block of the response as it triggered a warning about more than 2 links in a post.

So there's a bunch of errors there, and apparently a missing file, any advice ??
> 0 votes

# Answer
Evidently, I'm not the only Joomla user having this issue, as this thread:

CiviMail Incomplete Load

was opened yesterday. Unfortunately, it was closed saying that an answer could be found in THIS thread. Wish that were true.

I'm still waiting for someone to give me a hint at what to look at, other than Coleman's less than helpful "Check the troubleshooting hints".

Been there, done that, didn't help.
> 0 votes

---
Tags: civimail, joomla
---


title: Apply Cividiscount to only one price.

text:
# Question
Title: Apply Cividiscount to only one price.
We are using Civi 4.7.22 on Wordpress 4.8.22

We have an upcoming three day event with several price options. Our full-price is $189.00 and we want to give members of our organization a $60.00 discount when they purchase the full-price ticket to the event. We do not want to give a discount to the lower priced tickets, whether the person is a member or not.

So far when using cividiscount, the discount price is applied to the entire price list and not just the full price. I don't yet see an option for controlling this. Does anyone know what I can do?

Thank you

# Answer
If you are using a price set, you can set which line items the code is valid for by selecting the line items in the field 'Price Field Options' under 'Additional Options' when you setup the code. You still need to set the event it is valid for under the 'Discounts for Events' section.

Hope this helps.
> 2 votes

---
Tags: cividiscount
---


# Question
Title: Error message on sending a mailing, CREATE TEMPORARY TABLE
Any ideas what is causing this when we try to send out a mailing?

```
("DB Error: syntax error",
CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache495 (SELECT 25 as grou...") #4

```

mysql Ver 14.14 Distrib 5.1.73

# Answer
> 1 votes
The last time I saw something like this was when custom fields on a table had been added, a group had been created using these custom fields and subsequently the custom fields had physically been deleted. This meant the custom group cache table failed to create - the group used in the mailing was the culprit. I'd try using a different group as a test. If it works then look to rebuild your smart group - the full error in the SQL should point you in the right direction.

---
Tags: mailing
---


# Question
Title: Webform Integration - Permission level for viewing the civicrm contact name column
Just curious if anyone using Drupal and the Webform integration has come across this:

When viewing results as an admin, I can see clickable links to the Civi individual who filled out the form - it's great! But I noticed that not all my users can see data in that column (they see the column it's just empty.)

If you click the view button for a submission, they can see (and click) the Civi Individual - but that same info does not show up on the list of completed submissions.

After some testing, I found that you have to give user the permission set "Edit All Webform Submissions" which is a little awkward. I just want this user set to VIEW the name of the person who completed the form and be able to click right over to civi (without having to open each survey).

Drupal 7.41 Webforms Civi 7.x.4.11

Any advice on how to accomplish this? Does it perhaps not behave this way in a future version?

# Answer
> 1 votes
The permissions per webform module overrides the webform permissions. When this module is installed and enabled, there will be a tab on the form settings called 'Permission settings' for every webform node. With this you can control the results tab on each webform by role. You can use only the Access webform results and Edit webform results.

Please test this module before using on production

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


# Question
Title: CPanel Cron stopped working after upgrade to Joomla 3.8.0
I run a cron in Cpanel for Civicrm to send a newsletter once a month. After the upgrade to Joomla 3.8.0 the cron has stopped working. This issue seems to be a big issue with this Joomla upgrade. I tried to have my web host install a backup, but they only keep backups for 24 hours and they were unable to restore the previous Joomla version. I have very little cron knowledge and need help figuring out how to get a cron working for this new version of Joomla so I can send out emails to my groups in Civicrm.

My current cron is the following: wget 'http://www.divingrebels.org/administrator/components/com\_civicrm/civicrm/bin/cron.php?name=login&pass=password&key=c121f216120e4362040e110a1f92db58' \>/dev/null 2\>&1

Thanks in advance Danny

# Answer
> 0 votes
The patch found here: https://issues.civicrm.org/jira/browse/CRM-21203 worked for me on CiviCRM 4.7.25 & J! 3.8.1

---
Tags: joomla, cron
---


# Question
Title: How to remove transfer or cancel message from event confirmation emails.
We are using Civi 4.7.22 on Wordpress 4.8.22

I just realized that the below message goes out in all event confirmation emails whether or not the box in the event configurations is checked. I would really like to remove this message. Can someone tell me where to do that?

***You may transfer your registration to another participant or cancel your registration up to 96 hours before the event. Cancellations are not refundable. Click here to transfer or cancel your registration.***

Thank you.

# Answer
> 1 votes
Found it. Message templates \> System Workflow Messages \> Events (receipt only).
Modify the lines on the bottom of HTML Format.

---
Tags: civievent, confirmation
---


# Question
Title: Is there a way of automatic discounting renewals based on referrals?
We have an offer for our existing members, that whenever any new member enrolls based on existing member's recommendation, that recommending member gets a fixed discount on his nearest membership fee. He can convinced as many new members, as he is able to do and by doing this he gets this discount for each of recommended new member and thus reduces his membership fee. Is it possible to calculate his discount every time he attempts to renew his membership? Any suggestions how to implement such functionality (CiviCRM 4.7 on WordPress)?

# Answer
> 2 votes
I think you'd need to write a custom extension to handle this.

I would create a custom field of type "contact reference" on your membership form so people could indicate their referring contact. Of course, this exposes some (or all) of your contact names to the public, but it's better than manually connecting the records.

Then you could write a simple extension that queries for the number of contacts that are referenced by this field on other contacts to calculate a discount. Optionally, you could also clear the fields after that to prevent the discount from being applied to a future renewal.

---
Tags: civimember, discounts
---


title: Missing contact records

text:
# Question
Title: Missing contact records
I am missing two contact records. I have done an advanced search in trash and they are not there. I have their information saved elsewhere (a spreadsheet, an email update from a webform) so I can recreate their records.

What concerns me, though, is that they were lost. The only reason they came to my attention is they belong to a particular student group that I needed to contact. This is a pretty small subset of our overall membership, so it was easy to identify that there were missing records. My concern now is that there might be more missing contact records, but I don't know how to look for them or even how they would go missing. Any ideas?

# Answer
As far as I know if you did not have the extended logging switched on, if they were permanently deleted there is no direct way to check.

You might want to compare a backup with the current data, if that is possible?

To reassure you: we work with a fair number of organizations that use CiviCRM, some small and some quite large. None of them have ever experienced contacts simply 'disappearing' from the database.
> 1 votes

# Answer
If you have logging on, then the contact will be added to that log when it is created or modified.

When they are Deleted Permanently those record remain in Logging.

Therefore you can do a search in log\_civicrm\_contact for log\_action = Delete. Then you can look at the log\_date and log\_conn\_id and work out who did it and when, and you can extract that info and recreate the contact.
> 0 votes

---
Tags: contacts
---


# Question
Title: Vague error in log "You do not have permission to access this page."
What's the first step to finding out the cause of an issue logged in ConfigAndLog/.log? (shown below).. Its from a shortcode on the frontend of wordpress 4.4.7 \[civicrm component="user-dashboard" hijack="0"\].

Civi 4.6.4

The page works fine but someone somewhere in the world might not have been able to access their dashboard:

```
Feb 09 11:41:08  [info] $Fatal Error Details = Array
(
    [message] => You do not have permission to access this page.
    [code] =>
)

Feb 09 11:41:08  [info] $backTrace = #0 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(363): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(294): CRM_Core_Error::fatal("You do not have permission to access this page.")
#2 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(277): CRM_Utils_System_WordPress->permissionDenied()
#3 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(232): CRM_Utils_System::permissionDenied()
#4 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#5 /home/public_html/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
#6 /home/public_html/www/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:2))
#7 /home/public_html/www/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(292): CiviCRM_For_WordPress->invoke()
#8 [internal function](): CiviCRM_For_WordPress_Shortcodes->render_single((Array:2), "", "civicrm")
#9 /home/public_html/www/wp-includes/shortcodes.php(326): call_user_func((Array:2), (Array:2), "", "civicrm")
#10 [internal function](): do_shortcode_tag((Array:7))
#11 /home/public_html/www/wp-includes/shortcodes.php(223): preg_replace_callback("/\[(\[?)(civicrm)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\...", "do_shortcode_tag", "[civicrm component=\"user-dashboard\" hijack=\"0\"]")
#12 /home/public_html/www/wp-content/plugins/civicrm/includes/civicrm.shortcodes.php(200): do_shortcode("[civicrm component=\"user-dashboard\" hijack=\"0\"]")
#13 [internal function](): CiviCRM_For_WordPress_Shortcodes->prerender(Object(WP))
#14 /home/public_html/www/wp-includes/plugin.php(601): call_user_func_array((Array:2), (Array:1))
#15 /home/public_html/www/wp-includes/class-wp.php(692): do_action_ref_array("wp", (Array:1))
#16 /home/public_html/www/wp-includes/functions.php(952): WP->main("")
#17 /home/public_html/www/wp-blog-header.php(14): wp()
#18 /home/public_html/www/index.php(17): require("/home/public_html/www/wp-blog-header.php")
#19 {main}

```

For example, this is an error in the production log but how do I know 'who' in the world or which constituent ran into the issue?

# Answer
> 1 votes
Try this extension

https://civicrm.org/extensions/civicrm-error-handler

> Sometimes CiviCRM can be real tough to debug. Especially when you are getting fatal errors, but only by some users, and you can't recreate the problems. This utility will send you a detailed email when a CiviCRM fatal error occurs.

---
Tags: permissions
---


# Question
Title: CiviReport - development recognition report
We need a donor recognition report that - for lifetime or a period of time (last FY for example) - will count totals per donor and include soft credits in the totals. Is this something that can be done "out of the box" or do I need a custom report?

# Answer
You might want to take a look at the Summary Fields extension and see if it provides a good foundation for you to add the 'Soft Credit' information to.
> 2 votes

---
Tags: civireport
---


# Question
Title: CiviCRM Mailings external links forbidden
Some people who received our big mailing get a forbidden message when they click on a link that goes to an external site. Most people are not getting the error.

> Forbidden You don't have permission to access /sites/all/modules/contrib/civicrm/extern/url.php on this server.

I've tested while not logged in to our website. I've tested on various IP addresses. I've tested while logged in as several types of roles with varying permissions. It's clearly a firewall issue, but if I post it somewhere else, I may push back about it being a CiviCRM issue. Why does my server think that this harmless CiviCRM external link tracking process is a SQL injection concern?

CiviCRM 4.7.15 Drupal 7

Apache SSL Error log reports:

```
[Tue Oct 10 23:45:07.760744 2017] [:error] [pid 27564:tid 140558165042944] [client 107.77.xxx.xxx] ModSecurity: Access denied with code 403 (phase 2). Pattern match "(^[\\"'`\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98;]+|[\\"'`\\xc2\\xb4\\xe2\\x80\\x99\\xe2\\x80\\x98;]+$)" at REQUEST_COOKIES:ajs_user_id. [file "/usr/share/modsecurity-crs/activated_rules/modsecurity_crs_41_sql_injection_attacks.conf"] [line "64"] [id "981318"] [rev "2"] [msg "SQL Injection Attack: Common Injection Testing Detected"] [data "Matched Data: \\x22 found within REQUEST_COOKIES:ajs_user_id: \\x224622165\\x22"] [severity "CRITICAL"] [ver "OWASP_CRS/2.2.9"] [maturity "9"] [accuracy "8"] [tag "OWASP_CRS/WEB_ATTACK/SQL_INJECTION"] [tag "WASCTC/WASC-19"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/CIE1"] [tag "PCI/6.5.2"] [hostname "www.fosterclub.com"] [uri "/sites/all/modules/contrib/civicrm/extern/url.php"] [unique_id "Wd1bg857a7YAAGus-PcAAADK"]

```

I'm stumped because I can't reproduce the error. The error log only shows a few of these but the access log shows several times the link was successfully accessed. Can't find a pattern.

Here is a screenshot that someone sent me.

Edit: the file permissions for /sites/all/modules/contrib/civicrm/extern/url.php:

```
-rw-rw-r-- 1 drupal-user server-group 1707 Apr 17 04:44 url.php

```

Link in email:

https://www.example.com/sites/all/modules/contrib/civicrm/extern/url.php?u=123099&qid=4531881

CiviMail translated that link from what we put in, which is the ultimate destination. Should be an auction site.

# Answer
You're correct, this is not CiviCRM-related.

Your Apache log is showing that `mod_security` is the culprit here. `mod_security` is a "web application firewall" - it sits between the user and Drupal/CiviCRM. It's used to block access to the application when it thinks the interaction is malicious.

From the log, I can see that it's blocking part of the cookie associated with `ajs_user_id`. A quick Google search says that `ajs_user_id` is probably tied to segment.com's `analytics.js`. Does that ring a bell?

The answer is to go to your webhost/sysadmin and show them this error; they should be able to change the `mod_security` logs. If they refuse, I recommend changing webhosts. If that's not an option, disable `analytics.js`.
> 2 votes

---
Tags: civimail, drupal
---


# Question
Title: Where is the 'subscription history' exposed?
CiviCRM has a table called civicrm\_subscription\_history. This table stores a log of each time a contact is added, removed, or deleted from a group. That's cool. It seems to be reliable (tied in to the groupContact BAOs), and is even used with the role sync Drupal module too.

But, it doesn't seem to be 'used' anywhere? The information in the subscription history is never exposed to the front end? It seems to be just an ever-growing list of history that most users will never know exists.

The follow-up questions would be (if indeed it isn't exposed anywhere), should we:

* Create a feature request to be able to turn the functionality on/off?
* Create a feature request to expose it via a UI in core?
* Create an extension that exposes it via a UI?
* Copy out the code into an extension, with a UI that exposes it (and eventually deprecate it from core)?
* Leave it alone? (Our table has 9 million rows though...)

It feels like a loose-end at the moment.

Edit: I notice it **is** exposed by the new GDPR extension from Veda Consulting.

# Answer
The subscription history is shown in the Group tab of the Contact summary in as much as you can see Groups people 'were' in.

The the civicrm\_group\_contact table stores that people are 'removed' from the group, but the date that it happened is pulled from civicrm\_subscription\_history (as part of this function: \CRM\_Contact\_BAO\_GroupContact::getContactGroup).
> 2 votes

# Answer
`civicrm_subscription_history` is only minimally exposed in the core UI - but there is a Subscription History Report extension on my Github that you can use which exposes it to CiviReports.
> 1 votes

# Answer
It is used in as far as when you look at the Groups tab it is the source of data for the date field displayed.
> 0 votes

---
Tags: groups, logs
---


# Question
Title: Having a Problem Installing CiviCRM 4.7.25 on WordPress
I'm having a problem installing the latest version of CiviCRM on WordPress 4.8.2 (Ubuntu 16.04.3 LTS, Apache 2.4.18, PHP 7.0).

Steps to Reproduce: 1) Log in to the WordPress site's administrative interface. 2) Click "Add New" under "Plugins" on the administration menu. 3) Click "Upload Plugin," then browse to and upload the plugin's Zip file.

Output: Unpacking the package… Could not extract file from archive. civicrm/civicrm/packages/kcfinder/themes/dark/img/files/big/..png

Expected Results: The package should have extracted and installed with no errors.

Please advise.

# Answer
> 1 votes
The CiviCRM "plugin" for Wordpress CMS is not installed like a conventional Wordpress plugin. There are many more things to be considered and you would be advised to read and follow all the stages described in the following Wordpress Installatin Guide for CiviCRM at https://docs.civicrm.org/sysadmin/en/master/install/wordpress/

Hope this helps.

---
Tags: wordpress, installation
---


# Question
Title: Trying to use CiviCRM to take memberships for an event
I've been looking at CiviCRM to see if it would work for running an event in about 3 years time.

I'm pretty new to CiviCRM. The event is a convention and is a one off. People can join many years ahead and their membership is effectively lifetime. I'm trying to set up a membership system that lets you join as one member type, then upgrade. Using a contributions page, I'm just adding the membership types for their prices. (I'm also using CiviDiscount to discount your upgrade). You can successfully upgrade, BUT it then keeps showing you the lower tier memberships. And you can choose them... Is there a way of not having them show up?

I'm glad to be pointed at educational resources. And glad to change code, but I'm not sure where.

I realise that this isn't really what CiviCRM is designed for. But the other features are so useful, that really if I can get past the membership problems I'm having, it may be worth it.

Thanks, Norman

# Answer
You can alter the price options to hide lower-tier memberships with a custom extension. This is a more maintainable alternative to editing the code directly, since it will work through an upgrade.

Check the docs for creating extensions and install `civix`. Then use the buildAmount hook to edit the price sets. Some folks think this is easier with the buildForm hook; you may want to try both.
> 1 votes

---
Tags: civimember, cividiscount
---


# Question
Title: No displayName after editing or creating
Since the last CiviCRm version 4.7.21 to 4.7.23, I have the display\_name empty. There is also the trouble for the sort\_name.

I found the report of SarahG (FountainTribe) here https://forum.civicrm.org/index.php?topic=33928.msg143820#msg143820 It states that :

> The return value from "CRM\_Utils\_Address::format" is returning an empty string for the display name and the sort name. Those empty strings cause the calling function to use email address instead.

I applied her solution :

---

In the file /CRM/Contact/BAO/Individual.php (around 210 -215) I replaced the line: Code: $displayName = CRM\_Utils\_Address::format($formatted, $format, FALSE, FALSE, TRUE, $tokenFields );

New line: Code: $displayName = $firstName." ".$lastName;

Did similar replacement for the $sortName variable.

---

This solved the trouble. But as she stated, it is only a temporary solution.

Does anyone still encountered this issue with CiviCRm version 4.7.23 ?

# Answer
After upgrading to 4.7.24 then to 4.7.25, I observed that the issue with the No displayName after editing or creating came back. This is strange that Release Candidate CiviCRm version 4.7.24 was the only fix. Does-it concern other people and other installation ?
> 1 votes

---
Tags: issues
---


# Question
Title: What to do about "Operation failed: Update Indices DB Error: unknown error Debug" after upgrading to 4.7.25
This is related to a question I posted yesterday (How does one delete "key indices"?), which was considered a duplicate of another question (Performance Warning: Missing Indices. Mismatched Index Key). I am posting this new question because it seems to be a somewhat different issue and because adding a comment to one of those other posts didn't quite seem to fit with this.

It was suggested that installing 4.7.25 would resolve that issue. However, it seems to have produced a new one.

With 4.7.25 installed under Drupal 7, I now get this warning:

> Performance warning: Missing indices
>
> The following tables have missing indices. Click 'Update Indices' button to create them.
>
> Table Name Key Name Expected Indices civicrm\_option\_value index\_option\_group\_id\_name name(128), option\_group\_id civicrm\_case\_contact UI\_case\_contact\_id case\_id, contact\_id

But when I click the Update Indices button, I get this error:

> Operation failed: Update Indices DB Error: unknown error Debug information: DROP INDEX index\_option\_group\_id\_name ON civicrm\_option\_value \[nativecode=1553 \** Cannot drop index 'index\_option\_group\_id\_name': needed in a foreign key constraint\]

Any help on what I can do about this would be appreciated. Please spell it out for me though; I'm not an expert at this stuff. Thanks.

Thanks.

# Answer
> 3 votes
You'll have to work on your database directly. The following works for me - although the Status screen still shows the error until the Update Indices button is clicked again after the repair has been done (I presume it simply verifies the fix):

```
USE your_civicrm_db;
SHOW CREATE TABLE civicrm_case_contact;
SET foreign_key_checks = 0;
DROP INDEX `UI_case_contact_id` on civicrm_case_contact;
CREATE UNIQUE INDEX `UI_case_contact_id` ON civicrm_case_contact (case_id, contact_id);
SET foreign_key_checks = 1;

```

If you do this via PhpMyAdmin (or similar), you can skip `USE your_civicrm_db;` since you'll have already navigated there.

---
Tags: error, 4.7, indices
---


# Question
Title: Where can I find the field string length?
I need to import addresses using the API. Some addresses go over the CiviCRM limit. For instance street\_address has a limit of 96 characters. I would like to know where are these limits defined in CiviCRM or where are they documented? I don't want to use the trial and error method to find out.

# Answer
These are defined in MySQL. Adjusting the length of those tables should cover this.

With some data entry, making the changes through the interface can increase the length of the tables in the system.

John
> 1 votes

# Answer
That field is defined at https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Core/Address.xml#L92. It is run through GenCode.php to create the definition of the field and table used in the database installation. This also creates the definition in DAO file (CRM/Core/DAO/Address.php):

```
'street_address' => array(
      'name' => 'street_address',
      'type' => CRM_Utils_Type::T_STRING,
      'title' => ts('Street Address') ,
      'description' => 'Concatenation of all routable street address components (prefix, street number, street name, suffix, unit
  number OR P.O. Box). Apps should be able to determine physical location with this data (for mapping, mail
  delivery, etc.).
',
      'maxlength' => 96,
      'size' => CRM_Utils_Type::HUGE,
      'import' => true,
      'where' => 'civicrm_address.street_address',
      'headerPattern' => '/(street|address)/i',
      'dataPattern' => '/^(\d{1,5}( [0-9A-Za-z]+)+)$|^(P\.?O\.\? Box \d{1,5})$/i',
      'export' => true,
      'table_name' => 'civicrm_address',
      'entity' => 'Address',
      'bao' => 'CRM_Core_BAO_Address',
      'html' => array(
        'type' => 'Text',
      ) ,

```

I bet that the generic import code truncates varchars to the maxlength of the field. So you could override this file to change that behaviour.

FWIW, on a buildkit development site you can set things up to re-run the GenCode so that change the xml for schema will be reflected in the regenerated DAO file.

If you want to propose a change to the schema in core, you will need to include in the PR an ALTER TABLE query in the appropriate file for the release in https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/sql, eg 4.7.28.mysql.tpl. Increasing the field length doesn't involve loss of data or any need to convert the existing data, so it would be a straightforward change.

However, I'm not sure whether proposing a change to a field that has been unchanged since version 1.1 will get the community approval ideally required for a schema change. FWIW, I'm mildly supportive and this has caused us grief over the years. I'd also try to review what impact a longer field might have on layout onscreen, in address labels in core, and in html message templates, etc.
> 1 votes

---
Tags: developer, fields, documentation
---


# Question
Title: Allow Duplicate External IDs for later merge?
I have a large number of contacts across different contact sub-types, imported via CiviMigrate.

The particulars:

I am pulling multiple contact types from the same, flat master table. This means that for example:

Pass 1 : Grabs all students Pass 2: Grabs all teachers Pass 3: Grabs all volunteers

There are naturally some students which became teachers, and were volunteers at some point, so there can be any combination of contact sub-types.

In the "worst" case, I'd end up with 3 contacts, one of each sub-type, that would need to be flattened into a single contact.

I have been matching on first and last name with some success, but there are multiple cases in which this causes the need for manual merge work (people with the same name).

Is there any way to temporarily allow dupe external ID's for the purpose of a later merge?

Now, this all stems from the fact that I can't find any documentation on how to pass multiple contact sub-types at once via CiviMigrate, perhaps there's an angle there?

Thanks! -d

# Answer
I do not think there is a (good) way to use duplictae external IDs in CiviCRM - if you want to use the external ID field to do so. You could however create a custom field, import your external ID in that one and then adapt your matching rules to find duplicates (/civicrm/contact/deduperules?reset=1).
> 1 votes

# Answer
If you really do want to do it via the External ID, then subtly adjust your ID on each import eg 567-s for the student import, 567-t for teacher import, 567-v for volunteer import
> 0 votes

---
Tags: contacts, external-id
---


# Question
Title: CiviCRM Events (WP) - error message "this contact has already been assigned to this event"
Getting the error message "civicrm error message Please correct the following errors in the form fields below: This contact has already been assigned to this event."

Oddly, this record is my own. I'm wondering if it's BECAUSE I created the event that I can't add myself. I am the Civi admin.

My name doesn't come up in any registered attendee report and when searching my own record, I am not recorded as being registered to the event. But I can't add myself, either. See below.

Here's what it looks like when I try to add:

So, I'm stumped! It's not life or death, but insights are appreciated in the event it crops up with other contacts as this event progresses. If it crops up with another contact, that could affect the event headcount.

Thanks,

L.

# Answer
This could be the outcome if you did a 'test' registration.

You can search for 'test' via Find Participants.

If you did, it is possible this would block you from registering again.
> 1 votes

---
Tags: civievent
---


title: Custom Invoice ID

text:
# Question
Title: Custom Invoice ID
My customer wants a different Invoice ID numbering.

A sequence based on year and contribution type.

So, something like Event-2015-001 Event-2015-002 .. Event-2015-156 Event-2016-001 Memb-2015-001 Memb-2015-002 .. Memb-2015-129 Memb-2016-001

How would you approach that? What are the (unwanted) side-effects?

The invoices are generated by CiviCRM (so not an external source of the Invoice ID). The invoice ID's will be used by a financial package.

---

Thanks for the answers. After I showed the customer that Invoice ID's were adjustable with Batch Update Contributions via Profile they want to use that for now. Maybe later we will automate it.

# Answer
I think the answer is in the making: Klaas and Björn just proposed this PR: https://github.com/civicrm/civicrm-core/pull/11110
> 4 votes

# Answer
Where exactly is the invoiceID generated? I am not aware of any invoiceID generated automatically but that may well be my bad :-) If there is an invoice generated I would imagine you would be able to use the hook\_civicrm\_pre or if not the hook\_civicrm\_post on the Entity **ParticipantPayment** to catch and change the invoice ID?
> 0 votes

# Answer
Not a full answer but hope gives some insights.

The invoice ID is taken from the contribution ID, that said, I would rather go for a custom filed/extension. I do remember that contribution ID AND invoice ID (when applicable) is used to check against existing contributions, not 100% sure about this but perhaps someone from the core team could clarify.

There was a similar question here
> 0 votes

---
Tags: invoice
---