# Question
Title: How to migrate Raisers edge data to CiviCRM?
We have large data in Raisers edge.We need to migrate Raisers edge data to CiviCRM.

How to migrate Raisers edge data to CiviCRM?

# Answer
It is INCREDIBLY difficult to migrate data from Raiser's Edge. You will definitely want to use an ETL tool, as suggested in another answer.

I have made my documentation available here. I also have my Raiser's Edge to CiviCRM transforms available here. There's also a video available here.
> 5 votes

# Answer
To migrate you will need some kind of ETL process (Extraction, Transformation, and Loading).

If you have experience with Pentaho, it has an adapter for civicrm and might be faster.

If you don't, it's probably faster to write a php-cli script that goes through the data exported and re-create it using CiviCRM API.

This being said, the harder in that kind of job it to find for each row for each entity in the source system where to put it in the destination one. And how to deal with "impedence mismatch". As an example, CiviCRM expects to have the first and last name separated, but some other system have the name in a single field. Is the first "word" mostly the first name or last name? What to do when you have 3 words, is this two first names and one last name or the other way around?

Erik's suggestion of reaching to someone that has already done that work and done the mistakes you always do the first time is a wise answer IMO, but nothing is impossible, just time consuming ;)
> 2 votes

# Answer
I've recently done this myself with around 6800 contacts and 860 activities, when a new member organisation (who were previously using their own Raiser's Edge installation) joined and wanted to move their data to our platform. They provided various CSV files exported from Raiser's Edge.

I wrote some scripts, to load the CSV files and translate each line into the parameters to a chained API request. There was extra work in differentiating e-mail addresses from phone numbers, checking for invalid input, the different parts of postal addresses, date formatting, and things that were given as text in the data provided but are stored as IDs in Civi. We also needed to add several new titles/prefixes.
> 2 votes

# Answer
Just to add to the mix, we did a migration using the Migrate approach that Eileen has favoured. Agree about the difficulty of making RE data 'fit' in to a civicrm structure.
> 1 votes

# Answer
There are several not-so straight forward table mappings between Raiser's Edge (RE) and CiviCRM that require a lot of hand-holding and tweaking. Most of the basic contact information is easily transferred, but the constituent codes, prefixes, RE appeals, etc. don't map cleanly to a standard CiviCRM install.

For large Raiser's Edge databases that contain more than 200k records these types of migrations using the API v3 can take days to complete. We use a RAMdisk mapped MySQL instance to speed up the import and have migrated 500k contacts in under less than 6 hours (compared to 96 hours per migration iteration if using disk based MySQL.)

For these types of migrations from Raiser's Edge to CiviCRM it's important to be able to add new data mappings incrementally to the ETL and a flexible tool like Pentaho Data Integration is key.

Emphanos has an existing ETL process that can take a Raiser's Edge SQL Server .BAK file backup and creates a CiviCRM migrated instance that maps about 85% of all fields and performs a full migration with sub-sampling of about 2000 contact records in less than 1 hour.
> 1 votes

---
Tags: import, evaluating-civicrm
---


title: Site transfer from Joomla

text:
# Question
Title: Site transfer from Joomla
I have a prospective clients who would like me to take over their site currently on Joomla and using CiviCRM I prefer to "hand code" my sites. How easy is it to integrate existing CiviCRM into such a site?

# Answer
> 2 votes
You mean with your own CMS? you will mostly have to deal with the authentication and permission system. look at what is done in civi for WP, J+, Drupal to give you a sense of the scope. I personally would not invest this time for no obvious value, but I would not either "hand code" my site, so YMMV ;)

Good luck!

# Answer
> 2 votes
I wouldn't say that it is easy, but it might be possible. You could even look at something like a multi-site setup (https://wiki.civicrm.org/confluence/display/CRMDOC/Multi+Site+Installation) for some ideas. That said, I don't know that CiviCRM can run without a CMS of some sort. Permissions have to be handled somehow. Normally the CMS also handles the routing, but that I think could be dealt with.

Migrating the content from CiviCRM isn't usually too difficult, if you have a proper setup and not too many customizations.

You can still do a lot of customization and hand coding with Joomla, such as if you wanted to create your own template or extensions. I use a plugin, Sourcerer to use various kinds of code in Joomla articles if I don't want to have to start coding up a full extension/component. I use Chronoforms to create pretty forms to interact with my CiviCRM install.

# Answer
> 0 votes
I'll join the chorus from Xavier and recommend against hand-coding a CMS. You might be able to authenticate via the client's Google Domain (if they use Google) instead and use some light weight iframes to achieve some acceptable results.

You should contact Nicholas Ganivet from Cividesk about his code around CMS independent CiviCRM (which used to be its own branch.)

---
Tags: migration, html
---


title: CiviMail with postfix, handling retries

text:
# Question
Title: CiviMail with postfix, handling retries
I'm currently investigating switching from direct SMTP to Amazon SES to using postfix (configured to talk to Amazon SES) as I gather this is a more robust approach.

I'm slightly confused as to how CiviMail picks up failures, or retries from postfix.

For example, if halfway through a mailing Amazon SES becomes unavailable, what would happen? If postfix tries to send them again later how will these deliveries be recorded in CiviCRM?

# Answer
> 1 votes
Postfix is a Mail Transfer Agent (MTA), and the task of an MTA is to ensure that the mail gets through if at all possible.

If the remote site stops accepting connections for any reason, then your MTA will keep those mails on disk and retry them periodically. In the case where your SES becomes unavailable, your Postfix will just sit tight and keep trying.

Barring a severe SES outage, a local MTA + SES should be more robust than SES alone, because you have a local agent able to handle short SES outages. For even better handling, you may configure your MTA to "fail over" to a secondary mail provider, or attempt direct delivery over SMTP when the preferred provider is unavailable.

When a mail can't be delivered - whether or not this involves an outage at SES or elsewhere - the MTA currently holding the email should return it as a bounce message to the sender. This is the feedback loop which will return the failed delivery information to CiviCRM's Bounce Processor task.

---
Tags: civimail, smtp
---


# Question
Title: How does one call civicrm_api3_system_check API
What are the valid parameters to pass to civicrm\_api3\_system\_check($params)?

Passing $params = false or $params = array() causes an infinite loop despite my try catch.

**../civicrm/civicrm/api/v3/System.php** gives no hints

**../civicrm/civicrm/api/v3/examples/System/Flush.php** only shows how to use System flush

# Answer
Your example of calling `System.check` with an empty `$params` array should work. For example, this is what I get if I call the API from the command line:

```
$ cv php:eval 'return civicrm_api3("System","check", array());'
{
    "is_error": 0,
    "version": 3,
    "count": 6,
    "values": {
        "1": {
            "name": "checkExtensionUpgrades",
            "message": "Extension upgrades are pending.  Please visit <a href=\"/civicrm/admin/extensions/upgrade?reset=1\">the upgrade page</a> to run them.",
            "title": "Run Extension Upgrades",
            "severity": "error",
            "severity_id": 4,
            "is_visible": 1,
            "icon": "fa-plug",
            "id": 1
        },
        ...

```

(For other media, you can use the API Explorer to get code snippets.)

There are a lot of checks, and it's possible that they're slow on some systems. Alternatively, maybe one of the checks has a bug, relies on an incorrect assumption about the environment or data, or has an interaction with third-party code?
> 2 votes

---
Tags: wordpress, api, 4.7
---


title: Dropdowns Not Accessible

text:
# Question
Title: Dropdowns Not Accessible
Dropdowns are not accessible when clicked. Only when you close the window does the dropdown become accessible. After the window closes data does not save. Also getting duplicate action buttons on popup windows. I believe it is all related. Running Wordpress 4.7.3 and Civi 4.7.16. Same results on different computers and browsers.

# Answer
That's it @Carl Miller. I went through each plugin individually.

The Slider Revolution Plugin was doing it.
> 3 votes

---
Tags: wordpress, option
---


