# Question
Title: Webform CiviCRM, add contact to a group programatically
I want to add a contact to a group created from a Webform CiviCRM, depending on the fields' values.

I don't find where I should place this logic:

* In hook hook\_civicrm\_post, I don't have the origin (webform) of the contact created.
* The place should be in Drupal / Webform hooks, but I don't know how to "inject" the group to be assigned to the contact, to be processed by webform\_civicrm.

Any ideas?

Working with CiviCRM 4.6.30, webform 7.x-4.15, webform\_civicrm 7.x-4.18

# Answer
> 3 votes
After digging deeply into webform\_civicrm, I've found that the hook to use is **hook\_webform\_submission\_insert**

It's important to check that this hook is executed after webform\_civicrm's one, so the contact is created first and then we can perform our own actions. We can alter execution order with **hook\_module\_implements\_alter**

I couldn't access contact\_id created in any webform\_civicrm entities, so I had to get it from the table **webform\_civicrm\_submissions** where is saved

The source code:

```
// Be sure our module's hook is the last to be executed
function mymodule_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'webform_submission_insert') {
    $group = $implementations['mymodule'];
    unset($implementations['mymodule']);
    $implementations['mymodule'] = $group;
  }
}

function mymodule_webform_submission_insert($node, $submission){
  if (!empty($node->webform_civicrm)){
    if(... my condition based on $submission values ...){
      $sid = $submission->sid;
      $result = db_select('webform_civicrm_submissions', 'w')
        ->fields('w', array('contact_id'))
        ->condition('sid', $sid)
        ->execute()
        ->fetchAssoc();

      // contact_id is saved between '-'
      if($result['contact_id'])
        $contact_id = str_replace('-', '', $result['contact_id']);

      civicrm_api3('GroupContact', 'create', array('group_id' => $mygroup_id, 'contact_id' => $contact_id));
    }
  }
}

```

---

PS: *org.civicoop.civiruleswebform* looks like a nice alternative, but it has many dependencies (2 extensions and 4 modules need to be installed in Drupal to use it)

# Answer
> 2 votes
There are probably lots of solutions but I have created an extension which allows you to use CiviRules and Webform-CiviCRM together: https://github.com/CiviCooP/org.civicoop.civiruleswebform.

That might do the trick for you? You can then add the contact to the group with a CiviRules action.

# Answer
> 1 votes
Another approach is to use webform Conditionals which are part of webform. For example, if you had a custom field (Fruit and Veg) with options Apple or Orange or Carrot, then you could set your Group field (Fruit, Veg or Both) to be hidden and set the value using Conditionals based on the choice made in 'Fruit'.

Eg Apple sets to Group = Fruit Apple or Oranges sets to = Fruit Apple and Carrot sets to = Both Carrot sets to = Veg

Of course that is a very simplistic approach but hopefully conveys the possibilities.

# Answer
> 1 votes
In Drupal 8 Webform-CiviCRM, this should be easier. Create an element of type "Calculated Twig" and give it the same key name as the "Groups" field. Now you can use Twig calculations based on the rest of the form's values to fill in the Groups field as you like.

---
Tags: webform-civicrm
---


title: CiviCRM Search not working

text:
# Question
Title: CiviCRM Search not working
Here is what is going on.

I'm trying to do a search within my CiviCRM, however, I'm getting the error message:

One of parameters (value: sort\_name) is not of the type MysqlColumnNameOrAlias.

So I'm looking at the following log and one of the messages in the log:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in require\_once() (line 218 of /home3/isrcus/public\_html/sites/all/modules/civicrm/CRM/Core/ClassLoader.php).

I'm using Drupal 7. Not sure what version of CiviCRM I'm using..

# Answer
> 2 votes
Lots of folks are responding in the comments, but I'll try to give a non-technical answer.

**Short Answer**: You need to upgrade CiviCRM.

**Longer Answer**: CiviCRM is written in a programming language called PHP. Over time, new versions of PHP come out. CiviCRM must be updated in response.

It sounds like your webhost upgraded your PHP version to one that didn't exist when your version of CiviCRM was released. So any issues introduced by the newer PHP are affecting your experience. Newer versions of CiviCRM support newer versions of PHP, so you must upgrade CiviCRM. If you can control your PHP version yourself (some webhosts allow this, others don't) you can try downgrading PHP as a temporary measure, but that's not particularly secure or sustainable.

---
Tags: drupal, drupal-7
---


# Question
Title: How can I integrate Google Forms with CiviCRM?
I have a complicated Google Form I've already written. While it could be reimplemented in Caldera Forms, this would be time-consuming, and Caldera Forms is no longer being developed. Is there a way to integrate Google Forms with CiviCRM?

# Answer
> 10 votes
\[**Note**: With apologies to Jeff Goldblum, I was so preoccupied with whether I *could* do this, I didn't stop to think if I *should*. See the bottom for some caveats.\]

You can do this by adding a *Google Script* and *trigger* to your Google Form, and installing Form Processor on the CiviCRM side.

Configuring Form Processor is out of scope of this question - there are documentation and blog posts available to explain that. However, no documentation exists for the Google side.

### Instructions

* From the Google Forms editing screen, click the **More** menu (three vertical dots) and select **Script Editor**.
    + This won't appear if you're too zoomed in.
* Paste the following code into the editor and press **Save** (latest version on Github):

```
/**
 * @OnlyCurrentDoc
 */

function onFormSubmit(event) {

  // Set the values on these four lines for your Form Processor and site.
  var url = '<API3 REST Endpoint here>';
  var api_key = '<api key here>';
  var site_key = '<site key here>';
  var form_processor_machine_name = '<machine name of Form Processor here>';

  // Don't modify anything below this line.
  var submission = {};
  var responses = event.response.getItemResponses();
  for (var i = 0; i < responses.length; i++) {
    // Convert all non-alphanumeric values in the title to underscores, lowercase as well.
    title = responses[i].getItem().getTitle().replace(/[\W]+/g,"_").toLowerCase();
    submission[title] = responses[i].getResponse();
  }

  var payload = {
    "entity": "FormProcessor",
    "action": form_processor_machine_name,
    "json": JSON.stringify(submission),
    "api_key" : api_key,
    "key": site_key,
  }
  var options = {
    "method" : "post",
    "payload" : payload,
    "muteHttpExceptions" : true,
  };

  Logger.log(JSON.stringify(submission));
  // Fire the webhook.
  var response = UrlFetchApp.fetch(url,options);
}

```
* Modify the indicated lines at the top of the script to add these values:

+ The URL of your REST endpoint (varies by CMS and by CiviCRM version; check the REST Endpoint documentation);
    + The API key of a user with the necessary permission specified by your Form Processor configuration;
    + The site key (can be found in `civicrm.settings.php`);
    + The machine name of your Form Processor instance (can be found in the configuration).
* In the Google Script editor left navigation, click the **Triggers** tab, click **Add a Trigger** and configure it as follows:

+ *Choose which function to run*: **onFormSubmit**
    + *Which runs at deployment*: **Head**
    + *Select event source*: **From form**
    + *Select event type*: **On form submit**.
    + **NOTE**: If you create the trigger before adding the code, Google won't ask you to authorize the necessary scopes. Create the trigger last.

Now your forms will send the data to CiviCRM when they're submitted! To find the names of the inputs to configure Form Processor, do a test form submission, then in Google Script editor, click the **Executions** tab. The script will log the payload to Form Processor, and you can easily see the names of the fields as CiviCRM will see them.

**Caveats** This makes for an extremely brittle solution.

* Google Forms doesn't have "machine names" for fields - so changing a label requires a change in Form Processor or that field isn't processed.
* Multiple choice values must match EXACTLY in Google and Civi. Punctuation and case included.
* Changing your multiple-choice options in Google will cause a form to crash if that option doesn't also change in Civi.
* Multiple choice values changed in Civi won't crash the form, but obviously need to be replicated in Google.

In short - this is an inferior solution to, say, Civi Form Builder. It only makes sense if you have an existing Google Form that is embedded in your workflows, which changes rarely if ever.

---
Tags: forms, form-processor
---


# Question
Title: Looking for contacts that are Pending (status by email) E-news Opt-in
We are having an issue with the number of bots that are signing up for our e-news online. I would like to search for all contacts that have a status pending by email to our E-news group.

# Answer
**Jon from Megaphone Tech** created a **custom report** that that will allow you to filter by group status. Your system administrator would need to install it for you.
> 4 votes

# Answer
You can find Pending group members from Contacts \> Manage Groups. Click "Contacts" for the desired Group. Then expand the "Find Contacts in Group" pane.

from this post https://forum.civicrm.org/index.php%3Ftopic=25642.0.html
> 1 votes

---
Tags: email, groups, status, pending
---


# Question
Title: Update from 5.4 to 5.36.1 : problem to Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date
In Drupal 7, after this long update from 5.4 to 5.36.1 in a CiviCRM which I take administration, I had 2 blocking errors in the sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php file. I commented on the 2 lines that are problematic and the update could be done completely :

```
    $this->addTask('Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date', 'updateSmartGroups', [
  'renameField' => [
    ['old' => 'case_from_relative', 'new' => 'case_start_date_relative'],
    ['old' => 'case_from_start_date_high', 'new' => 'case_start_date_high'],
    ['old' => 'case_from_start_date_low', 'new' => 'case_start_date_low'],
    ['old' => 'case_to_relative', 'new' => 'case_end_date_relative'],
    ['old' => 'case_to_end_date_high', 'new' => 'case_end_date_high'],
    ['old' => 'case_to_end_date_low', 'new' => 'case_end_date_low'],
    ['old' => 'mailing_date_relative', 'new' => 'mailing_job_start_date_relative'],
    ['old' => 'mailing_date_high', 'new' => 'mailing_job_start_date_high'],
    ['old' => 'mailing_date_low', 'new' => 'mailing_job_start_date_low'],
    ['old' => 'relation_start_date_low', 'new' => 'relationship_start_date_low'],
    ['old' => 'relation_start_date_high', 'new' => 'relationship_start_date_high'],
    ['old' => 'relation_start_date_relative', 'new' => 'relationship_start_date_relative'],
    ['old' => 'relation_end_date_low', 'new' => 'relationship_end_date_low'],
    ['old' => 'relation_end_date_high', 'new' => 'relationship_end_date_high'],
    ['old' => 'relation_end_date_relative', 'new' => 'relationship_end_date_relative'],
    ['old' => 'event_start_date_low', 'new' => 'event_low'],
    ['old' => 'event_end_date_high', 'new' => 'event_high'],
  ],
]);

```

and 3 lines after, from 120 to 134 :

```
    $this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', [
  'datepickerConversion' => [
    'birth_date',
    'deceased_date',
    'case_start_date',
    'case_end_date',
    'mailing_job_start_date',
    'relationship_start_date',
    'relationship_end_date',
    'event',
    'relation_active_period_date',
    'created_date',
    'modified_date',
  ],
]);

```

Can anyone tell me if the 2 commented lines will pose a problem later and how to manually perform the operations left out?

I found this question but I didn't know what to do in my case : Upgrade fails with CiviCRM\_API3\_Exception: "API error: Could not delete payment processor type"

# Answer
> 1 votes
Those upgrade steps are updating particular fields in smartgroups. If you don't have any smart groups using those fields, it won't matter... but if those steps are failing it suggests you *do* have affected smart groups and those won't work correctly. You could delete those groups and recreate them.

But the underlying question is why is the upgrade hitting problems? If for example the field renames have failed, that will cause you more trouble in the future. I suggest you post the errors from the logs for the failing upgrade steps so we can diagnose the cause.

---
Tags: drupal, upgrade
---


# Question
Title: is there a possibility to add custom fields to "notes"
We want to structure the content in our "notes" by adding custom fields. We want to do this in notes because it is the only place where you can shield datafields form other users.

# Answer
Its possible to add custom fields for Notes through UI, by simply adding an option for `Objects a custom group extends to` option group.

However the fields wont appear on Add/Edit note form unless you write an extension to build the builds or modify core file to support custom fields(should be couple of hrs of work). Good news is the custom field data can be stored/viewed against the note by api.
> 1 votes

# Answer
There are other ways to make data more private, eg use an Activity Type and limit certain Activity Types to certain users (eg Private Calls/Meetings) via this extension
> 1 votes

# Answer
The privacy on notes fields is not very flexible. You can control access to a set of custom fields using ACLs.
> 1 votes

---
Tags: custom-fields, privacy
---


# Question
Title: FAIL : first and fresh install of CiviCRM 5.36.1 on BACKDROP 1.83
my first test of Backdrop 1.83 with CiviCRM 5.36.1 via MAMP 6.3 PHP 7.4.12) failed
backdrop installed correctly
civicrm installed correctly, no error
but
when i try to reach the civicrm dashboard: empty page
just the admin menu is displayed, but no link can be opened ..
tested on SAFARI and EPIC (chrome-like) on macos 10.14.6
PAGE ERROR MESSAGE (in french)
réponse du site (exemple) :
"
Page non trouvée
Ajouter une redirection d'URL de cette page vers un autre emplacement
Vous êtes ici : Accueil
La page demandée "/backdrop183/backdrop183/civicrm/a/" n'a pas pu être trouvée.
"
what's YOUR experience?

