# Question
Title: Is there a more elegant way to handling contribution pages that have ended?
When a contribution page passes its end date, you get the following error:

Is there a way to let the contribution page load, but display something like what is displayed on events?

Ideally it would say something like.

* This page is no longer accepting contributions.
* This contribution page has ended.
* Contributions are no longer being accepted on this page.

In the meantime, we are simply redirecting the pages.

# Answer
> 2 votes
This module might be what you need

> The extension allows a default contribution page to be configured (by domain), and blocks disabling or deleting of this page. Browsers accessing a disabled contribution page are redirected to the default page.

or, now i reread your post :-), could be a good place to add a new feature since i think you are saying 'my pages are not disabled, they are just past their use-by-date'

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


# Question
Title: Random Occurrences of Blank Contribution Thank You Pages
This is strange. Some donors are donating successfully but getting a blank thank you page. They get an email confirming their donation, but nothing on screen. D7 CiviCRM 5.31, Omnipay Cybersource

I can't seem to find any issues in the log either.

The URL at the blank screen is `/civicrm/payment/ipn/1`

When it works correctly, the thank you screen has a url of `civicrm/contribute/transact?_qf_ThankYou_display=1&qfKey=**********************`

Any ideas?

# Answer
> 2 votes
This issue is related to Drupal 7 (possibly wordpress), PHP prior to 7.3 and Chrome 80+

To fix, upgrade to PHP 7.3 and add the following text somewhere in your drupal 7 settings.php file.

```
ini_set('session.cookie_secure', 1);
ini_set('session.cookie_samesite', 'None');

```

or you can style it like we did so you remember why you added this.

```
/**
 * Fix for Chrome Cookies Issue - See:
 * https://www.zoocha.com/news/how-fix-chrome-80-cookies-issue-drupal &
 * https://lab.civicrm.org/dev/core/-/issues/2059
*/
ini_set('session.cookie_secure', 1);
ini_set('session.cookie_samesite', 'None');

```

Clear CiviCRM and Drupal caches. Clear browser cookies and cache.

(Unfortunately for your returning users, unless you have them clear their browser cache/cookies, they might experience the blank screen again.)

If you do not want to upgrade to PHP7.3 the zoocha article explains how to fix in previous versions.

---
Tags: civicontribute
---


# Question
Title: Can "Contributions - Recurring Billing Updates" and similar messages be turned off?
We'd like to turn off Contributions - Recurring Cancellation Notification, Contributions - Recurring Billing Updates, and Contributions - Recurring Start and End Notification. We don't want the messages to be sent.

Generally, we update people's billing information from the backend. In this case, we don't want to send confirmation messages automatically. Sometimes we have to cancel a recurring donation and create it again to get the right financial type, etc. and in that case we definitely don't want email notifications going to donors!

Is there any way to entirely disable all these notifications?

# Answer
> 1 votes
This is untested but in hook\_civicrm\_alterMailParams you can check `$params['messageTemplateID']` and if it's one you care about set `$params['abortMailSend'] = TRUE`.

---
Tags: civicontribute, recurring-contributions, system-workflow-messages
---


title: Display thank you message in QuickForm