# Question
Title: How to target a specific event registration form in an extension
I'm trying to use a custom extension rather than using a template override (template\_name.extra.tpl) to implement some jQuery on an event registration form (essentially to hide some form fields unless the right radio button is selected). Jackrabbithanna's useful guide here (http://www.jackrabbithanna.com/articles/easy-jquery-modificaiton-civicrm-forms) has been most helpful in getting me much of the way.

That guidance talks about targeting a specific contribution page by using:

```
    function tctaextend_civicrm_buildForm($formName, &$form) {
if($formName=='CRM_Contribute_Form_Contribution_Main'){
     if($form->_id==2 ){
      CRM_Core_Resources::singleton()->addScriptFile('com.skvare.testextend', 'my_alter_contribform.js');
     }
   }
}

```

In my case I want to target a particular event. The form name is CRM\_Event\_Form\_Registration\_Register, so I thought I could do a straight replacement, e.g.:

```
    function myextension_civicrm_buildForm($formName, &$form) {
if($formName=='CRM_Event_Form_Registration_Register'){
     if($form->_id==1 ){
      CRM_Core_Resources::singleton()->addScriptFile('com.example.myextension', 'my_alter_eventform.js');
     }
   }
}

```

But that generates a php notice:

> Notice: Undefined property: CRM\_Event\_Form\_Registration\_Register::$\_id in myextension\_civicrm\_buildForm()

And also throws a fatal error if I try to create a new contribution page, even though the hook function is aiming to impact only event registration forms.

If I remove the line

```
 if($form->_id==1 ){

```

Then no errors, but my injected jQuery will presumably impact every event registration form rather than just the event I want to target? Where am I going wrong?

# Answer
Digging into the hook reference documentation at https://docs.civicrm.org/dev/en/master/hooks/hook\_civicrm\_buildForm/ I can see that the correct approach is

```
if ($form->_eventId == 1) {

```
> 2 votes

# Answer
As Graham mentioned this is the correct approach:

```
if ($form->_eventId == 1) {

```

It is possible that \_eventId is protected, so you can not access it directly. In that case use

```
$eventId = $form->getVar('_eventId');
if ($eventId == 1) {

```
> 1 votes

---
Tags: extension, hooks
---


# Question
Title: Send rejected participants to wait list?
I would like to configure CiviEvent so that rejected participants are sent to the waiting list - is this possible?

Or is the easiest thing just to rename the *Rejected* status to something that sounds less final?

# Answer
> 1 votes
If you look at the participant statuses (Administer\>CiviEvent\>Participant Statuses) you can customize these any way you want. You can use the wait list by manually changing to that. The key is how they are counted. If you look at the class column you will see the following:

* Positive - paid in full, etc.
* pending - counted but awaiting payment, can from pay later or just moved off wait list.
* waiting on wait list or some other state (not counted)
* negative - rejected or not approved, etc.

You can manage the statuses in what ever way best fits your process. You want to make sure your reporting reflects how you decide to use statuses. Also, make sure you aware of which statuses are being counted against the participant total.

Hope this helps

---
Tags: civievent, email
---


# Question
Title: How to pause, cancel or delete a scheduled CiviMail mailing
I suspect I'm missing something obvious here... but I've just spent 30mins googling without success.

So... if you've scheduled a mailing in Civicrm, how can you pause, delete or cancel it?

On the main search screen for mailings, https://druyoga.com/civicrm/mailing/browse/scheduled?reset=1&scheduled=true, you can search for various mailing statuses, including paused and cancelled.

But I can't see a way to change a mailing's status to cancelled or paused.

Thanks for any ideas.

We're using drupal 7.54 and Civicrm 4.6.24

# Answer
> 4 votes
If you search for mailings (Search\>Find Mailings) and check 'Scheduled' when results com up on the far right there is an option to 'Cancel' under the 'more' menu.

I assume you can pause by searching for 'running' mailings and looking under the 'more' menu but I can't verify as I don't have a running mailing right now.

---
Tags: civimail
---


title: Triggers for Summary Fields disappeared

text:
# Question
Title: Triggers for Summary Fields disappeared
One of the user noticed the Summary Fields weren't being updated. Upon investigation I see that the triggers didn't exist anymore. My guess is an upgrade to 4.6.26 wiped them out. Unfortunately, I don't really know when they disappeared other than we had last payment dates of Jan 31. What's odd is the test environment still has the triggers. TTest was copied from production and upgraded. Than about a week later prod was upgraded.

The configuration page for Summary Fields showed the Contribution Table Triggers: Enabled. Funny since they didn't exist. I can see that the job for summary fields ran every hour without any errors.

Saving the configuration page and kicking off the job recreated them and seems have updated the fields.

The question here is why didn't the job notice the triggers were missing and why did it report there were enabled? Oh and I suppose what could have caused them to be deleted?

# Answer
I had a similar experience when I cleaned out and reverted to a slightly earlier CiviCRM DB because we had made a goof (no need to elaborate on that). When I imported the desired backup, I had neither ANY triggers nor the MySQL routine civicrm\_strip\_non\_numeric. We are running Wordpress 4.7.3 and Civi 4.7.16. I was able to recreate ***both*** the routine and the 27 triggers we use for our install by executing one of the functions for a typical site migration, namely: {$SITE\_URL}/wp-admin/admin.php?page=CiviCRM&q=civicrm/menu/rebuild&reset=1&triggerRebuild=1

If you're running Drupal or Joomla, there's a similar invocation. I didn't quite understand how/why it worked, but glad I stumbled across it ;). Evidently, it not only recreates triggers if missing, but adds in the missing routine. Perhaps someone with a little more experience might weigh in. I was just about to pose a question to that effect when I stumbled on your post via a search for "trigger."
> 2 votes

---
Tags: summaryfields
---


# Question
Title: Getting CiviCRM resources to load on the Joomla frontend
I have created an Event in CiviCRM and it all worsk fine in the Administrator side of Joomla when I test the Online Registration page. I have a price set of various ticket prices and the total adds up to the values as you would expect.

When I go the Registration(Live) page (i.e. the front end of Joomla) there is no Total Price text box, and the none of CiviCRM resources seem to load. The browser console is full of 404 Not Found errors for the CiviCRM scripts. On checking the path on the console the browser is trying to load the scripts from "/components/com\_civicrm/civicrm/" instead of "administrator/components/com\_civicrm/civicrm/".

This is a fresh install on CiviCRM 4.7.17 on Joomla 3.6.5.

What have I missed in the setup to get the CiviCRM resource loading from the Joomla frontend?

# Answer
I found that on Joomla the default value for `CiviCRM Resource URL` (on Administer \> System Settings \> Resource URLs), which is `[civicrm.root]`, doesn't work. For me, using a relative path for `CiviCRM Resource URL` does work:

```
administrator/components/com_civicrm/civicrm/

```

See also the answers to this question and the work being done by Coleman, but that patch didn't work on Joomla when I tried it.

**EDIT:** As of 4.7.17, the default setting of `[civicrm.root]` appears to work properly now.
> 1 votes

# Answer
I don't have enough experience to add this as a comment yet, but wanted to point out that you could also go to ~joomla for Joomla specific help with CiviCRM issues.
> 0 votes

---
Tags: joomla, installation, javascript, css
---


# Question
Title: Why is the entity.action permission sparse?
I've recently been exploring the `$permissions` array that drives API actions and extracted the metadata from the logic to allow displaying as a nice table.

The `CRM_Utils_Hook::alterAPIPermissions($entity, $action, $params, $permissions)` hook further modifies this permission matrix before it gets passed to function check($permissions)

The grid is sparse in some places and references:

What is the over-arching strategic architecture behind this? (to the extent that one exists at least)

Or what should it be?

# Answer
I like the table.

It would be really cool if that information were available inline as part of the "API Explorer" -- eg when you inspect the `Activity.create` API, you'd be able to further review the required permissions.

The permissions in the table you describe are generally *coarse-grained*, *entity-oriented* permissions. Quintessential examples are "edit all contacts" or "delete mailings". These depend only on the entity name and action name.

The other items that you're asking about could be categorized as *fine-grained* authorizations. These depend on the specific data involved. However, they slice-and-dice differently (applying different rules to different data in different use-cases).

* `DynamicFKAuthorization` is applied to `Attachment` API. Every attachment is subordinate to another record (like `Mailing #123` or `Contact #456` or `Activity #789`). Your permission to CRUD an `Attachment` depends on your permission to CRUD the targeted record. The basic idea is *delegation*. For example, the permissions for `Attachment.create(entity_type=mailing,entity_id=123)` are determined by delegating to the authorization logic of `Mailing.create(id=123)`.
* `_civicrm_api3_check_edit_permissions()` is nominally applied to many API entities, but in reality only applies to `Phone`, `Email`, `Address`, `IM`, `OpenID`, and `Website` records. All of these are subordinate to `Contact`. Your permission to CRUD a `Phone` depends on your permission to CRUD the contact record.
* `BAO::addSelectWhereClause` is nominally applied to most API entities. On its own, it doesn't do much, but it can be adapted via subclass or hook. It allows to limit visibility into entities based on their data. For example, a listener might define a rule that "the current user can only query activities of type `Meeting`".

These three examples have some similarities (e.g. they're all *fine-grained*), and they have some arbitrary differences (e.g. procedural style vs OOP style), but they also address qualitatively different scenarios. I don't think their original authors intended/expected them to be compared in this way, so it wouldn't be accurate to describe them with an "over-arching strategic architecture". However, if someone finds an elegant way to make these more-similar, that would be great.

(**Edit**) Returning to your original question -- "Why is the matrix sparse?" The matrix only addresses cases where we expect coarse-grained/entity-oriented access-control to serve the business-needs of typical organizations. In cases where we expect the business needs to be more fine-grained/data-oriented, you need to reference more nuanced logic.
> 1 votes

---
Tags: permissions, coding-standards
---


# Question
Title: Webform Error - Expected one PriceSet but found 25
I am using Webform with CiviCRM to enable a family to renew their memberships. On many of the submissions when I click View Contribution I get the following error:

```
CiviCRM_API3_Exception: "Expected one PriceSet but found 25"

#0 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php(158): civicrm_api3("PriceSet", "getsingle", (Array:2))
#1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(549): CRM_Contribute_Form_ContributionView->preProcess()
#2 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(92): CRM_Core_Form->buildForm()
#3 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contribute_Form_ContributionView), "display")
#4 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_ContributionView), "display")
#5 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("display")
#6 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(214): CRM_Core_Controller->run()
#7 /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php(286): CRM_Contribute_Page_Tab->view()
#8 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(310): CRM_Contribute_Page_Tab->run((Array:4), NULL)
#9 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#11 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(448): CRM_Core_Invoke::invoke((Array:4))
#12 [internal function](): civicrm_invoke("contact", "view", "contribution")
#13 /var/www/html/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:3))
#14 /var/www/html/index.php(21): menu_execute_active_handler()
#15 {main}
Sorry but we are not able to provide this at the moment.
Expected one PriceSet but found 25

```

> Return to home page.

It does not happen on all submissions and I have not been able to diagnose the cause. Has anyone else experienced this issue?

# Answer
Webform doesn't use pricesets. Are you using a normal fully-configured contribution page that has a priceset? If so, try a simple contribution page as described here: https://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration#WebformCiviCRMIntegration-Acceptingpaymentsthroughawebform
> 1 votes

# Answer
I do not know what your set up is but the error is from an API call (entity PriceSet action getsingle) and it means it expects to find only one price set but it gets many. Can you check in your set up of the contribution page if you are using a price set and if it is set up properly?
> 0 votes

---
Tags: webform-civicrm
---


# Question
Title: How can i add organization Legal name to search?
I am looking for a way to add Legal name to search. I can see on this page that it is possible to add Nickname to search, which i have done.

Civi webform adds great functionality to add relationship to individual contacts. I allow users to lookup their current employer when completing a webform online and with possibility to add new employer.

I'm looking for a way to reduce the amount of duplicate employers added by users because some new organizations added are already in the database but entered different or only with an acronym.

I have turned off wildcard search, and also enabled Nickname field search.

The problem here is that, i have organizations in different languages, so Organization name field is for English name, Nickname is for another language or for acronym. I want to be able to also use the Legal name and add it to search. For example: Organization name: **World Bank**, Nikcname: **WB**, Legal name: **The World bank**. This way user will be able to find the same organization by keying it in 3 different ways thus reducing the number of duplicates in the system. With only the organization name and Nickname, another user will add 'The World Bank' as new organization.

# Answer
> 1 votes
How are you letting the users lookup their employer? Is that an autocomplete existing user on the webform?

If so, you can customise what information is displayed in the autocomplete, but that does not currently include legal name. I'd guess that is a trivial enhancement.

If you want the option of the autocomplete searching on legal name, that might be a bit more effort. For both, you could raise an issue at https://www.drupal.org/project/issues/webform\_civicrm

To add an option for legal name search in the normal search would need a core change following the same pattern as nickname.

A different approach would be to provide a separate lookup facility on legal name using a view but that is not as integrated.

---
Tags: webform-civicrm, search
---


# Question
Title: ARCHIVE not enabled by default on MariaDB 10.1
The ARCHIVE storage engine is enabled by default on MariaDB 10.0, but no longer from 10.1.

Therefore, you get a *DB unknown error* when CiviCRM tries to create a logging db table when logging is active (admin=\>system=\>misc), for instance when creating a new custom field.

From MariaDB 10.1, the plugin needs to be specifically enabled, for example:

```
INSTALL SONAME 'ha_archive';

```

More on https://mariadb.com/kb/en/mariadb/archive/

# Answer
> 2 votes
My strong advice to you would be to change the tables to be anything but ARCHIVE. Even InnoDB would be fine and preferred over ARHCIVE. We've had a number of sites have their entire audit schema's become corrupt and its been down to the storage engine being ARCHIVE.

Also you'll probably want to add indexes into the audit schema otherwise you cant access the change log without waiting for minutes.

I think later versions of CiviCRM do not use ARCHIVE storage format by default

---
Tags: custom-fields, logging, mysql-archive-format
---


title: Does CiviMail support PGP encryption ?

text:
# Question
Title: Does CiviMail support PGP encryption ?
There are many stories of leaked e-mails making news, and we know that repressive governments read emails to suppress dissent.

It would probably be possible to have CiviMail check a public PGP server for each outgoing email address, and if it found a public key, use it to encrypt the outgoing message by default. Perhaps there could be also be a user-requested preference to NOT encrypt as an exception.

Is this on the wish list ?

# Answer
Not yet!

This could potentially be done from an extension in a hook like `hook_civicrm_alterMailParams()`, alongside a scheduled task to fetch GPG keys from keyservers (to avoid slowing down delivery with HKP lookups).

Another approach might be to handle this at MTA level with something like Zeyple (a PGP filter for Postfix).
> 1 votes

---
Tags: civimail
---


title: accessing merge screen through URL

text:
# Question
Title: accessing merge screen through URL
I need an advice on a small problem. My database contains many duplicate Contact records, of which I have determined the contact id. I have a log list with pairs of contact id.s

What I would like is merge the records using those contact id pairs. It is not easy to find the pair using the contact ids. I have not found a way yet to use the advance search so that I have a result screen containing the two records base on the ID.

Is it possible to create a URL for each pair that directly leads me to either a search result screen in which I can select and merge them, OR go directly to the merge screen for the two records?

If not, is there a way in which I can provide the people who do the merging with an easy method to process the list with id pairs?

thanks in advance, Ruud

# Answer
Another way of accessing Merge is from any Search function (based on Contacts eg Find, Adv Search, Quick Search). Eg click in QuickSearch, hit Enter (gives you all Contacts), select any 2 Individuals, in Actions chose Merge, this gives you a url like this (but without the cool arrows Chris had)

```
civicrm/contact/merge?reset=1&cid=2&oid=3

```

As a further answer, if you have the paired IDs in an external spreadsheet, then use the CONCATENATE function to join together all the bits as a hyperlink, then you should be able to just click through to the merge url for each pair.
> 3 votes

# Answer
By testing Find & Merge contacts at the https://civicrm.org/demo site, I was able to see that the URL will look like

```
                                   ⬇
civicrm/contact/merge?reset=1&cid=123&oid=456&action=update&rgid=3&limit=
                                           ⬆

```

Where `cid` is the retained contact ID, and `oid` is the old (merged and removed) contact ID. You should probably test this on your own site, since I suspect `rgid` may also be significant (probably a group id).

If you ever want a sandbox to test things out harmlessly, head over to https://civicrm.org/demo \- note there are two sections on that page, first some partner-provided, customised CiviCRM installs and below that (blue section) is a set of more stock demo sites you can use as well.
> 2 votes

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


# Question
Title: Petition Email Error When Creating New Petition
I just installed the "Petition Email" extension (2.0) for CiviCRM (4.7.10) under Drupal (7.50). When going to Campaign \> New Petition, I get the error

```
Sorry but we are not able to provide this at the moment. 'civicrm_survey' is not a valid option for field entity_table

```

# Answer
> 1 votes
This is a known issue - see CRM-19286. To fix, upgrade to CiviCRM 4.7.12 or higher.

# Answer
> 0 votes
If you can't get it to work as you need you could consider just using webform\_civicrm module which gives great functionality for Petitions and much more.

# Answer
> -1 votes
Luckily that's a helpful error message. The code causing the error is on line 182 in petitionemail.php, and the error can be eliminated by commenting out that line.

However, being new to this extension, I don't know if that's affecting functionality. Everything seems to work.

---
Tags: extension
---


title: Mobile responsive email template

text:
# Question
Title: Mobile responsive email template
Has anyone created a mobile responsive email newsletter template to work with Civimail? If so, can you please share the link to an example of the email newsletter which uses the template? If you have suggestions for how to create it easily, please share some tips. Thank you!

# Answer
> 5 votes
We worked on our main email template this last summer, using the 'Sample Responsive Design Newsletter - Single Column Template' from within Civi as a springboard. We also created an account with MailChimp to see how MailChimp put their templates together.

As old as they are, HTML Tables are still the way to go because of how differently email clients handle display. We used `<style>` tags as needed and used media queries within those `<style>` tags. We ended up using a good bit of the CSS from our website to maintain our look; we just had to adapt our website's CSS to work with tables.

Here is an example mailing we did from last summer: https://glenwoodcc.org/civicrm/mailing/view?reset=1&id=77 We usually email short snippets and point back to our website, so we typically only have one main header image, one heading and then the content. Our two column footer was a challenge to sort out responsively with tables, but we got there. We also have a template that repeats the simple template so we could have multiple sections (image/heading/content) to the email.

# Answer
> 4 votes
There is a new option on the horizon using Mosaico thanks to this extension

# Answer
> 3 votes
I have not had much opportunity to test this method but I think broadly speaking it is a good approach to create templates responsive, more or less quickly. Then:

1. First you have to create a responsive template using a tool for generating templates like the MailChimp generation tool for example.
2. Second you can adapt the template to your needs and remove unnecessary code that generation tool introduced on the template.
3. Finally to take advantage of css header styles that include these types of templates, exist this fantastic extension https://civicrm.org/extensions/css-inline.

# Answer
> 2 votes
We started with the Zurb responsive email templates, created headers and footers from those along with templates for the "body" of our emails. This allows us to pick the correct header for the type of email (donation appeal, eNews, action alert, etc.) then a general "layout" for the body (1-column, 2-column, hero image or not, etc.) for quite a bit of flexibility. Eventually I'll create "mini-templates" for the body, so we can stack templates on top of each other to build larger emails. The CSS for each style is contained in the header file and then inlined using the css-inline extension.

http://zurb.com/playground/responsive-email-templates

https://civicrm.org/extensions/css-inline

# Answer
> 1 votes
We actually just launched a web app in free open beta to help convert mail templates from tools like mailchimp that offer great template creation interfaces to places like Civi. The site converts over all the merge tags, adds the required anti-spam tag requirements based on the service, makes a plain-text version for the 1% of people who want that, and finally does the CSS inlining for you. Go give it a shot and give some feedback if you could mailtemplateconverter.com! It also lets you use purchasable templates built for other services from sites like themeforest and actually have them be usable in Civi.

---
Tags: civimail
---


# Question
Title: Is a contribution always a donation or could it be a receipt from other(s) to one Member or contact?
Is a contribution always a donation or an amount **from** any Membership or could it be a receipt from other(s) **to** one Member(ship) or contact?

# Answer
> 1 votes
Hard to be sure I quite get the question but you can apply a Soft Credit to imply that a payment came in from one contact but should be recorded for another.

Also, you can have one Contact purchase a membership "on behalf of" an organisation.

Best that you clarify what you are trying to do by editing your question of neither of my points are helpful.

---
Tags: civicontribute
---


# Question
Title: How does one get rid of the CSS errors regarding dashicons.eot
Or is this a Microsoft Edge only problem?

# Answer
> 1 votes
The page you loaded seems to be about widgets and not related to civicrm

---
Tags: wordpress, 4.7, css
---


title: CiviCRM on mobile phone

text:
# Question
Title: CiviCRM on mobile phone
Is there any app for mobile phones that works with recent version of CiviCRM? We use CiviCRM ver. 4.7.16. and there is one app CiviSync Mobile on Google Play shop, but it doesn't work.

# Answer
> 1 votes
To use your CiviCRM on small screens a responsive theme is all that's needed.

This is an extension that will make the admin menu responsive: https://civicrm.org/extensions/slicknav-web-responsive-admin-menu

# Answer
> 0 votes
I'd recommend not trying to go down the route of making all CiviCRM responsive on all devices. How often do you import spreadsheets on your smartwatch?

Instead, I recommend responsive views/themes for specific areas of the CRM.

# Answer
> 0 votes
A google summer of code did make one app that interfaces with other phone features. I'm not sure why it's not on the google play, but https://github.com/Jagatheesan/CiviDroid---Alpha https://github.com/MounaAnnavarapu/Cividroid-2.0-Dashlets

---
Tags: mobile
---


# Question
Title: Adding Referenced civicrm_entity contact in node with email, address and phone doesnt work
i still building a drupal site with civicrm and civicrm\_entity support and get stucked by adding form fields for adding synced contacts.

a single contact is possible, but i need an email, phone and address field in addition. for that i used the civicrm entity reference field in the contact entity to add these references.

but it seems that civicrm\_entity cant support the submission of the fields to the civicrm database, because in the time where i send the form, the civicrm id doesnt exist. for that other ref fields cant have the needed civicrmID.

did i miss something, or is this the wrong way to realise a contact submission with reference entitys from a drupal node to civi?

# Answer
> 1 votes
So I've done some development to enable CiviCRM Entity Reference (CER) fields that target CiviCRM Contacts, either via the Drupal contact edit form "/civicrm-contact/add" or via an entityreference field targeting contacts (which form has CER fields attached), that can be on nodes or other entity types, using the Inline Entity Form Single widget.

Its available now on the -dev version of CiviCRM Entity, and will be in the next beta.

Support for the Inline Entity Form Multi widget is not yet included, it will take another small leap to get it working there, although the foundation is now laid.

The functionality for inline entity forms on either reference field type has worked and continues to work for node/entity edits.

---
Tags: drupal, civicrm-entity, entity-reference
---


# Question
Title: Access CiviCRM fields from Drupal entity
I use CiviCRM 4.6.14 with Drupal 7.43. I have defined a Drupal content type with a field that contains a CiviCRM contact using the `civicrm_entity` module.

When I render this content type, I want to access a few fields from the contact - namely, its name, website, and a Google map link (derived from its address or geocode or whatever's best). In PHP, how can I access these fields from the `$content` object? If I `var_dump($content)` I can see the name & geocode, but not a full address (should I piece that together from component fields? seems error prone) and no website field at all.

If I do this by trial and error using `var_dump`, I'm going to end up with code like

```
print($content['field_venue']['#items'][0]['entity']->display_name);

```

which doesn't seem healthy.

# Answer
The website is a separate entity from the contact; so is the address data, though some of it is made available (for the primary address only) on the Contact entity.

I know the Address entity is available; I don't think the Website entity is, but that's out of an abundance of caution; it's basically identical to the Phone entity, so you should just be able to edit civicrm\_entity.module to patch it in. If you use it and it works, don't forget to submit a patch upstream!
> 2 votes

# Answer
So you can configure your Entityreference field to display the rendered entity, and you can choose a view mode. You can configure multiple view modes for CiviCRM Contact entity, and selectively choose which fields to include. I highly recommend enabling Display Suite, and enabling a Display Suite layout for your view mode, as you will get field formatters for CiviCRM properties.

To access subsidiary entities from the contact display, you can add CiviCRM Entity Reference (CER) fields to the Contact entity...this field type is provided by a submodule of the CiviCRM Entity project, and called CiviCRM Entity Reference Field.

You can target addresses, emails, websites, phones etc...by created a CER field for each entity. The CER acts as a "remote reference field". By this I mean that it accesses the subsidary data in the civicrm database directly, and does not store a target\_id value in Drupal field tables....

To display say a contact's addresses, on the contact view page (or the rendered contact via an entityreference field on a node view page), you set the CER to display the rendered entity, and like the normal entityreference field type, you can choose a view mode...you can create multiple view modes for the Address entity, configure which fields display, and thus achieve your goal, solely with site building, no code required.

The Website entity is now supported as well in latest -dev (3-26-2017) of CiviCRM Entity, and the process is the same as described for displaying addresses.
> 2 votes

# Answer
Using a slightly different approach we have done this many times, if i understand, by building a Drupal View (CiviCRM Contacts based) to pull in the information using Contextual Filters to ensure the relevant data shows on the node. You can see examples if this here.

Pretty much all the data other than the body and map are Civi data that either relate to the contact that was connected to the node via 'CiviCRM reference field'
> 1 votes

# Answer
Perhaps you need is CiviFirst's awesome Drupal CiviCRM Session Tokens module, which gives you access to Civi data about the logged in user. That can then be accessed either via the \_SESSIONS variable, or through the tokens in blocks or field filters - both of which this module translates for you - , or anywhere else that you can use tokens. I haven't yet included the contact's web address, but it could be easily expanded to cover that.
> 0 votes

---
Tags: drupal, civicrm-entity, fields
---


# Question
Title: How do I fix this in CiviCRM System Status - sites/default/civicrm/extensions is not writable Please change your file permissions?
I'm getting a warning message in CiviCRM System Status while setting up 4.7 - "sites/default/civicrm/extensions is not writable. Please change your file permissions." What should I do?

# Answer
if you want to be able to download and install extensions automatically, you need to either change the owner of your folder sites/default/civicrm/extensions to www-data and/or change its access rights so www-data can write into it
> 1 votes

---
Tags: installation, permissions, 4.7
---


# Question
Title: Recurring contribution cancelled in CiviCRM but still active in PayPal
I cancelled a monthly recurring contribution in the back end, and the status now shows "cancelled" but in PayPal (more than 24 hours later) it's still Active. My understanding was the cancellation should have propagated to PayPal, yes?

CiviCRM 4.6.18 Joomla 3.5.1

# Answer
I could be wrong, but I don't recall reading that CiviCRM tells Paypal to cancel the recurring charge. I think you have to do that in Paypal.
> 2 votes

# Answer
Although the code has a cancel payment function which calls the PayPal service, there's also a comment saying

```
// since subscription methods like cancelSubscription or updateBilling is not yet implemented / supported by standard or express.

```

https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment/PayPalImpl.php#L637

Please can you provide more info on your PayPal installation?
> 1 votes

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


title: Group visibility

text:
# Question
Title: Group visibility
I've defined a number of groups under an "Administrator" account. I expect these groups to be visible for all users under the "Manage Groups" section but they currently can't see any previously defined groups.

The users in question have the "CiviCRM: edit groups" permission and the "CiviCRM: administer reserved groups".

The visibility for each group is set to "User and User Admin only" and the groups are not marked as "Reserved".

Is there anything else that would affect a users ability to view the defined groups under "Manage Groups"?

Thanks,

---

Some additional context based on Fabian's suggestions:

Our system has two kinds of contacts:

* Normal
* Protected

We have two kinds of users:

* Power user
* Normal user

Some power users need access to protected contacts as do some normal users.

Users are either "normal users" or "power users" (roles within the CMS). Power users and normal users do not have access to "view all contacts" or "edit all contacts".

We also have a group (within Civi) called *Protected User Admin*. Some users are assigned to this group as well.

From an ACL point of view, I've created two smart groups:

* Protected contacts
* Not protected contacts (all contacts not in the above group)

Within the ACL settings:

* *Everyone* is assigned access to the not protected smart group
* Users within the *Protected User Admin* group have access to protected users

Everything is working as expected - except neither power users nor normal users have access to previously created groups.

Am I doing something wrong?

# Answer
As per Allowing group management to users with limited permissions, it doesn't look like it's possible to give users access to their own groups if using ACLs.

It's possible to add a DB trigger such that a new ACL is created whenever a new group is created, but there are some major drawbacks of this approach (i.e. if a user adds a group with a restricted contact in then all users will have access to that contact).

Hopefully resolved in a future version of Civi.
> 0 votes

# Answer
You have probably considered this already but the users obiously need the "Access CiviCRM" permission, as well as the permission to view contacts.

Maybe you could add some more information to your questions as well such as:

* does admin see the groups which version of CiviCRM?
* which CMS are you using?
> 0 votes

---
Tags: groups, permissions, smartgroups, acl
---


# Question
Title: Using the answer in custom field (select) to auto fill other field
how would I get a custom field to automatically select from a list based on the answer given in a custom field where the answer has to be selected.

Basically the user selects the Scottish local authority field from a select list (Say, Edinburgh City Council). I want a field of MSP Regions - in this case Lothian Region - to auto fill based on the local authority.

Thanks.

# Answer
Depends on the context:

On a public or profile, develop a custom JS file to do this.

On editing a CiviCRM contact through the interface there's probably no good way to do this, other than adding custom JS in an extension.

If you're using Drupal Webform you can use the Validation Rules to show and hide fields. With some creative optioning you can get the results you need entirely through an interface.

My recommendation is the Drupal Webform.
> 2 votes

# Answer
Have a look at the CiviCRM Region Lookup module You may need to tweak the code a bit for your needs.
> 1 votes

---
Tags: custom-fields
---


title: CiviSurvey - User/Config Question

text:
# Question
Title: CiviSurvey - User/Config Question
How best to survey all participants that attended a specific event?

I have successfully created some custom data fields, added them to a profile of type survey, and within Campaigns created a survey.

I am struggling with attaching survey respondents. What I really would like to be able to do is an advanced contacts search (all contacts that attended a particular event) and then under the Activity menu have an option to 'Conduct Survey' and then select a particular survey.

OR

When I create a survey and get to the 'Reserve Respondents' section, have an additional field called 'Events', and when I select 1 (or more?) events, have the Respondents section populated with the event attendees.

Any thoughts or suggestion much appreciated.

# Answer
> 1 votes
A Drupal solution we implemented recently was to put the survey/rating fields on the participant record, then set up a Scheduled Reminder to send a checksum link to a Webform that holds the fields.

However, I don't think putting the fields on Participant is probably the best solution for capturing data on people who attend but who were registered via a 'buy 5 tickets' type Price Field as we don't actually have the participant record in those cases.

# Answer
> 0 votes
Use a group of Event Attendees in the meantime, and request the first option at issues.civicrm.org - including the exact URL link you'd like an action to. If you do add an issue then include a comment for me john@civifirst dotcom and I can take a look at it on the upcoming sprint.

---
Tags: civisurvey
---


# Question
Title: How would you anonymise (or redact) private data for developer stage?
Private information is confidential. However for developers to debug errors they need a copy of your data that's close enough to production to effectively debug. How can we redact, strip or remove confidential data from CiviCRM?

Two options come to mind. I could spend time creating anonymous test data that covers all the possible variants of our complex hierarchical contact relationship structure. The other option would be to go through a copy of production and anonymise it by overwriting private data with random strings. But we are talking here about some 9000 contacts. Working with API calls to anonymise could take hours, not really an option for a fast workflow.

Anyone with experience or ideas could share his thoughts on this subject?

# Answer
## Some thoughts

Anonymizing data is hard work.

Eg: Would it be OK if your developer could de-anonymize your contacts by identifying from geolocated data? What about identifying by "metadata", if suburb data is left in? Does your developer need a DB with activities from inbound email left in? Has the situation improved in the decade since `WIRED` Why 'Anonymous' data sometimes isn't, or gotten worse? (It got worse!)

As you anticipated, generating real-looking fake data is much slower than garbage data, and that's one tradeoff. The other is that a CRM has data in places you might not think to look, so you are safer treating the data as "mostly anonymized" even when you're done. (See that Wired article!)

One approach, which may also speed up your testing, is to remove data unless you know it's needed (and only anonymize what you didn't already remove).

* Not testing mailing reports? *Truncate those huge mailing tables.*
* Not testing custom data? *Great, that stuff is hard to anonymize! Drop it!*
* Not testing performance? *Cull your test DB down to 500 contacts before anonymizing.*

What you choose depends on how you need to use it, and what's OK for your testing. As you say, for debugging developers need a "near exact" copy of the live data ... but the more a test data set matches your site's profile, the less anonymous it will be.

## Some starting points

* **anonymize extension** (anonymize) aims to anonymize a DB. Offers two strategies: Faker (slow, generates real-looking names like "King, Lesley") and SQL (fast, generates names like "Tdfv, Fnedftd"). With recent updates, this is probably your best bet - but you'll be an early user, so please direct feedback to the issue queue in CiviCRM's Gitlab!
* **gibberish extension** (gibberish) creates SQL to replace the contents of your database with gibberish
* **Michael McAndrew's POP library** is the most featureful IMO, its goal seems to be to populate a site with fake data rather than anonymize an existing DB. See the blog post Populate your CiviCRM site with fake data. A similar example using nodejs is civi-charlatan.
* **anonymiser** (systopia/de.systopia.anonymiser) is another CiviCRM anonymiser extension under recent development as of June 2018. I haven't checked this out (and Sean and I didn't find it when we started work on anonymizer).
* **redaction\_tool** (johnff/redaction\_tool) is another tool to redact contact data (WIP)
* **civicrm-fake-data** (on github) is a ruby script to replace existing data with fake data.
* **civicrmanonymisation** is an SQL approach to anonymising a DB.
* **encryptDB.php** *was* in CiviCRM core, but it was a poor starting point; MD5 is not encryption, so what changes it does make are reversible. It also targeted a limited number of fields, so your DB would still contain identifying data even if not deanonymised ...
* **civicrm\_obfuscate\_db.php** (based on `encryptDB.php` above) is another script I wrote several years back. It generates a set of SQL commands to obfuscate your DB. It's SQL-based so relatively fast, generates incomprehensible names ("bggerns srrssbb"), and like all the above options is not a complete solution.
* Another option would be to construct a test environment with test only data that simulates all situations you need to test, and keep expanding it as you identify new bugs. Let's be realistic, few CiviCRM sites have budget for that

To recap: none of the above are complete working solutions for what you want, and the solution you need depends on your context. But please do contribute your experiences to the community - most of the above have a Github issue queue you could submit improvements / feedback to!

One particular sticking point for several of the above seems to be CiviCRM's "Database Logging" tables, which by default use a format which complicates sanitisation. If you're testing or using any of the above, you should definitely review whether those tables are being de-identified completely in the process.
> 23 votes

---
Tags: drupal, developer
---


title: How to Migrate Memberships

text:
# Question
Title: How to Migrate Memberships
Our organization currently has several membership levels and has since 2014. We are moving to a single membership level and sustaining contributions instead. Is there a way, short of an Update SQL Script to move anybody with Membership A to Membership B?

# Answer
A 'way' would be to export all Membership data together with Internal ID, then manipulate the data as you want, and then delete all existing member data and then doing an Import. It may feel 'safer' than in mysql since you will be able to make whatever tweaks might be required for those 'odd case' members.
> 1 votes

---
Tags: wordpress, civimember
---


# Question
Title: How can I use the API to set a field to NULL on an existing record?
Let's say I have a contact which exists and has `id = 12345`. I can use the API like this...

```
CRM.api3('Contact', 'create', {"id": 12345, "nick_name": "Bob"});

```

to change the contact's nick name. Cool.

---

But when I try this...

```
CRM.api3('Contact', 'create', {"id": 12345, "nick_name": null});

```

the call completes with success but does *not* set the `nick_name` field to `NULL` as I'd expect. Why? Is there some other way I can do it?

# Answer
> 3 votes
It doesn't quite feel right to me on the empty vs null front - playing around with the API explorer in 4.7.15, but what I can say is if I do an api call for a contact ID (say, 3) with nickname IS NULL as follows:

```
CRM.api3('Contact', 'get', {
  "sequential": 1,
  "id": 3,
  "nick_name": {"IS NULL":1}
})

```

I come up with the result for cid 3 including `"nick_name": "",` (which would say to me that it's *empty* instead of IS NULL... but comes up with the previous api call anyways.

Then I run the following test by adding a nickname:

```
CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": "nickname"
})

```

and run the same GET query as above, and get no results as follows:

```
{
    "is_error": 0,
    "version": 3,
    "count": 0,
    "values": []
}

```

If I then run:

```
CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": ""
})

```

and run the first GET query... I come up with the same result as the beginning again... which appears to be a contact with nickname empty ("") rather than null.

**TLDR;** It looks like you can use

```
CRM.api3('Contact', 'create', {
  "sequential": 1,
  "contact_type": "Individual",
  "id": 3,
  "nick_name": ""
})

```

even though it doesn't feel quite right... if you're trying to pull that contact up with "nickname IS NULL" searches using the api.

---
Tags: api
---


# Question
Title: A way to continue a mailing that was cancelled?
Currently when a mailing is scheduled if we see a change that is needed, we have to cancel the mailing, then reuse it, fix the mistake, and send it again. Then we have to delete the original if we want to get it out of the interface.

Is there a way to simply "Continue" the cancelled mailing to save a few steps and avoid creating a duplicate and cluttering the interface?

# Answer
> 1 votes
This is not pretty, but you can use the API from your browser to un-schedule the mailing.

1. Find the ID of your mailing

1. Go to **Mailings \> Scheduled and Sent Mailings**
    2. Find your scheduled or canceled mailing within the list
    3. Determine the ID of the mailing by hovering over **Report** and looking for the number after `mid=` in the URL
2. Open a javascript console in your web browser

1. Begin with your web browser on any CiviCRM page.
    2. In Firefox go to menu \> "Developer" \> "Web Console". In Chrome, go to menu \> "More tools" \> "Developer Tools" \> "Console".
    3. If you can type `2+2`, press `Enter`, and see `4`, you're all set.
3. Execute some API commands to un-schedule the mailing

1. Copy-paste the following code into the console (but don't press `Enter` yet)

    ```
    var mailingID = 0;
    CRM.api3('MailingJob', 'get', {'mailing_id': mailingID}).done(
      function(response) {
        CRM.api3('MailingJob', 'delete', {'id': response.id});
      }
    );
    CRM.api3('Mailing', 'create',
      {'id': mailingID, 'scheduled_id': '', 'scheduled_date': ''});

    ```
    2. Update the number 0 after `mailingID` to your own ID value determined above.
    3. Press `Enter` to execute the commands.
4. See the results

1. Go to **Mailings \> Draft and Unscheduled Mailings** and find your mailing here, waiting for you to **Continue**

---
Tags: civimail
---


# Question
Title: How can I change a CiviEvent status using Webform Conditionals?
I am currently using Drupal 7.52, CiviCRM 4.6.24, and Webform 7.x-4.14

I have a CiviEvent where I want to register multiple registrations and a matrix of different combinations of payment levels and options. I am currently configuring a Webform where I have configured (at least in a draft form) for the CiviEvent participant fee to be passed to Stripe and the registration.

I also have the *participant\_status\_id* field exposed to the Webform; within CiviCRM processing I have the Event Registration \> Registration Status set to * User Select * - I noted that if it was set to anything else then it would not be exposed in the Webform.

What I want to do is set the *Registration Status* using conditionals. So if the registration is paying using Stripe in full then set to Registered, or if paying by Cheque set to Pending from Pay Later.

The Webform Component allows me to select which CiviEvent status I want exposed to the form (I opted for Registered, Pending from Pay Later, Partial Payment), but I then can't set that using Conditionals. I also notice that when I can not set a Select Option webform component using Conditionals as well; maybe it is not possible?

I suspect my alternative would be a simple textfield, but I am looking for a better way.

# Answer
What you are attempting to do should already be handled by the module automatically. Simply omit the status field from the form (leave it set to "Automatic" on the CiviCRM tab of your webform) and the status will be set based on the payment status to either "Registered" or "Pending from pay later" or "Pending from incomplete transaction".

You can see where this is handled by webform-civicrm here in the code.
> 1 votes

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


# Question
Title: What is the join logic when using API chaining with action = get?
I read about API chaining and I'm using it with `get` actions to learn more about how it works. I'm confused by the inconsistent behavior of the following two API calls:

---

```
CRM.api3('participant', 'get',
  {"id": 12345, "api.Event.get": {} });

```

That gets a participant record and embeds the single associated event record within the results. Cool.

---

But this one works differently:

```
CRM.api3('participant', 'get',
  {"id": 12345, "api.ParticipantStatusType.get": {} });

```

It gets the same participant record, but embeds *all* status type records within the results. Why?

---

In general, I'd like to understand what logic CiviCRM is using to filter the results of chained calls.

# Answer
> 16 votes
Chaining will attempt to "guess" at the id of the chained entity. In your first example, the fetched participant record has an "event\_id" and the api chaining controller passes that into the chained Event api call as the id.

The guessing is pretty basic though. For everything else, you should specify params explicitly. You do so by using the magic "$value" notation. E.g.

```
CRM.api3('participant', 'get', {
  id: 12345,
  "api.ParticipantStatusType.get": {id: '$value.status_id'}
});

```

Note that you can also use joins for this type of thing, which is generally more efficient than chaining. Check out joins in the Api explorer.

---
Tags: api, chaining
---


# Question
Title: How to update multiple records with API?
For doing updates to multiple contacts using the API, is there a better way than this?

```
$res = civicrm_api3('Contact', 'get', $params);
foreach ($res['values'] as $contact) {
  civicrm_api3('Contact', 'create', array('id' => $contact['id'], ... ))
}

```

For a large number of contacts, this is slow and eventually runs out of memory.

# Answer
> 2 votes
You can use chaining:

```
civicrm_api3('Contact', 'get', array(
  'return' => 'id', // more efficient since you don't care about the get results
  ... other search params ...
  'api.Contact.create' => array('last_name' => 'Something'),
));

```

The 'id' will be set for you automatically by the chaining. For more about chaining see this post.

Also remember the 'gotcha' that unless you specify otherwise, this will only fetch & update 25 records.

---
Tags: api
---


# Question
Title: Installing CiviCRM on Local: Getting Uncaught Exception Thrown
I am beginning to build a new version of our existing Drupal 7 site locally, which has CiviCRM 4.7.15 installed. I installed a fresh copy of the same version of CiviCRM into a fresh SoopterTheme Drupal 7 demo and the installation was successful, however, when I went to review permission settings or click on configuration check list, I get the following error, site-wide. Drupal and CiviCRM both have their own usernames and databases:

> Additional uncaught exception thrown while handling exception.

I have run through this process multiple times and get the same error. I also received this same error when trying to set up a local copy of the existing site.

If I run any drush commands, I get:

```
Drush command terminated abnormally due to an unrecoverable error.                                                                                [error]
<p>Initialization Error</p><p><pre>Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => simpleHandler
        )

    [code] => -24
    [message] => DB Error: connect failed
    [mode] => 16
    [debug_info] =>  [nativecode=No such file or directory]
    [type] => DB_Error
    [user_info] =>  [nativecode=No such file or directory]
    [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=No such file or directory]"]
)
</pre></p><p></p><p>Initialization Error</p><p><pre>Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => simpleHandler
        )

    [code] => -24
    [message] => DB Error: connect failed
    [mode] => 16
    [debug_info] =>  [nativecode=No such file or directory]
    [type] => DB_Error
    [user_info] =>  [nativecode=No such file or directory]
    [to_string] => [db_error: message="DB Error: connect failed" code=-24 mode=callback callback=CRM_Core_Error::simpleHandler prefix="" info=" [nativecode=No such file or directory]"]
)
</pre></p><p></p>

```

Any guidance is appreciated.

**Edit:** I reinstalled using the same database user for Drupal and CiviCRM and it seemed to have worked initially but I am getting the same error again the next time I went to access the site locally.

# Answer
If installed locally, your `max_allowed_packet` in your .ini file or my.cnf file could be too low. Since it's local, I would set it high and forget it. Something like 100M or 500M should do the trick. See https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away or drupal.org/node/1014172
> 1 votes

---
Tags: drupal
---


# Question
Title: Upgrade Paystation processor to 4.7 compatible
After fixing some notices/warnings, I was quite able to configure and enable this processor on the contribution page.

When using this on a live page, I see an error after like

```
PHP Fatal error:  CRM_Contribute_Form_Contribution_Confirm::preProcess():
The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition "nz_co_fuzion_paystation"
of the object you are trying to operate on was loaded _before_ unserialize()
gets called or provide a __autoload() function to load the class definition
in /Users/jitendra/src/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
on line 323

```

I think as it doesn't actually follows the hierarchy CRM/Core/Payment/... this error is thrown.

Any thoughts?

Note: `$this->paymentProcessor['object']` has a class named `__PHP_Incomplete_Class` though it contains the paystation object.

I cloned it from https://github.com/eileenmcnaughton/nz.co.fuzion.paystation

# Answer
> 1 votes
Okay, I've just done a civix install using the developer guide and managed to get it done using the latest code formats. Things I did was:

* Migrated the files to CRM/Core/Payment/...
* Created a mgd file which automatically inserts the payment processor into the db.
* Fix errors/warnings encountered during testing.

Sample upgrade `commit - Link`

---
Tags: civicontribute, extension, payment-processor
---


# Question
Title: Why is my search for a specific contact subtype giving no results?
I'm working on a site that uses several contact subtypes for the Organisation contact type. Following a recent upgrade, everything seems to be working fine, but a basic or advanced search for contacts of this particular subtype gives zero results. Searches for other contact subtypes are working fine. Looking at the database I can see that there are in excess of 1300 contact records with this contact subtype, and they aren't in the trash.

Any thoughts on what the issue might be, how to fix it, or how to work around it (I was thinking about the possibility of creating a new contact subtype and applying this to all of the records - assuming of course that I can find them!).

# Answer
I remember there was a patch for a contact type search...let me dig....that was with CiviCRM 4.6 and the issue was https://issues.civicrm.org/jira/browse/CRM-18063. The patch worked for me, but I am not sure if you have the same problem?
> 2 votes

---
Tags: contacts, sub-types
---


title: Extension Download Errors

text:
# Question
Title: Extension Download Errors
I'm looking for help troubleshooting "Extensions Download" errors. Like Error: Can't Access CiviCRM Extensions, I've recently been getting lots of "Unable to download extension from ..." lightbox errors. My host confirmed there aren't any SSL protocol errors logged on our end, and suggested the issues are probably with civicrm.org's certificate(s) and/or the encoding of the xml files.

The System Status page reads:

> Extension Download Error: The CiviCRM public extensions directory at https://civicrm.org/extdir/ver=4.7.14|cms=Drupal could not be contacted - please check your webserver can make external HTTP requests or contact CiviCRM team on CiviCRM forum.

I'm running CiviCRM 4.7.14 with Drupal 7.52, and can usually troubleshoot issues, but I'm new to CiviCRM and can't think of anything I can do about this. Any suggestions?

# Answer
> 2 votes
In order to suppress this error, please add the following lines at the end of your civicrm.settings.php file and clear the cache.

```
global $civicrm_setting;
$civicrm_setting['Extension Preferences']['ext_repo_url'] = false;

```

Please check civicrm extension documentation on the below link:

https://wiki.civicrm.org/confluence/display/CRMDOC/Extensions#Extensions-Disableautomaticinstallationsofextension

# Answer
> 3 votes
two reasons I can think of: \- civicrm website was overloaded or down for a short maintenance operation \- your server or network connection prevents your site to connect to civicrm

if it's the former, wait a bit an retry, everything should be back to normal

to test if it's the later, try to connect to the site from the command line (if you have ssh access to your server) and run curl https://civicrm.org. if you have an error message, it should point you to the right direction

(we did change something about the TLS/SSL protocol accepted but don't recall if it was the main site or not). In any case, it would probably mean you have very old software on your server and you should upgrade your OS

# Answer
> 1 votes
Go into Administer \> System Settings \> Resource URLs or `<site_root>civicrm/admin/setting/url?reset=1` and change "Verify SSL Certs" to "No". When you are done adding extensions you can turn it back to "yes".

---
Tags: extension, 4.7.14
---


title: Error opening attachment in outlook

text:
# Question
Title: Error opening attachment in outlook
When I send mailing with an attachment, contacts with use outlook can't open the attachment and received a message like this

I have tried with pdf and doc. When I download the attachment to my computer, the size of the file is 0 byte.

The problem is the same if I use outlook in the browser.

An idea to solve the problem? Regards,

# Answer
> 1 votes
Can you try sending gmail? to be sure the problem is on the sender side (civi) and not on the recipient one.

if the size is 0 byte, it might be that you have a limitation in PHP on how big files you upload/process can be. Is this a problem you have all the time or only with these files? are they big?

---
Tags: civimail, email, attachments
---


# Question
Title: Support for distributing benefits in Turkish
Can CiviCRM be quickly setup in a cloud so that it's primary function is to distribute benefits (cash, food, etc) with user interface in Turkish?

# Answer
> 1 votes
you would have to check how complete the turkish translation is. It seems we have achieved 100% translated, but can't judge of the quality of the translation.

https://www.transifex.com/civicrm/civicrm/

They are various hosting providers that can offer you to host. We do host on our own servers, so don't have a first hand experience on what they offer and it is not a question that fits the SE format, but I can mention that a nice community member is fast at replying and has a lot of experience with civi: hershel, you can find more on civihosting

and this page lists other providers, that are all active in the community: https://civicrm.org/hosting-providers

---
Tags: households
---


# Question
Title: Is there a way to preserve existing data when importing into multiselect and checkbox fields?
My use case involves lots of importing, and extensive use of multiselect fields (to track things like skills, interests, etc). Sometimes we get new information about, for instance, an existing contact's skills. We want to include this new info in our import. But of course importing with "fill" overwrites the old information. We want to keep the old information and add the new information to it.

Unfortunately this is not something we thought about when we designed our fields and processes!

I am looking for advice on a (non-manual) process that a non-technical user could do to achieve the intended outcome (appending additional values to multiselect fields).

If anyone has any experience with this I would much appreciate your insight.

# Answer
> 2 votes
Depends on how you define non-manual. Only non-technical I know of is

1. import just the cid, add to group as part of import, then export
2. do a vlookup, and get your new data and old data for those fields on same spreadsheet
3. use CONCATENATE to combine your new 'option values' with the existing 'option values'
4. do import

# Answer
> 0 votes
If you are doing that regularly, you could write an extension to upload your csv, fetch the current values, merge in the new data and then update the contact.

Creating the extension is technical but it should be easy for non-technical users to run it.

---
Tags: import
---


# Question
Title: Who supports civiCRM in Raleigh NC using Wordpress?
Our organization uses civiCRM currently. We wish to migrate to WordPress for our new website design. We want three bids for this work. Who in Raleigh, NC are currently offering such services that are familiar with civiCRM and Wordpress?

# Answer
> 2 votes
You'll find a good list of available CiviCRM/Wordpress implementation experts here:

https://civicrm.org/partners-contributors?country=All&services=Implementation&language=All&cms=WordPress

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


# Question
Title: CiviEvent online registration and page not found for online registration
After looooong time not working with CiviCRM I was asked for help and now, I am out of ideas.

I've created event with online registration without any entrance fee. Everything is setup properly, but page is not displayed after event link is clicked. I've checked online manuals for that and everything is (or I think it is) setup properly.

CRM is working with 4.7.3 wordpress. Event generated link looks like that:

subdomain.domain.pl/civicrm?page=CiviCRM&q=civicrm/event/register&reset=1&id=3

and as far as I checked, it should looks like

suddomain.domain.pl/?page=CiviCRM&q=civicrm/event/register&reset=1&id=3

I've checked Resource URL and there is no change in those settings.

Also, when I register as participant and check confirmation mail it has another link subdomain.domain.pl/index.php/2017/01/31/witaj-swiecie/?page=CiviCRM&q=civicrm/event/info&id=2&reset=1

Any ideas why system generates me incorrect link to event registration?

# Answer
The page or post with a shortcode is not mandatory. Something is probably amiss. Here are a few things to check:

* Is your WordPress install in a sub-directory. So the website is http://website.org but the WordPress files reside in http://website.org/wordpress. This can cause the direct links to result in a page not found.
* Check your WordPress base page under 'Administer\>System Settings\>CMS Database Integration' it usually is set to /civicrm (default you can change it to what ever you wish). Make sure that page exists. This is the page Civi uses as a template.

You want to get this straightened out. It can result in some issues depending on what you are doing with Civi. For example your opt-out links in mailings may not work correctly.

Hope this helps.
> 1 votes

# Answer
Last time when I used CiviCRM (it was 4.6.4), page, or post was not mandatory.

After I create post with CiviCRM short code, everything works as requested. Thanks for guiding me to correct part of wordpress :)
> 0 votes

---
Tags: wordpress, civievent
---


# Question
Title: Where do I find Apache error logs for sites that I installed with buildkit?
I installed a site with buildkit. Now I'm doing some dev work which is producing WSOD / 500 / "Internal Server Error" errors, but I can't find any logs about these errors.

I've looked in `/var/log/apache2/` and don't see any recent logs there. Is there somewhere else that the log messages are going?

# Answer
Buildkit uses amp to install sites which means you have to look in `~/.amp`. Log files are in `~/.amp/log` and separated by site.
> 2 votes

---
Tags: developer, civicrm-buildkit
---


# Question
Title: What is the pattern used to name the fields accessible through the API?
I'm getting familiar with the API and having trouble understanding the pattern used to name fields.

A call like **`CRM.api3('Address', 'get')`** makes sense to me because the fields in the result are (1) named consistently, and (2) each named exactly as they appear in MySQL. I see things like `street_address`, `location_type_id`, and `is_primary`. I like this.

A call like **`CRM.api3('Activity', 'get')`** produces fields which make slightly less sense. I see `subject` and `status_id` which seem consistent. Good. But then I see `activity_date_time` and `activity_type_id` and become confused about why some fields are named with their entity as a prefix and some are not... *But* at the very least, all these field names are consistent with the column names in MySQL. Ok fine, I can live with that.

But then when I look at the same call for **`Contribution`**, I get even more confused. I see fields like `contribution_check_number` which seem to have an *added* prefix, not present from MySQL. Why?

And when I look at **`Participant`**, *all* the fields have a `participant_` prefix. Huh??

Is there some sort of underlying pattern that can explain this madness to my logic-seeking brain?

# Answer
For historical reasons (namely cramming a bunch of fields from various entities into a flat array for e.g. a profile form) some fields in the database have a "unique\_name" which is generally the entity prefixing the field name. For obscure reasons, the api v3 sometimes returns those "unique\_names" instead of the regular field names.

I personally hate the implementation of unique names in CiviCRM - it's inconsistent and confusing and if I have anything to say about it there will be *no* unique names in api v4!
> 1 votes

---
Tags: api
---


title: Autofilling a new custom field

text:
# Question
Title: Autofilling a new custom field
I've just created a new field with a 'yes/no' answer. Can I auto-fill all records with a specific answer?

# Answer
> 1 votes
Once you set the default value, you have to somehow trigger an update for your contact records so the default value gets populated. One way to do this might be to export a minimum of contact fields and re-import them (careful with this technique, unless you do it properly you'll create a lot of duplicate contacts in your db!).

# Answer
> 0 votes
You can set a default value in the custom field definition.

---
Tags: custom-fields
---


# Question
Title: How to populate the tokens used for a Scheduled Reminder in the Activity
Scheduled Reminders allow one to "Record activity for automated email" which is great. But if tokens are used in the Reminder, these are not populated in the Activity that is created.

How would one improve civicrm so that the Activity actually records what was sent out, rather than just showing the token name?

# Answer
There is a JIRA ticket now CRM-20361 and will hopefully be in the next release.
> 1 votes

---
Tags: scheduled-reminders, tokens, activity
---


# Question
Title: "Cannot redeclare class CRM_Core_ClassLoader" in backup site
I had a civicrm 4.4.6 site in my drupal 7 subdomain, which is beta.mydomain.com.
I want to have a backup site to perform update on civicrm, but it shows:

> Fatal error: Cannot redeclare class CRM\_Core\_ClassLoader in /home/mydomain/www/backup/sites/all/modules/civicrm/CRM/Core/ClassLoader.php on line 36

Below is my setting scenario:

I created a subdomain, backup.mydomain.com, and copied all the files from beta site to backup site.

In beta site, these are the database: civicrm (drupal default database) and civicrmdb (civicrm database)

I had copied the database, as backup\_civicrm and backup\_civicrmdb

In backup site, I made the following changes:

1. **sites/default/settings.php** : change database name to backup\_civicrm
2. **sites/default/civicrm.settings.php** :

* define( 'CIVICRM\_UF\_DSN' ) : change to backup\_civicrm
    * define( 'CIVICRM\_DSN' ) : change to backup\_civicrm
    * $civicrm\_root = '/home/mydomain/www/backup/sites/all/modules/civicrm';
    * define( 'CIVICRM\_TEMPLATE\_COMPILEDIR', '/home/mydomain/www/backup/sites/default/files/civicrm/templates\_c/' );
    * define( 'CIVICRM\_UF\_BASEURL' , 'http://backup.mydomain.com/' );
    * define( 'CIVICRM\_MAIL\_LOG', '/home/mydomain/www/backup/sites/default/files/civicrm/templates\_c/mail.log' );

After configuration, my backup site shows error:

> Fatal error: Cannot redeclare class CRM\_Core\_ClassLoader in /home/mydomain/www/backup/sites/all/modules/civicrm/CRM/Core/ClassLoader.php on line 36

I had cleared all the files in sites/default/files/civicrm/templates\_c , and it does not work.

I found that when I change $civicrm\_root to beta, it works.

```
$civicrm_root = '/home/mydomain/www/beta/sites/all/modules/civicrm';

```

This is weird. I need to perform upgrade on civicrm, if the root is link to beta, I'm not sure how this will affect my update.

Am I missing out any configuration? Any idea on what is the problem?

# Answer
It sounds as though there is either a cached path to ClassLoader.php somewhere or there are two copies of the CiviCRM code under your modules directories. Various scenarios and solutions are discussed in this forum post: svn installation says "Cannot redeclare class CRM\_Core\_ClassLoader" Please post back here rather than on the forum, though.

If you're sure that there aren't multiple copies of CiviCRM under /home/mydomain/www/backup/ then the most likely fix is to clear the Drupal variable `civicrm_class_loader`, e.g. using drush:

```
drush vset civicrm_class_loader ''

```

There's a good chance the fatal error will prevent the use of drush. In that case, you can delete the row from Drupal's `variable` table where `name` = 'civicrm\_class\_loader'. It's possible the variables are cached in addition -- you may need to clear Drupal's cache tables manually. (A targeted approach -- in Drupal 6, anyway -- is to delete the row from Drupal's `cache` table where `cid` = 'variables'.)
> 13 votes

# Answer
You can also get this error if you do something (ahem) really confused like have two copies of your Drupal site on the same machine that both point to the same CiviCRM codebase/database.

Of course you'd have to be stupid to do that. \*blush\*

I had the hard-coded strings in my `civicrm.settings.php` file pointing to paths in the other Drupal codebase. Just recording here in case it helps anyone else.
> 4 votes

# Answer
Try this (Drupal) :

1) Comment following lines in civicrm.settings.php :

```
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();

```

2) Take backup of variable table in database & delete the row with name = 'civicrm\_class\_loader'.

3) With this your civicrm page should get loaded.

4) Now clear civicrm caches or hit "http://your\_site/civicrm/menu/rebuild?reset=1" url.

5) Uncomment the above lines.
> 3 votes