# Answer
> 1 votes
The URL looks off to me. The link to the dashboard should be `/civicrm?reset=1` and to the status page `/civicrm/a/#/status`. `/civicrm/a/` is not a page and I also get "Unknown path" when navigating there in a Backdrop install. Perhaps check to see if your URLs are being rewritten in apache?

---
Tags: installation, backdrop, mamp
---


title: Notes next to contact phone numbers

text:
# Question
Title: Notes next to contact phone numbers
I work with homeless and their phone numbers change. We need to keep all their numbers but add small notes to them. Like busy signal, no voicemail, Old/Wrong Number... stuff like that. Because we deal with so many phone numbers when I was importing the csv list I had to create new fields to accommodate this or it would wind up on the same line. If there was a way to add notes on the contact summary page to quickly reference what's going on with the phone numbers next to the phone number?

# Answer
One option that wouldn't need any custom code would be to store phone numbers in custom fields instead of in the normal phone fields. Then you can have whatever fields you like for each phone number (phone type, notes, etc). You can set the fieldset to be default open on the contact page, so it would be fairly visible. Otherwise, you'd need to find someone to code this up for you, I'd think.
> 2 votes

# Answer
Circle Interactive had build an extension to support custom fields for Email and Phone, not sure if its been published(can't find under civicrm extension page though). If you want to go through customization would be good to contact them.
> 1 votes

---
Tags: contacts, contact-view, phone, contact-reference, contact-summary-editor
---


# Question
Title: Has anyone got a recent example of a REST client under Drupal 9, possibly using AJAX?
I am trying to work out a way of presenting contact information from CiviCRM to another server, but am struggling to work out how one would code it. Has anyone got an example of something that works under Drupal 9?

```
Running https://<server root>/civicrm/ajax/rest?entity=Contact&action=get&api_key=Userkey&key=Sitekey&json={%22contact_type%22:%22Individual%22,%22first_name%22:%22<firstname%22,%22last_name%22:%22lastname22}

```

gives

```
{"IP":"fe80::e00a:1010:c022:f80e%9","level":"security","referer":null,"reason":"CSRF suspected","is_error":1,"error_message":"SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api3()."}

```

so clearly it needs to be called from javascript, presumably on the client.

It would be really helpful if someone had an example of a working script.

# Answer
> 1 votes
You may need to add below line in .htaccess or nginx config to allow php file be executed

```
RewriteCond %{REQUEST_URI} !/libraries/civicrm/extern/[a-z]+\.php$

```

Copy extern directory from civicrm vendor folder into libraries

The rest api url for drupal would look like

```
https://sitename/libraries/civicrm/core/extern/rest.php

```

---
Tags: api, javascript, rest
---


# Question
Title: After update CiviCRM IATS Extension to 1.7.4, Card on file and Expiry Date fields are not showing
When we create a new iATS recurring donation, we can edit the payment information, but the old iATS recurring donations cannot be updated. I have checked in extension code getting the customer code by payment\_token\_id. But payment\_token\_id is missing in ContributionRecur API response. Only issue is in old (before update extension) iATS recurring donations.

# Answer
> 1 votes
I have upgraded the extension 1.6.2 to 1.7.4. During upgraded extension upgrade function were not ruined upgrade\_1\_7\_002 and upgrade\_1\_7\_003. After manually run the SQL Queries issue is resolved.

---
Tags: civicontribute, civicrm-home, iats, iatspayments
---


# Question
Title: How is the en-/decoding of the optOut-URL done ? (algorithm)
is someone there who knows how the en-/decoding of the optOt-URL is implemented ?

Example: https://....../crm/civicrm/mailing/optout?reset=1&jid=7&qid=14&h=817b324557dc9cb9

I'd assume that the part "817b324557dc9cb9" is the encoded contact\_id 15944 ???

Please help me ;-) Thanks a lot and kind regards Dieter

p.s.: https://gchq.github.io/CyberChef/ =\> Analyse hash: 817b324557dc9cb9 Hash length: 16 Byte length: 8 Bit length: 64

Based on the length, this hash could have been generated by one of the following hashing functions: CRC-64 RIPEMD-64 SipHash

# Answer
Welcome to SE!

You can see the construction of the opt-out URL here and the processing of it here

* 'jid' is the Job id
* 'qid' is the Queue id
* 'h' is the Hash

The contact\_id is not included in the URL but can be looked up via the qid.
> 3 votes

---
Tags: civicrm.org
---


# Question
Title: Best practices for translating message templates
As the message templates are quite complex, especially the system-flow templates, with their Smarty templating structures, and they sometimes are updated, you would rather not edit them.

But if you have users using other languages than English it is almost essential to translate them.

Is there any best practice to manage this? Jon G suggested using a Smarty-enabled editor which is at least one step towards not messing them up. But it doesn't resolve the issue with diffing against the system version when all the text in them has changed to another language...

# Answer
> 1 votes
It has been a while since I last did this, so I had forgotten about "Administration-\>CiviMail-\>Header, Footers and automatic messages" where you should do this. At least when it comes to subscriptions, confirmations etc.

Don't. Touch. The. Message. Templates.

---
Tags: message-templates, translation
---


# Question
Title: New error when editing membership: Argument 1 passed to CRM_Financial_BAO_Order::setOverrideTotalAmount() must be of the type float, string given
This error seems to be connected with the update to version 5.36 as it just appeared after that.

When editing an existing membership or adding a new membership the following error appears in the logs:

`TypeError: Argument 1 passed to CRM_Financial_BAO_Order::setOverrideTotalAmount() must be of the type float, string given, called in C:\wamp64\www\civicrmd8\httpdocs\sites\all\modules\civicrm\CRM\Member\Form.php on line 486 in CRM_Financial_BAO_Order->setOverrideTotalAmount() (line 152 of C:\wamp64\www\civicrmd8\httpdocs\sites\all\modules\civicrm\CRM\Financial\BAO\Order.php).`

I feel it could be connected to https://github.com/civicrm/civicrm-core/pull/19476/files

A quick fix I found was to change line 486 of civicrm/CRM/Member/Form.php from

`$this->order->setOverrideTotalAmount($formValues['total_amount']);`

to

`$this->order->setOverrideTotalAmount((int) $formValues['total_amount']);`

But I am not quite sure if this really solves the issue or what sideeffects I do not see. Maybe this type casting should be done earlier in the process? or maybe the problem lies somewhere else? In my case the value of $formValues\['total\_amount'\] is an empty string but I do not know where this value comes from.

# Answer
Just for the record - the issue is solved in CiviCRM version 5.36.1
> 1 votes

---
Tags: civimember
---


# Question
Title: CKEditor can only edit user driven message templates
If I edit a user driven message template, then CKEditor works nicely. If I try to edit a system message template, the template fills only into a textarea, without CKEditor.

Since it's done as site admin having all the permissions, and these symptoms are the same on dmaster.demo.civicrm.org for system templates and for user templates, I guess this is a bug.

Do you have any workaround here?

My install is on Aegir 3.17.3 with Drupal 7.64 and CiviCRM 5.10