text:
# Question
Title: Display thank you message in QuickForm
I'm writing an extension with a quickform form. It takes `_GET` parameters to set itself up. I've done this in buildQuickForm (not sure when I'd choose to use preProcess instead?)

I've got the quickform to display and to be processed ok, but once it's processed ok I'd just like to display a "ta very much, love" message to confirm it's all finished.

I'm using `CRM_Core_Session::setStatus()` to display the message.

The problem is that after processing it seems to issue an HTTP redirect to which then goes back to the build phase, which then gives errors because there's no `_GET` data this time.

I've tried (to no avail)

* using `$this->set('isCompleted', TRUE)` in the `postProcess()` function and then checking for that using `$this->get('isCompleted')` in the `buildQuickForm()` function, but it get unset.
* using `CRM_Core_Session::pushUserContext('civicrm/myform?isCompleted=1')` thinking that this might cause a redirect to that URL. It doesn't.
* setting a property on the form in post, but it's not there when the form is re-fetched.
* using `CRM_Utils_System::redirect()` to redirect to `civicrm/myform/?isCompleted=1`, which does redirect, but not until the build has re-run and generated errors on the session.

# Answer
The way I've done this is:

1. in preProcess, `if (!empty($_GET['reset'])) {` then inspect GET for the initialisation data, and if it's valid, store it using `$this->set('key', $validData)`. I've also set some object properties in this stage, but these will only be around for one request, including a `showForm` one. I have called `setMessage()` with any initiation data validation errors.
2. in `buildQuickForm`, I've reduced this to adding just the form elements I need to display. (I was previously using hidden elements to store the authorised/parsed initiation data.) I also `$this->assign('showForm', $this->_showForm);`
3. in my `.tpl` file I wrap the whole thing in `{if $showForm}`.
4. in `postProcess` I fetch data using `$this->get('contactID');` and user submitted form values from `$this->exportValues()`. I process that and use `setStatus`. I then set `$this->_showForm = FALSE` (might not be necessary) and do a redirect to the same path but without any query data.
5. on the redirect, without any GET data, my default FALSE `showForm` variable is not changed, and the form does not display, except for the `setMessage` messages.

Phew.

I'm not sure this is the right way. But it seems to work. Other answers very welcome!
> 1 votes

---
Tags: quickform
---


# Question
Title: Selecting location type or multiple email/phone fields in Reports
Is it possible to select a location type for default contact reports, or is it just hard-coded to use the Primary address/email/phone? Also, would it be possible to list a report with multiple email addresses or phone numbers (e.g. a column for Home, Work, etc.)?

# Answer
Old question but for a CiviCRM only solution, I found that Extended Report has a Report `Extended Report - Flexible contact report` that does an aggregation of all the phone numbers.

As of version 5.8, you have to use the following PR to make it work : https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport/pull/461

To use this method :

1. install Extended Report and patch with the PR
2. in Reports -\> All Reports, create a `New Report` and choose `Extended Report - Flexible contact report`
3. choose the column `Phone`

You should have something like that in the phone column for each contact :
> 4 votes

# Answer
Can't comment on CiviReports, but I know my way around Drupal Views enough to suggest that as an alternative option since it allows you to specify for each field/column which Location Type to use for the phone, email etc

And to ensure you only see a single row for John even if he has multiple Work Phones it looks like there are two approaches.

Views Merge Rows module (not tried it) or

Views Field View which requires you to create a separate View display for each phone type/location and then insert that as a column, so eg for Home Phone it would give you a list of all the person's home phone in the one cell - but that adds a fair bit of work if you have to do it for many variations of phone/email v home/work etc, ie one view display per combination so the first option might be the better one to try
> 3 votes

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


title: Import bulk email addresses

text:
# Question
Title: Import bulk email addresses
I have 700 email addresses in an Excel doc. How can I import them en masse to a single smart folder for a one-off mailing?

# Answer
When you import you can specify 'add to group' or 'add to new group' on the final step of the import wizard

It doesn't make sense to me why this should be a 'smart group' per your OP ah but you said 'smart folder'. shrug. hope my answer helps :-)
> 1 votes

---
Tags: civimail
---


# Question
Title: How to import to multi-record set custom fields
I am trying to import records to a custom multi-record set of fields. I read somewhere that it was a new feature for 4.5.8 but now for the life of me I cannot find where I read it - pretty sure it was the release notes, but may have got the version wrong.

Would appreciate a pointer in the right direction. (we are currently on 4.6.4)

Many thanks

# Answer
> 5 votes
Steps:

1. Contacts \> Import Contacts
2. Click the help ? at the end of: "The Import Wizard.... them here."
3. Click the link on here at the end of: "If you need to import Multi-value Custom Data for contacts.... from here: /civicrm/import/custom?reset=1 .

You should see the multi-record field to import

# Answer
> 1 votes
You can import multi-value custom fields through the API, including the API CSV Import GUI. You use the `CustomValue` API; you can also use the command-line CSV import tool or even `drush`.

Your contact ID field should be imported as `entity_id`. If the custom field ID is "4", then import to `custom_4`.

As an example - if your field set is called "schools attended", with custom fields "school" (custom field ID 7) and "degree" (custom field ID 8) for a contact with an ID of 123, your data may look like this:

```
entity_id | custom_7                 | custom_8
123       | University of Wisconsin  | BA
123       | Rutgers University       | MA

```

# Answer
> 1 votes
If you have complicated import needs - for instance, you need to import multi-value custom fields as part of a larger import - you may want to consider the "Advanced Import-Form Processor" approach.

I really need to write docs up, but in general:

* Install Form Processor.
* Create a new form processor instance. Each "input" should correspond to a column in your source data.
* When creating your actions, the "Update Individual" action won't import multi-value custom fields - but the "Contact: Update Custom Data" action will.
* Test it out using the "Try Out" functionality to ensure it works as expected. Now the magic bit - how to use this as an import instead of for form submissions?
* Install Advanced Import.
* Install Advanced Import Form Processor.

Advanced Import gives you an import UI; Advanced Import Form Processor lets you use a Form Processor instance to process each line in your file. Advanced Import has some limitations (e.g. it doesn't handle large files well) and Form Processor is relatively slow - but you can create pretty much any import you need without coding by using these three extensions together. *And* it has an end-user focused UI. Much like Views or Webform, an admin can create something complex, but the end result is usable by end users.

Below is a screenshot of a Form Processor instance I created. I was given a list of students with their schools and related information. I was able to:

* Create students if they didn't exist, or use existing contacts if they did (XCM integrates with Form Processor for very fine-grained duplicate matching).
* Create the school if necessary.
* Create a "Student/School" relationship that filled in relationship custom fields "Major" and "Degree". Note that you can import relationships with standard import, but can NOT import to relationship custom fields.
* Imported alumni information, which is stored in a multi-record custom field group.

# Answer
> 1 votes
I ended up using a drush script to import data into custom multi record fields:

create file `import-script.scr` run it as: `drush scr import-script.scr`

script:

```
<?php

$file = '/var/www/html/sites/default/scripts/civicrm_value_import.csv';

$fh = fopen($file, 'r');

while ($row = fgetcsv($fh)) {

  $contact_id = $row[8];
  if (empty($contact_id)) {
     continue;
  }

  // Build array for new data
  $import = [
    'entity_id' => $contact_id,
    'discharge_reason_329' => $row[14],
    'primary_presenting_problem_335' => $row[15],
    'principal_diagnosis_336' => $row[16],
    'diagnosis_2_337' => $row[17],
    'diagnosis_3_338' => $row[18],
    'opioid_dependency_339' => $row[19]
  ];
  if (!empty($row[11])) {
    $import += ['referral_date_331' => $row[11]];
  }
  if (!empty($row[12])) {
    $import += ['enrolment_date_332' => $row[12]];
  }
  if (!empty($row[13])) {
    $import += ['discharge_date_333' => $row[13]];
  }
  if (!empty($row[21])) {
    $import += ['initiation_date_341' => $row[21]];
  }

  //  print_r([$import]);

  // Insert
  db_insert('civicrm_value_raam_66')
    ->fields($import)
    ->execute();

  // For testing one row
  // break;

}

```

---
Tags: import
---


# Question
Title: CiviCRM - Drupal - Webform Submissions - how can I track the date submitted
Here is the problem I am having... I am using a Drupal Civi web form to allow people to join a waitlist.

Obviously the time the form is submitted is important to where they are on the wait list.

I see two possibilities:

1. Use the Contact Record Creation Date - but this has some practical challenges. The contact creation date record is not easily usable in the various CiviCRM reports and searches (that field never shows up as usable in civi). And using that contact creation date as a proxy for the waitlist sign up date makes assumptions about the contact that might be incorrect in some use cases.
2. Using a new Field-Set for a Contact for waitlist purposes. This is nice because in that field set I can collect extra data such as a little bit about the person joining the waitlist. But this has a problem in that I can't figure out how to get that Civi Date Field pre-filled with \[current-date\] and either hidden or non-editable. I can get that new Civi Custom Field Set on the form just fine but I can't figure out how to get it set to \[current-date\].

Anyone following along or did I totally mangle the description of my problem?

Thanks

# Answer
On the webform element config set the default value for your civicrm custom date and time fields to ‘now’.

Hide the field using a conditional, or set it to read only.
> 2 votes

---
Tags: drupal
---


title: Validating options in API4?

text:
# Question
Title: Validating options in API4?
Is there a way to make APIv4 validate options when creating/updating?

For example, using the demo data I can run:

```
$ cv api4 Contact.update '{"where":[["id","=",202]],"values":{"constituent_information.Marital_Status":"Junk"}}'

```

and then verify the update took place with:

```
$ cv api4 Contact.get '{"select":["constituent_information.Marital_Status"],"where":[["id","=",202]]}'

```

producing:

```
[
    {
        "id": 202,
        "constituent_information.Marital_Status": "Junk"
    }
]

```

So `Marital_Status` is set to `Junk` \- even though that is not a valid option. When viewing this in the UI the field now shows as blank.

I could use `getfields` to get the valid options and check them before doing the API call but an option (or default behaviour) on the API call to produce some sort of error or warning would be useful.

# Answer
> 1 votes
APIv3 does option-matching by default. APIv4 only does option-matching if you ask it to. The way to do that is by specifying what property of the option you are passing in. Typically `:name` for the machine name or `:label` for the localized label.

Try this api call:

```
$ cv api4 Contact.update '{"where":[["id","=",202]],"values":{"constituent_information.Marital_Status:label":"Married"}}'

```

Passing in an invalid option should fail.

---
Tags: apiv4
---


# Question
Title: Merge contacts deletes left hand user in Wordpress
I'm working with a new membership site and have migrated the data. When members renew, if the email address is different, it creates a new contact, as expected. So I have been merging a few contacts in Civi. At the top of the merge screen it says: " WARNING: There are WordPress user accounts associated with both the original and duplicate contacts. Ensure that the WordPress user you want to retain is on the right - if necessary use the 'Flip between original and duplicate contacts.' option at top to swap the positions of the two records before doing the merge."

So I keep the Wordpress user on the right, check the fields to merge and then complete the merge. However, the wrong Wordpress user is kept linked, and not the one associated with the Civi record on the right.

Am I doing something wrong?

# Answer
> 2 votes
I think the wording needs updating. What matters is the checkbox at the very bottom of that screen that takes the left user and moves it over to the right. If it's checked then the user account on the left now gets associated with the contact on the right.

# Answer
> 1 votes
I think I found the workaround to this. If I make sure that I have transferred anything from WooCommerce (that is what we use) to the new user within Wordpress and then delete the Wordpress user that I don't want, I can then merge the accounts in Civi and keep the account in Wordpress linked that I want. It's a bit more of a faff but at least it is possible for an admin user to do this.

Does anyone use WooCommerce CiviCRM? It's very good but could do with some enhancing so I hope I'm not the only one still using it...

---
Tags: wordpress, duplicate-contacts, user
---


# Question
Title: Limit access to form to authenticated users?
We're using Drupal8+CiviCRM

We have a data entry form (created with a profile) that we don't want Anonymous users to access. We also have several other forms that we do want Anonymous access for (donations, email subscribes).

How can I limit access to just one form?

Thanks for any help!

# Answer
> 1 votes
At the bottom of the profile settings page, there's a collapsed advanced section. There you can limit it to a group.

# Answer
> 1 votes
You could use Drupal webform\_civicrm module which gives you fine grained control on who can access the forms.

---
Tags: forms, anonymous-user
---


title: Membership status rules query

text:
# Question
Title: Membership status rules query
This is a follow-up from a previous question that we couldn't find a resolution for (Membership status rules not updating statuses).

We have three status rules once a membership has not been renewed - Grace, Lapsed and Not Renewed. 'Not Renewed' is an extension of Lapsed and we consider it more permanent than lapsed and cannot target those members again unless they get in touch due to data protection/spam etc.

The issue was that membership status of those members more than 3 months past end date did not get updated to 'Not renewed' and stayed at lapsed. Thought this was maybe just a limitation of the number of 'lasped' membership status you could have. However, checking today, I see a small number of membership statuses have updated to 'not renewed'. In all cases, there was a failed PayPal transaction so the contribution is still pending.

Able to add pictures of the rules this time for clarity. Anyone have any ideas what we're doing wrong?

Thanks for your time :-)

# Answer
I think the issue is similar to what Parvez describes with a slight twist. I think it is the fact that you renamed Expired to be Lapsed, and the system is set up so that once it is Expired it will not progress based on the rules.

So if you create a new Lapsed one, or switch your Lapsed and Not Renewed around you might find it starts working.

I.e. the original 'expired' has special properties and hence should be the last one in the automated statuses.
> 1 votes

# Answer
Sorry I thought I'd answered previously but I'm 99% this is down to the fact that once a membership status becomes ended the automated rules then wont touch it. So the first status of type ended in theory would be the one that gets applied and any subsequent ones wouldn't be something that automatically gets moved on. I'm 99% thats the issue your facing, a previous question asked if CiviRules could be used to change membership statuses (which it cant yet), your case is probably one that fits a CiviRules status change I think. Let me know if you prove the theory!
> 2 votes

---
Tags: civimember
---


title: Mass SMS recipients count

text:
# Question
Title: Mass SMS recipients count
*Wordpress 5.5.3, CiviCRM 5.31.0.* While testing Mass SMS with new Twilio account we've discovered it does not quite work. Searching for a solution here and across lab.civicrm.org haven't helped much. Logs are empty so it is not an error or is not considered as an error by CiviCRM. The most popular related solution ( replace "is\_deceased" from NULl to 0 in the database ) hasn't helped. Mass mailing works fine and the number of recipiens counted is correct. Individual SMS sending works also. The only clues we have are:

* "Send SMS" action is not visible for individual contacts.
* Attempt to create Mass SMS for all contacts in the database ( around 10 000 ) displays only **5** contacts on "Total Recipients: 5" counter. Probably it is something with data in the database. We were having big updates for both wordpress and civi past weeks on a decent hosting so things might have been a little messy. The question is, where to start with debugging. Perhaps, if we saw which exactly contacts were counted, we would be able to find what all these 5 have in common and figure out the next steps. Any clue will be helpful.

# Answer
> 2 votes
The only logical explanation to the above was that someone had overwritten Phone to Mobile and Mobile to Phone which was why you were seeing perverse results.

Checking in log\_civicrm\_option\_value table for option\_group\_id = 35 (which is phone type) and seeing if it has changed and if so when/who may confirm this

# Answer
> 2 votes
**Kudos to Demerit and petednz-fuzion for helpful pointers, see below:**

* Demerit: Dummy SMS extension
* petednz-fuzion: check your log\_civicrm\_option\_value table for option\_group\_id = 35 to see who changed it

---

It is possible to find recipients of each mailing (even scheduled/not sent) via MySQL following these steps:

1. Table **log\_civicrm\_mailing** gives us our Mass SMS id
2. Table **civicrm\_mailing\_recipients** contains all recipients of all mailings (mass sms included) in the format: *mailing\_id/contact\_id/email\_id/phone\_id*
3. From here we can explore each **"phone\_id"** record in **civicrm\_phone** table, where we can see **"phone\_type\_id"**.

And this is a funny part: all my 5 recipients have phone\_type\_id=2 ("Phone") while "Mobile" phone type has phone\_type\_id=1. So, it seems Mass SMS in my case checks if phone type is **Phone**, not **Mobile**.

Advanced Search by "Phone type=Phone" returns only 3 numbers, but it seems to be another story. Perhaps, it worth checking what exactly happens on line 227 of \CRM\Mailing\BAO\Mailing.php in this regards:

```
'location_filter' => CRM_Utils_SQL_Select::fragment()->where("$entityTable.phone_type_id = " . CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_Phone', 'phone_type_id', 'Mobile')),

```

---
Tags: wordpress, mailing, sms, twilio
---


# Question
Title: How can I automatically turn off civirules after a given period?
I have a rules that should perform action only until a certain date. What would be the best way to handle this situation so that after a given date the specific rule would be turned off automatically? Thanks

# Answer
> 4 votes
Depending on your Trigger in the rule, I would suggest just adding a time-based condition.

If contribution, add criteria «Field Value Comparison» for «Date Received» and set the operator to less than the desired date.

If activity, use activity date. If new membership, use membership start date, and so on...

---
Tags: civirules
---


title: Mosaico editing

text:
# Question
Title: Mosaico editing
Mosaico displays editing icons depending on the nature of the text. However when text is to be edited the Format drop down does not include the ability to create bullets or numbered lists. Where are the edit icons configured in Mosaico templates?

# Answer
To add bulleted and numbered lists to the Mosaico editor, install the Mosaico Toolbar Editor (com.ginkgostreet.mosaicotoolbarconfig) extension.

Then go to **Administer** \> **CiviMail** \> **Mosaico Settings**, and edit the **Mosaico Toolbar Settings** field and insert `bullist numlist` after `hr`.

Hopefully this might be incorporated into CiviCRM Mosaico one day so that it wouldn't be necessary to install another extension but for now this is how to do it.
> 2 votes

# Answer
I opened Word, pasted the text I wanted bulleted, then bulleted it, then copied it and pasted it into Mosaico template. The bullets held.
> 1 votes

# Answer
Once the extension is installed here is where to find TinyMCE identifiers
> 0 votes

# Answer
Andrew's answer is great if you can install extensions but you can't code. But if you already have your own extension, you only need these 4 lines of code:

```
/**
 * Hook Mosaico TinyMCE config to add bulleted and numbered lists.
 */
function myextension_civicrm_mosaicoConfig(&$config) {
  $config['tinymceConfigFull']['plugins'] = ['link paste lists code civicrmtoken'];
  $config['tinymceConfigFull']['toolbar1'] = 'bold italic removeformat | link unlink | bullist numlist | civicrmtoken | pastetext | code';
}

```

(Replace `myextension` with your extension's short name, of course.)

There's a list of plugins and buttons at: https://www.tiny.cloud/docs/advanced/available-toolbar-buttons/
> 0 votes

---
Tags: mosaico
---


# Question
Title: Change permission to "Print Report" in CiviCase
I want to modify CiviCase so that every user with the right "view my cases and activities" can see and use the "Print a Report" button in the Case View. Right now, this is only granted to users with the "view **all** cases and activities" right.

I modified a template (sites/default/files/civicrm/templates\_c/en\_US/%%64/643/643EC55F%%CaseView.tpl.php) where I found the "Print Report" link in the following code:

```
<?php if ($this->_tpl_vars['hasAccessToMyCases']): ?>

          <a class="crm-hover-button action-item no-popup" href="<?php echo CRM_Utils_System::crmURL(array('p' => 'civicrm/case/report/print','q' => "all=1&redact=0&cid=".($this->_tpl_vars['contactID'])."&caseID=".($this->_tpl_vars['caseId'])."&asn="), $this);?>
"><i class="crm-i fa-print" aria-hidden="true"></i> <?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Print Report<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></a>
        <?php endif; ?>

```

and changed the condition to:

```
<?php if ($this->_tpl_vars['hasAccessToMyCases']): ?>

```

Now, the "Print Report" button appears also when I log in as a user that has only "view my cases and activities" rights. But when I click on it, I get redirected to the (non-logged-in) startpage.

Does anybody have an idea what else needs to be changed?

*Edit*: I created an extension including Demerit's code. It was necessary to additionally change the permission in the file templates/CRM/Case/Form/CaseView.tpl so the button will be visible in the first place. Though, the functionality doesn't work yet.

*Edit:* I think the problem is that I am setting the permission to "view all cases and activities" only on the CaseView form, but not the page that opens when user clicks 'Print Report'. I suppose the permissions for that page are set in `sites/all/modules/civicrm/CRM/Report/Page/Report.php`.

# Answer
sites/default/files/civicrm/templates\_c is where temporary compiled files live. You could try instead editing templates/CRM/Case/Form/CaseView.tpl but there is no such thing as hasAccessToMyCases (where you've just replaced "All" with "My") so you'd need to use something else. But also note this will break when you upgrade since the file will get replaced.

What I would do is create an extension and in hook\_civicrm\_buildForm I would do something like:

```
if ($formName == 'CRM_Case_Form_CaseView') {
  $form->assign('hasAccessToAllCases',
    CRM_Core_Permission::check('access my cases and activities'));
}

```

This would also give access to the Audit Report, but you're probably ok with that since it's just a variation of the Print Report. I vaguely remember the original reason for restricting being something like "this would make it too easy for somebody to print it and then give it to an unauthorized person, either on purpose or inadvertently". It was a different era.

But it may also allow access to other things it shouldn't. Would need to test.

Then you also need to edit this line in CRM/Case/xml/Menu/Case.xml which controls access to urls, and then clear civi caches after at Admin - System Settings - Cleanup Caches.

`<access_arguments>access all cases and activities</access_arguments>`

change to

`<access_arguments>access my cases and activities</access_arguments>`

Also when you get redirected like that, if you then visit any civi page it will show you the actual error.
> 1 votes

# Answer
I now created a small extension for that purpose: https://github.com/5knots/de.5knoten.access-to-print-report

It is my first extension and I am open for any comments on that :)
> 0 votes

---
Tags: civicase, permissions
---


# Question
Title: CiviCRM Resourse URL incorrectly configured in the CiviCRM Admin page
Unfortunately, I configured the **CiviCRM Resource URL** incorrectly in the Admin Page, instead of writing ***civicrm.root***, I typed "***civicrm\_root.url***" and although ***$civicrm\_root*** is correctly configured in *civicrm.settings.php* it is not possible now to access CiviCRM as it throws:

*RuntimeException*: Cannot resolve path using "civicrm\_root.url" in Civi\Core\Paths-\>getVariable() (line 140 of C:\Apache24\htdocs\drupal\sites\all\modules\civicrm\Civi\Core\Paths.php).

How can I change now **CiviCRM Resource URL** without accessing the admin user interface?

Any help will be very much appreciated!

# Answer
> 1 votes
1. Try accessing directly using /civicrm/admin/setting/url?reset=1
2. That setting is written to the database. You can edit it (or delete it) by looking in the civicrm\_setting table, with the variable name="userFrameworkResourceURL".

# Answer
> 0 votes
Issue fixed! Changing that setting in the CiviCRM\_Setting table with the variable name="userFrameworkResourceURL" solved the problem. Many thanks for your help!

---
Tags: resource-urls
---


# Question
Title: What is the status of CiviCRM working with Drupal 9?
With the official release only a few days away (June 3, 2020) and the Drupal 9 porting weekend having just completed with a big effort by KarinG (https://github.com/colemanw/webform\_civicrm/pull/314), what is the status of CiviCRM working with Drupal 9?

# Answer
Trying to upgrade a D8.8.6 site to D9 -\>

```
karins-MBP:d9civicrm.local sysadmin$ composer require drupal/core-recommended:~9.0.0@dev drupal/core-composer-scaffold:~9.0.0@dev --update-with-dependencies --no-update
./composer.json has been updated
karins-MBP:d9civicrm.local sysadmin$ composer update

```

Found two issues:

```
symfony conflict -> Drupal 9 requires 4.4
civicrm/civicrm-core 5.25.0 requires symfony/dependency-injection ^2.8.50 || ~3.0

pear exception conflict: Can only install one of: pear/pear_exception[v1.0.1, v1.0.0]; - pear/log 1.13.1 requires pear/pear_exception 1.0.0 -> satisfiable by pear/pear_exception[v1.0.0].

```

WIP PR by Core Team -\> to resolve the symfony conlict: https://github.com/civicrm/civicrm-core/pull/17380

And resolved!

This now works:

a) create a D8 project -\>

```
composer create-project drupal/recommended-project d9civicrm.local

```

b) `cd d9civicrm.local`

c) `composer require civicrm/civicrm-core:dev-master civicrm/civicrm-packages:dev-master civicrm/civicrm-drupal-8:dev-master civicrm/civicrm-asset-plugin:~1.0.1`

