# Question
Title: Error from CiviCRM code when I try to install other Drupal modules
Drupal version 7.34, CiviCRM version 4.5.5

Hi, When I try to install Views and CTools on our Intranet installation, I am getting the following error from Drupal:

Exception: API error: DB Error: already exists in CRM\_Core\_ManagedEntities-\>onApiError() (line 396 of /srv/www/htdocs/drupal/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php)

(currently, CIviCRM is the only module installed)

Is this something that upgrading both CiviCRM and Drupal will fix?

# Answer
> 5 votes
It looks like CiviCRM is trying to insert some "Managed Entities" which already exist in the DB. Certain actions within the Drupal CMS will trigger CiviCRM to attempt this, and enabling / disabling modules is one of them.

What I might do in this situation (if I had to fix it without upgrading CiviCRM) is:

* Make a backup of your DB. Make two.
* Look in CiviCRM's debug logfile for `ManagedEntities_failed` \- this has additional information to the Exception message you posted above.
* Review the entry which CiviCRM was unable to insert to the DB (because a conflicting entry already existed).
* If the entry CiviCRM tried to insert matches closely to an entry in the DB, then remove the DB entry you find and hope that when CiviCRM re-inserts the same, it "sticks" the second time around.
* You might need to repeat this process, so pay attention to any new errors in the same logfile, and see if they are clashing with new entries or the same one ...

# Answer
> 2 votes
If CiviCRM is the *only* module installed, consider upgrading to the current release if at all possible.

Doing this is likely to fix a lot of bugs, and may well address your problem. It will also address multiple security issues fixed between 4.5.5 and the current release, which is probably just as important to you and your contacts. We strongly recommend keeping up to date with a supported CiviCRM release.

If you have a compelling reason to stick with 4.5.5, then consider the workaround in my other answer.

# Answer
> 2 votes
Looks very similar to the error message I got after upgrading to 4.6.8 which was affecting every Drupal module or CiviCRM extension I tried to install.

Reproduce the same conditions in order to reproduce the error and then look at the day's log file in sites/default/files/civicrm/ConfigAndLog This might give you some clue what was the cause.

In my case it was choking on pre-installed and unwanted demo Cases. After disabling them I got things running error free again.