# Answer
Jaap's comment is correct. It's unfortunately not possible to use a WYSIWYG editor on system templates because they're not (just) HTML, but contain Smarty code as well. Not only would Smarty break CKEditor, but CKEditor would break the Smarty code.

This unfortunately makes editing system templates difficult to do. However, one trick that makes it easier is to copy the text into software that understands Smarty templates. I use Netbeans IDE for this. While this may be overkill for most uses, Netbeans can recognize both HTML and Smarty tags and the tag that closes a section. So it's easy to use code folding to identify and hide the sections that don't concern you.

I work in Netbeans, then paste the text back into CiviCRM and press "Save". It's relatively quick to iterate this way.
> 4 votes

# Answer
A new alternative is to use the Pretty Workflow Messages extension, which allows you to edit a header and footer that go around the original message, and can be edited with a normal editor.
> 0 votes

---
Tags: message-templates, ckeditor, system-workflow-messages
---


# Question
Title: Can I deactivate my CiviCRM WordPress plugin without losing all my data?
We haven't used our CiviCRM plugin for quite some time, but it has acquired data I don't want to lose. I think it's slowing our site down and I'd like to disable it in anticipation of increased web traffic for an upcoming event. If I deactivate it, will I lose all my data?

# Answer
> 2 votes
Welcome to SE! If you deactivate the CiviCRM plugin the data will still all be in the database and not changed. However, I'd be surprised if CiviCRM slowed anything down if its not being used, so I think you'll have to look elsewhere for your problem.

---
Tags: wordpress, data
---


# Question
Title: Multiple First Names for a Contact - implementing AKA (also known as)
We continue to generate duplicate contacts in situations where an individual uses different variants of their first name. E.G. (Robert, Rob, Bob, Bobby) or (William, Bill, Billy) or (Rick, Rich, Richard, Dick). We have to dedupe and merge these redundant duplicates again and again.

The problem arises frequently as our contacts typically are not users in the CMS so aren't logged in.

Is there a way to have a dedupe rule that requires a match of first, last, and email, but is able to look at multiple alternative first names for a match. Then if we find that a person uses both Bill and William, we could add William as an AKA and not continue to generate the duplicates.

I could imagine having a custom field of AKA, and I could set up a weighted rule where we award e.g. 5 points to a match of Newfirst and first, OR Newfirst and AKA.

I've searched for this topic and couldn't find anything, but if there's an answer out there, please point me to it.

Thanks, Rick

# Answer
OK, I believe Eileen's "Deduper" extension is just about the answer I needed - I haven't completely grokked the user interface, but I'm confident that those of us who really want to successfully deal with nick names and AKAs will find the answer here.

https://civicrm.org/extensions/deduper

https://civicrm.org/blog/eileen/deduper-extension-release-14

*Deduper extension release 1.4 Release 1.4 of the deduper extension is now released. ***This contains a number of additional resolvers*** that the Wikimedia Foundations uses to enable more duplicate contacts to be merged without manual intervention. CiviCRM provides a UI and a script for merging contacts individually or in batches. In addition the deduper provides it’s own UI. In all these place a ‘safe’ merge will attempt to merge 2 contacts and refuse to merge them if they are in conflict. The resolvers attempt to resolve the conflict to \[sic\] (so?) the merge can be completed. New resolvers include (laundry list of resolvers follows..) The diacritics resolver - chooses José over Jose ...... ***Nick name resolver - saves and uses known nicknames.*** .......*

Going further, Eileen's blog post provides an interface for defining, editing and extending the nick name rules, e.g. I can indicate that Ted is a nick name for Edward, etc.

Take a look at this post and you will see the screenshots for how this works.. https://civicrm.org/blog/eileen/leveraging-search-kit-deduper

(Having posted all this, I need to say I haven't completely figured out how it all works, but I'm confident that Eileen's solution will take most of the pain out of nick names and since I believe a number of people are following this, I wanted to get the word out for those who weren't aware of Deduper extension and the search kit ehnancements)
> 2 votes

---
Tags: civievent, dedupe-rules
---


# Question
Title: Export list of all successful civimails?
I feel I should know this and the answer is going to be obvious. Is there a way to export a list of successful civimails? I need the mailing name and date, and it would help to have the mailing list sizes but this isn't crucial. I don't need the participants' details.

I'm using D6 and the latest Civi.

# Answer
You can use CiviCRM inbuild reports (i.e Mailing Detail or Summary report) or extended mailing stats extension. You can export the result as CSV or PDF
> 4 votes

# Answer
Not an elegant solution, but as a one off you could list the mailings with Find Mailings, select a suitable number of rows per page, select all the table and copy and paste into Excel. I doesn't have the list size. To more than this I think you'd have to do a query of the database and write some code to also query the report to get the list size.
> 1 votes

---
Tags: civimail
---


title: Searchable Profile fields do not work

text:
# Question
Title: Searchable Profile fields do not work
I have an issue on creating profiles.

When I create a profile with several fields such as "First Name" "Past Name" "E-Mail" and some Custom Fields and I set these fields to "searchable", everything looks fine at first. I can check the preview and the Use - Create/Edit/Listing Modes and it works.

But after a while, it suddenly doesn't work any more:

* I get for the Listing Mode the error message: "No fields in this Profile have been configured as searchable. Ask the site administrator to check the Profile setup. "
* Preview is empty
* Preview od searchable fields tell: "Profile Field Preview This CiviCRM profile field is view only." -\> BUT IT IS DEFINITELY SEARCHABLE AND NOT "VIEW ONLY"

for me this feels a bit like a bug. Would be nice to hear if this problem is known and if there is any fix

# Answer
Clearing cache may be the solution? If yes you can turn on 'Clean-up Temporary Data and Files' schedule job with below parameter.

```
dbCache=1
memCache=1

```
> 1 votes

---
Tags: custom-fields, profile, permissions, forms
---


title: Should I use cPanel on my server?

text:
# Question
Title: Should I use cPanel on my server?
If I am using a hosting provider like Bluehost, or a2, should I also use cPanel ? cPanel is an admin interface and what looks like a handy utility for administering my server. Are there advantages and disadvantages to using cPanel?

# Answer
I've certainly found cPanel very useful to do lots of things and easier that using ssh access (some hosting providers might not provide that). I have found it does everything I need that can't be done in the CiviCRM UI. My hosting provider (Siteground) has moved away from it to its own control panel which covers all the same functionality and has some better functionality, but there was nothing wrong with cPanel. Of course it also depends on the functions provided through cPanel as its a toolkit and they might leave bits out.
> 2 votes

# Answer
so my suggestion would be to go ahead and use it. As much as software can make things less secure, in this instance the cpanel is probably setup to auto update so its not something your managing and its probably installed on the server anyway so whether you use it or not, its going to be present.

From the other side of security, the more that the panel can do for you, in terms of checking, configuring and recommending, the better your security is likely to be. The modern panels have all sorts of plugins which will enhance and not detract your experience.

Think of the panel like any CMS such as Drupal or Wordpress. Yes, you could create a website without them but they provide a hell of a lot out of the box and keep getting updated. Hosting panels are similar, they offer you a bunch of functionality that will make your life a lot easier.
> 2 votes

# Answer
It's a tradeoff - it does a whole bunch of stuff that you don't need and some types of custom configurations can be difficult or get overwritten, but it does make some tasks easier, e.g. SSL certificate autorenewals, split php versions for different sites, creating mysql databases, etc...

And I'm not saying cpanel is insecure but just as a general comment about any software the more stuff you have running the more surface there is for attacks. It does let you turn off some things.
> 1 votes

# Answer
It is true that the more stuff you are running then potentially there are more attack vectors. If you are not comfortable doing all the low level config on the server or are not an expert then using something like cPanel or Plesk will give you more confidence. Additional extensions are available to do things like security checks which can be invaluable. It's always a trade of though - if you want to be able to do deep level tweaks and config and want to squeeze the max performance out of the server then go without.
> 1 votes

---
Tags: sysadmin, system-settings
---