Go through the usual motions of installing D8 in your favourite language, database and timezone -\> and then enable CiviCRM Core \[you will need to ensure your `web/sites/default dir` is writable for the `civicrm.settings.php` file to be generated\].

d) then onto D9 -\>

```
composer require pear/pear_exception:'1.0.1 as 1.0.0'

```

e) `rm composer.lock`

f) `composer require drupal/core-recommended:^9.0 drupal/core-composer-scaffold:^9.0 drupal/core-project-message:^9.0 drupal/core-dev:^9.0 --update-with-all-dependencies`

And that produces:

Next step is here: `https://github.com/civicrm/civicrm-drupal-8/pull/40/files` \[that will make CiviCRM installable as a D9 module\].

Many more steps to go I'm sure! Thanks to Core Team and Mikey for their quick action on some of these items!

Update -\> as of June 03 - 2020 -\> webform\_civicrm module is officially D9 Compatible:
> 3 votes

# Answer
As of CiviCRM version 5.31, Civi will work with Drupal 9. https://civicrm.org/blog/dev-team/civicrm-531-release
> 3 votes

---
Tags: drupal
---


# Question
Title: CiviCRM Navigation Menu is not displayed
After some time working with CiviCRM, the **Navigation Menu** is not displaying. I've been researching different solutions, but neither of them seem to be the issue.

Could someone guide me what I should be looking at or give me some tips to lead me to the cause of the problem?

I'm working with **CiviCRM 5.32.1**, **mySQL 5.7.27** and **php 7.3.14** on **Drupal 7.69**.

Many thanks in advance!

# Answer
I've seen a number of causes including perhaps gremlins

* Permissions on the directories used by the asset builder plug in
* The URL (including either http or https) in the civicrm.settings file
* Cache in both Drupal and Civi
* Reset directories in Civi
> 1 votes

---
Tags: menu
---


title: Contribution status for tax deduction?

text:
# Question
Title: Contribution status for tax deduction?
This is a question on best practice I think:

To get tax deduction for donations in Norway, the NGO has to send a report to the tax authorities (as in addition to the donor itself)

In addition to donation data in CiviCRM, we also have data from other systems. The money from those donations are already recorded in CiviCRM as they are paid out collectively at the end of the month.

Now I want to import the donations from the other systems into CiviCRM so that I get a full and accurate report for the tax authorities.

But I do not want to have the donations to be summed up double, as the transactions are already recorded.

My idea was to add another contribution status like «tax deduction» on those contributions from the external systems.

And then I could edit my tax report to include both contributions with status Completed, and Tax deduction.

And the rest of the donation reports in CiviCRM will generally be unaffacted, since they all look for contributions with status Completed.

Anyone has any thoughts on why or why not this is a good idea?

# Answer
So if I'm understanding this correctly, you currently have monthly collective totals in Civi and now want to import the detail behind those so you can do reporting at the individual level.

If you have the individual level detail to import, do you still need the monthly entries? If not, just delete the summary ones and import the details.

If you do want both: you suggest adding a new contribution status. There is a lot of logic based around those statuses and I wouldn't mess with that. But slightly changing that idea you could add a new financial type such as 'imported-monthly-total'. Then change those monthly totals to this new type so that you can import the detailed data and in the tax reports be sure to filter by financial type to exclude 'imported-monthly-total'.
> 2 votes

---
Tags: contributions, best-practice
---


# Question
Title: CiviEvent Mass Participant Registration - Blank Page
WordPress 5.5.3 CiviCRM 5.31.1

## Problem with CiviCRM event (CiviEvent) mass registration

I'm trying to mass register participants as per: https://docs.civicrm.org/user/en/latest/events/manual-event-registration/#mass-registrations. However, on clicking `Register participants for event`, it simply redirects me to a blank page titled `New Event Registration`.

What I clicked on:

Redirected to:

I've checked 5.32.0 https://github.com/civicrm/civicrm-core/blob/5.32/release-notes/5.32.0.md release note and there's nothing addressing this issue.