# Answer
This can also be done w/o Drush where you examine the Drupal 'variable' table in MySQL and delete the rows that contain CiviCRM 'class loader' data.
> 2 votes

# Answer
If you're getting a Fatal Error: Cannot redeclare class CRM\_Core\_ClassLoader in /sites/all/modules/civicrm/CRM/Core/ClassLoader.php, line 36

Then a

```
sudo -u apache drush status

```

will also result in a Fatal Error - and you will also not be able to run:

```
drush vset civicrm_class_loader ''

```

You're definitively looking for multicode bases: perhaps you're getting this after an upgrade and you copied your old CiviCRM code to `civicrm-old` or something like that.

```
rm -r civicrm-old/

```

will fix this.
> 2 votes

---
Tags: drupal, backups
---


title: DB error on tag page after installation

text:
# Question
Title: DB error on tag page after installation
I'm new to CiviCRM and just installed it (v. 4.7.17) on Wordpress 4.7.3

When I access the tag management page (wp-admin/admin.php?page=CiviCRM&q=civicrm%2Ftag&reset=1), I get a DB Error + a display bug.

Error is

```
Expression #12 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'civicrm.child.id' which is not functionnally dependent on columns in GROUP BY clause ; this is incompatible with sql_mode=only_full_group_by, 1055

```