# Question
Title: Order API + Payment with multiple line items creating wrong financial trxn record?
Say I have two price fields, thumbtacks at $1/unit and ketchup at $20/unit (it's very good ketchup). Suppose they each have a different financial type, such as "Office" and "Condiments".

If I use the order api to create a contribution where you've bought one of each this looks fine. I get correct looking records in civicrm\_line\_item etc. The problem is when I record the payment. It properly records two items in civicrm\_financial\_item corresponding to the line items, but then in civicrm\_entity\_financial\_trxn, it properly creates two records, but the entity\_id for both of them points to the same entry in civicrm\_financial\_item. This then shows up in the UI on the contribution as "Condiments, Condiments" for the payment instead of "Office, Condiments".

When I record the same contribution from the start using the UI and the price set, it has entity\_id pointing to the separate items, as I'd expect, and in the UI shows "Office, Condiments" for the payment.

The code looks something like this:

```
$result = civicrm_api3('Order', 'create', [
  'contact_id' => 17,
  'financial_type_id' => 'Donation', // this seems irrelevant
  'receive_date' => date('YmdHis'),
  'contribution_status_id' => 'Pending',  // this is required according to the docs - the payment below completes it
  'line_items' => [
    [
      'params' => [],
      'line_item' => [
        [
          'label' => 'line 1',
          'qty' => 1,
          'unit_price' => '1',
          'line_total' => '1',
          'financial_type_id' => 22, // Office
          'price_field_id' => 12, // this seems almost irrelevant - using "1" has the same effect but then oddly doesn't show the line item breakdown when viewing the contribution
        ],
        // It doesn't seem to make a difference if I put the 2nd line item here or as a separate array in the outer array.
        // It's the payment part that is creating the wrong entity_id.
        [
          'label' => 'line 2',
          'qty' => 1,
          'unit_price' => '20',
          'line_total' => '20',
          'financial_type_id' => 23, // Condiments
          'price_field_id' => 13,
        ],
      ],
    ],
  ],
  'api.Payment.create' => ['total_amount' => 21],
]);

```

# Answer
As per this old issue and PR

https://github.com/colemanw/webform\_civicrm/pull/58#issuecomment-289561525

you want to specify the price\_field\_value\_id or else CiviCRM will try and be clever and guess one for you and will often get it wrong. I think it's using the same mechanism it uses when you specify values for a payment page without using a real price set - i.e. it access a hidden price set that it uses for the purpose.
> 1 votes

---
Tags: financial-types
---


# Question
Title: How to set up basic CiviCRM access for a user in WordPress?
* I created a basic WordPress user with Author role.
* I sync'ed the user to CiviCRM and checked the corresponding Contact was created
* I edited the WordPress Access Control to grant some permissions to the Author role

However when my user logs in to WordPress there is no CiviCRM menu item...  What else needs to be done?

Note that access works fine for Administrators -- but I would prefer not to give full admin rights to everyone.

This has to be something really simple -- but I'm not seeing it.... Pointers would be much appreciated

# Answer
See the Access Control (Permissions) in WordPress section of the documentation. To access the backend you need the 'CiviCRM: access CiviCRM backend and API' permission.

You can create additional roles with other WP plugins.
> 1 votes

---
Tags: wordpress, roles
---


# Question
Title: I want to find a specfic group and get their email addresses
I need to know how to request a specific group (Fundraisers) using their email address.

# Answer
Welcome to SE! Unless I have misunderstood this is straight forward, this is very simple. If you got to **Find Contact** you can select the the contacts in the particular group (third box down) and that listing will include email addresses.
> 2 votes

# Answer
As said by Mick, you can find contacts in a group, this will list contacts and than you can export the records into csv with emails fields.

Another approach would be to use Contact Summary report to fetch contacts from a group and export them into csv or pdf
> 1 votes

---
Tags: email, groups
---


# Question
Title: Problem : Adding not existing contacts to organisations
When i open the sheet of organisation in civicrm then i want to add relationship with another contact civi propose only existing contact.

is there way to add new contact in this relationship using the same screen 'add relationship' without using "add new person" in navigation bar?

# Answer
You do get a option when selecting a contact on add relationship form, 'New individual', 'New Organization' etc. That should allow you to create new contact from the same form
> 3 votes

---
Tags: relationships
---


# Question
Title: Wordpress upgrade from 5.16.12 to 5.32.0 fails
Unfortunately my update/upgrade has failed.

I've done my best to follow the instructions on this page: https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/

Made it as far as the "Upgrade the database" instruction, by pointing my browser to the indicated url: http://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1

I gave it permission to proceed, and the progress bar began showing progress. Unfortunately when it hit 5.20 it stalled and sat there for a very long time.

It finally exited, incomplete. What was left on the system was not functional.

I've managed to back out and have reverted to the former system by re-naming my CiviCRM directory. I never deleted the original, as suggested in the instruction page. Rather, I renamed it civicrm.bak, in case something bad happened (and it did).

Where from here? My CiviCRM system status now indicates: Database Partially Upgraded Database check failed - the database looks to have been partially upgraded. You must reload the database with the backup and try the upgrade process again.

Were I to go through the same steps again, should I expect anything different? Or, will it merely repeat the problem?

Should I have tried to do this in a greater number of smaller increments?

Thank you.

Here is the most recent entry in the ConfigAndLog file. I've replaced our actual login id with "loginID":

```
Dec 28 12:45:02  [debug] $backTrace = #0 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(915): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(997): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#3 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#4 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", "DB_Error", TRUE)
#5 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1925): PEAR->__call("raiseError", (Array:7))
#6 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(935): DB_common->raiseError(-19, NULL, NULL, "SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", "1054 ** Unknown column 'a.api_entity' in 'field list'")
#7 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(405): DB_mysqli->mysqliRaiseError()
#8 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1231): DB_mysqli->simpleQuery("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#9 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#10 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#11 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(421): DB_DataObject->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#12 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1463): CRM_Core_DAO->query("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...", TRUE)
#13 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php(117): CRM_Core_DAO::executeQuery("SELECT `a`.`id` AS `id`, `a`.`form_values` AS `form_values`, `a`.`mapping_id`...")
#14 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(59): Civi\Api4\Query\Api4SelectQuery->run()
#15 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php(50): Civi\Api4\Generic\DAOGetAction->getObjects()
#16 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(68): Civi\Api4\Generic\DAOGetAction->_run(Object(Civi\Api4\Generic\Result))
#17 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Generic\DAOGetAction))
#18 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(231): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#19 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/SavedSearch.php(214): Civi\Api4\Generic\AbstractAction->execute()
#20 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(463): CRM_Contact_BAO_SavedSearch::getSearchParams("5")
#21 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3192): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
#22 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(3093): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), "civicrm_group_contact_cache_5fea43ce068b3", "contact_a", "IN")
#23 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(1820): CRM_Contact_BAO_Query->group((Array:5))
#24 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(2058): CRM_Contact_BAO_Query->whereClauseSingle((Array:5), FALSE)
#25 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(582): CRM_Contact_BAO_Query->whereClause(FALSE)
#26 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(529): CRM_Contact_BAO_Query->initialize(NULL)
#27 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(4610): CRM_Contact_BAO_Query->__construct((Array:1), (Array:1), (Array:131), TRUE, FALSE, 1, TRUE, TRUE, FALSE, NULL, "AND", NULL, 1)
#28 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(210): CRM_Contact_BAO_Query::apiQuery((Array:1), (Array:1), NULL, NULL, 0, 0, FALSE)
#29 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContactCache.php(192): CRM_Contact_BAO_GroupContactCache::add((Array:9))
#30 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(683): CRM_Contact_BAO_GroupContactCache::loadAll((Array:0), "Number optional-Limit the number of smart groups rebuild")
#31 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_group_rebuild((Array:2))
#32 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#33 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#34 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("job", "group_rebuild", (Array:2))
#35 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(133): civicrm_api("job", "group_rebuild", (Array:2))
#36 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(66): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#37 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(118): CRM_Core_JobManager->execute(FALSE)
#38 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
#39 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#40 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#41 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Job", "execute", (Array:2))
#42 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(122): civicrm_api("Job", "execute", (Array:2))
#43 /home/loginID/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli->callApi()
#44 {main}

```

# Answer
> 1 votes
When attempting an upgrade, always approach it in many smaller version increments, rather than one large leap. I wish that this guidance had been provided somewhere. It would have saved me a lot of grief.

# Answer
> 0 votes
I know this isn't helpful for the current issue but when upgrading I create a copy of the database and zip file of the CiviCRM files - both with the version number as part of the file name. That way I can do multiple upgrades in quick succession and step back to specific versions if one of them gets stuck.

---
Tags: wordpress, upgrade
---


# Question
Title: Do the localisation files change between releases, as a rule?
Do the files named .I10n (localisation files) change from (say) 4.6.4 to 4.6.5? Or do they only change with major updates, say 4.5 to 4.6?

# Answer
The l10n translation files (civicrm.mo files in the l10n directory, distributed in the civicrm-l10n-4.6.x.tar.gz files) *should* change between versions, however:

* The latest translation files always support the 3 last CiviCRM versions. So currently, civicrm-l10n-4.6.5.tar.gz can be used for CiviCRM 4.4.x, 4.5.x and 4.6.x. This was done a while back to avoid having version-specific translation spaces on Transifex.com, while still supporting older versions.
* Between minor versions of CiviCRM (4.6.4 to 4.6.5), there can be changes in the code that require us to send new strings to Transifex. For example, if someone fixed a typo in a string, added new strings, etc. We have not been doing that systematically for every release. While the process of pushing strings has become easier, it's still kind of messy, time consuming, because it requires validations to make sure we don't accidentally delete strings, or I find typos in new strings that need to be patched before we can update the strings, etc.
> 7 votes

# Answer
Use l10n update extension to keep them fresh https://github.com/cividesk/com.cividesk.l10n.update
> 0 votes

---
Tags: localisation
---


# Question
Title: Upgrade to version 5.37 - Database error
I have avoided upgrading for quite a while, but went ahead finally. Here is the error received below, and am completely unsure where to go to edit the field length. Or is the solution to rollback and re-install my backup and resolve it from there.

\[Error: Expand internal civicrm group title field to be 255 in length\]

Error Field Error Value

Type DB\_Error

Code -1

Message DB Error: unknown error

Mode 16

UserInfo ALTER TABLE civicrm\_group CHANGE `title` `title` varchar(255) DEFAULT NULL COMMENT 'Name of Group.' \[nativecode=1071 \** Specified key was too long; max key length is 767 bytes\]

DebugInfo ALTER TABLE civicrm\_group CHANGE `title` `title` varchar(255) DEFAULT NULL COMMENT 'Name of Group.' \[nativecode=1071 \** Specified key was too long; max key length is 767 bytes\]

Here is the screenshot:

# Answer
> 1 votes
Run below command before running the upgrade

```
ALTER TABLE civicrm_group ROW_FORMAT=DYNAMIC;

```

Include the below config in mysql config file

```
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true

```

---
Tags: database
---


# Question
Title: Is it save to delete old entries from the civirule_rule_log table
This table can become rather large (See the experience experts at https://lab.civicrm.org/extensions/civirules/-/issues/89). Can old entries be deleted without losing vital information?

# Answer
This table is used to prevent that cron triggers fire two times on the same day. So entries older than a day can be deleted.

The table is also a help debugging. For example, in the 'Manage CiviRules' form, they are used to show the latest contact a rule is triggered for. This information possible dissapears if you delete the older entries.

(But beware, in the Open Source world it is always possible that you have installed an extension that this table for important actions).
> 2 votes

---
Tags: civirules
---


# Question
Title: How can I automate printing address labels?
Is there an API call available which could automatically create address labels?

This could be very handy with CiviRules, to have an automatic API-action to create address labels overnight.

# Answer
> 1 votes
It depends what you mean by "API". If it's a script you're going to run overnight you could do something like this and put it in a file, let's say `labels.php`:

```
<?php
$form = new CRM_Contact_Form_Task_Label();
// Array of contact ids - could get this from wherever.
$form->_contactIds = array(2,3,4);
$params = array(
  'label_name' => 3475,
  'location_type_id' => NULL,
  'do_not_mail' => 1,
);
$form->postProcess($params);

```

Then run the script with `cv`, e.g. `cv scr --user=admin labels.php > output.pdf`

Or some variation of that. There's some trickiness to capturing the output within the script if you didn't want to redirect to a file - you'd either have to duplicate a lot of code or rely on something that is internally used for unit tests and could disappear.

---
Tags: api, civirules, address-labels, form-processor
---


# Question
Title: Can't get Pretty Workflow Messages to work
I'm trying to use Pretty Workflow Messages to prettify system messages, in particular the subscription messages.

I'm running CiviCRM 5.36.1 with PWM 1.2. I've created a special message template and selected this in the PWM settings but the subscription system message is still as plain as could be.

I've tried with just selecting other templates too, but no difference.

Using Joomla and Swedish, if that might make any difference...

# Answer
> 3 votes
Group subscription messages are not part of 'System Workflow Messages'. Hence it is not supported for them.

Here is the list of default CiviCRM 'System Workflow Messages'.

Hope this helps!

---
Tags: joomla, message-templates, system-workflow-messages
---


# Question
Title: How to inherit data from Organization to contact?
I want to inherit custom fields from an organization contact to an individual contact with a relationship. I'm asking if it's possible to do that or not.

# Answer
Welcome to SE. There is no inheritance of custom fields via relationships.

I'm not aware of an extension that does that but it would be possible to write one that copies fields from an org to an individual based on a relationship and keeps them updated if the org fields are changed.

Alternatively you might be able to achieve what you need with CiviRules
> 2 votes

---
Tags: relationships
---


# Question
Title: Webform "Not You?" message does not appear in secondary theme area
If I set up a webform and put it in the primary theme area, I can see the "Not You?" message on top of the screen. The same webform, in a secondary theme area (a sidebar), doesn't show the "Not You?" message. Is there any way to make that message show up?

Drupal 7.

# Answer
We just set that "Not You?" message using standard drupal message functions (in D7 and D8). A theme will typically display such messages in a separate region above the content region. What you can try is change the Region settings -\> i.e. change it from in your case Help -\> Secondary.

D8 example - using Olivero Theme: works well:
> 1 votes

# Answer
Just in case it's helpful to anyone else, my hacky workaround was to put a webform in the primary theme region as well as the secondary region. This webform in the primary region contains nothing but the existing contact and the Not you? option, which means it just shows a submit button and the Not you? option. Hide that button with Javascript and now you have a Not you? link that works for your secondary region webform too.
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: How to flag all contributors with a specific tag?
I am wondering if it is possible to flag all the contacts who ever made a contribution in the past with a specific tag.

When I search for the contributors and select all of them, no action is available to set a tag on them.

If this is not available through the GUI, a MySQL statement could be a solution.

# Answer
Yes you can tag contacts from the search. Find Contribution list all the contributions and its not possible in current system to tag contribution, so action option would be available from Find contribution to tag the results.

As said by Andy and Pete, you will need to Advance search to the the contacts based on the criteria and choose the 'Tag - Add to contact' action.
> 3 votes

# Answer
I'd answer this in a slightly different way, the question was tagging contributions and not contacts, my assumption is that there is a need to hold metadata against a contribution. We have a similar requirement in the UK for knowing if a specific contribution can have gift aid tax claims made against it or if the contribution already has been claimed etc.

So my answer, assuming this is the case, would be that you first need to add a custom field to the contributions to had the tag/indicator you wish to record about the contribution.

You could then follow two paths to mark them, one is using bulk profile update in a similar fashion to the previous answers. The second method would be to bulk export, tag and reimport. The choice depends on the number of contributions etc. There are relatively minor developments you could also do to make the process much easier - for instance using Rules to automatically mark/update the contributions with the relevant metadata.

Hope that makes sense!
> 1 votes

---
Tags: civicontribute, civicontact
---


# Question
Title: How do I use the javascript field in the price_sets table of the database
I have noticed that there is a field called 'javascript' in the 'price\_sets' table in the CiviCRM database.

The comments associated with this field are:
'Optional Javascript script function(s) included on the form with this price\_set. Can be used for conditional'.

However I cannot find any documentation on how I should do this in the correct way, and have never seen it mentioned when using price sets through the UI.

I would really like to use this functionality, to limit what people can enter into a form, e.g. for event registration.
I know that this is not a fail safe method, but could limit confusion or mistakes from users.

Does anyone have experience of using this database field to add javascript functions to? An example would be great!

# Answer
> 2 votes
I don't see any evidence that that field was ever used for anything. If you want to insert javascript into the page see https://docs.civicrm.org/dev/en/latest/framework/resources/#javascript which you can use as part of an extension: https://docs.civicrm.org/dev/en/latest/extensions/

---
Tags: price-sets, javascript
---


# Question
Title: When I go to the "Advanced Search" Screen, I don't see the tab Contributions
When I go to the "Advanced Search" Screen, I don't see the tab Contributions for searching on the fields related to donations.

Is this a bug or the consequence of having activated only the CiviContribute, CiviMail and CiviReport components? Should I activate another component? Which one?

# Answer
> 4 votes
You need to enable it in Display Preferences. Navigate to CiviCRM \>\> Administer \>\> Customize Data and Screens \>\> Display Preferences. Check the contribution option under 'Contact Search' field.

---
Tags: civicontribute, civicontact
---


# Question
Title: How can I remove the Billing Name and Address section from the donation form?
I would like to remove the `Billing Name and Address` section (which includes the fields First Name, Last Name, Street, City, Country, State, ZIP) from the donation page. What would be a good way to go about that?

The section shows when I am using a credit card payment processor (Stripe in my case).

I have tried commenting out the section from the smarty template `/civicrm/templates/CRM/Core/BillingBlock.tpl`. However, CiviCRM naturally still checks those fields upon form submission and gives an error that they are empty.

For background information, the reason for removing the section is that I noticed that the workflow of completing this section on a mobile device is extremely poor. It was difficult even for me to complete these fields on a mobile device - actually I quit trying after some effort. Additionally, our organization does not use this user data, so removing the section seems like a very good streamlining of the user experience without any disadvantage to the organization.

# Answer
> 3 votes
How are you collecting the payment? As far as I understand it, those fields are required by certain merchant account services. For instance, on our page if we do pay later or Paypal, those fields do not come up. But if you select credit card, which is run through Authorize.net, then those fields become available (and required). There's a checkbox to state that the information is the same as what was entered above.

# Answer
> 3 votes
\[UPDATE FOR 2021!\] - Different payment processors require different amounts of data. The older processors, like Authorize.net, required more. Newer processors require less.

Traditionally CiviCRM had a fixed set of required billing fields - see below. However, work has been done to allow payment processors to define an alternative set of billing fields. I know the Stripe processor does this but I don't know which others do.

This is the "traditional" hard-coded list of billing fields. It's in `CRM/Core/BAO/UFField.php` in the `assignAddressField()` function, it's called `$requiredBillingFields`. Note the lines directly above that let a payment processor define the alternate set.

* first name
* last name
* street address
* city
* state/province
* postal code
* country

Finally, if you include all of the required fields in your page's **top** profile(s), you'll get the "My Billing Address is the same as above" checkbox. The fields must be associated to the Billing address.

**Note:** Adding these fields to another profile (bottom) won't create the *My billing Address is the same as above* checkbox.

# Answer
> 3 votes
If you are using latest version of stripe extension there’s a option to disable billing block.

Go to Administer \>\> CiviContribute \>\> Stripe Settings

# Answer
> 2 votes
Have you looked in the Manage Contribution Page \> Profiles? This is where you control what displays there.

But some of that information maybe required to process the credit cards. I do not know what is the minimum required fields.

If you run into some of the address fields being required or you have to display one profile, you can edit the Billing Name and Address Profile under Administration \> Custom Data and Screens \> Profiles. Look for the Billing Address Profile and click Edit, then start disabling fields and test your donation page. You might be able to disable down to just the Postal Code.

# Answer
> 2 votes
You need to have:

* First name (required)
* Last name (required)
* Street address (associated to Billing address and required)
* City (associated to Billing address and required)
* Sate/province (associated to Billing address and required)
* Postal code (associated to Billing address and required)
* Country (associated to Billing address and required)

This will allow for the *"My Billing Address is the same as above"* to appear and checked

**Note:** You must add these fields to the top profile on your Contribution or Event page for it to work properly.

In addition, on the Fees page "Billing address required" must be unchecked (or the user will be required to add billing info twice).

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


# Question
Title: Add Donations to Event Registration Form
I'm trying to give people an option to add donations to special projects when they register for a particular event. We could just point folks to the contributions pages, but it would be more effective/convenient to just roll the donations into the event registration form.

Any advice on a strategy to accomplish this?

What I've tried so far:

* A developer friend suggested adding custom profile fields to the Register.tpl template and then saving the donation amounts to the custom fields using an ajax call. I've got that working.
* I'm not sure how to add my custom donation field values to the event amounts, which would be needed in order to actually charge people for their donations during the event confirmation and payment pages. (I've tried using the postProcess and buildForm hooks, but don't see how/where to change the "amounts" values.)

(CiviCRM 4.1.6; Drupal 6)

# Answer
Simply set up an additional line item for a donation in a Price Set.

This is how I do it... the Price Set definition:

And then how the 'Optional Donation' is defined:

And a preview of this in action:

Feel free to give it a whirl on my website - and make a donation if you like it! :-) http://www.breinton.com/book/hipp-abbate
> 7 votes

# Answer
There is a similar but slightly different approach that allows the user to enter any amount for a donation. It is mentioned in the documentation for a membership price set, but equally would work for events:
https://docs.civicrm.org/user/en/latest/membership/membership-price-sets/#non-membership-price-fields

Add a Price field to your price set with these options:

* Field Label: Choose a suitable name and include the currency symbol e.g. 'Donation £'
* Input field Type: 'Text / Numeric Quantity'
* Price: 1
* Financial Type: 'Donation'
* Display Amount?: Uncheck this option

One caveat of this approach is that a user could enter a negative number in this field to dishonestly receive a discount!

Although there is an extension that was created to prevent exactly this situation: https://civicrm.org/extensions/negative-negator

I actually really like approach of Lionel Smith-Gordon's answer, and I might decide to use it myself for simplicity, however I wanted to add this alternative here so people were aware of this approach.
> 1 votes

---
Tags: civievent, api, hooks
---


# Question
Title: What is a jailed shell and should I use one for my hosted site?
Say I am using a hosted site on Bluehost or a2 or another hosting platform which runs cPanel. I'm being required to use a 'jailed shell'. What is a jailed shell and should I use one? I found some documentation on jailed shells here - https://docs.cpanel.net/knowledge-base/accounts/virtfs-jailed-shell/

# Answer
> 1 votes
If you are using cPanel on a shared platform then you pretty much have no choice i.e. for you to access the server via SSH it will be a jailed shell account you'll be presented with.

This is because you won't actually have access to the OS libraries etc but just the section of the server where your hosting resides so you can run some basic commands etc.

If you were hosting your own server and installed a panel access platform like Plesk or cPanel then you would also have non jailed SSH access as you'd have access to all of the server and its installed components.

# Answer
> 1 votes
Using a jailed shell is really a footnote of your hosting provider's setup. "Jails" were a precursur technology to containers... probably not helpful, but it's true. Think of a jail as your own private filesystem. It is a key mechanism to keep users on a multi-tenant system from interfering with each other.

It is good to be aware of where your boundaries lie and if you are using such hosting, it means for hosting CiviCRM, that you may have to request changes to the OS environment. One example would be if you wanted to use wkhtmltopdf for rendering pdf's in CiviCRM.

---
Tags: sysadmin, system, system-settings
---


# Question
Title: How to set ckeditor text with javascript
Is it possible to set ckeditor text with javascript for a custom field?

I want to do something similar to the mail templates selection.

I try $('#custom\_162\_126').val('blub') but this only change the original field.

# Answer
> 2 votes
Use the CKEditor method `setData()`:

```
CKEDITOR.instances['custom_162_126'].setData('blub');

```

---
Tags: ckeditor, javascript
---


# Question
Title: Checksum and Shifting Expiration Windows
Where/when does CiviCRM calculate the expiration date of a checksum? Is the expiration date encoded in the checksum upon generation, or is the date of checksum creation encoded and then the creation date is compared to the default expiration setting?

This is relevant to the following scenarios:

1)a checksum is created with an expiration default of 30 days. Contacts are sent a checksum.
2a)The expiration default is altered from 30 days to 14. Will the previously created checksum still work between days 15-30?
2b)The expiration default is altered from 30 days to 60. Will the previously created checksum work between days 31-60?