# Answer
This is a recent regression. A fix has been merged for 5.33 (RC) and the upcoming 5.32.2.
> 3 votes

---
Tags: wordpress, civievent, registration, participants
---


# Question
Title: Drupal 8 CiviCRM Entity and Views activities
We have been working on Views, with Civi Entity, on Drupal 8.

We are having an issue a list of Activities and filters. We only want to load Activities where the source contact is a particular Contextual filter (contact ID). But adding a Contextual Filter of 'CiviCRM Activity (CiviCRM Entity): Activity Source Contact' leads to an error.

SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'civicrm\_activity.source\_contact\_id' in 'where clause': SELECT civicrm\_activity.id AS id FROM {civicrm\_activity} civicrm\_activity LEFT JOIN {civicrm\_value\_volunteering\__9} civicrm\_value\_volunteering\__9 ON civicrm\_activity.id = civicrm\_value\_volunteering\__9.entity\_id WHERE (((civicrm\_activity.activity\_type\_id = :civicrm\_activity\_activity\_type\_id)) AND ((civicrm\_activity.source\_contact\_id = :civicrm\_activity\_source\_contact\_id))) AND ((civicrm\_activity.is\_deleted = :db\_condition\_placeholder\_0) AND (civicrm\_value\_volunteering\__9.validated\__200 = :db\_condition\_placeholder\_1)) LIMIT 11 OFFSET 0; Array ( \[:civicrm\_activity\_activity\_type\_id\] =\> 66 \[:civicrm\_activity\_source\_contact\_id\] =\> 20 \[:db\_condition\_placeholder\_0\] =\> 0 \[:db\_condition\_placeholder\_1\] =\> 1 )

Is that the right method for adding a contextual filter to that type of View. Or is there another way?

Olly

# Answer
> 2 votes
Here's a working example of "My Activities" Olly: you should just be able to change Assignee to Source for your use case (in Configure Relationship Contact)

Code: git repo -\> last commit -\>

```
commit bb1f503bd67d1537a16b28022a4f2444883ef231
Author: Rob Ellis <>
Date:   Sun Oct 11 23:21:17 2020 +0000

    Changed views contact subtype default arg to return "<none>" for users without a subtype

```

# Answer
> 1 votes
This is a known issue which is locked in github repo. There is a work in progress to fix the issue.

You can try applying the below patch in your d8 install to see if it resolves your problem

---
Tags: drupal-views, civicrm-entity, drupal-8
---


# Question
Title: api4: get(FALSE) vs get()->setCheckPermissions(FALSE): which is preferred?
In ap4, there are apparently two different ways to specify skipping permissions:

In the api4 browser at /civicrm/api4, when you un-check the "CheckPermissions" checkbox, the action method is given a single boolean-negative argument:

```
\Civi\Api4\Contact::get(FALSE)

```