And debug info is in the image attached.

Does anybody know how to sort this out?

thanks

Thomas

# Answer
ok, finally got it working by adding the following lines to the config file located at */etc/mysql/my.cnf*

```
[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"

```

But looks like a bug anyway..?!
> 1 votes

---
Tags: error, database, tags
---


# Question
Title: Scheduled reminders - Email head css attributes are being stripped out
I'm hoping to use email templates in Scheduled reminders that have css in a `<style>` tag at the start of the email. Declaring css here for html elements and classes makes MUCH more robust templates that aren't prone to disasters from click-happy admin teams deleting in-line styles.

I can use these templates effectively in CiviMail and when sending emails directly from a contact's summary screen.

However, the Scheduled reminders engine strips out all the css attributes in the initial `<style>` tag. So the email looks awful and the `<style>` declaration contains all the tags and classes - with no actual css!

I'm guessing this is perhaps something to do with the IDS? I don't see any IDS log errors though. If it is something that we can tell the IDS to ignore, I'd be grateful to know how to do this.

Or is there some other way we can tell the Scheduled reminder system not to strip those attributes?

I'm using 4.6.24 with Drupal 7.54 and CKEditor. Note that the styles aren't being stripped by CK Editor (I've adjusted the editor's config.js to make this possible), because they work perfectly well in CiviMail and from a contact's summary screen... and they are there safely inside the Scheduled reminder email CKEditor screen.