# Answer
The checksum string is created when the token is processed, so everytime the checksum string is created it has the expiry date based on 'Checksum Lifespan' set in your systems under CiviCRM \>\> Administer \>\> System Settings \>\> MISC.

When validating the checksum is decoded to get the exipry date and checked against now().

Regarding your question

* 1 -\> Yes
* 2 -\> Yes(since the checksum has expiry date)
* 3 - No
> 1 votes

---
Tags: civimail, checksum
---


title: Drupal 8/9 Compilation Install Error

text:
# Question
Title: Drupal 8/9 Compilation Install Error
I'm getting thiis error, when I try to install civicrm on Drupal 8 and 9

The following packages have new compilation tasks:

* civicrm/composer-compile-lib has 1 task
* civicrm/civicrm-core has 1 task

Allow these packages to compile? (\[y\]es, \[a\]lways, \[n\]o, \[l\]ist, \[h\]elp) y Compiling additional files (For full details, use verbose "-v" mode.) Compile: Generate CCL wrapper functions Compile: Greenwich CSS (dist/bootstrap3.css)

> @php -r 'require\_once '''/home/bvivaccinate/public\_html/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('''../../bower\_components/select2/select2-bootstrap.css''', '''extern/select2/select2-bootstrap.scss''');' @php -r 'require\_once '''/home/bvivaccinate/public\_html/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS\["COMPOSER\_COMPILE\_TASK"\]);' Script @php -r 'require\_once '''/home/bvivaccinate/public\_html/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS\["COMPOSER\_COMPILE\_TASK"\]);' handling the shell-runner event returned with error code 255 Subcommand @composer compile returned with error code 255

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