# Answer
> 2 votes
I've had the same issue on 4.6.8. Couldn't install any Drupal modules after creating a custom CiviCRM case type. Getting the same Drupal log error as seen above (Exception: API error: DB Error: already exists in CRM\_Core\_ManagedEntities-\>onApiError() (line ...).

Disabling the case type allows the Drupal modules to be installed.

Olly

# Answer
> 0 votes
After looking at "sites/default/files/civicrm/ConfigAndLog", I have found that disabled "Relationship Type" under "Administer/Customize Data and Screens/Relationship Type/" was causing the error. After deleting relationship, error was gone.

version 4.6.15

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


title: Deleting email addresses from list

text:
# Question
Title: Deleting email addresses from list
Some people have asked to be removed from our email list. How do I do that? I've tried just deleting the name but I can't make it permanent

# Answer
Several interpretations here.

If 'remove from email list' is the equivalent to 'unsub from group x which is used for a Mailing List' then you should be able to 'remove' them directly from the group.

If it means 'stop sending me any bulk mailings' then you can set their email to "on hold"

if it means 'never ever email you' you can set their record to Do Not Email which should stop even one to one emails from the system
> 3 votes

---
Tags: civimail
---


# Question
Title: How can I change the 'Postcode' field to work with UK postcodes?
I am currently running tests with CiviCRM 4.6.14 and have custom functionality working as we require. During testing by the end user, an issue has come to light with the 'Postcode' field.

Despite having the UK localization installed, the report filters are still treating the postcode field as an integer. UK postcodes are a mixture of letter and numbers and I need to be able to query the database using these.
Have I missed something in the localization? Is there something I can alter so the postcode field is interrogated as an alphanumeric rather than integer?

Any help would be appreciated. Many thanks Russell

# Answer
Short answer:

This is a limitation/bug in CiviCRM. The advanced search handles postcodes correctly (ex: I can search postcode ranges H4 to H5), but most reports do not. It would be a feature that needs to be implemented in CiviCRM reports.

Longer answer, if you are a developer:

We could fix it by changing the filter type in the report, but then US-style postal code would lose the ability to search by range. I'm not too sure how to implement that in the report.

Ex: civicrm/CRM/Report/Form.php in function addAddressFields():

```
    'postal_code' => array(
      'title' => ts('Postal Code'),
      'type' => 1,
      'name' => 'postal_code',
    ),

```

Should be:

```
    'postal_code' => array(
      'title' => ts('Postal Code'),
      'type' => CRM_Utils_Type::T_STRING,
      'name' => 'postal_code',
    ),

```

but, as I mentioned, this breaks "search postcode between X and Y". The advanced search has a checkbox to enable "search by range", and it works for UK/Canada-style postcodes, but I'm not sure how to implement this for reports.
> 5 votes

# Answer
Although you have the localisation file installed, do you have the setting in Administer/localization/address settings/Default Country actually set to United Kingdom? I do have it set up like this and it works for me by allowing UK post codes to be entered alpha/numerically. I am using civicrm 4.7.6 with Wordpress 4.5.1 Incidentally, I did not install the localisation file and haven't found a need for it, yet.
> 0 votes

---
Tags: reports, postcode
---


title: CiviMail not working

text:
# Question
Title: CiviMail not working
I'm unable to send mail; it runs for a while but then returns:

```
Fatal error: Uncaught
PEAR_Exception: not connected in unknown on line unknown
- PEAR_Error: not connected in unknown on line unknown
Exception trace
#   Function    Location
0   CRM_Core_Error::exceptionHandler(Object(PEAR_Error))    unknown:unknown
1   call_user_func(Array, Object(PEAR_Error))   /var/www/slnmembers_drupal/sites/all/modules/civicrm/packages/PEAR.php:931
2   PEAR_Error->PEAR_Error('not connected', null, 16, Array, null)  /var/www/slnmembers_drupal/sites/all/modules/civicrm/packages/PEAR in /var/www/slnmembers_drupal/sites/all/modules/civicrm/CRM/Core/Error.php on line 901

```

PHP 5.6, MariaDB 5.5

# Answer
Seems to be an error from PEAR Net\_Socket, probably a few more lines of the backtrace would reveal that this came from Net\_SMTP?

"Not connected" likely indicates that the remote SMTP connection has dropped the connection - this could be for a number of reasons, including intentional disconnection on that server's part ("whoah, 250 messages at once?!"), or an issue on that server, or even a network issue between CiviCRM and that server.

Since you say this is GMail, I'd guess that you might be running into intentional sending restrictions on Google Mail.

> To keep our systems healthy and your accounts safe, Google Apps limits the amount of mail one user can send. Limits restrict the number of messages sent per day and the number of recipients per message. After reaching one of these limits, a user can't send new messages for up to 24 hours after the limit was exceeded, but they can still access their account and receive incoming email.

I don't recommend using Google SMTP for CiviMail, they will shut you down (even mid-connection!), because the service is not intended to be used as a bulk mail provider. That's not a bug, it's part of the package.

Switching to `mail()` method will work, but may also be limited by the hosting environment. For example, one popular webhost limits outbound emails to 150/hr *and silently drops delivery of any mails beyond this*. That's a situation where you might run a few test CiviMails successfully, then push out a large promo and be left confused at why the response was so poor ...

If you want to be assured of your CiviMail delivery, make sure you have established terms with your SMTP provider & make sure they accommodate the level of usage you need.
> 2 votes

---
Tags: civimail
---


title: Error Message Customization

text:
# Question
Title: Error Message Customization
Is there a way to change the error message that users receive when they try to register for an event online for which the registration date has passed? Currently the message is: ! ERROR Registration for this event ended on April 25th, 2016 12:00 PM.

# Answer
I think it is Possible to customize the error, On your install, visit the Form Registration.php in CRM/Event/Form directory.

The the error message is found in the function checkValidEvent(XXXX). and the line looks like this

CRM\_Core\_Error::statusBounce(ts('Registration for this event ended on %1', array(1 =\> $endDate)), $redirect);
> 1 votes

---
Tags: civievent
---


# Question
Title: Minimum Fee for Membership Types won't save
I'm running CiviCRM 4.7.6 with WordPress 4.4.2.

I've created a new membership type called "guest" and set the minimum fee to $25.00. However, in the list of membership types, the minimum fee showed blank, so edited the type to add a minimum fee, but it still shoes blank.

I've also created a separate membership type called "executive" which is a zero dollar membership intended track which members are on the board, and we give them additional permissions using a Smart Group and ACLs. This works fine, however, when you create a new "executive" and select the "executive" membership type you have to "record a payment" and set the amount to zero because otherwose I get the following text in the Amount field:

```
Invalid format passed to CRM.formatMoney

```

I'm guessing these two issues are related, and that somehow the minimum fee being passed from the membership type record is invalid causing the error text to be pasted.

I failed to reproduce the problem with the Demo site, which leads me to fear there might be an issue with the database.

Has anyone seen this problem, and is there a known solution for it?

# Answer
> 1 votes
After spending time to resolve this across several days and working with our site administrator to troubleshoot we figured it out. The site administrator was able to confirm that the values were being stored in the database, so it was probably something to do with formatting.

I eventually discovered that the display rules were configured wrong. It was configured as follows:

Monetary Amount Display: `%c %a`

Monetary Value Display: `%c`

As I understand it, the formatting rules here are nested. When you're trying to display currency, it first looks to "Monetary Amount Display" to figure out how to display the value. In the case above, it was telling it to display the currency symbol with `%c` followed by the amount with `%a`.

The second field, "Monetary Value Display" contains the rules for displaying the value requested by `%a`. With the example above, the rules were to show the currency symbol for the value, which was invalid, so it chose not to show values at all.

I corrected the setting as follows:

Monetary Value Display: `%!i`

This instructs CiviCRM to display the value using the localization rules specified earlier in the form but to suppress the currency symbol. We don't need it, since we're adding a currency specific symbol in the "Monetary Amount Display" field.

I hope my frustration will save someone else some pain later on!

---
Tags: civimember, contributions, currency
---


# Question
Title: How to add custom templates (tpls) or php files
What is the 'civi' approach to customising templates and php files? (if this question is a duplicate very happy to remove. I just searched for one after reading Error Message Customization

# Answer
Am sure others will provide a more substantive answer but going to start just with a link to this wiki page since I had it handy
> 2 votes

# Answer
The 'Civi approach' towards customising templates and php files would be to create an extension with your customizations. How to do that can be read on this wiki page

An extension is basically an additional bit of software that you switch on in CiviCRM and adds stuff to CiviCRM or customizes parts.

That is the recommended approach. You can also customize core templates and put them in your customized directory as the link from petednz explained (and the same for php files). This is however an approach that can throw up problems when upgrading. Extensions might not be compatible with upgraded versions either, but can simply be switched on and off.
> 2 votes

---
Tags: php, custom-templates
---


# Question
Title: Joomla: Warning: Missing argument 1 for CRM_Utils_System_Joomla::getDefaultSiteSettings()
This is a new install Linux - shared hosting with Godaddy.

Joomla 3.5.1

PHP 5.4.45

CiviCRM 4.7.6

I have uploaded and installed CiviCRM. No errors. When I go to Adiministrator\>Components\>CiviCRM, I get:

> Warning: Missing argument 1 for CRM\_Utils\_System\_Joomla::getDefaultSiteSettings(), called in /home/username/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php on line 687 and defined in /home/username/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Utils/System/Joomla.php on line 698

I get CiviCRM Home, with Configure Your Dashboard link, and the Loading Icon. Also, System Status Errors:

> ```
> Cron Not Running
> Timestamp Mismatch
> Configure Default Mailbox
> Complete Setup
>
> ```

I have spent countless hours on this today, installing, uninstalling and installing over and over. Same result, every time. I'm fairly certain it must have something to do with the config file and variables, and I've gone over them time and again. Any ideas??? HELP!

Line 698 in Joomla.php:

`public function getDefaultSiteSettings($dir) {
 $config = CRM_Core_Config::singleton();
 $url = preg_replace(
 '|/administrator|',
 '',
 $config->userFrameworkBaseURL
 );
 $siteRoot = preg_replace(
 '|/media/civicrm/.*$|',
 '',
 $config->imageUploadDir
 );
 return array($url, NULL, $siteRoot);
 }`

# Answer
The issue was reported on JIRA here: https://issues.civicrm.org/jira/browse/CRM-18411

The patch can be found here: https://github.com/civicrm/civicrm-core/pull/8164

The patch was merged in, so it is fixed in 4.7.7 onwards.
> 1 votes

# Answer
just pass the argument to this getDefaultSiteSettings(); of your live site url: something like this $this-\>getDefaultSiteSettings('http://localhost/CiviCrm/'); at line no: 687
> 0 votes

# Answer
Curtis -- Those are not errors, they are PHP warnings. And while it would be good to clean them up in the code, they do not affect functionality. They are present because the error display level in Joomla is dialed up too high. In your Joomla backend, go to System \> Global Configuration, click the Server tab and change your Error Reporting option to "none" (which is what it should be set to on a production site).

The system status errors popup in CiviCRM are informative of various configuration pieces you have not completed. If you click the link you'll see more details about those, and will have the option of disabling the notification if desired. For example, if you're just getting the site up and running now, you may not need/want the cron jobs to be running yet, and so you can disable that warning for a week.
> 0 votes

# Answer
I got the same warning after updating civicrm from 4.6.15 to 4.7.6. I did have the error reporting in Joomla set to Maximum. When after updating the files I tried to run the upgrade database script for civicrm it stalled completely. I concluded that the update failed, reset the error reporting from Maximum tot None, and went back to the upgrade script: that now ran and completed the update correctly. Strange: the warning somehow blocked the database update. In Joomla warnings are not coupled to cms actions or scripts. Perhaps this is different with civicrm?
> 0 votes

---
Tags: joomla, error, installation
---


# Question
Title: How to extend Database Log Report from Contact
I would like to extend standard functionality of Database Log Report generated from contact.

For now there is list of standard colums, but there is no information about what changes was made in fields. Only interactions are tracked. I would like to have report, which will show me changes on fields, eg changes in email address.

Is there any solution for that?

# Answer
> 4 votes
See https://book.civicrm.org/user/current/advanced-configuration/logging/

But oddly that page just explains it and doesn't say how to turn it on. You go to Administer - System Settings - Misc and then turn on logging.

---
Tags: civireport
---


# Question
Title: DB Error on upgrade to 4.7: Duplicate entry activity_tab_filter for key 'index_domain_contact_name'
I receive the error below during the upgrade process. I restored to previous backup and tried again and received the same. Any ideas what exactly is it indicating is duplicate? Thanks so much!

> \[Error: Migrate Settings to 4.7.alpha1\] Error Field Error Value Type DB\_Error Code -5 Message DB Error: already exists Mode 16 UserInfo ALTER TABLE civicrm\_setting ADD UNIQUE INDEX index\_domain\_contact\_name (domain\_id, contact\_id, name) \[nativecode=1062 \** Duplicate entry '1-571-activity\_tab\_filter' for key 'index\_domain\_contact\_name'\] DebugInfo ALTER TABLE civicrm\_setting ADD UNIQUE INDEX index\_domain\_contact\_name (domain\_id, contact\_id, name) \[nativecode=1062 \** Duplicate entry '1-571-activity\_tab\_filter' for key 'index\_domain\_contact\_name'\]

# Answer
It seems that you have the same setting that is set twice on your database, and the upgrade to 4.7 enforce it won't happen.

You will need to list your settings as stored in the database, you should see more than one activity\_tab\_filter for the contact\_id 571.

Delete the duplicate(s) and keep only one and then run the upgrade again and you should be fine

X+
> 4 votes

# Answer
This would appear to be an issue that should be cleaned up prior to the upgrade. I have logged this issue in the JIRA issue queue here https://issues.civicrm.org/jira/browse/CRM-18485 and I have a proposed solution of essentially purging the database of the activity\_tab\_filter settings before upgrade. My proposed solution is here https://github.com/civicrm/civicrm-core/pull/8273
> 3 votes

# Answer
Initially deleted what appeared to be duplicate activity entries from user #571, but that did not fix the problem. Restored to the backup version and then this problem was finally resolved by deleting user 571 (my own entry) from the DB.
> 1 votes

# Answer
Similar problem here. How do we fix this problem? I don't understand how to do this: "You will need to list your settings as stored in the database..."
> 1 votes

---
Tags: upgrade, error
---


title: Error deduping with custom file field

text:
# Question
Title: Error deduping with custom file field
when deduping contacts holding a custom file field, we're a facing the following error:

**One of parameters (value: 5667c1677bca0\_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg) is not of the type Integer**

From a first glance at the code I think there may be a bug. As you can see in the stacktrace below, CRM\_Core\_BAO\_File::paperIconAttachment() is feeded with the field's **value** while it requires the field's **id** as param.

Could that be?

StackTrace:

```
Apr 12 10:49:36  [info] $backTrace = #0 CRM/Core/Error.php(366): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 CRM/Utils/Type.php(369): CRM_Core_Error::fatal("One of parameters  (value: 5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg...")
#2 CRM/Core/DAO.php(1335): CRM_Utils_Type::validate("5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg", "Integer")
#3 CRM/Core/DAO.php(1254): CRM_Core_DAO::composeQuery("\nSELECT    CF.id as cfID,\n           CF.uri as uri,\n           CF.mime_typ...", (Array:2), TRUE)
#4 CRM/Core/BAO/File.php(309): CRM_Core_DAO::executeQuery("\nSELECT    CF.id as cfID,\n           CF.uri as uri,\n           CF.mime_typ...", (Array:2))
#5 CRM/Core/BAO/File.php(691): CRM_Core_BAO_File::getEntityFile("*", "5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg")
#6 CRM/Core/BAO/CustomField.php(1233): CRM_Core_BAO_File::paperIconAttachment("*", "5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg")
#7 CRM/Core/BAO/CustomField.php(1139): CRM_Core_BAO_CustomField::formatDisplayValue("5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg", (Array:44), NULL)
#8 CRM/Dedupe/Merger.php(1411): CRM_Core_BAO_CustomField::displayValue("5667c1677bca0_3f2cb71777b83d7a5ed1cca5e7dff69f.jpg", 88)
#9 CRM/Contact/Form/Merge.php(186): CRM_Dedupe_Merger::getRowsElementsAndInfo("266847", "252170")
#10 CRM/Core/Form.php(519): CRM_Contact_Form_Merge->preProcess()
#11 CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#12 packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contact_Form_Merge), "display")
#13 packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Merge), "display")
#14 CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#15 CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#16 CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Merge", "Kontakt zusammenführen", NULL)
#17 CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
#18 CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#19 drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
#20 [internal function](): civicrm_invoke("contact", "merge")
#21 /d/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#22 /d/index.php(21): menu_execute_active_handler()
#23 {main}

```

# Answer
> 0 votes
For anybody running into this: fixed in 4.7.6

---
Tags: custom-fields, duplicate-contacts, core
---


# Question
Title: Buildkit - amp test failed - /root/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/root/' is executable'
I am trying to setup buildkit in my new Debian machine. I installed all the required packaged, ran `civi-download-tools` and `amp config` with correct credentials and included `Include /root/.amp/apache.d/*.con` in *apache2.conf* file. On restarting apache it gave me error saying there was no \*.conf file to be included in `/root/.amp/apache.d`. I checked the directory; **it was empty.**

However, I copied `localhost-7979.conf` from my previous buildkit setup on another machine and placed inside `/root/.amp/apache.d` folder and restarted apache. On running `amp test` it gave me following error:

```
PHP Warning:  file_get_contents(http://localhost:7979/index.php): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden  in phar:///opt/buildkit/bin/amp/src/Amp/Command/TestCommand.php on line 163

```

I checked `localhost-7979-error.log` inside `root/.amp/log`. Following line was there.

```
'/root/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/root/' is executable'

```

Strange. There isn't even any *.htaccess* file inside `/root`. I tried every solution I could find on CiviCRM StackExchange and Forums but none worked.

# Answer
> 1 votes
I was performing all actions as a root. That was probably the reason no .conf file was generated in */root/.amp/apache.d/*. I switched to a non-root user with sudo privileges and it worked smoothly.

---
Tags: civicrm-buildkit
---


# Question
Title: Let participants confirm registration with one click?
We frequently have trouble with participants not finishing the confirmation process (after being allowed to participate --\> pending from approval), because offering them all data input fields again is confusing them.

So I'd like to make the link sent within the "Please confirm your registration" mail directly confirm the registration without having to go through all registration pages again (directly link to the Thank you-page).

Is that possible? (Very limited php/html skills available...)

Thank you in advance!

Drupal 7.43 with CiviCRM 4.6.4

# Answer
One way to do that would be:

Create a drupal webform where you show the CiviCRM user and the Event and a Submit button that registrates the visitor to the Event.

If you use a checksum token in the link then the person you mail will be shown on that page.

With a second parameter in the URL, for example "&action=register", you can use Javascript to auto-submit that form.

(Simirarly you can also create a cancel webform + email to send to people who already registered, so you make it easy for them to let you know that they will not be there).
> 2 votes

---
Tags: civievent, email, registration, confirmation
---


# Question
Title: Should we install CiviCRM again and import cleaned up data?
I have recently joined the International Voluntary Service as Director and I am trying to understand the database - CIVI

the system was installed several years ago and has not been updated consistently. it is in quite a big mess.

I am trying to work through how to solve this. My query is this - can we set up an entirely new account with CIVI? effectively start all over again? Then merge the clean data from the old system into a new account?

# Answer
> 2 votes
By "new account" I assume you mean a new CiviCRM instance (a new install).

If yes, then yes! You can start fresh in a new CiviCRM and import the cleaned up data. If you search for "CiviCRM Import" you'll get a number of useful search results related to importing data, including tutorials.

But if you have a complicated data structure you may be better of trying to clean it up in the existing instance.

# Answer
> 2 votes
I will put a different answer. We have also had clients who have had a CiviCRM that has been neglected or poorly managed with the result of their being many Groups, Fields, Tags etc that were created but poorly used. But I believe it can be more efficient to do the CiviCRM upgrades and then use the CiviCRM inbuilt tools to do the clean up. Exporting all the related data and reimporting can take a lot of time.

The one occasion where we might recommend a data migration is if we can find any evidence that poor security practices might have led to the site having had some nasty code installed.

# Answer
> 1 votes
From what you describe it would make perfect sense to me to start over again and then import the cleaned data. Depending on what you use you can do this with the standard import functionality. What parts of CiviCRM do you use and what data would you want to migrate? (as in contacts, activitities, contributions, groups, relationships.....)

---
Tags: civimail
---


# Question
Title: Online receipt change in 4.7: Wrong template is being used
We upgraded to 4.7 and using WP 4.4.1. The Online receipt for payments has changed -- something is telling the system to use the summary receipt and I can not find out what it is.

See pics. How can we get the full receipt back or is there something else wrong?

**Before update:**

**After update:**

# Answer
You can update your CiviCRM ticket to tell them that $contributeMode is being set to "notify" for credit card payments, which is why credit card information isn't being printed.
> 1 votes

# Answer
Please create a bug report in JIRA for this.
> 0 votes

---
Tags: contributions, receipts, issues
---


# Question
Title: membership recurring payments using Drupal webform
I have a webform in Drupal 7 that is using CiviCRM integration to allow users to purchase memberships. I'm having a little bit of trouble figuring out what the correct setting should be, and not finding documentation that helps. Here is what I would like to happen:

* In the webform, a user selects from multiple membership options.
* They may also select to buy a non-membership item.
* Either on this page or the confirmation page, I'd like to collect payment information and allow users to opt-in for recurring payments.

Right now, I know how to create a membership page that includes payments, and I can see how to allow membership registration on the webform, but I haven't figured out how to get payment integrated into the user flow. Have any ideas for me, or links to documentation?

# Answer
Documentation lives here: https://wiki.civicrm.org/confluence/plugins/servlet/mobile#content/view/120029195

In a nutshell - to integrate payment you need to create a civicrm contribution page - enable a payment processor. In the webform civicrm tab select this contribution page - this way webform civicrm will know that you want to process payments, what payment fields to display and which payment processor to connect with.

Re: recurring payment - to my knowledge you can't do this yet. I've started thinking about how to make that happen.
> 2 votes

---
Tags: drupal, civimember, webform-civicrm, authorize.net
---


# Question
Title: Account Creation Form not showing In Contribution Page
I created a profile and enabled account creation required. I attached the profile at the Contribution Page, but the account sign-up form is now showing up when I am not logged in. I am using Wordpress 4.4.2 with CiviCRM 4.6.8.

Any help will be appreciated.

# Answer
> 2 votes
Thanks but i have resolved this. The problem was that i did not set that anyone can register in wordpress –

---
Tags: profile, user-account
---


title: Dies CiviCRM support Stripe Checkout

text:
# Question
Title: Dies CiviCRM support Stripe Checkout
Does Stripe checkout work with CiviCRM, Drupal combination? Or only Stripe.JS will work with CiviCRM?

# Answer
You can Follow this discussion to clarify your Stripe Checkout integration which talks about what your question requests
> 1 votes

---
Tags: stripe
---


# Question
Title: Mass mailings and German law conformity – provide do-not-track for civimail (opt-out from track open)
German privacy acts demand fulfilling three requirements when sending mass mailings using tracking technology and I wonder how to achieve this. Because I think CiviMail's and CiviCRM's core and therefor all german users would benefit from a generic solution, I'd prefer handling this in civi itself. But walking the customization way is an option too.

1. **Pseudonymization**

The tracking information has to be detached from all data which may identify the corresponding contact.

AFAIK civi does not provide such a possibility or does it?

How could we hook into database and reports to cut the link between tracking information and the civi contact? If the link is just a civicrm\_contact\_id in a tracking table, could we create a pseudonymic fake contact and generally override the db field with it's id?
2. **Ability to contradict**

The possibility to opt-out from tracking is mandatory.

How to implement a new communcation setting named somethin like "Do-not-track" besides "User opt-out" which tells the system to not insert tracking links or beacons in a contact's mails?

Or – as a customization approach – should we add a custom field, edit it in the mails via a link to a custom extension's function and read it using some thing like hook\_civicrm\_alterMailContent?
3. **Transparency**

Users have to be informed about all tracking that is done. Easy as it is a just a matter of text. But maybe we could add a default snippet.

Any help appreciated.

# Answer
I don't think there is a way to achieve "pseudonymization" without having to touch code (except for turning off tracking altogether). However, implementing what you suggested, i.e. assigning the tracking events to a predefined contact ("Anonymous") one way or another, should be reasonably easy for a developer.

Adding on do-not-track flag is a different story though, that entails a lot of little changes throughout the system. It also raises questions like "if I set this flag for a contact, do we want to keep the previously gathered data?" or "should that flag also affect bounce processing?".

You might also consider doing this as an extension at first, because it will take a while to be released in an official CiviCRM version. Plus, you could make sure it's working and well thought-out.
> 2 votes

# Answer
Easiest would be to not track via CiviCRM. But track via Piwik (www.piwik.org).

You would get info about how much people visit your site from the Mailing (via https://piwik.org/docs/tracking-campaigns/#tracking-campaigns-using-url-parameters), but you would not see how much people opened the mail or who clicks which link.

Piwik has all the opt-out options you need.
> 2 votes

---
Tags: civimail, developer
---


# Question
Title: hide select box options in contributed page
I am currently trying to edit : sites/default/files/civicrm/templates\_c/CRM/Contribute/Form/Contribution/Main.tpl

to try and alter when select box A of pricesets are chosen then hide an option in select box B, as I understand civi used a different kind of jquery select box is there anyway I can hide it so that the options do not come available as I already hide the original part but its still available

thank you

# Answer
First - don't edit anything in the templates\_c directory! These are cached pre-compiled copies of the template, and are frequently cleared out.

Second - it's not advisable to edit the templates that ship with CiviCRM directly, because you'll have to apply your changes on every upgrade.

The best practice is to install civix and create an extension, but in your case, I don't see the harm of using a template override, and more specifically a ".extra.tpl" file.

This wiki page has all the information you need. I would start by just creating a "custom templates" directory, and make sure you can successfully implement your change with a normal template override. Then remove your override and reimplement using a .extra.tpl file, and your change should be OK through most upgrades.
> 2 votes

# Answer
With Drupal you can easily inject some JS for specific CiviCRM URLs - this example is for an event/registration page - but this should work for all urls.

```
function myorg_zen_preprocess_page(&$variables, $hook) {
    if (strpos(request_path(), 'civicrm/event/register') === 0) {
      drupal_add_js(drupal_get_path('theme', 'myorg_zen') . '/js/civicrm-event-register.js');
    }
}

```

and then in that js file - you can add all the js you need/want to change/re-arrange the elements on that civicrm page. Things we often do:

* show/hide custom fields based on change in the price option selected
* replace the ugly black CiviCRM buttons with nice colorful modern sass buttons
* style the #google\_map
* control whether the default for is\_recurring on contribution pages that allow recurring contributions - is checked - or not
> 1 votes

---
Tags: civicontribute, contribution-page, price-sets, javascript
---


title: The Cost of Civi

text:
# Question
Title: The Cost of Civi
I work for a charity and we are considering Civi as I used it through a previous workplace.

I was wondering what the costs are - is it one off or monthly?

Are you able to give me a rough quote for the following, separately and combined please?:

Hosting our website/ so that we can manage content ourselves CRM Donations Newsletters

I look forward to hearing from you.

With thanks and best wishes, Janice

# Answer
Thanks for your question and welcome to CiviCRM!

CiviCRM is open source software. This means that you don't have to pay a license fee to use it. So in theory you can use it for free.

However, unless you are technically inclined you would probably benefit from having a partner set up CiviCRM for you. Most organisations go down this route.

There are also other costs to consider such as hosting.

It is difficult to give an estimate without knowing much more about what you need. If you get in touch with one of the partners I'm sure they will be able to give you an estimate.

See also this related question: What is the price of CiviCRM?
> 5 votes

---
Tags: evaluating-civicrm
---


# Question
Title: Why are contacts getting multiple membership scheduled reminders?
We saw this with a WordPress 4.4.2 CiviCRM 4.6.14 instance.

A reminder was sent every time cron was run.

This is not related to Why is Scheduled Reminders sending multiple emails but not creating an activity? an activity is created every time a reminder is sent.

# Answer
This is a bug as reported here \- when a membership end date is changed the system keeps sending scheduled reminders.

The issue is fixed in 4.7 but remains for 4.6
> 4 votes

---
Tags: civimail, scheduled-reminders
---


# Question
Title: What happended to the ability to expand parent groups in the Manage Groups page?
The Manage Groups page used to show a little icon you could click in order to see the child groups of a parent group. Now, under 4.7.6 there are no icons. This means you can't see or manage the child groups. This is a major issue for us. Any suggestions for how to fix this. Is it a bug?

# Answer
> 2 votes
As you noted in the comments below, there is a JIRA discussion about this issue. The issue has been tracked down, and a patch submitted (which is now in Q&A and slated for 4.7.8).

Per @jitendrapurohit on the Jira thread above:

> Submitted a PR - https://github.com/civicrm/civicrm-core/pull/8323
>
> 1) First issue mentioned above was the regression of CRM-18184. Seems the patch attached on that was different from the PR submitted. This was later fixed in this PR https://github.com/civicrm/civicrm-core/pull/8020
>
> 2) Second point was a regression of this commit. The updated params loses the key('parentsOnly') sent from $\_GET.

---
Tags: groups, 4.7
---


title: Why is my mailing taking so long?

text:
# Question
Title: Why is my mailing taking so long?
Our problem has two parts. We tried to send an email to our members and supporters from one user's computer but could not add recipients' addresses (she was away for the upgrade). I tried to send it from my computer instead as I have been doing for the past 6 months. It won't send though - has apparently been 'running' for 2 and a half hours, not being delivered.

# Answer
As Tomek suggested, try running this task, usually referred to as a Job.

Administer \> System Settings \> Scheduled Jobs \> Send Scheduled Mailings \> More \> Execute Now
> 1 votes

# Answer
All are not delivered, or part? We faced the same problem, when there was no CRON runnig from server side. If You are sending them via Administrer task, just run this task one more time.
> 0 votes

---
Tags: contacts
---


# Question
Title: Dashboard Issue after attempted Installation on Wordpress 4.5
Attempting to install CiviCRM 4.7.6 on WP 4.5. Plugin activates fine. All checks on Installation screen are fine/OK.

On finish, there was a note about "Cron not running", but no error that was obvious.

The civicrm.settings.php file is not present in the installation.

When I click on CiviCRM to view the dashboard - It opens, but does not display the dashboard and no menu. None of the links go anywhere.

Any help is appreciated!

Near the bottom is an error message: Powered by CiviCRM 4.7.6. System Status: Error The Error link is a dead end/circular to the same page.

# Answer
> The civicrm.settings.php file is not present in the installation.

you can use the command "locate civicrm.settings.php " on your command line to see if you can find it because on wordpress you can have the settings file floating somewhere probably and the installation cannot run to completion if the settings file is not there "( so i think )"

you could also get to see some compatibility issues which have been stated Wordpress plugin incompatible with CiviCRM to see if you have an issue related to those.

If it takes so much time, you can take a lesser time to follow this Installing CiviCRM on wordpress which is very explicit and well elaborate
> 0 votes

---
Tags: wordpress, installation, dashboard
---


# Question
Title: Bulk merge creating multiple address (and email) records of same location type
I'm pretty sure this is not an intended behavior, but I want to make sure.

When I try to add a second address of the same location type I get an error and civi will not let me (Image 1).

If I use the merge tool and I try to merge contact A (Image 2) with contact B (Image 3), I am told moving/merging the home address to the home address of the destination contact will cause an overwrite (Image 4).

In the merge tool I see no conflicts even though contacts have home addresses that differ (Image 5). If I use the \[Batch Merge All Duplicates\] button I end up with 1 contact with 2 different address records of the same type (Image 6). Same issue with email addresses, although civi will let me add two email addresses of dame location type (which I don't think should happen).

Bug?

\*note, this was tested on civi demo site.

**Image 1**

**Image 2**

**Image 3**

**Image 4**

**Image 5**

Image 6

# Answer
> 0 votes
The address aspect of this has recently been raised as a bug here: https://issues.civicrm.org/jira/browse/CRM-18455

And has been patched as part of: https://issues.civicrm.org/jira/browse/CRM-18338

As for the rest of the merging logic - where it creates many email addresses (phone numbers, and other 'location blocks') of the same type, I agree this doesn't seem desirable; but deciding which phone/email to keep isn't always straightforward. The current logic is:

When force merging if there are any conflicts the 'main' record takes precedence, otherwise any information from the 'other' record is added to it. Ie: all emails would be added. If there were two addresses of the same type then the 'main' one would stay on the record.

I also posed this question on the civicrm-dev mailing list as to whether this is the desired behavior and I've created a follow-up thread on the forum: https://forum.civicrm.org/index.php?topic=37165

Please feel free to get involved =\] It would be great to improve this tool and have it working as desired - once we know what 'as desired' looks like.

---
Tags: duplicate-contacts
---


title: Contribution Page has stopped working

text:
# Question
Title: Contribution Page has stopped working
I have a contribution page that has stopped working for me. Actually from the end user perspective the contribution page work perfectly. The correct forms are displayed, and they can complete the contribution, which is one of several free memberships.

The issue is that none of the input on the contribution page are being saved in the backend. Nothing at all is recorded in contributions or memberships. It is like the transaction never happened.

It took us a bit to realize that there was an issue, and the extent of the issue. The last successful use of the contribution page was April 8th. Something obviously changed after that to cause the issue, but I can't figure out what. There wasn't an upgrade that caused the issue, either to CiviCRM or Joomla or the hosting account (that I am aware of).

Anyone ever have issues with a contribution page doing this? Any ideas at all what I can do to resolve this?

Thanks for any help and ideas.

CiviCRM 4.7.6 Joomla 3.5.1 PHP 5.5.31

# Answer
Maybe you have published the test-drive link to the contribution page rather than the live link.
> 1 votes

---
Tags: civimember, contributions
---


# Question
Title: Chained API Call : Membership.contact_id EntityTags
I am looking to get a list of all contacts with active memberships, and their respective tags. I went about this by starting from an api call to give me all current memberships owned by a company.

```
CRM.api3('Membership', 'get', {
  "sequential": 1,
  "return": ["contact_id.tag","contact_id.id"],
  "status_id": "Current",
  "contact_id.contact_type": "Organization"
}).done(function(result) {
  // do something
});

```

Running the above only gets me the default returns vals of the contact\_id and id of the membership. It does not return the tags.

When I run this by itself:

```
$result = civicrm_api3('EntityTag', 'getsingle', array(
  'sequential' => 1,
  'contact_id' => 137402,
));

```

I get what I want, the tag ids for the contact.

What am I doing wrong here?

# Answer
> 1 votes
Ideally I would be using the $value.contact\_id var but I can't get it to work that way.

membership-\>tags (via contact\_id)

What I did get working was inserting a 3rd link in the api call chain.

membership-\>contact-\>tags

```
CRM.api3('Membership', 'get', {
  "sequential": 1,
  "status_id": "Current",
  "options": {"limit":0},
  "contact_id.contact_type": "Organization",
  "api.Contact.get": {"api.EntityTag.get":{}}
}).done(function(result) {
  // do something
});

```

# Answer
> 1 votes
First, you need to do chained api call, like you did with :

```
"api.Contact.get": { "sequential": 1, "api.EntityTag.get":{}}

```

Second, you can filter the result of your chained call by doing so :

```
"$value.api.Contact.get.contact_type": "Organization"

```

Third, to get the result of your chained api call, you need to do something like :

```
tags = result['values'][0]['api.Contact.get']['values'][0]['api.EntityTag.get']['values'];

```

If you want something a little less complex, you can use `getsingle` or `getvalue` instead of get. This way, you won't have to loop on `values`

So the final result should look like :

```
CRM.api3('Membership', 'get', {
  "sequential": 1,
  "api.Contact.getsingle": {
    "api.EntityTag.get" : {}
  }
  "status_id": "Current",
  "$value.api.Contact.getsingle.contact_type": "Organization"  // instead of contact_id.contact_type
}).done(function(result) {
  // replace by a loop on membership...
  tags = result['values'][0]['api.Contact.getsingle']['api.EntityTag.get']['values'];
});

```

---
Tags: civimember, api, tags
---


# Question
Title: Testing a module which uses CiviCRM php api
I have written a drupal module that uses the CiviCRM api. I want to build tests for my module. Drupal 7 includes the simpletest module in core, so I'm using that. I have created the following test:

```
class ExampleCiviCRMTestCase extends DrupalWebTestCase {

public static function getInfo(){
    return array(
        'name' => 'Example CiviCRM Test',
        'description' => 'Check that CiviCRM API can be used in tests',
        'group' => "CiviCRM",
    );
}

public function setUp() {
    parent::setUp(array('civicrm'));
}

public function testCivicrmWorks(){
    civicrm_initialize();
    try {
        $result = civicrm_api3('Contact', 'get', array(
            'sequential' => 1,
        ));
    } catch (CiviCRM_API3_Exception $e) {
        $error = $e->getMessage();
        $this->fail($error);
    }
    $this->assertFalse(empty($result['count']));
}
}

```

This test fails. The error page states that the civicrm module was successfully enabled, but then this error occured: `Access to undeclared static property: Database::$ignoreTargets`. The error occured in database.inc on line 1473. Does anyone have any experience using simpletest with civicrm?

# Answer
> 2 votes
I'm not an expert of testing but i'm pretty sure that SimpleTest creates a new instance of Drupal with a new database each time the testing process is ran.

CiviCRM is not a standard Drupal module and cannot just be enabled. In your `SetUp` function, You need to install CiviCRM to create the corresponding tables in the database. It could be a rather complex task but it's possible to do so. There is a drush script to do it so it might be a good inspiration.

You might want to check `drush_civicrm_install` in https://github.com/civicrm/civicrm-drupal/blob/7.x-master/drush/civicrm.drush.inc

Otherwise, you might find easier to use CiviCRM testing way (phpUnit) : https://wiki.civicrm.org/confluence/display/CRMDOC/Testing

And an example : https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php

---
Tags: drupal, api, testing
---


# Question
Title: Can Attendees Modify their Registration?
Can attendees access their registration and make changes after they've submitted a completed registration?

# Answer
This is not out-of-the box functionality. Have a look at these threads:

Recommended process for credit card additions/'edits' to event registrations?

Can I allow users to update their registration?
> 3 votes

---
Tags: civievent
---


title: HTML tags showing in Activity details

text:
# Question
Title: HTML tags showing in Activity details
This seems to have been an issue before. Formatting tags shown in activity view Has this been resolved because I am still having an issue with this. I am not on the current version. If there has not been a fix for this - is there a work around? CivicCRM: 4.7.2 Drupal: 7.43

Thank you Casey

# Answer
A work around I use is to use simple text area instead of CKEditor.

It should be fixed in 4.7.5 according to this issue.
> 1 votes

---
Tags: contacts, activity
---


title: How to Create an extension?

text:
# Question
Title: How to Create an extension?
I am really finding it difficult in creating an extension in CiviCRM.

I just want to create a section in contacts Called DSearch like , when we click in contacts we get differeent sections like Address , Notes, Communication Preferences etc.

# Answer
Not everyone has the skills to create extensions. But here are a couple of links that you might find useful:

https://github.com/totten/civix

https://wiki.civicrm.org/confluence/display/CRMDOC/Create+an+Extension
> 3 votes

---
Tags: extension, civicrm-home, civicrm-entity
---


title: MailChimp extension certificate error

text:
# Question
Title: MailChimp extension certificate error
Anyone seen this particular error before when trying to sync Civi contacts to Mailchimp?

API call to lists/batch-unsubscribe failed: SSL certificate problem: unable to get local issuer certificate

Googling this didn't turn up much that was helpful; I've inquired of Mailchimp but have yet to hear back.

CiviCRM 4.4.14/Mailchimp extension v 1.7

Thanks in advance, Lesley

# Answer
If you are on Linux, I found this explanation (https://www.drupal.org/node/2477693) :

> The Root CA used to sign \*.api.mailchimp.com was removed from Mozilla NSS CA \> Certificates bundle in February 2015, and was removed from Debian 8's ca-certificates package in January 2016.

I used this method to solve the problem :

1. Download cacert.pem file from here: https://curl.haxx.se/ca/cacert.pem
2. Add this Mailchimp CA cert at the end of cacert.pem :

```
GTE_CyberTrust_Global_Root
==========================
-----BEGIN CERTIFICATE-----
MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
-----END CERTIFICATE-----

```
3. Save the file in your PHP configuration folder.
4. Open your /etc/php5/apache2/php.ini file and add this line:

curl.cainfo="/etc/php5/apache2/cacert.pem"
5. Restart your Apache server and that should fix it.
> 2 votes

# Answer
I am not sure if the poster is on Debian Jessie. But if yes, then the correct solution is to reinstall the ca-certificates package. It seems this is a bug with a recent package update of ca-certificates.

```
apt-get --reinstall install ca-certificates

```
> 1 votes

# Answer
The other answers are definitely more "correct" than this one - but I had this problem for a while when my client's host ran a very old version of FreeBSD with a different set of root certificates. Until I was able to fix the problem properly, I did this. Note that "line 108" is probably no longer correct - these notes are a year old.

In the Mailchimp extension, in vendor/mailchimp/Mailchimp.php, line 108, I changed it from:

```
public $ssl_verifypeer = true;

```

to:

```
public $ssl_verifypeer = false;

```
> 0 votes

---
Tags: mailchimp
---


# Question
Title: Should "CiviCRM: view my contact" permission result in user being able to edit themselves in CiviCRM
We think we have found a bug in the core CiviCRM related to user permissions.

If we give a role (eg authenticated) only the "CiviCRM: view my contact" permission. They have NO other CiviCRM permissions. Then as that user we go to our CiviCRM contact record (we did this by typing in the path as have provided no way to get there ie http://demo.fuzion.co.nz/civicrm/contact/view?reset=1&cid=230). On that page you get a EDIT button, which allows you to edit your contact details, and you are able to save these changes. I would assume this button should only be available if the role is given the "CiviCRM: edit my contact" permission.

We are on Drupal 7.43 and CiviCRM 4.6.14.

This is not the same issue as https://civicrm.stackexchange.com/questions/7151/permissions-view-my-contact-and-edit-my-contact-do-not-seem-to-work as I checked without the "CiviCRM: view my contact" they get access denied on the page.

# Answer
This issue was a bug that has been fixed. For reference purposes you can see the issue here
> 1 votes

---
Tags: permissions
---


# Question
Title: How to delete/reorder a Contact from a Webform
I have developped a complex Webform with 4 Contacts.

I want to delete Contact #2 : I can delete it in the "Webform" Tab, but it remains in the "CiviCRM" Tab : how can I delete it also in the CiviCRM Tab ?

I also would like to create a New Contact #1 (just before the current #1) : How can I do that ?

# Answer
> 3 votes
Sorry, the module does not have any mechanism for reordering contacts. The only solution is to reconfigure the contacts manually. Since you are wanting to add a new contact #1 and get rid of contact #2, you don't have to mess with #3 or #4 - they can stay put. Just configure #2 to have all the properties of #1, and then change #1 to be like the new contact you are wanting to add.

# Answer
> 3 votes
If you prefer editing a file to GUI clicking, you could try the node\_export module: export your existing webform as a text file, edit it very carefully, and import it as a new webform.

On a simple 2 contact POC, I removed the components with form\_keys starting civicrm\_1, then renamed the civicrm\_2 form\_keys to civicrm\_1. In the webform\_civicrm contacts array, I removed the first contact. The imported form seems ok.

You might need to do more on a complex form.

Some features depend on the order of contacts (eg relationships are only possible with earlier contacts) so shuffling the order could cause problems.

# Answer
> 1 votes
I found some solutions, so I answer my own question :

In fact, reordering or deleting the Contacts in the CIVICRM tab has no importance, since it can be done in the WEBFORM tab.

... except for the first (primary) one, which is "Usually assumed to be the person filling out the form" : if you want to change (reorder) it, the solution I found is to clone this primary contact (in the WEBFORM tab), then modify it to become what you want (the clone has not this property)

... somewhat what Coleman proposes above (thanks)

# Answer
> 0 votes
OK - massive get out of jail card thanks to Jacques. Here is my scenario and how i dealt with it. Contact 1 was not current user (it has started off as a public form and then modified for admins to use).

It had a gazzillion fields, fieldsets and layout boxes.

CID 2 was the current employer. What i need was cid1 to be current user, cid2 to be a clone of what cid1 had been, and cid3 to be current employer.

* reset civi tab to only have 1 contact (may not have been necessary)
* deleted cid 2 via webform components
* added a new field to cid 1 as i had already thrown away its fieldset :( - and smile because i know that adding any new field will recreate the fieldset, which is a pain many times, but this time made me happy
* drag all the fields, fieldsets and layout boxes back in to the new cid 1 fieldset which last step recreated
* check. all looks good. clone contact 1 fieldset via webform tab
* check that cid 2 is now copy, it is, yay
* on civi tab, remove all fields for cid 1 other than 'existing contact' (using the 'select none' for each field group rather than lots of clicking - thanks coleman!)
* drag all fieldsets and layouts for cid 1 in to a single fieldset so i only have to hit delete once (perhaps i could have combined this and previous set rather than doing above via civi tab)
* set civi tab to have a 3 contact and set that to be the employer of 2

+ chill.

---
Tags: webform-civicrm
---


# Question
Title: Using Search Builder to search on a field with custom location gives DB error
On current CiviCRM demo site (4.6.10) if you

add a new location type, then populate a contact with an email address of that location type, then use Search builder to search for email address with location type, it gives error:

DB Error: syntax error

# Answer
> 1 votes
For completeness, my comment probably should have been an answer…

I think this is probably a bug.

It doesn't matter if you create a new location type or use a pre-populated one. The sql has a column that doesn't exists and it's going against the wrong table. Here's the sql:

```
SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name
FROM   civicrm_contact contact_a
WHERE  ( ( LOWER(Home-location_type.name) = '8' ) )
AND    (contact_a.is_deleted = 0) GROUP BY contact_a.id
ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc

```

\[nativecode=1054 \** Unknown column 'Home-location\_type.name' in 'where clause'"

AlanGallery submitted a bug see comment above.

# Answer
> 1 votes
I have the same problem. I have some installations that work correctly and some that's don't work.

I made this patch, it's not a nice patch, becasuse it's not applied in CRM\_Contact\_Form\_Search\_Builder, but temporally works

https://github.com/rubofvil/civicrm-core/commit/facfa396891229eb914397eb4920e75b6abff4a2

---
Tags: search, location-type
---


# Question
Title: Are there recommended directory ownership and permission settings for CiviCRM files?
CiviCRM (and Drupal) issue warnings when a file directory permission presents risk. However, periodic warnings also indicate that a file directory cannot be accessed because of a permission setting. These warnings seem to contradict each other from time to time - recently using an extension.

Are here recommended settings for both ownership and permissions (assuming apache as group setting)? For CiviCRM and Drupal files? Are there guidelines for .htaccess files? (individual forum posts address specific user situations but a more comprehensive guideline would help prevent issues)

# Answer
## What you want

* You want the webserver to have read-only access to all the files and dirs or the site can't function.
* You want the webserver to have read-write access to all the files it's expected to manage, e.g. everything under `sites/default/files`
* You want the webserver to have read (r) and search (x) access to all directories under your webroot (with the *exception* of any repository dirs, like any `.git` repos)
* You want your developer(s) to have read write access throughout.
* You want to apply this to a pre-existing install that may have who-knows-what permissions.
* You'd like the permissions to stay this way; so new files must be created with the same rules.

## What you DON'T want

* You don't want your webserver to have write access to your php files. Otherwise an vulnerability that allows evaluating php can write its own php permanently, becoming a stored attack. I've encountered this (not on a CiviCRM install) and it's not nice. The counter to this argument usually goes "oh but I like the one-click update button my CMS offers me and that requires write access and it's surely more secure for people to be easily able to upgrade their site than to go without security updates". So for less experienced developer/implementers on certain non-Drupal CMSes this might be for you.
* You don't want the execute bit set on *files*. Unless you do actually need to execute them from a shell.
* You don't want any permissions wider than those that are required for the proper functioning of the site. Does every user need access? no. Does your mailman user need access? No. Does another website you run on the same host need access? No. So they shouldn't have access, otherwise a vulnerability in an external package could be exploited to access your site/data.

## How

There are many ways to set up your permissions, users and groups and the best way for you will depend on the number of developers you have and what webserver config you use.

I am a single person developer and so I usually have php (etc) files owned by me, put them in a group the webserver user is in, and deny all other access. I use git, too.

Here's what I do for a reset:

First, ensure your user is in the webserver group. Check with the `id` command. If you're not in the group:

```
adduser $USER www-data

```

If you had to do that you'll need to logout and in again (or do `su -l $USER`) for it to take effect. Without being in the group some of the commands below will silently fail.

```
cd /var/www/mysite.com/
# Dirs outside of files dir: 02750, Files: 007.
# Owned by developer $USER and group www-data
find -path ./sites/default/files -prune \
  -o -execdir chown $USER:www-data \{\} \+ \
    \( \
       -type f -execdir chmod 00640 \{\} \+ \
    -o -type d -execdir chmod 02750 \{\} \+ \
    \)

# In files: allow rw access.
find ./sites/default/files \
       -type f -execdir chmod 00660 \{\} \+ \
    -o -type d -execdir chmod 02770 \{\} \+ \
    \)

# Disallow webserver access to any git repos
find . -name .git -type d -execdir chmod 00700 \{\} \+

```

Note that the last command might generate errors because there may be existing files that are owned by the webserver user, not you, and so you don't have permission to `chmod` them. Typically you can ignore those errors; you could add tests in the find command but my commands were long enough so I didn't include those complications.

## Explanation

1. `00640` means rw for user, read for group.
2. `02750` means rwx for user, rx for group **plus group sticky bit** which means that any files created within that directory will have the group ownership of the parent dir. This is really handy for developers because it means if you create a file from the shell then it is given the correct group and the webserver can access it.
3. `00660` means rw for user and group.
4. `02770` is like (2) but also gives group write access.
> 5 votes

# Answer
These are the Unix/Linux permissions I tend to set my permissions for CiviCRM directories in Drupal 7:

* chmod 555 sites/default
* chmod 644 sites/default/settings.php
* chmod 644 sites/default/civicrm.settings.php
* chmod 770 sites/default/files
* chmod 755 sites/default/files/civicrm

I generally have the ownership set to the hosting account username and the group to the server group, like apache so something like:

* sudo chown username:daemon -R httpdocs
> 6 votes

---
Tags: permissions
---


# Question
Title: Unrecognized database version from 4.6.16 to 4.7.7
Joomla 3.5.1, Linux, Php 5.6.20

Is there a "quick fix" I could make to a script to allow it to either recognize the database, or would it be OK to manually change the database version number only back to 4.6.15?

When I try to upgrade from 4.6.16, to 4.7.7 it says that it doesn't recognize database version 4.6.16. It says:

***Your database is marked with an unexpected version number: 4.6.16.*** *The automated upgrade to version 4.6.7 can not be run - and the 4.6.7 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using prior to beginning this upgrade until you resolve this problem.*

In addition, the actual error message is NOT formatted correctly. The full message (as it appears on screen) is:

```
An error has occurred.
 0 <div id="crm-container" class="crm-container" lang="en" xml:lang="en"> <style type="text/css" media="screen"> @import url(/main/administrator/components/com_civicrm/civicrm/css/civicrm.css); @import url(/main/administrator/components/com_civicrm/civicrm/bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css); </style> <div class="messages status no-popup"> <div class="icon red-icon ui-icon-alert"></div> <span class="status-fatal">Sorry but we are not able to provide this at the moment.</span> <div class="crm-section crm-error-message">Your database is marked with an unexpected version number: 4.6.16. The automated upgrade to version 4.6.7 can not be run - and the 4.6.7 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using prior to beginning this upgrade until you resolve this problem.</div> <p><a href="http://ahymsin.org/main/administrator/" title="Main Menu">Return to home page.</a></p> </div> </div> <script language="JavaScript"> function toggle( element ) { var className = element.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { element.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } } </script>

```

# Answer
Error found: I downloaded the correct 4.7.7 to my computer, but then uploaded 4.6.7 to the server by mistake and ran that installation. Thanks @davejenx for noticing this.
> 2 votes

---
Tags: upgrade, database, 4.7, 4.6
---


# Question
Title: Why is the field "contribution_id" in "civicrm_line_item" sometimes NULL
The table "civicrm\_line\_item" has a field called "contribution\_id". For the most part, this field is filled in. But there are many records where the "contribution\_id" field is NULL. I have seen this with happen no matter what the "entity\_table" value is.

Why is "contribution\_id sometimes NULL? What would cause this? (I have seen this in version 4.5.x and version 4.6.5)

# Answer
For every contribution, a line\_item is being created. The `contribution_id` field is the FK reference to the `civicrm_contribution` table.

If I manually delete the Contribution record related to the Contact, the contribution gets deleted from `civicrm_contribution` table, which results in `contribution_id` to be NULL in `civicrm_line_item`.
> 1 votes

# Answer
Here's one context where a `civicrm_line_item` record is created with `contribution_id` NULL:
Line Items should be created for all Membership Signup/Renewal and Participant Registration transactions

See also:
Line item for membership entity should be created even when Record Payment is not checked
> 0 votes

---
Tags: civicontribute
---


# Question
Title: Settings - Date Preferences - mailing - start offset, end offset (what do they mean?)
Please can someone explain what the **start offset** and **end offset** fields mean in Settings - Date Preferences - mailing. The default values are 0 and 1 respectively. I feel it should understand this, but I don't. Am I an idiot? Thanks.

# Answer
OK, I'm an idiot. The start offset means that users can't schedule mailings in the past, and the 1 means that they can schedule mailings up to one year into the future.

Maybe "offset" isn't the ideal word. "Start of valid range" and "End of valid range" would be clearer.
> 1 votes

---
Tags: mailing, settings, preferences
---


# Question
Title: Can a Profile have hidden fields with preselescted or predefined values?
I'm trying to create a profile to be used as a form, but rather than having the user populate certain fields, have the form populate them automatically. An example of what I'm trying to do:

The profile form is only presented to people that are registering as guests, therefore I want to pre-select the Membership Type as `Guest` rather than allowing the user to select the membership type. In fact, I don't even want the user to see the membership type field.

I'm running CiviCRM 4.7.6 on WordPress 4.4.2.

# Answer
I've used a custom template page with jquery to do something similar. (I wanted the event to assume they were registering themselves and one other person - and NOT allow them to see they could choose how many.)

I wrote a quick jquery statement to preselect the value and then hide the option altogether with css.

https://civicrm.org/blog/hershel/how-customize-civicrm-pages-jquery
> 1 votes

# Answer
I think you can use CiviCRM hooks as Hook functions allow module-extensions to run extra logic as part of the normal CiviCRM processing

A video could be found here , In this video, an extension i created and it is demonstrated how to preset custom fields with values when the form load s

You can as well look at Implementing hooks within an extension
> 0 votes

# Answer
Take a look at CiviRules. It could potentially add a Guest Membership based on people who fill in that profile being added to a specific group, so base the rule off 'if contact is added to Group x, then give them membership type Y".

Above suggestion is just that, i have not gone in to CiviRules to verify
> 0 votes

---
Tags: civimember, profile
---


title: Why can't I delete an event?

text:
# Question
Title: Why can't I delete an event?
We have an event that will not delete. When trying to delete, the system gives:

"This event cannot be deleted because there are participant records linked to it. If you want to delete this event, you must first find the participants linked to this event and delete them. You can use use CiviEvent \>\> Find Participants page ."

There are no participants registered for this event. This happens every so often.

# Answer
> 3 votes
Perhaps you have is\_test participants?

Events -\> Find Participants Participant is a test? Hit the Yes radio button Search

If you have any - then select the participants you found - and then in the actions: delete participants.

---
Tags: civievent
---


# Question
Title: Update to 4.7.7 broke CiviCRM contact search
I update to CiviCRM 4.7.7 from 4.7.6 and immediately got errors for my contact search. The contact search in the upper left corner, Find contacts, and Advanced Search. The error I get is:

@import url(http://www.mysite.org/administrator/components/com\_civicrm/civicrm/css/civicrm.css); @import url(http://www.mysite.org/administrator/components/com\_civicrm/civicrm/bower\_components/font-awesome/css/font-awesome.min.css); Sorry but we are not able to provide this at the moment.

One of parameters (value: `1-street_address`) is not of the type MysqlColumnName

Return to home page.

function toggle( element ) { var parent = element.parentNode; var className = parent.className; if ( className == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') { parent.className = 'crm-accordion-wrapper crm-fatal-error-details-block'; } else { parent.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block'; } }

Anybody else having this problem?

# Answer
> 2 votes
This is a regression that has been identified in 4.7.7 - thanks for spotting it.

Progress on the issue, and a patch to resolve it, will be posted on the issue tracker here: https://issues.civicrm.org/jira/browse/CRM-18510

---
Tags: search, custom-search, quicksearch
---


title: Credit Card Processing Fee Field

text:
# Question
Title: Credit Card Processing Fee Field
I have a volunteer project I am doing and the organization it is for wants to be able to show donors the estimated cost of their credit card processing and then let them add it to their total. I know we can do this an extension but I am trying to come up with another way. Any ideas are appreciated.

Thanks, Steve

# Answer
I would tuck these into a priceset; so two fields: donation and processing cost; then add some Javascript to the contribution page to do the math and dynamically populate the processing field based on the value in the donation field.

Add another field to the contribution form via a profile (yes/no radio button) and use that in your Javascript as a switch ($0 or do the processing cost calculation).
> 3 votes

---
Tags: civicontribute
---


title: Why do I get a Content Encoding Error?

text:
# Question
Title: Why do I get a Content Encoding Error?
Using Firefox on a Mac generates erratic and inconsistent error screens that say "Content Encoding Error". Sometimes reloading the page solves it, sometimes not.

# Answer
> 2 votes
This turned out to be an unexpected odyssey.

1. This error was misleading, and actually indicated that some of the page elements were being returned with 0 bytes.
2. Those elements were civicrm php urls, and most of the errors we noticed where from a 4.7 installation.
3. There were unhelpful messages in the php error log until I turned on 'catch\_workers\_output=yes' in the php-fpm.d/www.conf file.
4. The detailed error 'WARNING: \[pool php56u\] child 31883 said into stderr: "zend\_mm\_heap corrupted"' led me to https://bugs.php.net/bug.php?id=65590
5. A suggestion in that thread "opcache.fast\_shutdown=0" appears to have resolved the issue.

---
Tags: admin, sysadmin
---


# Question
Title: Is there a reason CiviMail won't send a draft if no recipients are selected?
Often, CiviMail users will want to send a draft email to someone for approval before they know the exact list of recipients. However, you can't "Send Test" unless you meet all the requirements for sending the email itself - most notably, the list of recipients.

Is there a reason for this I can't think of? I wanted to put it out here before I considered writing a patch for this.

# Answer
> 3 votes
I would think this is just that the entire form is being validated. It would make sense that there is different validation for the preview than their is for sending.

-Steve

---
Tags: civimail
---


# Question
Title: Only admin can access event registration page
I've created a view with a block of upcoming civicrm events with links to the online registration pages. Only the administrator can get to the registration page. Anonymous and authorized users get this message:

"Sorry but we are not able to provide this at the moment. XML data could not be loaded. Make sure you specified the correct path.

Return to home page."

Anonymous and authorized users have permission for
CiviEvent:register for events, CiviEvent:view event info , CiviCRM:access all custom data.

The CiviEvent is setup to allow online registration.

# Answer
> 1 votes
There are some steps in the original comment you might want to do first but this link has the solution that worked for a few people. https://forum.civicrm.org/index.php?topic=23855.msg100253#msg100253

Try:

rm -rf sites/all/files/civicrm/ConfigAndLog/

CiviCRM will rebuild the ConfigAndLog folder.

-Steve

---
Tags: civievent
---


# Question
Title: Is it safe to delete multiple membership records after ensuring the Contact record has been merged?
I am working on merging duplicate contact records, which is successful for the most part. However, I am finding that merging the contact record does not remove multiple membership records seen when pulling reports for membership year 2016.

For example: We merged all records for ContactA, so there is only one contact record for her. However, there are still two membership records for her in Civi that are exactly the same. They have the same contact ID (35747). All of the info is the same but there are two records – so it throws off all of our reports. She is not the only member where we find this happening. Is it safe to just delete one of the membership records since all the data has been merged into the other record?

# Answer
It is okay to delete a duplicate membership, but if there is a payment associated with that membership record, that payment will also be deleted. If that is an issue, you may want to consider creating a new membership status to reflect these duplicate memberships, you'll be able to easily filter them from reports that way.
> 3 votes

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


# Question
Title: "Already subscribed to list" message after submitting contribution (Drupal)
By default, all contributions add the associated email address to our mailing list. In the case of people who are either already subscribed, or who are logged in to a Drupal account (which also are default opted in to the mailing list), upon completing the contribution, they receive a CiviCRM info message stating " is already subscribed to the list."

Obviously we'd like to avoid this if possible. Is there a way to avoid trying to subscribe people to the list if they are already added?

# Answer
> 1 votes
Unfortunately, this is a consequence of using the profile to add contacts to a group. There are a couple of ways to work around this that may be better for your needs:

* **Make a smart group.** If everyone who makes a contribution should be in a group, why record that information separately from the contribution? Just make the email list a smart group of all contacts with contributions.
* **Have people opt in.** Are you certain that donors know they're signing up for the email list? If not, you really should make that explicit. You could add the "Group(s)" field to the profile to let people choose among all public groups, or you could add a single checkbox field for someone to say they'd like to subscribe, and you could base a smart group on that.
* **CiviRules.** You may find that you can create a workflow for this step using CiviRules and if it does throw up a warning about the contact already being in the group, at least it is out of public view

---
Tags: civimail, civicontribute
---


# Question
Title: Install Error DB Error: extension not found
Using "upload package file" or "install from folder" on a clean new Joomla 3.5.1 installation without any other extension I get this error :

**Cannot open mysql://XXX:YYY@localhost/XXX?new\_link=true: DB Error: extension not found**

Tried 4.7.7 and for testing even CiviCRM 4.6.16 LTS -\> same error

PHP Built On Linux dd36620 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86\_64

Database Version mysqli 5.6.27-nmm1-log

Database Collation latin1\_swedish\_ci

Database Connection Collation utf8mb4\_general\_ci

PHP Version 7.0.4-nmm1

Web Server Apache

WebServer to PHP Interface fpm-fcgi

Joomla! Version Joomla! 3.5.1 Stable \[ Unicorn \] 05-April-2016 22:45 GMT

Joomla! Platform Version Joomla Platform 13.1.0 Stable \[ Curiosity \] 24-Apr-2013 00:00 GMT

User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36

Tried as suggested in the WIKI

php\_value memory\_limit 128M

php\_value register\_globals off

php\_value max\_execution\_time 600

Maybe someone has an idea what I could do to get it installed, thanks

# Answer
> 2 votes
Have you installed php-mysql?

`sudo apt-get install php-mysql`

To me, it sounds like PHP doesn't have the MySQL extension installed.

Meanwhile, at this point, CiviCRM doesn't support PHP 7, so if you do get this working, you'll run into that problem next.

---
Tags: extension, database, error, installation
---


# Question
Title: Anonymous users cannot register for a civievent
CiviCRM 4.7.6 and Drupal 7.43. I created a CiviEvent and enabled online registration. I can access the registration page when logged in as the administrator but anonymous users get this error message:

The requested Profile (gid=12) is disabled OR it is not configured to be used for 'Profile' listings in its Settings.

Drupal permissions for anonymous include CiviCRM: profile listings and forms, CiviCRM: profile view, CiviCRM: access all custom data, CiviCRM: view all activities, CiviEvent: register for events, CiviEvent: view event info.

# Answer
When you create an Event you specify what Profiles should show eg at http://d46.demo.civicrm.org/civicrm/event/manage/registration?reset=1&action=update&id=3 you can see it has Include Profile = Your Registration Info.

In this case it sounds like you have some other Profiles in use (instead or as well)

And either those Profiles are "not configured to be used for 'Profile' listings in its Settings" - which is what your error says - or the Profile might have incompatible fields included in it.
> 0 votes

---
Tags: civievent
---


title: Is postURL no longer supported?

text:
# Question
Title: Is postURL no longer supported?
We have recently upgraded from 4.4 to 4.7.3 and are now experiencing an issue with one of our profiles. It seems that the civi will no longer use the postURL we are passing to it in an html form. I don't see any release notes saying this was removed and I am kind of at a loss of what could be causing this.

Any suggestions?

Thanks

David

# Answer
> 1 votes
I assume you're talking about a profile where you've copied the HTML Snippet and pasted it onto another site. If so, you should be aware that the necessary code does change periodically between major versions.

Thankfully, the answer is pretty straightforward: just generate the HTML Snippet all over again. Go to **Administer \> Customize Data and Screens \> Profiles** and select **More \> HTML Form Snippet** next to your profile. Copy the HTML and paste it into your other page.

# Answer
> 0 votes
I couldn't get the postURL to work on HTML snippets either, but setting a redirect URL in the actual profile settings worked ok.

---
Tags: profile
---


# Question
Title: How to edit php so civicrm can find the extensions
neither - for the directories

* /home/mysite/public\_html/wp-content/plugins/files/civicrm/custom\_ext

nor - for the resources

works as an entry to find the extensions - everything is 775 permissions

**Is anything in the path incorrect?**

oddly, if I only use /home/mysite/public\_html/ and /http://www.mysite.org/ civicrm **picks up a zip file for another web app** and displays this ridiculously long path to get to the file - in case you are interested it's

**\- Local Path = /home/mysite/public\_html/qdpm/core/lib/vendor/symfony/test/unit/plugin/fixtures/http/pear.example.com/REST/p/sffooplugin**

How it can find and interpret this as and extension and not the recommended path I don't know. Does anyone?

I have searched the forum and not found anything that worked. Not sure why this is so difficult to setup. I have many web apps that just create the directories you need and you are done.

Anyway, do I need to edit directories.php etc. to make this Extensions show up as they should. This is a deal breaker since there is no ad hoc reporting and I am hoping a report extension will give us what we need. Otherwise Civicrm is useless for us.

Thx

# Answer
You can define a directory for your extensions and point CiviCRM to it. Remember that custom extensions directory should be kept outside your CiviCRM installation because they will be easy to manage in case you need an upgrade on your install.

Below are the steps which i propose you carry out to setup your extensions directory

* create your directory probably /home/../../../extensions
* Give appropriate permissions to your extensions directory
* Go to your CiviCRM install, under administer \>\> System settings click on Resource URL.
* place the full path of the directory you created above in the "Extension Resource URL"
* Now any extensions you place in the directory above should be seen and interpreted properly as an extension

-\* you can verify and install by navigating to Administer \>\> System settings \>\> Extensions( there you will see all extensions )

If that does not make sense to you then you can follow from Extensions
> 1 votes

---
Tags: wordpress
---


title: Cron issue with shared hosting

text:
# Question
Title: Cron issue with shared hosting
CiviCRM 4.6.7

I get an error with this command: wget -O - -q -t 1 'http://www.website.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=user&pass=password&key=site-key'

> Fatal error: Uncaught exception 'Exception' with message 'Function "is\_admin()" is missing, even though WordPress is the user framework.' in /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php:258

Thanks for helping.

Edit:

With CLI PHP I get this error:

This what I get with CLI PHP:

Sorry. A non-recoverable error has occurred. Could not find the install directory for WordPress

```
#0 /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php(343): CRM_Core_Error::fatal("Could not find the install directory for WordPress")
#1 /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(1500): CRM_Utils_System_WordPress->loadBootStrap((Array:0), FALSE, FALSE, "/var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/")
#2 /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(251): CRM_Utils_System::loadBootStrap((Array:0), FALSE, FALSE, "/var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/")
#3 /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(72): civicrm_cli->_bootstrap()
#4 /var/www/vhosts/website.org/httpdocs/wp-content/plugins/civicrm/civicrm/bin/cli.php(31): civicrm_cli->initialize()
#5 {main}

```

# Answer
> 1 votes
I have resolved the issue. The path to the wordpress directory was wrong, don't know why. I have changed hosting during the week.

I had to add this line in civicrm.settings.php:

```
define('CIVICRM_CMSDIR','/var/www/vhosts/website.org/httpdocs');

```

This issue helped me: Problem with open\_basedir restriction in effect

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


# Question
Title: Batch update participants by profile - show more than 9 fields
I'd be grateful if anyone knows the answer to this:

I need to make a variety of batch update profiles that allow me to edit details of up to 40 custom participant fields on one screen. The batch update by profile is perfect for this.

However, while I can make these profiles exactly as I want them, when I use them for 'Batch update participants by profile' only the first 9 fields are shown on the batch update screen. I've tried this with a variety of different profiles, with different custom fields from different custom field sets and get the same result - only the first 9 fields show. This is also the case regardless of whether I am showing 4 or 22 rows. (My 2 test scenarios).

Is there a way to change this from 9 to 40 columns?

I'm on Civi 4.6.12, Drupal 7.43. We've long ago changed our php input variable limit to 4000 because we have many many blocks in our site, so it can't be this...

Thanks!

# Answer
> 4 votes
Try increase $\_maxFields in: CRM/Event/Form/Task/Batch.php

> /\** * Maximum profile fields that will be displayed. \*/
> protected $\_maxFields = 9;

This would be a core hack though! To do this properly -\> copy Batch.php -\> into a custom\_php directory.

---
Tags: civievent, profile, search, batches
---


# Question
Title: Views : Syntax error or access violation: 1142 (???)
I am trying to implement Views, but when I want to create an elementary users view, I get the following error :

SQLSTATE\[42000\]: Syntax error or access violation: 1142 SELECT command denied to user 'XYZ'@'localhost' for table 'civicrm\_uf\_match'

This, though I followed the Wiki : https://wiki.civicrm.org/confluence/display/CRMDOC/Views3+Integration

Here under is a partial copy of my settings.php file where I have copied the requested info :

---

$databases = array ( 'default' =\> array ( 'default' =\> array ( 'database' =\> 'paroisse\_drup275', 'username' =\> 'xyz', 'password' =\> 'abc', 'host' =\> 'localhost', 'port' =\> '', 'driver' =\> 'mysql', 'prefix' =\> 'dr\_', ), ), );

$databases\['default'\]\['default'\]\['prefix'\]= array( 'default' =\> 'dr\_', 'civicrm\_acl' =\> '`paroisse_civicrm`.', 'civicrm\_acl\_cache' =\> '`paroisse_civicrm`.', 'civicrm\_acl\_contact\_cache' =\> '`paroisse_civicrm`.', 'civicrm\_acl\_entity\_role' =\> '`paroisse_civicrm`.', 'civicrm\_action\_log' =\> '`paroisse_civicrm`.', 'civicrm\_action\_mapping' =\> '`paroisse_civicrm`.', 'civicrm\_action\_schedule' =\> '`paroisse_civicrm`.', 'civicrm\_activity' =\> '`paroisse_civicrm`.', 'civicrm\_activity\_contact' =\> '`paroisse_civicrm`.', ... );

---

I am in CiviCRM 4.7.6, with Drupal 7.43

# Answer
> 1 votes
Based on your comment, I see that each database only provides privileges to their respective user - and it seems implicit that you're using different users for each database.

That means that your Drupal MySQL user doesn't have access to the CiviCRM database. For Views to work properly, the Drupal user must have permission to run SELECT statements on the CiviCRM database. From the documentation you linked: "If you have different database users for your CiviCRM and Drupal databases, then you need to grant SELECT access for the Drupal user to all the CiviCRM tables."

Please try granting this access and try again, you should be good to go!

---
Tags: drupal-views
---


# Question
Title: Is command-line upgrade broken on CiviCRM 4.7.7?
I just tried upgrading a very vanilla site from 4.7.6 to 4.7.7. I ran `drush civicrm-upgrade-db`, which has worked previously on this site (which receives every point update - it's our internal CRM that serves as a testbed).

I received the following error:

```
WD php:                                                              [error]
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
You have requested a non-existent service "sql_triggers". in
Symfony\Component\DependencyInjection\Container->get() (line 317 of
/path/to/civicrm/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "sql_triggers". in Symfony\Component\DependencyInjection\Container->get() (line 317 of /path/to/civicrm/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php).
Drush command terminated abnormally due to an unrecoverable error.   [error]

```

Upgrading via the web URL worked fine. Has anyone else experienced this?

# Answer
> 4 votes
Someone actually provided the answer to another person on the CiviCRM chat channel, so I'm posting it here:

```
<juri_> "You have requested a non-existent service 'sql_triggers'."
<juri_> anyone care to take a guess? this is civi on drupal 8.
<mollux> juri_ clear the CiviCRM cache, had the same issue yesterday

```

---
Tags: upgrade, drush, cli
---


# Question
Title: CiviMail not delivering to certain mail servers eg. wp.pl
CiviMail fails to deliver some emails to specific domain servers: @wp.pl. Each time I send a mailing I receive a bounce message which reads like this:

```
This is the mail system at host stpuk-org.nazwa.pl.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<xxx@wp.pl>: host mx.wp.pl[212.77.101.4] said: 550 SPF Error:  Senders are
    required to provide correct SPF records. If you are
    a poczta.wp.pl user check SMTP configuration:
    http://poczta.wp.pl/autoryzacja/ (in reply to MAIL FROM command)

Final-Recipient: rfc822; xxx@wp.pl
Original-Recipient: rfc822;xxx@wp.pl
Action: failed
Status: 5.0.0
Remote-MTA: dns; mx.wp.pl
Diagnostic-Code: smtp; 550 SPF Error: Senders are required to provide
correct SPF records. If you are a poczta.wp.pl user check SMTP
configuration: http://poczta.wp.pl/autoryzacja/

```

The original message header is:

```
Return-Path: <bounces.stp+b.215.1467.3d8a9854510a5876@gmail.com>
Received: from mydomain.nazwa.pl (unknown [85.128.142.61])
    by stpuk-org.nazwa.pl (Postfix) with ESMTP id 2CE5F2411C0
    for <xxx@wp.pl>; Sun,  8 May 2016 23:28:11 +0200 (CEST)
To: <xxx@wp.pl>
Subject: =?utf-8?Q?=5BSzkic_CiviMail=5D_Og=C5=82oszenia_STP?=
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_7bef5881a1e24565cf35e4ad4b65e26c"
Reply-To: =?utf-8?Q?Stowarzyszenie_Technik=C3=B3w_Polskich?=
 <office@stpuk.org>
From: =?utf-8?Q?Stowarzyszenie_Technik=C3=B3w_Polskich?= <office@stpuk.org>
List-Unsubscribe: <mailto:bounces.stp+u.215.1467.3d8a9854510a5876@gmail.com>
job_id: 215
Precedence: bulk
X-CiviMail-Bounce: bounces.stp+b.215.1467.3d8a9854510a5876@gmail.com
Date: Sun, 08 May 2016 23:28:11 +0200
X-HTTP-Posting-URI: http://www.stpuk.org:80/civicrm/ajax/rest
X-HTTP-Client: 92.1.74.193
Message-Id: <20160508212811.2CE5F2411C0@stpuk-org.nazwa.pl>

```

I spent some time testing various approaches but without success. Few additional comments:

* Civimail is successful delivered to main providers such as gmail, yahoo
* For gmail I get a spf=softfail (txt below) but still delivers:

(google.com: domain of transitioning bounces.stp+b.197.1415.436c299ebc4d880a@gmail.com does not designate 85.128.169.253 as permitted sender) client-ip=85.128.169.253
* My DNS configuration has spf: "v=spf1 ip4:85.128.169.253 ~all"
* I use Google apps to handle my mail, hosting to handle website and CiviCRM and gmail for bounce processing

I believe I am missing something but I have no idea what.

# Answer
Demerit is correct, but I'll add a bit more detail and how you can fix it.

Your CiviCRM sends emails as `bounces.stp@gmail.com` from `212.77.101.4`. The SPF records looked up are those for the sender's domain, `gmail.com`, which does not include your webserver's IP.

Gmail treats this as a softfail, but nazwa.pl seems configured to treat failed SPF more strictly. Both are SPF fails.

Unless you control `@gmail.com`, you can't fix this via SPF for that originating email. What you can do is send messages from your own domain, with working SPF configuration.

To address this, change the originating email address (CiviCRM Menu \> Administer \> CiviMail \> From Email Addresses) to eg `bounces@stpuk-org.pl`.

This mailbox can in turn forward to your Gmail address, so CiviCRM can continue monitoring that mailbox for bounces.
> 3 votes

# Answer
Not sure what you mean by you use gmail for bounce processing. You can't control SPF records for @gmail.com addresses, and the error seems to indicate that's what it's looking for.
> 0 votes

---
Tags: civimail, bounce
---


title: Profile No Longer Creates WP User

text:
# Question
Title: Profile No Longer Creates WP User
Vistors to our website can fill out a form to create an account. It is a CiviCRM profile, and "WordPress user account registration option" is set to "Account creation required". The username and password fields are shown above the profile but a Wordpress account is not created when the form is saved. A Contact is created, but it is linked to the Wordpress admin account (ID #1).

I attempted to replicate this on the Wordpress Demo site. I created a profile that required Wordpress registration, but it (quite reasonably) would not allow me, as the demo user, to create a page for embedding it. When I view the profile in "Create Mode", it does not show the username and password fields (even when not logged in), and no new contact or account is created.

# Answer
> 0 votes
As it turns out, it was a custom extension that was causing the problem. Under certain conditions the extension would generate a blank `cms_name` value. When `wp_insert_user` was called with a blank username in the Wordpress.php system backend, it returned a `WP_Error` object instead of a userID. This error was ignored by CiviCRM and the newly created Contact was assigned Wordpress ID #1.

# Answer
> 3 votes
Occasionally WordPress plugins can interfere with user account creation. Have you installed any spam prevention plugins recently? If so, try turning it off and seeing if the user creation option shows up on your profile.

The reason this isn't working with WordPress demo site, is that User Creation is turned off on all demo sites. You may want to check that this is enabled on your own site as well.

---
Tags: wordpress, profile, 4.7
---


# Question
Title: Civicontribute registration module with wordpress
i created a contribution page, but when an user fills out the fields and pays we receive the paypal advice only without the user data registration. How to solve it?

# Answer
> 1 votes
Make sure you have enabled receipting in the Event configuration - and double check the to and bcc fields!

Reference: https://book.civicrm.org/user/current/events/creating-an-event/

Scroll down (lots) to Confirmation Email section.

If that's working: check that you can send Email from CiviCRM: go into your Administer -\> System Settings -\> Outbound Email -\> and try send yourself a test Email;

Reference -\> https://book.civicrm.org/user/current/advanced-configuration/email-system-configuration/

---
Tags: civicontribute
---


# Question
Title: Difference between 'active' and 'disabled'
I have set up custom fields for an event. There are multiple choice check boxes for field trips during the event. Some of the trips have reached the max number of participants and I need to stop additional sign ups. Please clarify the difference between the 'active' check box setting and the 'disable' menu item for multiple choice items. I want to hide the option but retain all current option data.

# Answer
> 4 votes
The "Disable" and "Enable" menu items toggle the option's `is_active` field. The "Active?" checkbox does the same.

# Answer
> 2 votes
A bit off-topic but if you want to limit the number of places for an option, instead of creating a custom field, you could create a price field item with price option and specify Max Participants.

This way, the option will be disabled from the list of choice when the limit has been reached.

The drawback of this method is that it's difficult right now to search / report based on the chosen price option.

---
Tags: wordpress, 4.7.6
---