Perhaps it may be useful to add here that I'm not using a `<head>` tag to contain my `<style>` tag. In my config I haven't been able to persuade CKEDitor to retain the `<head>` tags. Nevertheless even so all is well for the other email scenarios.

One final point - I'm aware of how to skip IDS using the following method. So could possibly add an extra path to skip in this: https://github.com/teamsinger/uk.teamsinger.civicrm.mailgun#user-content-skip-ids-checks

Thanks for your help.

# Answer
The main issue seems to be the `<style>` tag defined in the templates. Schedule Reminder uses smarty engine by default which strips down the css styles defined.

This doesn't occur in CiviMail because Smarty is disabled in civicrm.settings.php. If `CIVICRM_MAIL_SMARTY` is set to 1, civimail will too see this error.

As Smarty processing is done, escape the tag within {literal}. Something like:

```
{literal}
  <style>........</style>
{/literal}
.
.
.
(further html code)

```

See - http://www.smarty.net/docs/en/language.escaping.tpl.

`To avoid the {literal} statements being displayed in the email's wysiwyg view you can enclose those {literal} statements in a <p> tag with class or style to make them hidden - eg <p style="display:none;">.`
> 5 votes

---
Tags: email, scheduled-reminders
---


# Question
Title: How to fix 'New mailing' that only has 'Initializing' and edit boxes that wait forever
One of my Civi installs has a problem where clicking 'New mailing' has 'Initializing' but nothing more, and edit boxes on the summary screen have a continuously circling triangle if an item is edited. I've been through this forum help and looking at the browser console I can see 'HTTP/1.1 500 Internal Server Error 54ms'. I have removed extensions, and upgraded to the latest 4.6.27 CiviCRM release but no change. I really don't know what to do next, so very grateful for any help. CMS is Drupal 7.52 and PHP 5.6 (Added) The full message in the above browser console is: 'https://www.myapp.com/civicrm/ajax/angular-modules HTTP/1.1 500 Internal Server Error 34ms'