\[RuntimeException\] Subcommand @composer compile returned with error code 255

These are the commands I ran to install it for drupal 9

php composer.phar create-project drupal/recommended-project

php composer.phar require pear/validate\_finance\_creditcard:dev-master

php composer.phar config extra.enable-patching true

php composer.phar require civicrm/civicrm-asset-plugin:'~1.1'

php composer.phar require civicrm/civicrm-{core,packages,drupal-8}:'~5.37.2'

Composer version 2.0.13 PHP 7.3.28

Can someone please assist

# Answer
In the meantime until this is fixed you can install this patch: https://patch-diff.githubusercontent.com/raw/civicrm/composer-compile-lib/pull/1.patch

Then run `composer compile`.

May also need to then run `composer civicrm:publish`.
> 1 votes

---
Tags: error, installation, css, install, composer
---


# Question
Title: How can I customize the user-access to Mailing lists?
Its not clear to me how I as an admin can control the access for different groups to their mailing lists. For example, the leader of group A should be restricted to mail to group A.

Is it possible to create some kind of mail-distributor (a mailing-adress to which I can send a mail and from which it is distributed to a mailing list).

kind regards

# Answer
You want to set ACLs that only allows those users to view those groups - and thus to add those groups to mailings.

There is no built-in mailing list functionality, i.e. you send an email to a specific address, it is distributed to a group, in CiviCRM.
> 1 votes

---
Tags: civimail, permissions, mailing, accessibility
---


# Question
Title: Upgrade from Drupal 7/ CiviCRM 4.6.38 to Drupal 9 / CiviCRM 5.37.2
Good morning ladies and gentlemen, I would like to upgrade my old installation of CiviCRM on an old system (Drupal 7, CiviCRM 4.6.38 ) to an up to date system like Drupal 9 / CiviCRM 5.37.2. Are there any suggestions how to do that including migration of all data? CSV export? Mysql-dump (which tables?). I am very open minded (Wordpress instead?) and experienced hacking the shit out of my system. Just looking for a best practice solution. Thanks for your help, Robert

# Answer
> 2 votes
If you have a very simple d7 front end with minimum common modules than it won't be difficult to upgrade from d7 \>\> d8 \>\> d9.

To Upgrade Civi i would do incremental upgrade i.e

* 4.6 \> 4.7(latest)
* 4.7 \> 5.8(latest)
* 5.8 \> 5.22(latest)
* 5.22 \> 5.37(latest)

Would upgrade Civi first than drupal.

---
Tags: drupal, upgrade, export
---


# Question
Title: Corrupt installation during upgrade to 5.37.2 on Joomla 3.9.26
I have run into some trouble trying to upgrade from and old version of Civi to version 5.37.2 on Joomla 3.9.26 running on PHP 7.3.27 and MySql 5.7.32-35.

The initial problem was that I could not get the upgrade file running. I manually deleted the folder administrator/components/com\_civicrm/civicrm and I extracted the administrator/components/com\_civicrm/civicrm.zip file. This created a new administrator/components/com\_civicrm/civicrm folder.

I then rerun the Upgrade Database with https://domainname.com/administrator/index.php?option=com\_civicrm&task=civicrm/upgrade&reset=1

and this time I was able to start the upgrade process.

Unfortunately in the middle of the upgrade I got the following error:

\[Error: Update smart groups to rename filters on case\_from and case\_to to case\_start\_date and case\_end\_date\]

CiviCRM\_API3\_Exception: "DB Error: no such field"

I have to specify, that at this point I was still able to access the Civi Admin interface on the website and I was also able to see all my Campaigns and Event Records, etc.

In trying to trouble shoot this issue, I landed on this post What can I do to fix my database that has been partially upgraded?. I was able to discover in the civicrm\_domain table that the upgrade had stopped at 5.20.alpha1.upgrade.

I then proceeded to manually process all the updates in the Incremental/sql folder, which I was able to process successfully.

However when I now try to access the Civi Administrator backend, I am no longer able to as I get the following error:

DB Error: no such field

And when I look at the Log I get the following:

```
May 16 11:47:37  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`title` AS `title`, `a`.`help_pre` AS `help_pre`, `a`.`help_post` AS `help_post`, `a`.`extends` AS `extends`, `a`.`icon` AS `icon`
FROM civicrm_custom_group a
WHERE (`a`.`is_multiple` = "1") AND (`a`.`is_active` = "1")
 [nativecode=1054 ** Unknown column 'a.icon' in 'field list']
    [type] => DB_Error
    [user_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`title` AS `title`, `a`.`help_pre` AS `help_pre`, `a`.`help_post` AS `help_post`, `a`.`extends` AS `extends`, `a`.`icon` AS `icon`
FROM civicrm_custom_group a
WHERE (`a`.`is_multiple` = "1") AND (`a`.`is_active` = "1")
 [nativecode=1054 ** Unknown column 'a.icon' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`title` AS `title`, `a`.`help_pre` AS `help_pre`, `a`.`help_post` AS `help_post`, `a`.`extends` AS `extends`, `a`.`icon` AS `icon`
FROM civicrm_custom_group a
WHERE (`a`.`is_multiple` = "1") AND (`a`.`is_active` = "1")
 [nativecode=1054 ** Unknown column 'a.icon' in 'field list']"]
)

```

If you need the full log, let me know and I can send it.

I see from your original message that you also recommend running the php functions. As I have not done this, I am wondering first if I can assume that anything up to 5.20 (FiveTwenty.php) as already been run through the original upgrade process and secondly how do I actually run these php files? Can I just call them manually, one at a time, from the backend like this?

https://mydomain.com/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveTwenty.php https://mydomain.com/administrator/components/com\_civicrm/civicrm/CRM/Upgrade/Incremental/php/FiveTwentyOne.php etc.

You also say, "Once you have done all the things the upgrade script would have done to get to the next point version you can alter the value in civicrm\_domain.version to the next point version & remove the upgrade & then start the script running again".

I have now already adjusted the version number in civicrm\_domain table to 5.37.alpha1.upgrade. Can you please explain how do I remove the upgrade and when you say start the script again, do you mean doing