But various documentation (e.g. https://docs.civicrm.org/dev/en/latest/api/v4/joins/#using-an-api-join and https://docs.civicrm.org/dev/en/latest/api/v4/differences-with-v3/) describes an explicit method:

```
\Civi\Api4\Email::get()
...
  ->setCheckPermissions(FALSE)
...

```

I assume these are equivalent. Personally I prefer the more explicit method as it's well, more explicit, but I wonder:

Is one of these preferred as a best practice, in the community at large or by core developers?

# Answer
> 3 votes
Core tends to use the short form but both are equally valid. The short form was introduced later just because it comes up so often that you want to set it to false.

---
Tags: best-practice, coding-standards, apiv4
---


title: Unable to Create New Contact Field

text:
# Question
Title: Unable to Create New Contact Field
I'm currently setting up the CIVICRM platform, now at the stage of importing data I am unable to create new contact fields, I followed the instructions available to create custom fields however none of the created custom fields is visible when mapping the data for import.

Please assist as soon as possible.

Edit: here are some screenshots:

@fuzion, I yes the fields are set to searchable, on contact report I can also see the created custom field, but not in the import page.

@Aidan, Please expand more I do not completely understand you.

# Answer
> 1 votes
The problem is that the custom field has been set up to allow Multiple Records, and you did not click on the ? to read the notes about this type of setting - and those notes would have explained that the 'special power' of multiple records impacts on the ability or approach to other functionality including Importing records.

---
Tags: contacts, custom-fields, import
---


title: Solicitation Frequency

text:
# Question
Title: Solicitation Frequency
More and more donors over the last few months have been asking to have custom Solicitation Frequency - IE: Once a year, once every six months. I can't seem to find a spot within CIVICRM to indicate this within their record. Is there a spot I am missing?

# Answer
There isn't, but you could create one with a custom field - **Administer menu \>\> Customize Data and Screens \>\> Custom Fields**.
> 1 votes

---
Tags: mailing
---


# Question
Title: Email report via cron gets moved every time it runs!
I have scheduled job (daily) to email a report to myself. I would like to receive it on a specific time everyday. Although I have set the time when it should run, every time it runs on a different time and keep getting moved forward 20-30 min ahead of when it ran yesterday.

Is it an issue can be fixed easily? Thanks in advance.

# Answer
> 2 votes
If you want the jobs to execute at exactly the same time every day, swich it to disabled in the UI and then call that job with its params from a system crontab instead. We do this often for recurring contribution jobs e.g.

Here's an example from one of our clients who in addition to executing the usual CiviCRM scheduled jobs mails out a report at a very specific time -\> params are: instanceId=44 and format=pdf (just like in the CiviCRM UI). Note that the `/usr/local/bin/vcv-production-all` (it's our way to call civicrm's `cv`) and `secureexampleca` is this site example and is specific to our docker set up - but crontab is not - it's a UNIX command.

```
5 * * * * /usr/local/bin/vcv-production-all api job.execute auth=0
1 09 * * * /usr/local/bin/vcv secureexampleca api job.mail_report instanceId=44 format=pdf

```

---
Tags: email, reports, cron, cron-job, scheduled-job
---


title: Non-chargeable event participants

text:
# Question
Title: Non-chargeable event participants
I have a some event roles (tutor and administrator) that are not chargeable. I want to be able to add these from the back end - Register Event Participants, but I have to accept a fee and provide charging information which is not wanted. I've set the roles to be "not counted" but that doesn't help. If I add a zero fee then that is going to show as an option for the online booking. In How do I configure a free event ticket option for internal use without it showing up on the website? there are two suggestions: I can't go down the price set for these existing events and the other option suggests that you can have a role that isn't charged.

Am I missing something?

I might be able to do it by importing participants but that's more work than it should be. as I'd have to export event and contact data and then create a spreadsheet.

# Answer
Are you using price sets for the ones that are public and chargeable? If so, we add an option and set the visibility to Admin. Then we can add them in the back-end, but they don't show up publicly.
> 2 votes

---
Tags: civievent, participants
---


# Question
Title: How can I run a report with Pending (Incomplete Transaction)?
Essentially I want the contribution detail report but to filter Contribution Status: Pending, Is Pay Later: No

(I know I can do this with search)

I can do this with some extensions, but they do not hyperlink to the contact or contribution for easy access.

D7 Civi 5.32

# Answer
> 2 votes
Pay Later isn't available in reports provided by core civicrm. I added this to extendedreport extension recently - https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport/pull/434

The PR is merged so you can use the latest (or master) version and use contribution details extended report to find the required filter.

---
Tags: civicontribute, civireport
---


# Question
Title: PayPal IPN Notification Inconsistently Received
Random completed PayPal transactions are not being updated in CiviCRM and the contribution records are incorrectly left as "Pending." I have worked with PayPal to confirm that all IPN notifications are being successfully sent from their end. CiviCRM's logs do not show any errors; they simply do not show that they received any notification from PayPal.

To make matters more confusing, when I resend IPN notifications through PayPal, they are then correctly received by CiviCRM the second time around and the contribution record is updated.

Any ideas on how to rectify this situation? I cannot find any pattern as to which notifications go unreceived and which contributions are successfully updated. I am on WordPress 5.5.3 and CiviCRM 5.30.1.

# Answer
As an update to this thread, the issue was identified as a bug in the PayPal integration (https://lab.civicrm.org/dev/core/-/issues/1931) and was resolved in an update pushed by CiviCRM Admin Utilities 0.8 released on 20 November 2020. Payments have been closing perfectly for us since applying the patch.
> 1 votes

# Answer
First check to see if they're unrecieved or received but not processed by looking for them in `civicrm_system_log`. If they're not there, you can review web server logs.

If they *are* there, you can replay them using the notificationlog extension. Check the ConfigAndLog directory to see the Civi log errors when you do that - as well as review the logs for when the IPN was originally received.
> 0 votes

---
Tags: contributions, paypal, ipn
---


title: Events Editable But Public URL is Bad

text:
# Question
Title: Events Editable But Public URL is Bad
Wordpress 5.6, CiviCRM 5.32.1, Shared server with ssh access When I go to Events -\> Dashboard and choose an event to review an existing or past event, I can edit it but when I choose the public link at the bottom of the page I get this:

https://nonprofit.org/wp-admin/admin.php?civiwp=CiviCRM&q=civicrm%2Fevent%2Finfo&id=56&reset=1

This gives a white screen for anyone, even an admin. When I manually change it to remove wp-admin/admin.php I get this format:

https://nonprofit.org/?civiwp=CiviCRM&q=civicrm%2Fevent%2Finfo&id=56&reset=1

Which gives me a list of old events - not the specific event.

I can edit the events. I simply can't show them publicly. I suspect this has something to do with this post: https://civicrm.org/blog/kcristiano/civicrm-526-and-wordpress-important-notice However, WP was updated to 5.5 before I updated civicrm.

And of course this is different because it's adding the admin part to the URL. If anyone has suggestions, I'd be grateful.

# Answer
I figured it out. I needed a base page. It's fixed!
> 1 votes

---
Tags: wordpress, civievent, urls
---


title: Wordpress Cron not Running

text:
# Question
Title: Wordpress Cron not Running
I am using the following method to get cron to work with wordpress. It has worked in the past but recently (around December of 2019) it stopped working. It hasn't become too big of a problem until recently.

/usr/local/cpanel/3rdparty/bin/php /home/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s SITE -u USERNAME -p PASSWORD -e Job -a execute

The error that i get from cPanel is:

PHP Parse error: syntax error, unexpected '?' in /home/public\_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php on line 214

Can anyone help me figure out what to do.

# Answer
That could be an old version of php. Assuming you are on current CiviCRM then try setting your php version to 7.3 See https://docs.civicrm.org/installation/en/latest/general/requirements/#php
> 1 votes

---
Tags: wordpress, cron
---


# Question
Title: WordPress w/ CiviCRM - Using Gutenberg in CiviMail
Small bit of background, I volunteered with a charity and helped implement a Drupal 7 / Civi install a few years ago. So I know enough to get around Civi before looking at any more recent changes.

I am a member of a non-profit organisation where a members website is needed. The user-base is such that I am thinking a WordPress / Civi build is more appropriate to make better use of Gutenberg. My question is, can you use Gutenberg as an editor for CiviMail?

I am just thinking about ease of use, compared to the users who would need to use it.

# Answer
> 3 votes
HTML email is a bear, even with templated services like MailChimp. For that reason Civimail will not be compatible with Gutenberg. Why? Because most HTML5 editors are not compatible with email-style HTML. In order to ensure that an HTML email looks pretty much the same for all users across platforms, you end up having to use old-school borderless tables with styles embedded in the HTML. Style sheets and divs simply don't translate to email because html mail protocol is still over a decade behind browser html technology. Develop a simple html mail template with borderless tables and embedded styles. Make the template a fixed width of 500px. Even more critical is whether the email has images embedded or stored on your site, but that's beyond the scope of this response.

Frankly, younger users eschew email altogether at this point. You're better off creating a short text, twitter or instagram post with links to a news or newsletter post on your WP site. Of course your post on the WP site itself would be Gutenberg friendly.

Edit: Of course you could also go with an extension like CiviCRM Mosaico as Fabian suggested above. ;)

---
Tags: civimail
---


# Question
Title: How do I translate the "On behalf of Label"?
Using a multilingual install, on the configuration page of a contribution page, the "On behalf of Label" doesn't provide a multilingual option.

Switching languages and inputting the translation into this box just overwrites the previous one.

Similar issue with the "Honoree Section Title".

Using Drupal 7 + CiviCRM 5.28.4

# Answer
> 1 votes
This is a civicrm core bug, fixed in 5.30, as per Demerit's comment below.

These labels live in the table civicrm\_uf\_join as the 'module\_data' field.

---
Tags: civicontribute, translation
---


title: Smarty and Mosaico - compatibility?

text:
# Question
Title: Smarty and Mosaico - compatibility?
Seeing a lot of smarty errors in Drupal log file for mailings using Mosaico template - looks like an error for every message sent so thousands filling log files.

Nothing obvious in Mosaico template but thinking it must be a conflict with use of { } in each case. Smarty logic in the template that I can see.

should smarty be turned off in civicrm.settings.php if using Mosaico?

# Answer
> 1 votes
You can't use Smarty and Mosaico together. Tim Otten presents a long answer why if you want details!

# Answer
> 0 votes
I found this: https://github.com/mjwconsult/civicrm-mosaico\_smarty I need to upgrade my system to try it out, let me know if it works.

---
Tags: smarty, mosaico
---


# Question
Title: Memberships - Receipt (on-line) template: how to check if it is a subscription or a renew
I would customize the template *Memberships - Receipt (on-line)* in order to give a different message if it is a signup or a renewal. I try a lot of tokens, but no ones works: $receiptType $membership\_status $membership\_source $source $status $membershipStatus $form.receipt\_text $formValues.receipt\_text\_signup $formValues.receipt\_text\_renewal $formValues.receipt\_text $formValues.receipt\_text.label $receipt\_text $receipt\_text.label

In the offline template I use $receiptType EQ 'membership signup'.

Have you any suggestions?

# Answer
I found a solution, not perfect, but it works for me: I use the $mem\_status token and check if it is New. In this case I assume that it is a signup else it is a renew
> 3 votes

---
Tags: civimember, tokens, renewals
---


# Question
Title: Are others experiencing problems with PayPal
We're recently having problems with PayPal payments leaving transactions in a Pending state even though the PayPal payment goes thru.

# Answer
What version of CiviCRM do you use? In at least two of the latest versions released recently there is some Paypal bugs that has been fixed. You should first of all make sure you have the latest version installed.

You can see it in release notes for:
> 1 votes

---
Tags: paypal
---


title: Checksum expiration

text:
# Question
Title: Checksum expiration
How long is a URL-link using a checksum token from CiviCRM valid?

And can you send multiple emails using same token?

When does the expiration clock start ticking?

# Answer
I found it myself:

/civicrm/admin/setting/misc?reset=1

Default setting is 7 days.
> 5 votes

---
Tags: tokens, checksum
---


# Question
Title: Civicrm Event Info Page has Register, iCal, and iCal feed buttons too close to each other
I'm using CiviCRM with wordpress for first time, but the same "issue" exists with Drupal. The bottom "Register Now" button on the info page for an event is very close to two more buttons for downloading iCal info for event, and accessing iCal feed for the event.

We're finding that fat-fingered folks on tablets are hitting one or the other of these buttons, then getting confused and giving up. Is there a setting in the UI to either not have these buttons, if I just want to provide more spacing, do I need to edit something in the backend? If the latter, could someone point me to the particular file?

(and is this a smarty template modification that I need to make and then keep updated?)

# Answer
You could add CSS, either to `civicrm.css` or to your site's theme, that adds space between them.

If there aren't any CSS selectors specific enough for that, you could add *those* to the template, and submit that as a patch to upstream CiviCRM. It would be a welcome addition, and would then be the standard in future versions of CiviCRM, which removes the maintenance burden from you.
> 1 votes

# Answer
OK, it is easy to do with minor edits to the code (a template). I edited the following smarty template:

wp-content/plugins/civicrm/civicrm/templates/CRM/Event/Page/iCalLinks.tpl

I commented out lines 10 to 16, which is the entire executable for this file.

This gets rid of the two badges under the edit button, and solved this problem for fat-fingered folks.

**I still wonder if there's anything in the CiviCRM UI that would do the same thing without editing the template..**

Thanks All in advance.

WordPress 5.6, CiviCRM 5.32.1
> 1 votes

# Answer
If you look at https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Event/Page/EventInfo.tpl#L219-L223 where the EventInfo template includes the iCalLinks template you will see that it is conditional on `$event.is_public`

So if you untick the 'Public Event' checkbox on the 'Info and Settings' tab then those iCal links go away.

However, that also has a couple of other effects which may or may not be a problem for you. From the help text:

> Public Events
>
> When enabled, this event will be included in iCalendar feeds and displayed on your site's "Upcoming Events" block.

Alternatively you could add some css to increase the spacing between the Register Now button and the iCal links, or jQuery to hide them.
> 1 votes

---
Tags: wordpress, civievent, smarty
---


# Question
Title: Drush cannot locate CRM/Core/ClassLoader.php
I'm trying to configure Drush on my shared host and any time I try to do anything it fails as follows:

```
bash-3.2$ drush cache-clear all
require_once(CRM/Core/ClassLoader.php): failed to open stream: No    [warning]
such file or directory civicrm.settings.php:497

Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.php' (include_path='.:/var/sites/j/example.net/public_html/sites/all/modules/civicrm:/var/sites/j/example.net/public_html/sites/all/modules/civicrm/packages:.:/usr/newage/lib/php') in /var/sites/c/beta.example.net/public_html/sites/default/civicrm.settings.php on line 497
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: require_once(): Failed opening required
'CRM/Core/ClassLoader.php'
(include_path='.:/var/sites/j/example.net/public_html/sites/all/modules/civicrm:/var/sites/j/example.net/public_html/sites/all/modules/civicrm/packages:.:/usr/newage/lib/php')
in
/var/sites/c/beta.example.net/public_html/sites/default/civicrm.settings.php,
line 497

```

I found a suggestion in this answer to add the civicrm\_root variable to the `require_once 'CRM/Core/ClassLoader.php';` line in civicrm.settings.php, but that just results in the slightly more verbose:

```
bash-3.2$ drush cache-clear all
require_once(/var/sites/j/example.net/public_html/sites/all/modules/civicrm/CRM/Core/ClassLoader.php):[warning]
failed to open stream: No such file or directory
civicrm.settings.php:497

Fatal error: require_once(): Failed opening required '/var/sites/j/example.net/public_html/sites/all/modules/civicrm/CRM/Core/ClassLoader.php' (include_path='.:/var/sites/j/example.net/public_html/sites/all/modules/civicrm:/var/sites/j/example.net/public_html/sites/all/modules/civicrm/packages:.:/usr/newage/lib/php') in /var/sites/c/beta.example.net/public_html/sites/default/civicrm.settings.php on line 497
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: require_once(): Failed opening required
'/var/sites/j/example.net/public_html/sites/all/modules/civicrm/CRM/Core/ClassLoader.php'
(include_path='.:/var/sites/j/example.net/public_html/sites/all/modules/civicrm:/var/sites/j/example.net/public_html/sites/all/modules/civicrm/packages:.:/usr/newage/lib/php')
in
/var/sites/c/beta.example.net/public_html/sites/default/civicrm.settings.php,
line 497

```

For reasons I don't really understand my site seems to operate from the path

```
/var/sites/j/example.net/public_html

```

when as far as I can tell from the access the host gives us, I'm always working in

```
/var/sites/c/beta.example.net/public_html

```

Based on advice in a previous answer, I'd configured the $civicrm\_root variable to reflect the first and the site has always worked fine since then. For the sake of this, I tried putting that full second path in the `require_once 'CRM/Core/ClassLoader.php';` line and then got:

```
bash-3.2$ drush cache-clear all
Could not locate CiviCRM codebase. Make sure CiviCRM settings file   [error]
has correct information.

```

Why, then, can it normally find the rest of the codebase, but not that one file?

**Edit 6:31pm BST:** I tried updating the $civicrm\_root variable directly with the second path and it does now seem to work. But then I suspect the problems from the previous question that led me to set it as it was will reoccur. I guess the site itself must be using a different operational path than I get over SSL. Is there a way I can configure Drush to always remember and use a specific version of $civicrm\_root that's different from the version in civicrm.settings.php?

**Edit 22nd December:** `drush status` seems to correctly show that second path as the Drupal root. I've created a drushrc.php file in sites/default which is now defining the URL, but the problem remains the same.

```
bash-3.2$ drush status
 Drupal version         :  7.74
 Site URI               :  https://example.net
 Database driver        :  mysql
 Database hostname      :  10.169.0.172
 Database port          :
 Database username      :  example_user
 Database name          :  example_drupal
 Database               :  Connected
 Drupal bootstrap       :  Successful
 Drupal user            :
 Default theme          :  nexus
 Administration theme   :  seven
 PHP executable         :  /usr/bin/php-7.3
 PHP configuration      :
 PHP OS                 :  Linux
 Drush script           :  /var/sites/c/beta.example.net/drush/dru
                           sh.php
 Drush version          :  8.4.5
 Drush temp directory   :  /tmp
 Drush configuration    :  /var/sites/c/beta.example.net/public_ht
                           ml/sites/default/drushrc.php
 Drush alias files      :
 Install profile        :  standard
 Drupal root            :  /var/sites/c/civicrm.jesusshapedpeople.net/public_ht
                           ml
 Drupal Settings File   :  sites/default/settings.php
 Site path              :  sites/default
 File directory path    :  sites/default/files
 Private file           :  sites/default/files/private
 directory path
 Temporary file         :  tmp
 directory path

```

It seems Drush is taking the full path of civicrm\_root specified in civicrm.settings.php regardless of how it's own Drupal root is specified. Is there a way I can overwrite that variable in this file? Just adding

```
$civicrm_root = '/var/sites/c/beta.example.net/public_html/sites/all/modules/civicrm';

```

at the end doesn't seem to do it...

# Answer
> 0 votes
When your cli environment is different from the environment your web server is in, it makes a few things tricky.

Setting the drush document root and url would be the first thing to try. You don't want to mess up the working civicrm.settings.php file that is used for the webserver to find the code.

There are options to drush that let you save configurations, you probably want to research that.

---
Tags: core, drush, paths
---


# Question
Title: Registration Button not working on CiviCRM Event Page
Ok So I am working on CiviCRM 5.19.2 and WordPress 5.6. I've created an event in CiviEvent and set it to active. My Event page has the following shortcode

\[civicrm component="event" action="info" id="8" hijack="1"\]

which leads to the event information page as it should. However, the Register Here button isn't working. It just resets to the event information page again. If I add the shortcode for the registration page

\[civicrm component="event" action="register" id="8" hijack="1"\]

to the same Event Page, it leads to a list of events with more links that don't work.

I've temporarily bypassed the event info page so that my participants can register but I'd like that event info page in place with a working link. Any ideas?

# Answer
> 4 votes
CiviCRM 5.19 is not compatible with WP 5.6. WP 5.5 had a change that required an update which is in CiviCRM 5.26 https://civicrm.org/blog/kcristiano/civicrm-526-and-wordpress-important-notice

I'd recommend CiviCRM 5.32.2 currently as that version has all the security fixes in 5.28 (latest security version) as well many other bug fixes/enhancements.

Please look at https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-529 as this further documents some of the follow up changes that affect Paths and URLs in WP

---
Tags: wordpress, civievent
---


# Question
Title: CiviMail: Send to Individual Contacts (not just Groups)?
Is there an option in CiviMail to allow us to add individuals (not groups) in the Recipients field when creating a new Mailing? (we're using Mosaico/FlexMailer, if that helps).

We're trying to avoid having to put people into temporary groups each time we want to send a mass mailing. Sometimes new individuals come in after we've sent the mail mailing, and we want to resend only to those individuals, without having to add them into a temp group and then delete the group.

If there isn't an out-of-the-box option for this, any pointers to where we might be able to customize the new mailing screen to add this?

# Answer
> 1 votes
Not exactly what you want to do, but if you install the Resend Mailing extension, you can select one or more contacts from search results and use the action drop down menu to resend a mailing to those specific contacts.

Alternatively, you could just add the new recipients to the original group you used for the mailing and resend the mailing, subtracting the recipients of the original mailing and thus only sending it to the new group members.

---
Tags: civimail
---


# Question
Title: Browsing for images in the editor leads to an unexpected Error
I want to add an image in an email newsletter. However when I try to use the *Browse Server* button like:

and unexpected error is thrown:

The used versions are CiviCRM 5.32.2 and Drupal 7.77

# Answer
This is caused by a bug that prevents users that configure multiple languages to use the *kcfinder* plugin. So check if there are more available languages are configured at https:////civicrm/admin/setting/localization?reset=1

Restrict it to one, and try again.

At the moment a patch is available at https://github.com/civicrm/civicrm-core/pull/19245. And the PR is accepted so in later versions of CiviCRM you should not see this.
> 2 votes

---
Tags: drupal, ckeditor, images, upload, kcfinder
---


# Question
Title: Why would an email have much lower open rates in the final part of an A/B test, but only in Gmail?
Recently, we sent an A/B test using Mosaico, which showed a unique open rate of about 27% for Gmail addresses. The final mailing, which was identical other than being sent a few hours later, had an unique open rate for Gmail addresses of 2%. Open rates for other email domains were the same in the A/B test and the final mailing. Does anyone have any ideas why this may be?

About half of the emails on this list are Gmail addresses and yet all the click throughs recorded are for other domains. I suspect that these emails to Gmail were sent to spam or otherwise not showing up in people's mailboxes, but I'm not sure about this. The evidence from the donations is not conclusive, but the donation rate is about 80% lower for the Gmail addresses, so I suspect they didn't receive this email or it was somehow sent to spam or otherwise not to the inbox. I don't quite understand why that would happen for most of the final part of the A/B test, but not the initial parts.

We sent a similar mailing with an A/B test and final to a different list the same day and did not see any difference in Gmail open rates. One list with Gmail issues was 48k, the list without about 13k.

I've checked our mailer (Amazon SES) and it shows the right number of emails sent on that day. Bounce rates for all three messages were similar.

Thoughts or things to check about this are welcome. My current plan is to resend this mailing to all the Gmail addresses that don't show an open for it, perhaps with some slight changes to content.

Edit: This mailing was not sent during the recent reported Gmail outages. It was sent on Dec 10. Also, there is no correlation between the emails that do show as opened and the sending time of that particular email.

# Answer
> 2 votes
It's the metric. Open rate is not a reliable metric. An open is tracked through an image pulled from your crm server. If images aren't loaded the open doesn't get recorded. Further, Gmail uses something called image image proxying, i.e. they cache the images on their servers instead of pulling the images from your server.

Click rate is a reliable metric, though, so maybe construct decision making around that?

In any case it is still possible your emails are ending up in spam. There are services like glockapps that can help you figure out if this is the case.

# Answer
> 1 votes
I would say email end up in spam for many reason and this is not an CiviCRM fault -

I would suggest you to look for SPF, DKIM and DMARC - configuration first

Also for your reference : my emails going to recipient spam

I hope this helps !!!!

Thanks

---
Tags: civimail, mosaico, tracked-links
---


# Question
Title: Edit the financial type of an online contribution?
We have some online contribution transactions that we'd like to assign to a different Financial Type. E.g. they were assigned Donation rather than Member Dues. Is there a way to manually change the Financial Type of a completed transaction?

On a related topic, there are some combined transactions that we'd like to split: $20 -\> Member Dues, $10 -\> Donation instead of $30 -\> Member Dues. Is it possible to edit and split these transactions across the correct Financial Types?

cheers ... :) gn

# Answer
I could say try price set where you will have two different Financial type - one for donation and one for membership

For the record which you wanted to correct which has been already completed - you need to delete the records and create it against manually using price set that should be the best option

I guess this helps!!!

Thanks
> 1 votes

# Answer
For the second part of the question, the Edit Line Item extension is the answer: https://civicrm.org/extensions/line-item-editor. Only a few of our transactions had to be completely deleted and recreated (they didn't understand the line item options) and since we only have about 100 to edit, the manual editing of line items is acceptable. For larger datasets, export, delete, edit and import is the only effective answer.

For editing the underlying financial type, the only method seems to be deleting the record and recreating it -

cheers ... :) gn
> 1 votes