# Answer
> 1 votes
This problem turns out to be a mis-configuration on the shared server. We were also getting Internal Error 500 messages just on signing in today, but the hosting company (vidahost.com) fixed the problem & Civi is working fine now. So not a problem with Civi, but a problem on the shared server, now fixed. No wonder I couldn't find anything wrong with Civi..

---
Tags: mailing, 4.6
---


# Question
Title: Is there any way to make a normal textarea in civi editable using CKEditor?
I am referring in particular to the textarea that allows one to write a custom confirmation email in the 'Online Registration' tab of an event's configuration page.

Following the CKEditor integration documentation here (http://docs.ckeditor.com/#!/guide/dev\_installation-section-adding-ckeditor-to-your-page), I have added some JavaScript to the bottom of templates/CRM/Event/Form/ManageEvent/Registration.tpl to allow the CKEditor user interface to take over the textarea (where `confirm_email_text` is the `name` and `id` of the textarea in question):

```
CKEDITOR.replace( 'confirm_email_text' );

```

This appears to work, as the CKEditor interface appears where the textarea did previously. However, any content entered into this CKEditor textbox does not seem to be saved to the database.

The documentation for CK Editor 4 (the version in use on our version of CiviCRM) also says the following:

> When CKEditor functions as a replacement for a element, the integration with the parent element is automatic

(see http://docs.ckeditor.com/#!/guide/dev\_savedata)

Am I missing something here?

# Answer
> 1 votes
So we looked at how one of the existing CKEditor-enabled fields on the page was processed in the civi code base (we chose the `footer_text` slightly further up the Online Registration page) and tried to replicate the same processing with the confirm\_email\_text field.

Based on this, we changed two files.

**1. civicrm/CRM/Core/I18n/SchemaStructure.php**

In the original Civi code on our version this had the following settings for confirm\_email\_text:

```
      'confirm_email_text' => array(
        'type' => "TextArea",
        'rows' => "4",
        'cols' => "50",
      ) ,

```

We changed this (it was around line 644) to:

```
      'confirm_email_text' => array(
        'type' => "RichTextEditor",
        'rows' => "4",
        'cols' => "50",
      ) ,

```

In other words, we changed the type from 'TextArea' to 'RichTextEditor'.

**2. civicrm/CRM/Event/Form/ManageEvent/Registration.php**

In the original Civi code on our version this had the following settings for confirm\_email\_text:

```
$form->add('textarea', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);

```

We changed this (it was around line 423) to:

```
$form->add('wysiwyg', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);

```

In other words, we changed the first argument from 'textarea' to 'wysiwyg'.

**One more note**

This code sufficed to display the CKEditor instead of the default textarea, and to save and retrieve the text that was written into it. However, during testing we found that our emails were not displaying images that had a `src` with a % sign in it properly. This was remedied by altering our Message Templates. They had the following line in them by default for including the custom confirmation text at the top of the confirmation email:

```
{$event.confirm_email_text|htmlize}

```

We simply removed the htmlize filter, so instead we had:

```
{$event.confirm_email_text}

```

This seemed to deal with the problem.

I should note that we removed the line of code mentioned in my original question from Registration.tpl before implementing the actual working solution above.

---
Tags: civievent, email, ckeditor
---


title: How to update custom report template

text:
# Question
Title: How to update custom report template
I am using 4.7.13 on two different sites. On one site, when I update the class and refresh my custom report, all of the changes are visible. On the other site when I do the same thing, the changes are not visible. Even stranger, when I delete the class (i.e., the PHP file), the report is still visible in its old form. I have tried 'flush all cache' and searching for any other cached versions without success. Since this works on one site but not the other I suspect there is some configuration setting that I am missing somewhere.

# Answer
It sounds like you may have an override file in place. Check **Administer » System Settings » Directories** to get the custom PHP path, then look in the appropriate subfolder (if it exists) for an override file.
> 2 votes

# Answer
Issue was traced to opcache, which was running on one site, but not the other. Followed the instructions here (ma.ttias.be/how-to-clear-php-opcache) to clear the cache and that resolved the problem.
> 1 votes

# Answer
One word - ***pseudoconstants***. Put clear\_cache=1 in a call in the CiviAPI and see what happens.
> 0 votes

---
Tags: civireport, custom-reports
---


# Question
Title: How to find CiviCRM version in SQL from a database backup
I have a backup of a CiviCRM database from some time ago that I'd like to inspect inside a test site. When setting up the test site, I want to use the correct release version to match the version at the time the backup was made. How can I execute an SQL query on this orphan database to determine which version of the CiviCRM codebase its schema is compatible with?

# Answer
> 5 votes
You could use phpmyadmin and look in table 'civicrm\_domain' at field 'version' - the version is stored there.

---
Tags: sql, backups
---


# Question
Title: How can we give Admins more control on what is shown for non-existent pages such as contribution pages
What happens when an Event is deleted, or a contribution page is disabled, or a profile no longer exists?

Links i am thinking of include

CONTRIBUTION PAGE

http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=14 You get a yellow page saying

> Sorry but we are not able to provide this at the moment. The page you requested is currently unavailable.

EVENT PAGE

http://dmaster.demo.civicrm.org/civicrm/event/register?reset=1&id=18

If you are logged out you end up at the home page

PROFILE

http://dmaster.demo.civicrm.org/civicrm/profile/create?gid=19&reset=1

You get a yellow page saying

> Sorry but we are not able to provide this at the moment. The requested profile (gid=19) is inactive or does not exist.

# Answer
> 0 votes
There is also this extension from eileen at fuzion which lets admins set a default Contribution page to handle ones that don't exist any longer

# Answer
> 1 votes
This same issue bothers me because I see so many fatal errors in logfiles across multiple servers when all that is happening is that a contribution page has been disabled / removed. I'd love to see it addressed in core if possible; CiviCRM should be capable of handling invalid inputs without showing the end user an unthemed, unhelpful error message.

One extension does already address this - **ca.bidon.reporterror**. It includes an option to detect those fatal errors (a user hitting a contribution page with invalid ID, or a disabled contribution page, or with an expired session) and redirect them to a default contribution page. This is a big improvement on the default behaviour! However, it's not included in core, and it comes bundled with other behaviours which *might* not be what all sites want.

Ideally, I'd like to make progress on tickets like CRM-19157: Replace CRM\_Core\_Error::fatal() with CRM\_Utils\_System::permissionDenied() so that we can drop the ugly (to users) and noisy (to sysadmins) "fatal" approach to handling invalid inputs in favour of a more "controlled landing" when things go wrong - which can both deliver a helpful and on-brand experience to the user seeing it, and reduce the level of log noise which results from the use of `CRM_Core_Error::fatal()` as a technique to bail out.

Instead we should deliver be delivering a nuanced experience to both users and admins: where we currently have `CRM_Core_Error::fatal()` we should throw an exception with information about what went wrong, and then CiviCRM can handle those exceptions appropriately. Broken contribute URL? Direct viewer to a default contribute page! User triggered IDS / DDOS / flood control? Maybe we can dispense with the pretty theme ...

---
Tags: civievent, civicontribute, profile
---


# Question
Title: CiviCRM Bulk Email always shows [Civimail Draft] before the subject
When I send a email using the Bulk Mail facility of CiviCRM the subject line is always preceded by the text \[Civimail Draft\]. I must be doing something wrong but I am not sure what it is.

# Answer
You are not sending the final version, you are sending a draft. This is meant to be used to send to you and a few other testers.

The final "official" version is sent when you go to the next step and schedule to send it.

You will need to set up a cron to process the scheduled mailings and send them
> 1 votes

---
Tags: civimail
---