https://domainname.com/administrator/index.php?option=com\_civicrm&task=civicrm/upgrade&reset=1

If I try running the above now, I get the following:

Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again.

I would really appreciate your help getting this site back up and running.

Thank you in advance for all your help.

Regards, Adri

# Answer
Here's a few pointers that might help:

* Make sure you have a database backup before doing any manual fiddling!
* For each version change both the relevant sql and php changes under `CRM/Upgrade/Incremental` must be applied. The sql files are applied by the 'runSql' task in php.
* `.upgrade` on the version string means it has started the upgrades for that version but not finished.
* The automatic upgrader aborts if it finds a `.upgrade` version when it starts.
* You need to figure out which steps have been done - the log file should record steps but also manually check the database and see what has been applied.
* Once you know what steps have not been done, you need to do those manually. You will probably hit some difficulties here - if it 'just worked' the automatic upgrade would not have failed in the first place.
* When you have completed those upgrade steps, update the version string in the `civicrm_domain` table to remove `.upgrade` \- keep the rest of the version string the same.
* Run the automatic upgrader again and hopefully it continues on applying the remaining upgrades from 5.20.alpha1 to 5.37.2

If I understand correctly what you have done, then

1. You have applied `sql/5.20.alpha1.mysql.tpl`
2. You also need to apply the changes in `php/FiveTwenty.php` (check what if anything has already been applied)
3. You have changed the version string to `5.37.alpha1.upgrade` but you should change it to `5.20.alpha1` after you have completed the previous steps.

The 'No such field' error is to be expected since your code base has been updated to 5.37.2 but the icon field on the `civicrm_custom` table was added in 5.28 and the upgrades for that have not been run yet.
> 0 votes

---
Tags: joomla, upgrade, error, database, installation
---


# Question
Title: CKEditor in Civicrm - Is it possible to have a custom css file?
7 In Civicrm 4.7+ there's a great interface for customising CKEditor, and it allows you to add custom styles to the editor. That's great!

But we would very much like to go further and call a whole new custom css file for CKEditor. Much like you can in Drupal's CKEditor. We use in Civi we use CDEditor for event descriptions and much much more, and we'd like to make the CKEditor interface the same as for our Drupal web pages.

Is this already possible? And if not, any ideas about how to make it possible? Thanks for your help!

Civicrm 5.10.3, Drupal 7 latest.

# Answer
If you use the great CKEDITOR editor to configure what you can there, then save, you can then edit the file in (typically, for a D7 implementation): `sites/default/files/civicrm/persist/crm-ckeditor-default.js`

e.g.

```
CKEDITOR.editorConfig = function( config ) {
  config.allowedContent = true;

  // Added these lines: ↓
  if (typeof config.contentsCss === 'string') {
    config.contentsCss = [config.contentsCss];
  }
  config.contentsCss.push("/sites/all/themes/your-theme/css/ckeditor.css");
  console.log("I hacked CKEDITOR's CSS :-)", config.contentsCss);
  // ↑ you don't need that console.log, but it's handy to prove it's working.
};

```

However, do note as it says at the top of that file, *Note: This file will be overwritten if settings are modified*
> 2 votes

---
Tags: civievent, ckeditor
---


# Question
Title: Contribution Confirmation Page Issue in Joomla after upgrade
Friends

I have upgraded a few Joomla sites to the new 5.37.2 version. Now on all sites, the contribution confirm page does not work. Irrespective 'Go Back' or 'Confirm Contribution' is clicked; you are immediately redirected to the home page. When I disable / deselect this confirmation page in the setup, the contribution gets recorded with no issue.

Thanks :) Sri

# Answer
> 2 votes
After a long search and resetting paths and clearing cache and checking the .setting files 100s of times the issue was not with the site URL vs the .setting URLS being different aliases as pointed by many of the answers found; it was a damn malware!! 3 sites with the same phishing link in the defines.php in the includes folder. Who would have guessed that. Ths submissions were attempted to be redirected and civi pushes it back to the home page.

As always curse the virus and malware creators!!

---
Tags: contribution-page
---


title: CiviCRM in a NEOS website

text:
# Question
Title: CiviCRM in a NEOS website
Hi I have a Website with NEOS CMS. is it possible to implement CiviCRM Events, Payments etc. in that Website?

# Answer
> 2 votes
I take it you have already read that CiviCRM is designed to work with only the following 4 CMS: Drupal, WordPress, Joomla and Backdrop.

Therefore I assume you are asking a question more along the lines of 'how can I embed a form for event registrations on a standalone CMS?'

There are tools (RemoteForm, CMRF) that allow for this but they still all require CiviCRM to be set up with D, WP, J or B but will then capture the data from a from on an external website. Suggest you read

How can I connect my website to CiviCRM on a remote server?

https://civicrm.org/blog/jamie/display-civicrm-forms-on-any-web-site-anywhere

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


title: Can't load custom template

text:
# Question
Title: Can't load custom template
We need to customise a template called 'Selector.tpl', we have identify this template with debugging on and copied it into `/wp-content/uploads/civicrm/templates/` and this directory is declared in Directories. We followed the documentation and it should work fine when it doesn't. The template is not loaded. We've tried on the original file that gets modify in the desired way but we want to use the custom one. Folder has 755 rights on and File has 644 on. Is there something special to care about?

# Answer
> 3 votes
The Selector.tpl is placed wrong hence its not invoked. It should follow exact path of CiviCRM core module

For example if the Selector.tpl in Core is placed under `plugins/civicrm/civicrm/templates/CRM/Contact/Form/Selector.tpl` than in template over-ride it should be `/home/domain/testwpcivi/wp-content/uploads/civicrm/templates/CRM/Contact/Form/Selector.tpl`

Once you have tpl placed under correct directory path clear civicrm cache

---
Tags: custom-templates
---


title: Update multiple contacts failing

text:
# Question
Title: Update multiple contacts failing
Using the 'Update multiple contacts' action and a profile we get failures on large batches. The profile has 13 fields with 6 of them required by the profile.

If the update is run on one batch of 100 contacts, it fails complaining about multiple fields "... is a required field" despite a value being present. All the failing records are at the end of the batch.

If the same update is run as 2 batches of 50 contacts, it works as expected.

# Answer
> 2 votes
The problem was caused by the `max_input_vars` php setting being too low. The effect of this is that `$_POST` is truncated and therefore the form was failing the required field validations since the data was not actually reaching the form.

Raising `max_input_vars` from 1000 to 2000 in php.ini resolved the problem.

However, if the profile does not have validation rules the form is processed with the truncated data resulting in data loss (depending on the field type).

---
Tags: contacts, upgrade, batches
---


title: Events Calendar to display on front end

text:
# Question
Title: Events Calendar to display on front end
I have a joomla built website I have installed civicrm into. I would like to display an events calendar (not just the events list) on the front end. I have tried installing the available extensions that civicrm list, but those only appear to be for the back end of the civicrm component. Is there something that can be integrated with the events portion of civicrm and display in calendar format on the front end?

(Ed) I have tried these that can be found in the available extensions list: com.agiliway.civicalendar com.osseed.eventcalendar Both are only for the back end.

# Answer
com.osseed.eventcalendar can be used to display a calendar in the frontend of your Joomla-site by following the instructions in the readme.txt of the extension.

1. Copy the folder "yourextensiondirectory/com.osseed.eventcalendar/joomla/EventCalendar" to "joomlarootdirectory/components/com\_civicrm/views/" which will add the menu item type for Event Calendar.
2. For frontend display you need to add a menu item of the type "Event calendar" and provide the calendar id (if you have multiple calendars). If you pass an empty ID it will display the global calendar for frontend.
> 2 votes

---
Tags: civievent, joomla, calendar
---


# Question
Title: Is it possible to record a copy of sent system workflow message emails as activities?
Is there a way to do this, or an extension that offers it?

We want to be able to see what was sent to people when one of these was used.

# Answer
We built this extension to help with this scenario: https://github.com/fuzionnz/nz.co.fuzion.transactional

> This extension adds bounce handling and click tracking, and creates activities for CiviCRM's transactional emails (i.e event registrations, contribution receipts, invoices, scheduled reminders, and so on).

> Out of the box, CiviCRM only does the things mentioned above when sending via CiviMail. This extension adds that functionality to all mail sent from CiviCRM.
> 4 votes

---
Tags: email, system-workflow-messages
---


# Question
Title: Add new column to table in field 'selector.tpl'?
The purpose is to modify the template by adding new columns.As you can see in screenshot CIVICRM propose Nom "name", courriel "email",Telephone "phone", Action . So i want to add column "Job" before column Action.

I've tried to replace this code in field 'selector.tpl'

by this one