---
Tags: civicontribute, civimember, contributions, financial-types
---


# Question
Title: Word Replacement won't replace deceased on contact profile
We are using the deceased function for both contacts that are deceased or no longer employed. In word replacements we changed "Deceased" to "Terminated or Deceased" - however, on the contact profile page (deceased) still appears, so we added a word replacement that makes "(deceased)" replaced by "(Terminated or Deceased)" but that still didn't change it. I was able to replicate on the D7 Demo Master.

Thoughts?

# Answer
> 3 votes
It's case-sensitive, so if you want to do exact match you can make two entries in word replacements:

* deceased =\> Terminated or Deceased
* Deceased =\> Terminated or Deceased

(without the brackets)

---
Tags: contacts, word-replacements
---


title: How do I set default values in afform?

text:
# Question
Title: How do I set default values in afform?
I'm working on my first afform extension.

I've built a form, which works! I can submit values and create a contact.

However, I can't figure out how to pre-populate with default values. This is pretty important for the application. I've tried a number of things but none of them seem to work (not even the 'defn\` one which came from a published example). Any suggestions? Note: I don't want to populate the form with the values from an existing contact. I need to insert new values into the form so when submitted, it creates a new contact.

```
 <af-form ctrl="modelListCtrl">
        <af-entity type="Contact" name="member" label="Member" />
        <div af-fieldset="member">
          <af-field name="first_name" ng-init="first_name = 'Betty'" />
          <af-field name="last_name" value="Smith" />
          <af-field name="do_not_email" defn="{type: 'checkbox', default: 1}" />
        </div>
        <button ng-click="modelListCtrl.submit()">Submit</button>
  </af-form>

```

# Answer
> 2 votes
Afform is still in beta so I expect this functionality to improve further, but currently it does support passing in an id via the url. It keys off the `af-entity` name property. So if you visit your form and add `?member=123` to the end of the url string it should load contact id 123 as the "Member". In that case it will update instead of creating a new contact.

---
Tags: angular, formbuilder
---


# Question
Title: Parse error unexpected 'clone' (T_CLONE), expecting '('
After upgrading to PHP 7.4, started getting

ParseError thrown syntax error, unexpected 'clone' (T\_CLONE), expecting '('

when accessing posts, tags, categories

Everything went back to normal after deactivating CiviCRM 4.5 (I'm using Wordperfect version 5.6)

How can I fix this?

# Answer
> 3 votes
Welcome to SE! Do you really mean CiviCRM 4.5? - that's really old. The docs Jitendra points to are for the current version of Civi. If you are back on Civi 4.5 it won't work with any version of php7.

Go back to php5.6 and plan to upgrade. You'll want to do that in stages - see some of the other answers on here for upgrading from very old versions.

# Answer
> 1 votes
The requirement docs at https://docs.civicrm.org/installation/en/latest/general/requirements/#php-version says it is still incompatible with PHP 7.4.

More info and discussion is at https://lab.civicrm.org/dev/core/-/issues/1496

---
Tags: wordpress
---


# Question
Title: How to exclude contacts from a mailing who share an email with a group of contacts?
If I'm sending out emails asking for donation, I exclude all the contacts who have donated recently with a smart group. Unfortunately, because we have many contacts who share an email (generally couples), people who donate can still receive an email asking for a donation, because only one member of the couple has a recent donation and is in the smart group. The other contact receives the email as normal.

How do other people deal with this problem? Is there some way we can find all contacts who share a primary email with members of a group and exclude them from a mailing as well? We don't want to exclude everyone with a relationship of partner or spouse as we still want to send emails when the email address is different.

# Answer
You can find all contacts who share a primary email with members of a group, and save those contacts to a Smart Group, using Civi's APIv4. This solution was developed on CiviCRM 5.32.2 and may not work on previous versions.

Navigate to the API4 explorer within your Civi. Then configure a query as in the screenshot below, or paste the following into your URL bar after the word "explorer" and hit enter:

```
/GroupContact/get?join=[["Email AS contact_A_email",false,null,["contact_id","%3D","contact_A_email.contact_id"],["contact_A_email.id","%3D","contact_A_email.id"]],["Email AS contact_B_email",true,null,["contact_A_email.email","%3D","contact_B_email.email"],["contact_A_email.contact_id","<>","contact_B_email.contact_id"],["contact_B_email.id","%3D","contact_B_email.id"]]]&select=["contact_B_email.contact_id"]&where=[["group_id","%3D","18"],["status","%3D","Added"],["contact_A_email.is_primary","%3D","true"],["contact_B_email.is_primary","%3D","true"]]&limit=0&groupBy=["contact_B_email.contact_id"]

```

Note you'll need to select your "donated recently" smart group where I have "Email List - CA" in the screenshot. Also, if you'd like to widen the search to include non-primary email addresses, just delete the "where" clauses that refer to "is\_primary".

What this is doing is:

1. *GroupContact... get... Where group\_id = x and status = added*: Search for members of a particular group (in this case, it'll be your "donated recently" group).
2. *Join Email AS contact\_A\_email*...: get those recent donors' email addresses.
3. *Join Email as contact\_B\_email*...: get email addresses that are the same as the ones we just found, but belong to different contacts.
4. *Select contact\_B\_email.contact\_id*: return the contacts connected to those matching email addresses.

Once everything is set up, you can click the Save button and create your smart group. Once you have that, you should be able to exclude these contacts from mailings.

(P.S. There's a quirk about APIv4 which forces me to include the "x.id = x.id" clauses in the joins. I might even call it a bug -- so maybe it will be fixed in future versions.)
> 4 votes

# Answer
I don't have the solution, but we sometimes have similar issues.

Just so I'm clear, let me lay it out for my simple mind..

A and B are two contacts in a family unit, and they have the same email address; C and D are two contacts in a family unit, and they have different email addresses

For A and B: When you get a donation from A in response to a solicitation, you want to not solicit B with follow-on solicitations ***because the family already gave***, ***or is it because the two contacts really*** aren't distinguishable in an email solicitation and A will think you're hitting her up a second time

For C and D: when you get a donation from C in response to a solicitation do you want to: -- ***not solicit D*** with follow-on appeals because their family unit already donated OR -- ***solicit D*** with follow-on appeals because they have a unique email, and maybe both spouses would want to contribute
> 0 votes

---
Tags: civimail, contacts, smartgroups
---


# Question
Title: CiviCRM Smart Group Cache SQL Collation Error
Running CiviCRM 5.32.2 on Drupal 7, PHP 7.3, MySQL 8, Apache2, Ubuntu Server 20.04.

This instance of CiviCRM has just been migrated from another server and the migration has largely gone well.

However, there is one issue that has come up to do with Smart Groups that include other Smart Groups in their criteria.

Rebuilding the Smart Group Cache works fine for 'normal' Smart Groups, but Smart Groups relying on data from other Smart Groups fail with the following sort of error, both when building the cache and trying to view the list of contacts in that Smart Group:

```
backTrace

#0 /var/www/html/dc/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(944): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#3 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#4 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...", "DB_Error", TRUE)
#5 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, "INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...", "3995 ** Character set 'utf8mb4_bin' cannot be used in conjunction with 'binar...")
#7 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
#8 /var/www/html/dc/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#9 /var/www/html/dc/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#10 /var/www/html/dc/sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#11 /var/www/html/dc/sites/all/modules/civicrm/CRM/Core/DAO.php(457): DB_DataObject->query("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#12 /var/www/html/dc/sites/all/modules/civicrm/CRM/Core/DAO.php(1564): CRM_Core_DAO->query("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...", TRUE)
#13 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(488): CRM_Core_DAO::executeQuery("INSERT IGNORE INTO civicrm_tmp_e_gccache_3aec9ce4a5fb0a567be02bc71a5f7774 (gr...")
#14 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3156): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
#15 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3057): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), "civicrm_group_contact_cache_5fe30e787286d", "contact_a", "NOT IN")
#16 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(1819): CRM_Contact_BAO_Query->group((Array:5))
#17 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(2057): CRM_Contact_BAO_Query->whereClauseSingle((Array:5), FALSE)
#18 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(574): CRM_Contact_BAO_Query->whereClause(FALSE)
#19 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(523): CRM_Contact_BAO_Query->initialize(NULL)
#20 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(780): CRM_Contact_BAO_Query->__construct((Array:4), (Array:7), (Array:115), FALSE, FALSE, 1, TRUE, TRUE, FALSE, NULL, (Array:3))
#21 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/GroupContactCache.php(466): CRM_Contact_BAO_GroupContactCache::getQueryObjectSQL("23", (Array:4), "61 AS group_id", "NOT IN (\n                        SELECT contact_id FROM civicrm_group_contac...")
#22 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3156): CRM_Contact_BAO_GroupContactCache::load(Object(CRM_Core_DAO))
#23 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(3057): CRM_Contact_BAO_Query->addGroupContactCache((Array:1), "civicrm_group_contact_cache_5fe30e78711f0", "contact_a", "NOT IN")
#24 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(1819): CRM_Contact_BAO_Query->group((Array:5))
#25 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(2057): CRM_Contact_BAO_Query->whereClauseSingle((Array:5), FALSE)
#26 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(574): CRM_Contact_BAO_Query->whereClause(FALSE)
#27 /var/www/html/dc/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php(523): CRM_Contact_BAO_Query->initialize(NULL)

```

The issue seems to be some DB collation mismatch. I've tried changing collations and character sets but to no avail; just gives the same error.

The Smart Group Criteria worked fine on the previous server (CentOS 7 --- yeah, we're bailing early).

Any wisdom on where to look to fix this?

Thanks

# Answer
Okay, this appears to be an issue with running CiviCRM on MySQL 8. I downgraded to MySQL 5.7 and it's now working. Maybe worth investigating further.
> 2 votes

---
Tags: smartgroups, mysql, cache, mysql-8.0
---


# Question
Title: Having issues updating to civiCRM 5.32.2
So I've downloaded the file to update to civiCRM 5.32.2 and I'm on WordPress 5.6. When I upload the file to the plugins page it tells me that I need to overwrite the other version. Cool no problem. When I tell it to do that it tries for a few minutes and then it gives me a 503 error.

> Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
>
> Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

If I then try to activate the new version of civiCRM the whole site crashes with a fatal error that says the following.

> Warning: include\_once(/home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/includes/civicrm.users.php): failed to open stream: No such file or directory in /home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/civicrm.php on line 623
>
> Warning: include\_once(): Failed opening '/home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/includes/civicrm.users.php' for inclusion (include\_path='.:/opt/alt/php74/usr/share/pear') in /home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/civicrm.php on line 623
>
> Fatal error: Uncaught Error: Class 'CiviCRM\_For\_WordPress\_Users' not found in /home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/civicrm.php:624 Stack trace: #0 /home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/civicrm.php(379): CiviCRM\_For\_WordPress-\>include\_files() #1 /home/enaosj1vvfz0/public\_html/wp-includes/class-wp-hook.php(287): CiviCRM\_For\_WordPress-\>setup\_instance('') #2 /home/enaosj1vvfz0/public\_html/wp-includes/class-wp-hook.php(311): WP\_Hook-\>apply\_filters(NULL, Array) #3 /home/enaosj1vvfz0/public\_html/wp-includes/plugin.php(484): WP\_Hook-\>do\_action(Array) #4 /home/enaosj1vvfz0/public\_html/wp-settings.php(420): do\_action('plugins\_loaded') #5 /home/enaosj1vvfz0/public\_html/wp-config.php(89): require\_once('/home/enaosj1vv...') #6 /home/enaosj1vvfz0/public\_html/wp-load.php(37): require\_once('/home/enaosj1vv...') #7 /home/enaosj1vvfz0/public\_html/wp-admin/admin.php(34): require\_once('/home/enaosj1vv...') #8 /home/enaosj1vvfz0/public\_html/wp-admin/plugins.php(10): require\_once('/home/enaosj1vv...') # in /home/enaosj1vvfz0/public\_html/wp-content/plugins/civicrm/civicrm.php on line 624 There has been a critical error on this website. Please check your site admin email inbox for instructions.
>
> Learn more about debugging in WordPress.

I have all of my other plugins deactivated so I know it's not a conflict there. I've tried using multiple themes so no conflict there. I've even addressed caching issues as described in another thread (Errors involving /wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php)

The only other suggestion my hosting company had was to unzip the file myself and replace the files manually which just seems like a good way to screw up my data.

# Answer
> 1 votes
You can't use the WordPress plugin update system. You must do it via either ftp or SSH. You will find the full documentation at https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/

While complete and accurate, the comprehensiveness of that doc can be a little overwhelming. I created a checklist for myself to cover the bases on my server. It may be helpful to you. You can see my CiviCRM upgrade on WordPress summary here: https://kapn.net/support/civicrm-upgrade/

Some bits are very specific to me but they should be obvious. If it looks like gobbledygook to you then ignore it and focus on the official docs above.

---
Tags: wordpress, upgrade
---


title: Receipt for manual registration - HTML

text:
# Question
Title: Receipt for manual registration - HTML
I'd asked about this almost a year ago, and at the time was pointed towards a patch that was being worked on. But that patch, as I understand it, was closed as incomplete. Does anyone know if additional work was done on it? I really need to be able to have HTML on the confirmation email when you do a manual registration for someone or input a manual payment.

It's fine for now if it doesn't have a WYSIWYG, I just need the field to support HTML.

Right now, we have text on each individual event that gives information about the specific event, such as the location, recommended hotels, etc. It has HTML added manually to it (since that field doesn't have a WYSIWYG). That text all copies over to the receipt when you manually add a training to a record, including all the HTML tags. But when that email sends, it doesn't actually allow HTML. So all those tags just show up in the email as text.

Below is a bit of the text in the receipt that gets sent out with all the tags included. This is a screenshot from the actual email received, not the field inside Civi.

# Answer
> 1 votes
I agree that this should be possible in the manual registration.

However, you could likely work around this using CiviRules. Not knowing your exact situation I'm guessing here, but this is how I might approach it.

1. Install the 'Email API' extension (needed to be able to send email from CiviRules).
2. Install the 'CiviRules' extension.
3. Create a new participant status simply so it can be seen by the rules engine. Maybe something like 'Registered (manual)'.
4. Create a new rule 'send email to manual registrants'.
5. Make the rule trigger 'Event Participant is added'.
6. Add a linked condition to the rule 'Participant status is (not) one of'.
7. Set the condition operator to 'is one of'.
8. Choose the new participant status you created 'Registered (manual)'.
9. Add an Action 'Send Email'
10. In this example, you shouldn't need a delay, but it can be useful to introduce a short delay to allow tables to be updated if you need to test them or get data from them.
11. Lastly, set the email parameters including the message template. You can CC, BCC etc.
12. Save and test with a manual registration for a fake user. You will have to choose you the custom status you created so the rule will trigger.

You could add an additional action to the rule that changed the participant status to the normal one after the email is sent.

---
Tags: civievent, receipts
---


# Question
Title: custom fields become unavailable after a period of time
I have created some custom fields to collect size data as part of an event registration form. When I first create the fields I am able to include them in a profile and use them on the form. At some point though the profile becomes unable to display them and nothing appears. A regular profile preview just shows an empty box, but if I try to preview a single field in the profile then I see the message "This CiviCRM profile field is view only".

However, the field is most definitely not view only:

I have not found any way to make the fields display again. If I create new ones and use them, they will work for a while and then stop.

The further mystery is how they could be broken after a time? A scheduled job? Most of the enabled tasks are "always" and so I would not expect the form to work very long at all (cron runs every 10 minutes on this site). I wonder about the "clean-up" task since it runs hourly, but I'm at a loss to imagine how that would affect custom fields.

Any thoughts folks?

Running 5.31.1 on Wordpress 5.5.3

# Answer
Ultimately, the answer was simply to enable "CiviCRM: access all custom data" for all users in Administer-\>Users & Permissions-\>Permissions-\>WordPress Access Control.

I am unclear whether this presents a data risk. The wording of the permission makes it feel a bit like this, but I guess if a user only has limited access by context then it isn't an issue. I am fervently hoping this is so.

The reason it appeared to work at first was related to browser and server caching. As soon as the caches cleared it failed.
> 2 votes

---
Tags: custom-fields
---


title: Can't add dashlets on dashboard

text:
# Question
Title: Can't add dashlets on dashboard
on Drupal 7.67 + CiviCRM 5.32.2 I do can see the dashlets but I lost ability to add and suppress them, so I guess Ajax doesn't work any more. It stopped working with the upgrade to 5.32.2 before it was functioning.

Clicking on the cross also has no impact but I can move them once added on the dashboard.

Changing the jquery version in theme settings doesn't help (I've tried various versions from 1.4 to 3.1).

Is there a special setting in CiviCRM or is it a bug in 5.32.2?

These are the message in the javascript console:

```
Uncaught SyntaxError: expected expression, got '}' js_tirzwVKQe_kXpvFPxNVA-vmv7H54qthEMinEoehf1m8.js:12:51
else this._+='L'+(this._x1=t)+','+(this._y1=n);else},arc:function(t,n,e,r,i,a){t=+t,n=+n;var l=(e=+e)*Math.cos(r),f=e*Math.sin(r),u=t+l,c=n+f,s=1^a,o=a?r-i:i-r;if(e<0)throw new Error('negative radius: '+e);null===this._x1?this._+='M'+u+','+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+='L'+u+','+c),e&&(o<0&&(o=o%Ua+Ua),o>Dp?this._+='A'+e+','+e+',0,1,'+s+','+(t-l)+','+(n-f)+'A'+e+','+e+',0,1,'+s+','+(this._x1=u)+','+(this._y1=c):o>1e-6&&(this._+='A'+e+','+e+',0,'+ +(o>=Fa)+','+s+','+(this._x1=t+e*Math.cos(i))+','+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+='M'+(this._x0=this._x1=+t)+','+(this._y0=this._y1=+n)+'h'+ +e+'v'+ +r+'h'+-e+'Z'},toString:function(){return this._}};function ri(){};function gt(t,n){var r=new ri;if(t instanceof ri)t.each(function(t,n){r.set(n,t)});else if(Array.isArray(t)){var a,e=-1,o=t.length;if(null==n)for(;++e<o;)r.set(e,t[e]);else for(;++e<o;)r.set(n(a=t[e],e,t),a)}

```

# Answer
Most likely there is a js code error somewhere on your site (could be from any module). Keep debugging it by clicking the error message in the console.

But FYI, CiviCRM v5.33 comes with completely rewritten dashboard code. So upgrading may solve your problem too.
> 2 votes

---
Tags: dashboard
---


# Question
Title: Smarty contribution summary works on one site, but not another on the same server
I have burned hours on this and feel at a wall. Would appreciate some fresh eyes to shed light on new avenues of exploration.

I am using "find Contributions" to generate a list of contributions. I then choose "Thank you letters" and then choose the template I created.

In the template I am using some Smarty code that I found online last year that summarizes contributions and creates a neat table:

```
{foreach from=$contributions item=contribution}
     {assign var="date" value=$contribution.receive_date|date_format:"%d %b %Y"}
    <tr>
        <td>{$date}</td>
        <td style="text-align:right;">${$contribution.total_amount|number_format:2:".":","}</td>
        <td>{$contribution.payment_instrument}{if $contribution.check_number neq""} - #{$contribution.check_number}{/if}</td>
        <td>{$contribution.campaign}</td>
        <td>{$contribution.contribution_source}</td>
    </tr>
{/foreach}
    <tr>
        <th>2020 TOTAL</th>
        <th style="text-align:right;">${$contribution_aggregate|number_format:2:".":","}</th>
        <th> </th>
        <th> </th>
        <th> </th>
    </tr>

```

It works great on one site producing a neat table:

However, on another site on the same server, I get "There has been a critical error on this website. Please check your site admin email inbox for instructions."

Checking the Apache error log I find a somewhat non-specific error:

```
[Wed Dec 23 13:51:44.466136 2020] [php7:error] [pid 31786] [client maskedIP:43002] PHP Fatal error:  Smarty error: [in string:<table align="left" border="1" cellpadding="5" cellspacing="0" class="table" style="margin-top:15px;">\r\n\t<tbody>\r\n\t\t<tr>\r\n\t\t\t<th>Date</th>\r\n\t\t\t<th style="text-align:right;">Amount</th>\r\n\t\t\t<th>Method</th>\r\n\t\t\t<th>Campaign</th>\r\n\t\t\t<th>Note</th>\r\n\t\t</tr>\r\n\t\t<!--\r\n    {foreach from=$contributions item=contribution} {assign\r\n    var="date" value=$contribution.receive_date|date_format:"%d %b\r\n    %Y"}\r\n  -->\r\n\t\t<tr>\r\n\t\t\t<td>{$date}</td>\r\n\t\t\t<td style="text-align:right;">${$contribution.total_amount|number_format:2:".":","}</td>\r\n\t\t\t<td>{$contribution.payment_instrument}{if $contribution.check_number neq""} - #{$contribution.check_number}{/if}</td>\r\n\t\t\t<td>{$contribution.campaign}</td>\r\n\t\t\t<td>{$contribution.contri in /var/www/masked-url.org/wordpress/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1100, referer: https://masked-url.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontribute%2Fsearch&_qf_PDFLetter_display=true&qfKey=bd001d277ba51fe3447c1acb3c2bed4dceb754c89022040c362d62bb4e04b4b3_9738

```

I have disabled entities in the CKEditor on both sites:

I have ensured Smarty is enabled in message templates and the error log confirms that because the error is clearly Smarty related.

I have literally cut-and-pasted the code from one site to the other and not changed it in any way.

I am able to do a very simple test successfully by putting the following code into a template:

```
<p>{$smarty.now|date_format}</p>
<p>{$smarty.version}</p>

```

I get valid output for that simple test on both sites:

I have also tried writing other Smarty code, but have had no luck getting anything other than that basic case to work. Likely that has at least something to do with my limited Smarty experience. However, the first code I shared works just great on one site and fails on the other.

**Site 1 (works):** WordPress 5.6, PHP 7.3.22, CiviCRM 5.30.0, Smarty 2.6.31 (though this seems very old so I expect it has been the CiviCRM version for a long time)

**Site 2 (doesn't work - error above):** WordPress 5.6, PHP 7.3.22, CiviCRM 5.32.2, Smarty 2.6.31

While the CiviCRM versions differ, I would hope that this is not a regression. It seems especially unlikely since the Smarty version has not changed.

Hoping someone can shed light or offer other places to look for useful logs that might provide a clue.

# Answer
> 2 votes
Thanks to @demerit for suggesting a way to capture the full Smarty error in the log. I discovered that I was not getting the entire error in the Apache log. Using `CRM_Core_Error::debug_log_message($error_msg);` I was able to capture the entire error which included the following useful line:

```
 line 17]: [plugin] (secure mode) modifier 'number_format' is not allowed (Smarty_Compiler.class.php, line 1934)

```

Searching the web for that error revealed a post from Jan 2016 which showed that `number_format` is not supported, but one must use `crmNumberFormat` instead.

Making this replacement solved the problem. It remains a mystery why `number_format` works in another of my CiviCRM installations when it seems to have been an issue since at least 2016. However, that is a problem for another day. For now I am happy to have resolved the issue on this installation.

The corrected table is as follows:

```
<table align="left" border="1" cellpadding="5" cellspacing="0" class="table" style="margin-top:15px;">
<tbody>
    <tr>
        <th>Date</th>
        <th style="text-align:right;">Amount</th>
        <th>Method</th>
        <th>Campaign</th>
        <th>Note</th>
    </tr>
    <!--
{foreach from=$contributions item=contribution} {assign
var="date" value=$contribution.receive_date|date_format:"%d %b
%Y"}
-->
    <tr>
        <td>{$date}</td>
        <td style="text-align:right;">${$contribution.total_amount|crmNumberFormat:2:".":","}</td>
        <td>{$contribution.payment_instrument}{if $contribution.check_number neq""} - #{$contribution.check_number}{/if}</td>
        <td>{$contribution.campaign}</td>
        <td>{$contribution.contribution_source}</td>
    </tr>
    <!--
{/foreach}

-->
    <tr>
        <th>2019 TOTAL</th>
        <th style="text-align:right;">${$contribution_aggregate|crmNumberFormat:2:".":","}</th>
        <th> </th>
        <th> </th>
        <th> </th>
    </tr>
</tbody>

```

# Answer
> 1 votes
I've recently burned a lot of time on what looks like the same problem. For me it was a the CK editor persisting in browser cache, refusing to pickup updated configuration (which looks right in your screenshot).

Try different browser (or clean browser cache) and save the correct template again. Then test it. It should work.

---
Tags: civicontribute, message-templates, smarty
---