# Answer
> 4 votes
You can create a profile with the fields you want to display as a column and set the 'Default Contact Search Profile' in Search Preferences (CiviCRM \>\> Administer \>\> Customize Data and Screens \>\> Search Preferences.

# Answer
> 2 votes
Is this for search results? Instead you could try turning on the built-in extension "Search Kit" and it lets you add columns.

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


title: Insert svg file into mosaico mailing

text:
# Question
Title: Insert svg file into mosaico mailing
When I try uploading a svg file into a mosaico mailing, I get a message that this file type is not allowed.

Is there a way to change settings, that allows inserting svg files, and maybe other file types?

# Answer
"Safe File Extensions" can be configured under "/civicrm/admin/options/safe\_file\_extension?reset=1" - you could probably add .svg there.

This should allow you to upload sch files in CiviCRM. I am however not sure if that configuration also applies to Mosaico and if Mosaico can handle svg-Images.
> 0 votes

---
Tags: mosaico
---


# Question
Title: Unsubscribe confirmation email fails when using Exchange as the mail server
If a CiviCRM site is using MS Exchange to handle email, a user attempting to unsubscribe gets an error like:

*Mailing Error Failed to send data \[SMTP: Invalid response code received from SMTP server while sending email. This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM \>\> Global Settings \>\> Outbound Email (SMTP). (code: 554, response: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:89230000,*

# Answer
> 2 votes
I discovered this was because CiviCRM attempts to send the email from do-not-reply@ and the account used to send the email did not have the rights to send on behalf of that email address. You cure it by creating a shared mailbox called do-no-reply@ and give the outbound email account rights to send email from that mailbox.

---
Tags: email, unsubscribe
---


# Question
Title: Stripe card number field not showing since upgrade to 6.6
The block to enter credit card info is not showing up on my registration form so when submitted it does not go to Stripe...

Civi 5.36.1 Drupal 7.80

# Answer
I removed the "US" country code from the Stripe settings and the credit card block appeared. Not sure why but at least I have a working registration form.
> 2 votes

---
Tags: payment-processor, stripe
---


# Question
Title: CiviCRM does not have permission to write temp files - halts the system
My website stopped working due to a CiviCRM problem, all I see is: "CiviCRM does not have permission to write temp files in ...wp/wp-content/uploads/civicrm/templates\_c/en\_US/,exiting"

My hosting service may have recently updated to php 7.4. Seeing old solutions to this problem, I deleted all the folders in wp/wp-content/uploads/civicrm/templates\_c/en\_US/ but left .htaccess unchanged. That did not solve the problem. Should I delete everything in .../uploads/civicrm/templates\_c/ Has anybody had this problem and fixed it?

# Answer
Thank you. Deleting everything as suggested worked. Problem solved.
> 3 votes

---
Tags: wordpress, permissions
---


# Question
Title: Give anonymous users access to a report's contents?
I want to make a CiviReport accessible to anonymous users. I can set the report's "Access" to allow anonymous users, but I want them to see the results of the page without giving them the permission to view any data except what's on the report.

This is how Views works, and Webform-CiviCRM and Caldera Forms allow you to explicitly override contact viewing permissions for selecting anonymous contacts. Short of overriding a function in the report template, is there a way of making a report's contents available to anonymous viewers?

# Answer
How about creating an ACL(View only) on a group and restricting the report based on custom permission?

Isn't creating a view or report using dataprocessor not an option?
> 1 votes

---
Tags: civireport, permissions
---


title: Unable to create membership

text:
# Question
Title: Unable to create membership
Our system has 26 different membership type, for 3 different member organization. Since 5.35 Civi upgrade sometimes we are unable to create/update membership from New/Edit backend membership form. We encountered following errors(without priceset)

1. Please select a membership type (even though membership type is selected).
2. Unable to add membership for the contact.
3. Membership field is not updated(like source, join date, custom fields etc) but status message says saved successfully.
4. Upon submitting new membership says saved successfully but no membership is created.

There are so many scenarios where it fails to create and update membership. However it does work i.e save/update sometimes for some membership types but not for all.

Couldn't replicate the error on dmaster.demo.civicrm.org, may be because we are on older version of Civi? Is this already fixed in latest version of Civi, if so how difficult is it to port the changes to 5.35.2(we don't want to update Civi unless we do thorough testing)?

Any pointers or help really appreciated.

Thanks in advance

Abhi

# Answer
Did you recently merge Organization contact which was related to membership type? If yes than its a known error in CiviCRM. I always prefer to retain the contact linked to membership type or settings. Or another option to avoid this in future we have installed an extension on most of our client site.

Solution to fix the problem? Run below query to fix the price set data.

```
SELECT cpf.id, cpf.name, cmt.member_of_contact_id,  cpfv.membership_type_id
FROM civicrm_price_field cpf
  INNER JOIN civicrm_price_field_value cpfv
    ON cpfv.price_field_id = cpf.id
  INNER JOIN civicrm_price_set cps
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id;

```

-- Incase above query returned results with cpf.name \<\> cmt.member\_of\_contact\_id than run below query.

```
UPDATE civicrm_price_field cpf
  INNER JOIN civicrm_price_field_value cpfv
    ON cpfv.price_field_id = cpf.id
  INNER JOIN civicrm_price_set cps
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id
SET cpf.name = cmt.member_of_contact_id;

```

HTH

Pradeep
> 3 votes

---
Tags: civimember
---


title: Updating CiviCRM Module in Drupal 7

text:
# Question
Title: Updating CiviCRM Module in Drupal 7
Here is what happened...

I was doing an update to CiviCRM (through the recommended process) from .10 to .15.

After I copied the files over, I was getting a 500.

So I checked the log and I was getting an error message:

Notice: Constant CIVICRM\_MEMCACHE\_PREFIX already defined in include\_once() (line 310 of /home3/isrcus/public\_html/sites/default/civicrm.settings.php).

and the next one:

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; backup\_file has a deprecated constructor in require\_once() (line 279 of /home3/isrcus/public\_html/sites/all/modules/backup\_migrate/backup\_migrate.module).

Why am I getting those error messages?

Thanks! Kevin

# Answer
> 1 votes
Check what settings you have for `CIVICRM_MEMCACHE_PREFIX` in your civicrm.settings.php file. You can't define a constant more than once. Maybe copy/paste the relevant sections into your question. Don't include the whole file.

The 'Deprecated function' relates to the Drupal backup\_migrate module - nothing to to do with CiviCRM. Have you just changed php version? That message relates to a changes introduced in php 7 Make sure your Drupal modules are updated.

---
Tags: drupal, drupal-7
---


# Question
Title: Bounce processing using oath-client with GSuite: Required parameter not passed: "refresh_token"
Using CiviCRM 5.37.2.

I'm trying to use the oath-client extension to do OAuth authentication of a Google Workspace (GSuite) account for bounce processing. The credentials are created on the Google side of things, and when I set up the Mail Account in CiviCRM and assign it to bounce processing, it works; "Save and Test" responds positively. And if I then go to the Scheduled Jobs and immediately execute the Bounces Fetcher job, it completes successfully.

However, after a little while, it fails to run, with this error:

```
Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Bounces fetcher with result: Failure, Error message: Could not connect to MailStore for [the email address used for bounce processing]
Error message:

Required parameter not passed: "refresh_token"

```

Is this a problem with the oauth-client extension, or have I mis-set a setting somewhere in CiviCRM?

# Answer
> 3 votes
It's a known issue with using google + civi oauth. See https://lab.civicrm.org/dev/core/-/issues/2184

---
Tags: civimail, google, oauth, bounce-processing
---


# Question
Title: Webform Civicrm Custom Fields across Multiple Contacts not working in Drupal 7 and Drupal 8
I created a custom fieldset in CiviCRM, with the following field types,

* File Field
* Two Date Fields
* Two Country Fields

With a "Tab with table" style

A webform with CiviCRM Integration and multiple contacts were created and the custom fields on contact 2, contact 3, etc were enabled.

I created a webform submission. The custom fields on contact 2,3+ aren't added to CiviCRM, only on Contact 1. Please help, I have a very important system that I'm working on for an immigration assistance NPO, and would appreciate help on what might be causing this

Thanks

# Answer
> 1 votes
Re -\> Tab with Table style are these Multi value custom fields? We recently fixed a bug re: such custom fields in WFC D8/D9 and backported it to D7. What versions are you using? Are you able to clone from git or pull in a patch?

PS Multi value custom fields do complicate things (like eg reporting) so it may be a better option to create a regular Custom data set with the fields you need in it.

For sure non-Multi value custom fields across multiple contacts are working well - we're collecting custom fields data for up to 5 Contacts in e.g. a Family Registration form (up to 2 Adults + up to 3 Kids) - we did this in D7 -\> and now on D8 (this project just upgraded).

---
Tags: drupal, webform-civicrm, drupal-8, drupal-7
---


# Question
Title: How to modify Relationships column display?
This is a new launch for an old question, see here and here.

We want to modify the columns that are shown in the relationships result display and especially replace city and state/county rows by job title.

Is this something we can now set in admin or do we need to create custom templates? We identified /CRM/Contact/Page/View/RelationshipSelector.tpl for example and are still looking for the body template.

Should we follow on this way?

# Answer
Take a look at Coleman's searchkit & formbuilder video to see how to create a relationships display.
> 5 votes

---
Tags: relationships, display
---


title: What browser does Mosaico work in?

text:
# Question
Title: What browser does Mosaico work in?
Currently on:

* CiviCRM - 5.3.1
* Mosaico - 2.0-beta3.1512698300
* CiviCRM Bootstrap theme - 0.1-alpha14
* Flexmailer - 0.2-alpha5

In Firefox 'Quantum' - when hitting Continue on a mailing created this morning civicrm/a#/mailing/59 (with another browser) -\> it's stuck "Loading" (see top right) when I hit Edit on the Mosaico Mailing

# Answer
> 1 votes
In Chrome -\> all is well: for the exact same url: civicrm/a#/mailing/59 - I get passed the "Loading" -\> to a fully loaded Mosaico screen:

# Answer
> 3 votes
The current version produces a "Update your browser!" message - which is not helpful since I already have the latest, and that is not the problem.

Mosaico itself (not just the CiviCRM integration) is picky about the plugins you have installed in your browser.

See https://github.com/voidlabs/mosaico/issues/383#issuecomment-428911320 and https://github.com/voidlabs/mosaico/issues/312#issuecomment-295278878

> You have the RightToClick extension installed and this extension manipulates HTML content. Doing so it would break the email template generation. That's why we give that alert.
>
> Any extension that alters html for every iframe in the page is an incompatible extension: AFAIK apart RTC extension, the only other extensions doing that are spam stuff.

So paraphrasing, if they don't like the look of your plugins you are blocked.

Go through your plugins and disable them until you find which one is causing the problem.

In my case, it was the Google Analytics Opt-out Add-on - disable that and it passes the compatibility test.

# Answer
> 0 votes
I had this issue emerge recently with Safari 14.1. Based on the above advice, the fix was to disable the Wayback Machine extension I had recently installed in Safari.

---
Tags: civimail, mosaico
---


# Question
Title: How to solve uncaptured payment "Stripe Payments with Caldera Forms"
my problem is when I pay a contribution using Stripe and Caldera forms, i receive in Stripe account the payment is not captured.

I have tried paying the contribution directly without using the caldera forms and it works.

Someone had the same problem ?

# Answer
The problem is solved by using cf-civicrm developer version from github rather than the version proposed by Wordpress. To understand more you can see this Post : https://github.com/mecachisenros/cf-civicrm/issues/185
> 1 votes

---
Tags: stripe, payment, caldera-forms
---