# Question
Title: Drupal Webform civicrm_options workaround for conditonal states
I am converting some D7 forms and came across a problem this week with adding conditionals. On one form, I display a text field if one of a set of 8 check boxes is checked. It's the common form usecase to collect more information if the 'Other' choice is also selected.

When this is added to the webform automatically it is added as type 'civicrm\_options'. To add a conditional, I went to the text field and selected that I wanted it to be Visible if the 'Other' option was selected:

Try as I might I could not get this to fire. I made a test 'Table Select' element to see if I could mimic the behaviour and it worked fine... Looking a the source of the condition, the penny dropped:

This is the source that is produced by following what the UI allows you:

```
 visible:
  ':input[name="civicrm_1_case_1_cg43_custom_426"]':
    value: '6'

```

This is the source that I got from my test Table select element:

```
 visible:
  ':input[name="choice_multi[4]"]':
    checked: true

```

So the work around for me was to add the same syntax:

```
visible:
  ':input[name="civicrm_1_case_1_cg43_custom_426[6]"]':
    checked: true

```

This gives you this final result when it is viewed through the UI:

It perhaps should have been obvious, but maybe just an issue with the Webform CiviCRM integration. Anywway, I hope this helps others!

**An open question** \- I tried changing the type of my CiviCRM element from **civicrm\_options** to **tableselect**. It all seemed to work fine and values seemed to save OK. I am nervous about making those sorts of changes as it is only possible to do this sort of thing through the build YAML source. If it not dangerous, it might be far easier as then you get a far easier interface to do the conditionals.

# Answer
> 2 votes
I would retype from CiviCRM Options -\> Checkboxes. Then not only are conditionals way easier, you will also get some nice layout options -\> e.g. 2 columns or 3 columns.

---
Tags: webform-civicrm
---


title: Migrate/Update CiviCRM

text:
# Question
Title: Migrate/Update CiviCRM
We are running an old version of CiviCRM (5.3?) and we have planned to upgrade to a newer version and at the same time we planned to put CiviCRM in cloud. Our existing server is also old and seems to be not quite working recently. Is it true that we need to install the 5.3? version of CiviCRM (including the older version of PHP, MYSQL, and Wordpress) in the cloud first, import the data (created by MySqlDump) from the 5.3? version of CiviCRM into the newer version in cloud, then follow by the upgrade. OR create a new version of CiviCRM in the cloud and import the data over? I am new to CiviCRM, please give your advice and suggestions? Thanks

# Answer
You don't have to install the old version in the cloud first, but you may have to go in small steps (e.g. maybe do 5.13, then 5.23, etc, just as examples), and you will have to first downgrade the cloud version of php to 7.2 until you get to closer the end.
> 0 votes

# Answer
It depends on how dependent on your contact history you are and/or how many CiviCRM modules you use. We moved to the cloud (AWS Lightsail) last year. We are 'light' users. In 10 years on the old server, we had never used our contacts' history. So I installed the latest versions of everything. I re-created the old tags and groups and custom fields on the new server. Then I exported the contact data, tags, groups (as tags) and custom fields as CSV and imported the CSVs into the new server. No issues to date.
> 0 votes

---
Tags: upgrade, migration
---


# Question
Title: Is there a setting for Drupal Webform displaying raw token when they have no data to display
I am converting a Drupal 7 webform that uses two tokens in a text field's default data field to display data passed in via the URL e.g.

```
/myform?civicaseID=12345&sessionID=6789&cid1=9876&cid2=8765&cid3=7654

```

The tokens in the text fields default value are:

```
[current-page:query:civicaseID] [current-page:query:sessionID]

```

The link, created from a Drupal View, supplies all the data. Some links include `...&sessionID={{ xyz }}` and some do not depending on the context. The same form is reused for all instances, it is just that for some, we do not need to display this additional session ID data.

For all cases it displays the CiviCRM case ID as it is always present, the second token would not print if there was no data in the URL, now, it just prints the token itself if there is no data e.g. for this URL:

```
/myform?civicaseID=12345&cid1=9876&cid2=8765&cid3=7654

```

It populates that text field with:

```
12345 [current-page:query:sessionID]

```

Is there a setting/technique to hide this behaviour somewhere, or is it a bug?

# Answer
OK - I found the answer with a bit of a hack - you need to include the parameter in the URL whether you are going to use it or not.

So in my View I used to create and display links to this form with parameters depending on the context. Now, I just include &sessionID= and it works fine e.g. even though I know a particular link does not need this parameter, I just supply it anyway:

/myform?civicaseID=12345&cid1=9876&cid2=8765&cid3=7654&sessionID=

This seems to work fine and I've not seen any side effects for it.
> 1 votes

---
Tags: webform-civicrm, tokens
---


title: Get uploaded file full URL via API v4

text:
# Question
Title: Get uploaded file full URL via API v4
CiviCRM: v5.57.3 *(Currently waiting for a 3rd Party plugin to be updated to be compatible with the latest version.)* WordPress: v6.2.2

We have a custom field attached to CiviEvents that lets the team upload an image to be used when outputting the Event on the public front end.

We are building the front end outside of CiviCRM by using API4 to fetch data.

We can retrieve the file details via joining to the File on the custom field.

```
{
  "id": 1,
  "Events_.Image": 1234,
  "file.id": 1234,
  "file.file_type_id": null,
  "file.mime_type": "image/png",
  "file.uri": "example.png",
  "file.document": null,
  "file.description": null,
  "file.upload_date": "2023-07-05 16:00:00",
  "file.created_id": null

```

What we are having issues with is taking this information and getting a full URL to be used inside an `<img>` tag. eg, `https://www.example.test/app/uploads/civicrm/custom/example.png`.

I'd expect a function along the lines of `get_image_url(1234);` but cannot find anything within the CiviCRM documentation.

Any guidance is much appreciated.

# Answer
> 2 votes
With the help of Lars SG's links. I created a, PHP 8, helper function to get a URL based on a file ID provided by the API.

```

function se_45209_get_entity_image_url( int $entity_id, int $file_id ): string
{
    if ( $file_id === 0 ) {
        return '';
    }

    $file_hash = is_callable( [ 'CRM_Core_BAO_File', 'generateFileHash' ] )
    ? CRM_Core_BAO_File::generateFileHash( $entity_id, $file_id )
    : '';

    return CRM_Utils_System::url(
        path: 'civicrm/file',
        query: "reset=1&id={$file_id}&eid={$entity_id}&fcs={$file_hash}",
        frontend: true
    );
}

```

*Caveat: This does require the CiviCRM plugin to be loaded.*

# Answer
> 1 votes
Short answer: Use the Attachments API instead, but it isn't available in API 4 yet, so you'll have to use API 3. See this previous question for discussion.

---
Tags: wordpress, apiv4, attachments, files, upload
---


# Question
Title: Using Civi to Store historical mailing data, and auto updating
I was asked to implement a system within civi where we can **upload historical record of email** messages. I then found out these are supposed to be **auto updated with new messages every time a certain user sends a message**?

Not sure where to start with the implementation. I made a tab within a contact to write everything for a message, this would work great manually. I thought about using the mail account on civi then checking inbound messages and somehow storing it in a contact... but I'm really new this stuff.

Any tips are appreciated :)

Additional info: we currently use Gsuite and it would be specific accounts within the org that need to be storing their emails

# Answer
> 1 votes
Two options for the past emails:

1. You'll want to store the emails as activities, which you can import from a CSV. I'm sure you can find a Google Apps Script that will pull all a users emails based on whatever criteria you like into Google Sheets and then export that to CSV. Do you want to connect these activities to other contacts in CiviCRM (the contacts the emails went to)?
2. Depending on the number of accounts you are talking about and how the emails are stored, you could use Email-to-Activity processing with a specified IMAP folder and just go through each email account in turn by changing the settings in the Mail Account. The downside here can be that you'll create contacts for all cc-ed emails as well as from and to emails.

For new messages, have you read Email-to-Activity processing?

---
Tags: activities, data-import, inbound-email, mail
---


title: Household Configuration on Spark

text:
# Question
Title: Household Configuration on Spark
I am launching a new organization, and CiviCRM Spark looks like a great fit.

I noticed on the "subscription" page that the household configuration is disabled by default. Is it possible to enable that configuration using Spark?

# Answer
Yes - once you have signed up, you can email spark@civicrm.org and it will be enabled.
> 1 votes

---
Tags: households, civicrm-spark
---


# Question
Title: Do we need to restore civicrm_cache in upgrades?
when we upgrade to newer versions of civicrm, do we need to restore records from the civicrm\_cache in the old version to the new one? Thanks

# Answer
> 1 votes
No, civi clears cache on purpose during upgrade.

I'm assuming you're having some cache problem. Such problems are almost always caused by file system permissions. Check the cache folder is writable by the web server unix user (e.g. apache, wwwrun, etc)

---
Tags: cache
---


# Question
Title: Installation failure - doesn't to write to database (D7)
I'm unable to install CiviCRM under Drupal 7. This is something I've done dozens of times, to be clear. I install a clean D7 system (7.97 but also tried 7.95), the Civi install runs, I then get the usual screen that invites me to configure the install, but clicking that link fails because the database hasn't been written to. I raised a ticket with the hosting company as I surmised that something their end had changed - they tried and failed to install in the same way too, but came back to say it was an application problem. For the nth time I now have a clean D7 system sitting there, and ideally would like to install in 'debug' mode to try & track down the problem. Is this possible? Or would it be better to use the command line install (not something I'm familiar with)? The problem looks very similar to this but that was Wordpress.

# Answer
This turned out to be a hosting problem. It took a while to resolve, and I don't know what was fixed but it's all OK now. This is one of the problems of using shared hosting, of course - it's cheap but you are vulnerable to arbitrary updates - and there's also the problem of email delivery (I use mailjet to get round this).
> 1 votes

---
Tags: drupal, installation, install
---


title: Gift Aid - help needed

text:
# Question
Title: Gift Aid - help needed
I am very behind with GA claims, partly because I find it so difficult to remember how to generate the report I need out of Civi. I don't get on with extensions - I don't have the technical ability - so just want an aide memoire for how to run the report for each quarter in order to populate the HMRC template (I am comfortable with that end of it). I don't use Civi day-to-day, only for this report really. Can anyone help with a reminder of how to do it? Many thanks.

# Answer
> 0 votes
Assuming you are using the UK Gift Aid extension the official documentation has some really useful guidance for all of it, including how to generate the relevant report/batches

https://docs.civicrm.org/ukgiftaid/en/latest/batches/

Do have a look and if you have any more questions or need further guidance just update your question and I'm sure a member of the community will be able to help.

# Answer
> 0 votes
Gift Aid is complicated but the Gift Aid extension is intended to simplify handling it in Civi. You are going to need to do a lot of extra work in Civi to handle GA if you don't want to use the extension.

Some extensions do require more technical knowledge to install and configure but those that are available to install from the `Add New` tab of the `Administer > System Settings > Extensions` should be well tested and easy to install (sometimes referred to as 'in-app distribution').

If you don't feel confident doing that it is probably worth talking to someone (see list) to help get Civi configured appropriately for your needs, including Gift Aid.

---
Tags: civireport
---


# Question
Title: Can I manually add recurring contributions?
Is there a way to add a recurring donation if it hasn't been processed through CiviCRM? We are migrating over to Civi and some people give us donations through a direct bank transfer on a monthly basis. It would be helpful to be able to record these to their record on an ongoing basis. Thanks.

# Answer
> 2 votes
Using Offline Recurring Payment Extension can add recurring contributions in Civi.

Also membership extras extension provides the feature but also some additional features which your Organization may or may not be needed.

# Answer
> 2 votes
We use the CiviContribute Recur Extra extension for this. See the readme section here for details on how to set this up.

---
Tags: civicontribute
---


title: intermittent file not writable error

text:
# Question
Title: intermittent file not writable error
CiviCRM 5.62.1 / Wordpress 6.2.2

I have an intermittent error on the version check action as part of my cron. It'll run fine for a couple of days, then fail, then run again. I suspect an over enthusiastic Wordfence plug-in. I think the issue started around the same time Wordfence left 'training' mode, but I don't know which file to tell Wordfence to ignore.

The other actions on my cron seem to be fine, so I think it's just this one file relating to the version status that's affected.

Any suggestions?

2023-07-09 09:05:03 CiviCRM Update Check
Entity: job Action: version\_check Summary Finished execution of CiviCRM Update Check with result: Success (1)

2023-07-08 09:05:03 CiviCRM Update Check
Entity: job Action: version\_check Summary Finished execution of CiviCRM Update Check with result: Failure, Error message: File not writable

# Answer
> 1 votes
The version check job tries to write a file in the upload directory, typically `wp-content/uploads/civicrm/upload` Check the file permissions to make sure those files and directories are writable by the OS user that runs the webserver (might be `www-data` or `http` etc)

---
Tags: cron-job, scheduled-job, filesystem, version
---


# Question
Title: How to create relationships during event registration
I would need to create **relationships** between participants when **registering for an event** in the CiviCRM online registration form.

I have seen there is an **CiviCRM extension** that promises to do that:

https://civicrm.org/blog/sarahgladstone/new-extension-creating-relationships-durring-event-registration

but it seems it is not fully developed yet.

I have tried to use Caldera Forms for the event registration, as the CMS is WordPress, but it can't process payments as this plugin is no longer maintained and I can't get a license for the integration of the Payment processors with Caldera Forms.

Is there any **CiviCRM extension** that allows to **create relationships between participants** to an event?

Any help will be very much appreciated.

# Answer
I don't think there is an extension, but you can write an extension add a relation between Additional participant and Primary participant
> 1 votes

# Answer
CiviRules perhaps? Haven't tested it personally, however it has "Participant is added" trigger and "Add Relationship" Action so maybe it can do.
> 1 votes

# Answer
The "Group Event Participant Registration" extension does create relationships among contacts in in a multi-participant registration.

(I'm the author. The extension has been in production use for a couple of years by a client, but I've never bothered to promote it or list it on civicrm.org.)

The basic intent is to allow one person (who may not even be attending) to register others in their family or workplace. From the readme:

> * Allows registering user to indicate whether they will attend the event or not.
> * Provides list of related contacts as optional pre-filled additional participants.
> * Related contacts may be related directly to the registering user, or (optionally) through a mutually related organization.
> * Records all additional participants as related to user, with relationship type selected by user.
>
> ... See beta demo video here: https://www.youtube.com/watch?v=2zd3bENs0Ow&t=722s
> 1 votes

---
Tags: civievent, relationships, participants
---


title: Publish FormBuilder to Edit Contact

text:
# Question
Title: Publish FormBuilder to Edit Contact
In my **WordPress installation** I am working with a **form** to **edit** a **profile** because we need contacts to be able to fill in information from their own custom fields. I have also enabled the two boxes for "Upgrade" and "Accept ID from URL",

however when I open the link with ID contact in another browser **I DO NOT SEE THE PROFILE AND THE FIELDS**. Am I doing something wrong?

https://www.redmaternoinfantil.org.mx/civicrm/prueba/#?individual=1250

> (I can only see it if I'm logged in)

**This is the configuration of the form:**

1. Permission: **CiviCRM: Edit Profile**
2. Accessible on front-end of website: **Enable**
3. Security: **Open Access**
4. Allowed Actions: **Update**
5. Autofill: Neither

# Answer
> 0 votes
I am starting to test Form Builder, making my first steps, and faced the same issue. My understanding is that you need your form to be accessible by users that are not loggued in, right ? What I found is that the permission on the form should be : "Generic / allow all users (including anonymous)" Did you come to the same conclusion?

---
Tags: wordpress, contacts, profile, formbuilder, individual
---


# Question
Title: Add Custom Field Set to Contributions Edit/View
I have a bunch of custom field sets used for contributions. Most of them show up as collapsed groups when I edit a single contribution, but one of them does not. Is there a method to show a custom field set on the individual contribution?

# Answer
To debug this issue, examine the missing custom field (Administer \> Custom Data and Screens \> Custom Fields) and what exactly it is extending on a contribution entity. Is it for Contributions in general, or does the custom field that is "missing" only apply to a certain financial type potentially?

Also, check if there are any customization that may be not be showing them. If you are an admin, you can probably rule this out.
> 1 votes

---
Tags: civicontribute, custom-fields
---


# Question
Title: Editing / disallowing certain values in input fields
Is there a way in CIVICRM to not allow certain values in input fields? For instance, I do not want folks to put "Self-Employed" in the Organization field of an organization contact.

# Answer
> 1 votes
For something that specific you'd need to write an extension. It would be a small one though, where you just use hook\_civicrm\_validateForm to check the value and reject it.

---
Tags: configuration
---


# Question
Title: How to disable edit of all contact but allow creation of case?
I wish to create a role that is able to view all contacts, but unable to edit the contact details. However, this role should be able to create cases. I have tried the disable the access on "Edit All Contacts' and "Edit My COntacts". However, when I use disable the rule, I am unable to create case

# Answer
The below works for me just if you don't have Add Contacts permission you have to visit the contact summary first and then choose Add Case from the Actions dropdown.
> 0 votes

---
Tags: civicase, access
---


title: Easy way of one word translation?

text:
# Question
Title: Easy way of one word translation?
There is a code added somewhere amongst Wordpress theme php files:

```
function functionFunction() {
  var ts = CRM.ts();
  theButton =
  "<a id=thebutton href=/civicrm/contribute/transact/?reset=1&id=6>"
  + ts("The Button to translate")
  + "</a>";
  return theButton;
}

```

A website is multisite + multilingual ( and none of the languages is English ), therefore **The Button to translate** needs to be translated to all enabled languages and be preserved during l10n updates.

There are some recipies here https://explore.transifex.com/civicrm/civicrm/ and and here https://docs.civicrm.org/dev/en/latest/extensions/translation/#for-developers-generate-po-and-mo-files-for-your-extension and also here https://github.com/civicrm/civistrings and there How to add additional custom translation for a payment processor?.

However none of these addresses the situation where we need to translate a few lines of text without messing with MO/PO, gettext/poedit, etc., etc. It looks like the closest one could get is to create an "empty" extension, the single purpose of which would be MO files accommodation - and even in this case we need to "merge" the extension translation file with the rest of it, which seems to be a bit too much for a small amount of text.

Am I missing something here? Any alternatives/workarounds/hacks/fast&dirty tricks?

# Answer
Following on from comments, if this is custom code then you can use CRM.config.locale and hardcode the translation there, e.g.

```
var text = 'banana';
if (CRM.config.locale == 'fr_FR') {
  text = 'banane';
} elseif (CRM.config.locale == 'de_DE') {
  text = ... etc
...
}
theButton =
  "<a id=thebutton href=/civicrm/contribute/transact/?reset=1&id=6>"
  + text
  + "</a>";

```
> 2 votes

# Answer
Last I remember Administer - Customize - Word Replacements works for this it's just not obvious how to enter the text for the other languages. You need to switch to the language first then load the form. And the left hand side is always the en\_US word.
> 1 votes

---
Tags: wordpress, translation, multilingual, l10n, transifex
---


title: CiviCRM SearchKit Field Style

text:
# Question
Title: CiviCRM SearchKit Field Style
I have built a table in SearchKit and I want to colour the rows based on a person display name. Whilst the available styles are useful I would like to expand these to have more colours available I have searched on Google and looked through Civi docs but could not find much information. Any ideas would be much appreciated. See the image below for further detail:

# Answer
You can add your own class with the Other option and then load some css targeting that class, either via a custom css file (under Admin \> System Settings \> Resource URLs), from your CMS or in an extension. The custom css file option is the easiest, though it will load on all pages.
> 2 votes

---
Tags: searchkit, css
---


# Question
Title: Delay webform submission until email confirmation link clicked
We've just started using Drupal webform to offer a front-end to our email subscribers sign up form. Because we offer a number of different newsletters in different languages, we have a number of checkboxes to opt into these. In CiviCRM we run smart groups to gather up who receives which newsletter. Users are also added to a generic "subscribers" group when they click the confirmation link they receive in their email.

I just realised that this means that we're effectively bypassing the confirmation email phase. We could feasibly end up sending newsletters to people who haven't opted into them. Is there a way to configure this so that either a) no data is added to CiviCRM until the user clicks the confirmation link or b) users are set to "on hold" until they click the confirmation link?

Thank you!

# Answer
> 1 votes
Could you just make a smart group that is contacts with group status pending for the subscribers group and then exclude that smart group from your mailings? Alternatively, you could add this criteria to your newsletter groups (this can be achieved with SearchKit).

# Answer
> 1 votes
On the webform you can add them to e.g. Subscribers Group (a regular Group) and set Webform (Additional Settings) -\> Confirm Subscriptions.

Then Newsletter A Smart Group can be: All Contacts in Subscribers + who have indicated 'yes' (or checked box for) Newsletter A.

If they remain Pending in Subscribers group (i.e. if they don't confirm their email address) they will never be Added - they are never added to any Newsletter A, B, or C Smart Group.

---
Tags: civimail, webform-civicrm
---


title: Unique Membership Configuration/Tiers

text:
# Question
Title: Unique Membership Configuration/Tiers
New to CiviCRM and I'm trying to understand the best way to configure some unique memberships requirements for an organization.

The organization has the following types of memberships:
**Individual - US Domestic** \- $125/yr
**Individual - International** \- $145/yr

**Institutional** \- $425/yr (max 4 members, then +$125 for each member over 4)

What would be the best way to configure and manage this in CiviCRM?

# Answer
> 1 votes
Welcom. Do the first 2 either as different Memb Types, or as Price Set options.

For the latter do you want the related contacts data in civicrm or not?

Either should be possible out of the box. If you do want their data then you should use Related Contacts. How you approach it in terms of the form will depend on your CMS.

if this was Drupal I would expect it can all be achieved via Webform. Hmm less certain how to do this in pure civicrm if you need all the related contact details without jumping through a few hoops (eg using several forms)

---
Tags: civimember
---


# Question
Title: Error updating to civicrm 5.50.3 / Drupal 7.9
Attempting to update Civi to 5.50.3 \[Drupal 7.9, updating from 5.47, PHP v7.3, Server version: 5.7.36-39-log - MySQL Community Server (GPL)\]

Run into PEAR related database update error. Any thoughts/assistance most appreciated.

Full screen text as follows: Skip to main content \[Error: Convert "is\_autorun" to "runner"\] Error Field Error Value Type DB\_Error Code -19 Message DB Error: no such field Mode 16 UserInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\] DebugInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\] PEAR\_Exception: DB Error: no such field in /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922

* DB\_Error: DB Error: no such field in unknown on line unknown Exception trace

# Function Location

0 CRM\_Core\_Error::exceptionHandler(Object(DB\_Error)) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922 1 PEAR\_Error-\>\__construct('DB Error: no suc…', -19, 16, Array, 'UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB.php:997 2 DB\_Error-\>\__construct(-19, 16, Array, 'UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575 3 PEAR-\>\_raiseError(Object(DB\_mysqli), null, -19, 16, Array, 'UPDATE civicrm\_q…', 'DB\_Error', true) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223 4 PEAR-\>\__call('raiseError', Array) /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1928 5 DB\_common-\>raiseError(-19, null, null, 'UPDATE civicrm\_q…', '1054 \** Unknown …') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:936 6 DB\_mysqli-\>mysqliRaiseError() /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php:406 7 DB\_mysqli-\>simpleQuery('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/vendor/pear/db/DB/common.php:1234 8 DB\_common-\>query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:2696 9 DB\_DataObject-\>\_query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/packages/DB/DataObject.php:1829 10 DB\_DataObject-\>query('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:472 11 CRM\_Core\_DAO-\>query('UPDATE civicrm\_q…', true) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/DAO.php:1637 12 CRM\_Core\_DAO::executeQuery('UPDATE civicrm\_q…') /home/everyball/www/www/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FiveFortyEight.php:107 13 CRM\_Upgrade\_Incremental\_php\_FiveFortyEight::convertAutorun(Object(CRM\_Queue\_TaskContext)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Task.php:73 14 CRM\_Queue\_Task-\>run(Object(CRM\_Queue\_TaskContext)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Runner.php:215 15 CRM\_Queue\_Runner-\>runNext(true) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:36 16 CRM\_Queue\_Page\_AJAX::{closure}() /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:89 17 CRM\_Queue\_ErrorPolicy-\>call(Object(Closure)) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:38 18 CRM\_Queue\_Page\_AJAX::runNext() /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:285 19 CRM\_Core\_Invoke::runItem(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 20 CRM\_Core\_Invoke::\_invoke(Array) /home/everyball/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 21 CRM\_Core\_Invoke::invoke(Array) /home/everyball/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471 22 civicrm\_invoke('upgrade', 'queue', 'ajax', 'runNext') /home/everyball/www/www/includes/menu.inc:527 23 menu\_execute\_active\_handler() /home/everyball/www/www/index.php:21 24 {main}

# Answer
> 1 votes
This can happen if you try to re-run through the 5.48 part of the import and didn't do a complete drop of the database before restoring from backup. Find a pre-5.48 backup, drop the database completely, restore that backup, and then run the upgrade again.

Update: To address the second issue below in comments, what *might* work is:

* drop the database completely
* restore the "corrupted" 5.47 database:
* then do `DROP TABLE civicrm_queue;`
* then do the following, but if your database tables use utf8 instead of utf8mb4 then replace utf8mb4 below with utf8 everywhere. (You can check with something like `SHOW TABLE STATUS WHERE name = 'civicrm_contact';` and look in the collation column.)

```
CREATE TABLE `civicrm_queue` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Name of the queue',
  `type` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Type of the queue',
  `runner` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the task runner',
  `batch_limit` int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Maximum number of items in a batch.',
  `lease_time` int(10) unsigned NOT NULL DEFAULT 3600 COMMENT 'When claiming an item (or batch of items) for work, how long should the item(s) be reserved. (Seconds)',
  `retry_limit` int(11) NOT NULL DEFAULT 0 COMMENT 'Number of permitted retries. Set to zero (0) to disable.',
  `retry_interval` int(11) DEFAULT NULL COMMENT 'Number of seconds to wait before retrying a failed execution.',
  `status` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'active' COMMENT 'Execution status',
  `error` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Fallback behavior for unhandled errors',
  `is_template` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Is this a template configuration (for use by other/future queues)?',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC

```
* then run the upgrade

# Answer
> 1 votes
This worked for me. I followed the steps, but I had to disable foreign keys and after re-creating the table civicrm\_queue re-enable them by doing: SET FOREIGN\_KEY\_CHECKS=0; -- disable, ... SET FOREIGN\_KEY\_CHECKS=1; -- to re-enable them

---
Tags: upgrade, database
---


title: How to add/change the default language?

text:
# Question
Title: How to add/change the default language?
Brand new CiviCRM user here. Currently the default Language in Settings - Localization is English (United States). There are no other language options currently available in the Available Languages section. I would like the default language to be English (Australia), but can't find any information on how to do this. I notice that the Formatting Locale has many language options available, including the one I want. Any assistance appreciated, thanks!

# Answer
First you will need to load the languages from a separate download file, the localization files. Once these files are in place you will be able to select other languages.
> 1 votes

---
Tags: default-settings, language
---


title: can't install German language

text:
# Question
Title: can't install German language
I followed the description as in: https://lab.civicrm.org/dev/translation/-/wikis/Administrator-Guide to install additional languages (Joomla).

This is what my directories look like:

and:

Nevertheless, I only see 'English (US)' as possible language in the Administration console.

What can I do to switch to German (no other language needed)?

Thx, Stefan

# Answer
You need to add the l10n and SQL folder inside `/administrator/components/com_civicrm/civicrm` folder.

You will need to move all the folder `httpdocs/components/com_civicrm/civicrm/` to `httpdocs/administrator/components/com_civicrm/civicrm/`
> 2 votes

---
Tags: joomla, language
---


title: Contact layout not behaving as expected

text:
# Question
Title: Contact layout not behaving as expected
I am testing Contact Layout and I have what I think is a permissions issue to see the layouts. We use Drupal 7.92 and CiviCRM 5.54, Contact Layout is v2.1.1.

I have installed Contact Layout and have created a single additional layout called Elevated. The Elevated layout is a clone of the system fallback, with just the addition of the Demographics block:

The Display Preferences exclude the Demographic block for all users and this is rightly (I believe) reflected by the System Default layout.

If you are a member of one one of four ACL groups, I want you be able to view (if you have permission) Individuals, of any contact subtype, with the addition of the Demographics block:

This works perfectly when I personally log in as a user that is a member of one of those groups.

The issue is it does not fall back if I log in as a user that is not in one of those groups - the Demographic block is still displayed. Also, I do not see the Layout labels,

So I assume this a permissions issue with my setup? What permissions are required for a logged in user be filtered by and see the appropriate layout? If I change the group I'm in and reload the page, it swaps between Default and Elevated, as I assume it should. I have admin privileges on Civi, but most users do not.

I logged in as a colleague who also has various admin privileges but is NOT a member of any the four groups and she gets the Elevated label displayed... But, as I say, if I change my group membership, the label change works... Yet I am the Uber admin for Drupal and CiviCRM?

Can someone explain how this is supposed to work! There must be a combination of Drupal and CiviCRM privileges going on here, or possible weird caching issue? (I am clearing caches regularly on the command line though!)

# Answer
The 'fix' on my particular set up was to give 'View' permissions to the Group that was allocated to see that layout. It might be because we are quite locked down, but the code was failing to list the group or groups that were allocated to this layout (see my comments above)

I tested this by adding another plain group (i..e non ACL etc) called testLayout and adding this group to the Contact Layout. So now any user in either one of these groups should be able to see the said Contact Layout. When I added a user to the testLayout group, they were unable to see the Contact Layout, but when I gave View permissions to the testLayout group for that user, it all worked fine.

So I am not sure if this is working as intended, but that has been the solution that I'll be looking at implementing after a bit more testing. Fortunatley, the permissions are layered for me so that people (staff group) have permissions to View the people already in the Team leaders group, as these people are also in the Staff group as well.

It does seem odd though - I would have thought the code would just need to get a list of all groups regardless of who was logged in for this particular check (the code states it is to check for missing groups)
> 0 votes

# Answer
So far as I know, it's not as complex as you're suggesting. It's not using ACL's or CMS permissions, just Civi Groups. The readme says:

> * The "Show" option can specify a contact type, e.g. if a layout is specifically designed for Organization contacts rather than Individuals.
> * The "To" option can restrict a layout to be visible to only certain logged-in users (e.g. show one layout to your volunteers and another to your staff).
> * When a user views a contact, the first layout in the list which meets the "Show" and "To" criteria will be shown.
> * If no layout matches the criteria, the default system layout will be used.

I'm not sure what you mean by 'not seeing the layout labels'. The two following screenshots show the layout labels (or is that showing what you expect to see and aren't?) What happens if you switch to a different theme to rule out any Shoreditch oddities? Are there any javascript errors in the browser console?

I've just tried this on dmaster and the system default fallback works as expected when not in a group with a non-default layout.

==edit== (It's easier to read here than in a comment)

The layout is determined by CRM\_Contactlayout\_BAO\_ContactLayout::getLayout() which calls checkGroupFilter() to filter the layouts based on the contact's groups.

If you have `cv` installed you could check what results you get for your colleague:

`cv ev -U admin 'print_r(CRM_Contactlayout_BAO_ContactLayout::getLayout(CID, UID));'`

Replace 'CID' with the contact id of any individual.
Replace 'UID' with the contact id of your colleague.
If you don't have a CMS user called 'admin' replace that too.

If you get nothing returned, they should see the default layout.

Are there any errors in your errorlog?
> 1 votes

---
Tags: contact-layout-editor
---


# Question
Title: Permission system not working as expected
I created a simple permission structure where a group of CiviCRM users ("Group A") has write access to a group of contacts ("Group B"). (Every logged in user has read access.)

When a contact is now added to "Group B", users of "Group A" see the edit button on the contact and can add/remove the contact to/from groups on the contact detail page. When removing the contact from "Group B", the edit button disappears. So far, everything as expected.

But when using the actions menu from the search results, users can add/remove group assignments of a contact which is not in "Group B".

Isn't this an inconsistency in the permission system? Or am I missing something? How to avoid group membership changes of contacts which are not in "Group B" by users which are in "Group A"?

I'm using the newest CiviCRM version 5.63.1 under WordPress.

# Answer
> 1 votes
I think it is quite possible that the bulk group add and remove doesn't implement ACLs, which should prevent this. If you can replicate the issue on the wpmaster demo, then you should post an issue on Gitlab.

---
Tags: permissions, acl, roles
---


# Question
Title: "DB Error: no database selected" error if Outbound Mail SMTP username contains @
cross-related: **Sender email converts from sender@domain.tld to b.16.16.229f5073c3f9ee97@domain.tld**

The title says it all: saving Outbound Mail settings with SMTP username containing "@", extended log message says

```
      SELECT * FROM  civicrm_setting
      WHERE (  civicrm_setting.name  = mailing_backend )
      AND (  civicrm_setting.domain_id = 1 )
      AND (  civicrm_setting.is_domain = 1 )
      [nativecode=2027 ** Malformed packet]

```

*Drupal 9.5.10, PHP 8,2, CiviCRM 5.63.1*

# Answer
Very simple: despite of Cpanel new email account "Welcome" email states SMTP port to use is 465, it is actually **587**.

*No sense in asking why CiviCRM throws MySQL/DB connection error instead of "wrong SMTP credentials" notification, nor why wrong SMTP port information arrives from Cpanel.*
> 1 votes

---
Tags: civimail, mailing, smtp, drupal-9
---


# Question
Title: Best way to register multiple people for an event - golf tournament
I'm looking to do create an event for a golf tournament and I'd like to set the number of participants being registered based on the selection in the price set.

Ex. choose foursome in price set, it would show 4 participants to register for the event.

Is this possible? We do have Webform on Drupal, but I'm not well versed in using that.

p.s. A work around seems to be to have the user select the number of participants they are registering, then only have one option in the price set for "single golfer" then each participant would have that price automatically. I just think this would be confusing for end users.

# Answer
> 1 votes
In your Price Set you should be able to set each line item to be specified to count as a different number of Participants.

**Participant Count** Enter a value here if you want to increment the number of registered participants per unit against the maximum number of participants allowed for this event. For example, if this price field is for a table at a fundraiser which seats eight people, you would set Participant Count to 8.

# Answer
> 1 votes
If you have Drupal Webform then that is the most robust solution - it can do exactly what you want.

Here are some instructions for how to set up a Webform to do event registration: https://docs.civicrm.org/webform-civicrm/en/latest/examples/simpleevent/

---
Tags: civievent
---


title: remove left sidebar (Joomla)?

text:
# Question
Title: remove left sidebar (Joomla)?
I'm a new CiviCRM user, trying to find my way through the extensive number of options. What a powerful solution!!

Working on a small screen, I'd prefer to be a able to hide the sidebar with the 'recent items' and 'new individual' fields to save some space on the screen. Ideally find some switch that can toggle the sidebar off and on.

Is that possible?

Stefan

# Answer
Glad you're enjoying CiviCRM so far.

The Joomla layout for CiviCRM currently has that sidebar hard-coded in. However, you could hide it with 1 line of css and reclaim that space (or with maybe 3 lines of css you could conditionally hide it depending on the width of the screen). I then recommend you install the Recent Items Menu extension which will still allow you to navigate to recent items without the sidebar.
> 2 votes

---
Tags: joomla, user-interface
---


# Question
Title: Mosaico can't create template or see existing templates
WP 6.2 civi 5.61.1 or 5.61.4 or 5.62.2 formcore 5.62.1 After upgrade to mosaico 2.12 could not edit existing templates. Console 404 errors. I tried: installing & uninstalling, changing resource url to absolute, asset cache on, off, auto, making ext directory 777, uninstalling civigrant

Now upgraded to civi 5.62.2 and mosaico 3.1.1687383640. Mosaico page and "new template" page images below. Selecting new template just hangs with "loading"

Civi log shows: Jun 27 15:37:40 \[error\] Afform error: cannot process ~/afsearchMosaicoTemplateList/afsearchMosaicoTemplateList.aff.html: malformed entity name ()

Browser console has 404 for https://website/wp-content/uploads/civicrm/ext/uk.co.vedaconsulting.mosaico-2.8/css/mosaico-bootstrap.css?r=0uwJ4en\_US

full console error below

At wit's end really & boss wants newletter out yesterday!

\[!\[enter image description here\]\[3\]\]\[3\]

# Answer
Finally solved this. There was an .htaccess file in the wp-content/uploads/civicrm folder blocking all (direct) access to files in this directory. added below. Don't know how it got there - presume another extension?

content of file:

"\<Files "\*"\>

# OpenLiteSpeed 1.4.38+

\<IfModule !authz\_core\_module\> RewriteRule .\* - \[F,L\]

# Apache 2.2

\<IfModule !authz\_core\_module\> Order allow,deny Deny from all

# Apache 2.4+

Require all denied
> 1 votes

# Answer
You say you have a 404 error, so:

* Is the file on the server where it's supposed to be?
* Have you checked both the file *permissions* and *ownership*? Are they correct?

After that, you're getting into some weird scenarios, like web server misconfiguration. It may be worth looking at the HTTP response headers to see whether the 404 is coming from WordPress or the web server.
> 0 votes

---
Tags: mosaico
---


# Question
Title: Organisational membership renewals failing
Bit of a strange one. We have an organisation with an organisational membership. They have a contact with view and update permissions to and from the organisation. When they go to renew the membership it pulls through the membership fine, but when they try to submit the contribution form it shows this error:

*This organisation already has an organisation membership*

The membership's status is current and expires in about six weeks.

The membership was originally created offline by an admin - could this be the cause of it perhaps?

We're on Civi 5.52.2 and WordPress 6.2.2

# Answer
As well as having the permissioned relationship, the contact doing the renewal also needs to be marked as being a 'current employee'
> 0 votes

---
Tags: civicontribute, civimember
---


title: Standalone CiviCRM? (no CMS)

text:
# Question
Title: Standalone CiviCRM? (no CMS)
I was pretty excited to read about CiviCRM until I saw the requirement for one of the big 3 CMS systems. Is is possible to use/build CiviCRM without a CMS? All three of those CMS systems are massive overkill for my current needs (a very small organization with a generated/static website).

If not, can anyone recommend an alternative open source CRM system?

thanks!

# Answer
No, CiviCRM must be installed within one of these CMS platforms: Drupal, Wordpress, Joomla, or Backdrop. But this doesn't mean you need to use *that* CMS for your organization's main website — you can install CiviCRM (within one of those CMS platforms) on a subdomain.

The CMS handles the part of the application which deals with *users* (i.e. "reset my password" and other such functionality). The fact that CiviCRM delegates this functionality to the CMS does make it a tiny bit more complicated — but tremendously more flexible! For example, perhaps in 10 years your very small organization will have grown to the point where it *wants* a CMS which can integrate with its CRM. CiviCRM leaves that possibility open.

### Suggestions for you

* Install CiviCRM with Wordpress (the simplest one)
* Or, if the installation process feels daunting, consider hiring a hosting provider to set up and maintain a CiviCRM installation for you

Instead of viewing the CMS as "massive overkill" I would encourage you to think of it as only one small piece of CiviCRM itself. It just happens to be a *modular* piece. The size and complexity of an empty CMS actually pales in comparison to the size and complexity of CiviCRM itself.
> 10 votes

# Answer
There is a Make-It-Happen fundraising to get this fully developed. Please support it.
> 5 votes

# Answer
If you will not be using Drupal, Wordpress or Joomla for your main site, you can do what we did for over a year before we moved to Drupal 7 -- install Civi with your CMS of choice at a subdomain (cf: https://civicrm.stackexchange.com/a/12032/105). Your primary website can be as simple as you'd like it, while you still have Civi running in a separate space to manage your contacts, etc.

Any time you have an online signup or donation form, you can link to the subdomain from your main site. We chose Drupal integration at the subdomain so we could have complex webforms with Drupal's webforms module, and all of the data went straight into Civi. You only have to develop or fine tune the features of the CMS you would actually be using.
> 2 votes

# Answer
Talk to the people at cividesk.com. They have a standalone solution and they will host it for you. If you're a coder, he will share it with you but it's not a simple implementation.
> 1 votes

---
Tags: evaluating-civicrm, cms-integration, standalone
---


# Question
Title: We don't use the listed content managers. Can I still use CiviCRM for contacts?
We use SilverStripe as our content manager for our web page. Can I still use CiviCRM for contact management only? We currently have excel spreadsheets, Outlook, and Mail Chimp, and need to consolidate.

# Answer
> 5 votes
What you can do is set up a new subdomain https://secure.yourdomainname.org \- Then run a very minimal Drupal (or Wordpress) + CiviCRM on that secure.yourdomainname.org - this will provide you with all the benefits CiviCRM can offer and help you to consolidate things for your organization - without the need for your staff to learn how to use Drupal for content editing etc.

If in future you want more integration between your website and CiviCRM (esp in Drupal there are lots of integration options \[e.g. views and my personal favourite: webform\_civcrm module\] that extend what CiviCRM can do for you) - then you can consider moving your SilverStripe website to Drupal!

# Answer
> 4 votes
There is a Make-It-Happen fundraising to get a standalone civi that would work with SilverStripe fully developed. Please support it.

---
Tags: evaluating-civicrm, cms-integration, standalone
---


# Question
Title: How do I load javascript only on pages with CiviCRM loaded on them?
I'm trying to load a civicrm function. What is the recommended way to load 'CRM' checking that it is available on the page first?

```
CRM.$(function ($) {
  'use strict';

   ...

  addObserverFormErrors();
})

```

# Answer
> 0 votes
I've wrapped it with try / catch

```
try {
  CRM.$(function ($) {
  )(CRM);
} catch (e) {}

```

# Answer
> 1 votes
I would recommend to create a CiviCRM extension that implements either the pageRun or buildForm hook, which then checks which page you are on and loads the JavaScript file.

If your JavaScript needs to check for special variables or other data, it will be easier to use `addVars` to load the variable correctly, instead of relying on DOM hacks.

Otherwise I guess you could check if:

```
if (typeof CRM != 'undefined') {
  // ...
}

```

---
Tags: javascript
---


# Question
Title: qfKey are always invalid when returning from payment processor in contribution
I have a site which has been running for some time. Recently whenever anyone makes a contribution (via PayPal). When they click return to merchant they get the following error:

This is caused by the qfKey coming back in the URL being invalid. The error starts on line 308 of civicrm/CRM/Core/Controller.php and is caused by CRM\_Core\_Key::validate($key, $name, $addSequence) returning null.

I have disabling all my custom templates and the issue persists. Looking at the code it should get the qfKey from the request, so what is causing it to be invalid?

# Answer
> 3 votes
This usually happens when you have

1. Browser cookies disabled
2. CiviCRM cache cleared when users is on payment processor gateway and doing payment.
3. User is created at the time of submitting contribution and causes session to clear.

# Answer
> 0 votes
I have had a similar problem, but it involves existing users not created users. See my question for a description and solution.

# Answer
> 0 votes
Issue Description:

The issue is related to the getReturnSuccessUrl() function in the Payment.php file of CiviCRM. The original code is causing a problem where the query parameter \_qf\_ThankYou\_display is not properly appended to the $qfKey. As a result, the success URL is not being generated correctly.

Solution: To fix this issue, we need to modify the getReturnSuccessUrl() function by appending the \_qf\_ThankYou\_display=1 parameter to the $qfKey. This will ensure that the success URL is generated with the correct parameters.

Original Code:

protected function getReturnSuccessUrl($qfKey) { if (isset($this-\>successUrl)) { return $this-\>successUrl; }

return CRM\_Utils\_System::url($this-\>getBaseReturnUrl(), \[ '\_qf\_ThankYou\_display' =\> 1, 'qfKey' =\> $qfKey, \], TRUE, NULL, FALSE ); }

Updated Code:

protected function getReturnSuccessUrl($qfKey) { if (isset($this-\>successUrl)) { return $this-\>successUrl; }

// Append the '\_qf\_ThankYou\_display=1' parameter to the $qfKey. $qfKey .= '&\_qf\_ThankYou\_display=1';

return CRM\_Utils\_System::url($this-\>getBaseReturnUrl(), \[ 'qfKey' =\> $qfKey, \], TRUE, NULL, FALSE ); }

With this modification, the success URL will be generated correctly, and the issue should be resolved. Remember to apply the change in the Payment.php file as described in the solution above.

---
Tags: civicontribute
---


# Question
Title: Limited Activities Showing On SearchKit Display
Currently we have a SearchKit display to show activities on a case that are use to link to a form. Some activities are not showing as we expect on the final display.

As an example, there are currently a total of 13 activites on the SearchKit display that are appearing. However, on the case there are 16 activities. The three activities that are missing from the SearchKit display need to be visible to users.

On the preview of the search results, all 16 activities appear like we expect.. (see screenshot below) therefore the search is working however the display is not functioning as we expect.

Why aren't all 16 activities visible? Is there a limiter that I am not aware of, or is this potentially a bug?

**Preview of search results:**

**SearchKit display:**

**Here is a Gist link to what the API call looks like**

**Here is a Gist link to the SQL**

**The search being carried out:**

# Answer
Lars and Coleman suggested the solution to this comment. Removing distinct from just the date on the activity session has solved the issue.

See my comment above - I do not actually understand why this has solved the issue. Problem solved nevertheless! Thanks for your input.
> 2 votes

---
Tags: searchkit
---


# Question
Title: sub menu item is not showing under Developer
in menu under Developer, we have an arrow to go to APIv3, APTv4, and support. I just install 5.63.1, under Developer there are NO sub menu any more? any reason for that? Thanks

# Answer
> 1 votes
2 possible causes:

1. You are logged in as a non-administrator (those developer links are only for admins).
2. Someone has moved or deleted those menu items. To see if they still exist but got moved, try typing "api" into the search bar like this:

If they were deleted or moved, you can add them back by at the navigation menu configuration screen (**Administer -\> Customize Data & Screens -\> Navigation Menu**).

---
Tags: menu
---


# Question
Title: How to set a recurring membership start date to be 1st of the month
We have Authorize.net and Stripe as payment processors. We'd like to have recurring memberships run on the 1st of the month. I see under contributions there looks to be the potential to set it but that isn't working. (Does Civi still support the ability to set a specific start date for recurring contributions?) There is no such setting for membership.

How can we pass this data to e.g. Authorize.net? Is it technically possible to have custom code achieve this and has anyone done so?

# Answer
> 2 votes
This is available thru the Stripe integration as a new feature discussed in issue #199. For reference, it started with the 6.5 release.

# Answer
> 4 votes
Auto-recurring memberships are triggered by the corresponding recurring contribution, so what you need is:

1. A payment processor that supports future dates for recurring contributions.
2. A way to restrict which dates are allowable.

For 2., the functionality is built into the iATS Payments extension, and also in my extension here: https://github.com/adixon/ca.civicrm.contributionrecur

I'm not sure if my implementation in that custom extension will work with Authorize and/or Stripe, but you could try it. Those processors might need a small patch for it to work.

---
Tags: civimember, recurring-contributions
---


# Question
Title: CiviCRM Webforms - Webform submission value shows the field id instead of the value of the id
I have a problem with one of the fields in a notification email for CiviCRM Webforms.

I’m using a Drupal Webform which includes CiviCRM contact fields. These fields include a number of fields that make up the postal address.

One of these fields is the State/Province. The key is: civicrm\_1\_contact\_1\_address\_state\_province\_id

I’ve included that field in the Webform email: \[webform\_submission:values:civicrm\_1\_contact\_1\_address\_state\_province\_id\]

The problem is that when the email is sent, the value for the State/Province is shown as “1644” instead of “Victoria”.

All the other Webform submission values in the email are correct.

This was working as expected under Drupal 7 but we recently migrated to Drupal 9 and we are now seeing the wrong value for the State/Province.

The strange thing is that if we do a resend of the email, the correct value is shown.

# Answer
> 2 votes
I’ve not found a way of getting Drupal/CiviCRM to populate the email token with the text of the State/Province. It always comes out as the index number.

However, I’ve figured out a workaround. I’ve added a text field to the Webform and I then hide the field from the user. I then run some JavaScript to copy the value of the CiviCRM State/Province field into the hidden field. This gives me the text for the selected item. I then use that field id in the email instead of the CiviCRM field id.

Happy to share the JavaScript code but I'm new to StackExchange and I don't know how to do this.

---
Tags: webform-civicrm, email, tokens
---


# Question
Title: Smarty include getting illegal string on string error
How to fix Smarty in civicrm 5.63.1

The error originates in the following include from sites/default/files/civicrm/templates\_c/en\_US/%%1D/1DB/1DB03A28%%CustomField.tpl.php

Message TypeError: Cannot access offset of type string on string in include() (line 31 of .../sites/default/files/civicrm/templates\_c/en\_US/%%1D/1DB/1DB03A28%%CustomField.tpl.php)

Then: #0... vendor/civicrm/civicrm-packages/Smarty/Smarty.class.php:include() line 1914.

# Answer
This was fixed but missed making into 5.63.1. See https://github.com/civicrm/civicrm-core/pull/26517#issuecomment-1636255789

You can apply the patch there.
> 1 votes

---
Tags: smarty
---


# Question
Title: Webform import command line fails but import via UI is OK?
I am converting D7 webforms for D9 and importing data (latest webform 6.1.x and Drupal 9.5.x, CiviCRM 5.63.1).

To do a basic test I created an import file with a single entry and used the UI to import, treating all warnings as errors to be sure. This was successful (thanks Jacob Rockowitz for the video on this Import Webform Submission)

The forms are linked to CiviCRM.

I have a fair few to import so switched to the command line to avoid any time out issues and I can also script this way. I ran into a strange problem where an identical import fails using the CLI.

```
Drush webform:import myform /my_path/my_file

```

If I swtich back to the UI all 100 were imported without issue? The submissions look OK in the UI and I checked a few at random against the current D7 system and they are fine. All I see in the dblog is a load of warnings about unserialize(), but that's it.

Here is what I am seeing when I try to use the CLI:

Here is an example of one of the numerous deprecated function debug messages (I am using PHP 8.1 so that's probably it):

Deprecated function warning

Just in case, I have experimented with using --treat\_warnings\_as\_errors and --skip\_validation to no effect.

I can do it all via the UI, but would rather not! Any thoughts on this welcome.

# Answer
The issue was, as Demerit rightly pointed out (thank you!) to do with Drush running as a user that did not have the privileges to create a submission for my particular webform. The form was not a simple one, involving several contacts, a case and an activity all with custom fields.

The solution, a total hack, was to elevate the Anonymous user by temporarily granting the following permissions:

```
CiviCRM: all CiviCRM permissions and ACLs
Administer and use CiviCRM bypassing any other permission or ACL checks and enabling the creation of displays and forms that allow others to bypass checks. This permission should be given out with care

```

Clearly this is a very dangerous thing to do and you should not leave this on a production system or one exposed to the open internet. The solution is to lock the site behind HTTP Auth and or put the site into Maintenance Mode to do your import, then immediately remove this permission when you have done your import.
> 3 votes

# Answer
If you are running drush as anonymous civi won't have a source\_contact it can use. As noted in comments it seems with recent drush versions you can no longer set a user id, but all drush commands are equivalent to just calling some function in the code. For this one it looks like it's

`\Drupal::service("webform.cli_service")->drush_webform_import($webform_id, $path_to_csv, [array of options]);`

so you can use `drush ev` to first set a user, then call that function, e.g.

`drush ev '\Drupal::service("account_switcher")->switchTo(new \Drupal\Core\Session\UserSession(["uid" => 1])); \Drupal::service("webform.cli_service")->drush_webform_import($webform_id, $path_to_csv, [array of options]);'`
> 1 votes

---
Tags: webform-civicrm
---


# Question
Title: How can I display a count of new donors by month?
This seems a reasonable enough request but I can't put it together.

Here's what I've tried:

* Contribution Summary Report - Does not contain the "Contribution Ordinality" filter (though adding it might be my best option).
* Summary Fields - this is flaky with real-time updates, and scheduled updates lock the database.
* SearchKit - I created a search that grouped contributions by contact ID and gave the minimum ID. I saved that as a new SearchKit entity (this is new in 5.63). However, I couldn't join this new entity to other entities, and trying to make an entity from the entity gave me a database error.

# Answer
> 2 votes
I worked it out, you need two SK queries, not three, but you have to group by a partial month. Screenshots of the two queries are below, along with exports of the queries.

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "First_donations",
          "label": "First donations",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "Contact",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "display_name",
              "MIN(Contact_Contribution_contact_id_01.id) AS MIN_Contact_Contribution_contact_id_01_id",
              "MIN(Contact_Contribution_contact_id_01.receive_date) AS MIN_Contact_Contribution_contact_id_01_receive_date"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [
              "id"
            ],
            "join": [
              [
                "Contribution AS Contact_Contribution_contact_id_01",
                "INNER",
                [
                  "id",
                  "=",
                  "Contact_Contribution_contact_id_01.contact_id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": "Do not delete - necessary for \"New One-Time Donors by Month\""
        }
      ],
      "match": [
        "name"
      ]
    }
  ],
  [
    "SearchDisplay",
    "save",
    {
      "records": [
        {
          "name": "FirstDonationsDbEntity1",
          "label": "First donations",
          "saved_search_id.name": "First_donations",
          "type": "entity",
          "settings": {
            "sort": [],
            "columns": [
              {
                "type": "field",
                "key": "id",
                "dataType": "Integer",
                "label": "Contact ID",
                "spec": {
                  "name": "id",
                  "data_type": "Integer",
                  "suffixes": null,
                  "options": false,
                  "fk_entity": null,
                  "original_field_name": "id",
                  "original_field_entity": "Contact"
                }
              },
              {
                "type": "field",
                "key": "display_name",
                "dataType": "String",
                "label": "Display Name",
                "spec": {
                  "name": "display_name",
                  "data_type": "String",
                  "suffixes": null,
                  "options": false,
                  "fk_entity": null,
                  "original_field_name": "display_name",
                  "original_field_entity": "Contact"
                }
              },
              {
                "type": "field",
                "key": "MIN_Contact_Contribution_contact_id_01_id",
                "dataType": "Integer",
                "label": "Donation ID",
                "spec": {
                  "name": "MIN_Contact_Contribution_contact_id_01_id",
                  "data_type": "Integer",
                  "suffixes": null,
                  "options": false
                }
              },
              {
                "type": "field",
                "key": "MIN_Contact_Contribution_contact_id_01_receive_date",
                "dataType": "Timestamp",
                "label": "Donation Date",
                "spec": {
                  "name": "MIN_Contact_Contribution_contact_id_01_receive_date",
                  "data_type": "Timestamp",
                  "suffixes": null,
                  "options": false
                }
              }
            ]
          },
          "acl_bypass": false
        }
      ],
      "match": [
        "name",
        "saved_search_id"
      ]
    }
  ]
]

```

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Partial_Donation_Dates",
          "label": "Partial Donation Dates",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "SK_FirstDonationsDbEntity1",
          "api_params": {
            "version": 4,
            "select": [
              "COUNT(id) AS COUNT_id",
              "EXTRACT(YEAR_MONTH FROM MIN_Contact_Contribution_contact_id_01_receive_date) AS EXTRACT_MIN_Contact_Contribution_contact_id_01_receive_date"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [
              "MIN_Contact_Contribution_contact_id_01_receive_date"
            ],
            "join": [],
            "having": []
          },
          "expires_date": null,
          "description": "Do not delete - necessary for \"New One-Time Donors by Month\""
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

---
Tags: civicontribute, civireport, reports, searchkit
---


# Question
Title: Fill in a Constant for a parameter mapping in an action in form processor
In form processor I'd like to map some constant value to a parameter in an action (e.g. a constant amount for a SEPA Mandate in the action "Create SEPA Mandate (Recurring)"). In the Section "Parameter Mapping" I can only map inputs and outputs of actions into the parameters, but not any constant value.

What's the correct way to go about this?

# Answer
> 0 votes
The way to go is to use the action "Other: Set Value". Form Processor only handles objects not strings themselves.

By setting a condition on that action, values can be set conditionally even.

Even better, by using action "Other: Map Value" one can map values of parameters to other values obtaining conditioned constants in a new parameter. The mapping is given as a JSON dictionary e.g. `{ "A": "10", "B" : "20" }`.

---
Tags: form-processor, action-provider
---


# Question
Title: How do I create a supervisor/subordinate relationship between Contacts?
I want to produce a report that lists all supervisors and their subordinates. (Assume that all Contacts have supervisors but not all Contacts have subordinates.) I plan to export the report to Excel and then use pivot tables to produce a hierarchical org. chart. What's the most efficient way for me, a non-coder with no SQL, to create the relationships in CiviCRM and include them in the Columns table of the new report? (CiviCRM 5.58.1 on Wordpress 6.2.2)

# Answer
First create a new relationship type, then you can use SearchKit to find contacts with that relationship type and export in a CSV.
> 1 votes

---
Tags: wordpress, civireport, relationships
---


# Question
Title: Error "cannot assign an empty string to string offset" on contribution admin page
I'm seeing the below error on two different installs. One is running Joomla 4/Civicrm 5.63.2 the other Joomla 3.10/civicrm 5.63.1, both php 8.0. If I change back to php 7.4 the error does not occur on either. It is shown when I edit the Amounts tab of any contribution page that has monetary transactions enabled and php set to 8.0 or 8.1 (I was not using a price set, just setting a few fixed price contribution options on the Amounts tab).

I'm not able to recreate it on the demo site that is running joomla 4, php8.0, civi 5.61.4.

I have determined that if the column name in the table civicrm\_price\_field\_value is either blank or null the error is thrown. If I change them all for a particular contribution page to any other value it then works fine. (For example I changed all of one contribution page to item1, item2, ... using mysql access).

So I thought that perhaps i just had corrupted data. So I then created a new contribution page and then went back to edit the amounts tab - and got the same error again. Looking in the database shows the civicrm\_price\_field\_value table name column to be null for the new rows.

So I think its one of two things:

* a new install of civicrm uses NOT NULL DEFAULT "somevalue" for the name column of this table? (I doubt it I've looked on an older - but fresh install)
* something changed between 5.61.4 (cividemo version) and 5.63.1 to cause this? Yet looking in the repo doesn't show Amounts.php getting changed?

I know I have been able to edit contribution pages previously, but I'm not sure exactly when that was. I thought it was very recently but perhaps it was back before I upgraded php to 8.0.

Sorry for the rambling, heading off on vacation and I wanted to post before I leave.

UPDATE: I remembered I had an older civicrm install (5.55.2). So I created a contribution page using that. (the name column for civicrm\_price\_field\_value is indeed all null after the creation). Using php8.0 and this older version I'm able to go back and edit the amounts tab of this page. So I am beginning to think that a bug has been introduced sometime after 5.61.4.

---

```
Cannot assign an empty string to a string offset
.../administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/ContributionPage/Amount.php:239
234               $defaults['amount_label'] = $priceField['label'];
235               foreach ($options as $optionId => $optionValue) {
236                 $countRow++;
237                 $defaults['value'][$countRow] = $optionValue['amount'];
238                 $defaults['label'][$countRow] = $optionValue['label'] ?? NULL;
239                 $defaults['name'][$countRow] = $optionValue['name'] ?? NULL;
240                 $defaults['weight'][$countRow] = $optionValue['weight'];
241
242                 $defaults["price_field_value"][$countRow] = $optionValue['id'];
243                 if ($optionValue['is_default']) {
244                   $defaults['default'] = $countRow;-

```

# Answer
I had a look at this and it turns out that this is a something that broke in 5.63 and we should be able to fix it for 5.64. Details here.
> 2 votes

---
Tags: error, contribution-page, issues
---


# Question
Title: Finding contacts with no activities in the last 18 months- using searchkit
I'm trying to use search kit to find contacts who have had no contact with our organisation in the last 18 months.

Building this as a contact search, and then searching on contact activities

So date of last activity was more than 18 months ago.

What's the best way to build the query?

---

edit

---

Think I've figured it, I've searched for 2 contact activities

# Answer
> 2 votes
You've basically got it. You want Contacts without Contact Activities if Activity Date \< 18 months ago and Contact Role = Activity Target and with (required) Contact Activities if Contact Role = Activity Target. This gives you contacts who had at least one activity more than 18 months ago, but haven't had one in the last 18 months.

You can also, if this is something you do regularly and don't want to update the dates for each time, add an option to the relative date filter option group for the 'Last 18 months' (it should be `ending_18.month`, but test to confirm it works). Then you can use that as your date range for the without (Activity Date = Date Range Last 18 months) and for the with you can use Activity Date is between nothing and Last 18 months, which will find all activities up to 18 months ago.

# Answer
> 2 votes
I have done the equivalent for Contacts participating in events, based on the above but there are a couple more steps that weren't initially obvious.

1. Set up the JOINs as in the original question, but with the second join as With(Optional). Using Without does not work as noted earlier.:
2. GROUP BY Contact Id:
3. Add Fields as required for the first Join, and one field returning the Event Date (in my case) for the Second Join. I used a MAX field here.
4. Add a HAVING condition to only include result rows - i.e. Contacts - where the second Join Date field is empty. This excludes the whole contact record, including those with any earlier dated Events, which is the requirement.

This both solves the problem as stated, and allows use of relative dates which is a rider that I have added for my use-case, since the comparison occurs in the Join rather than the Having which does not support relative dates.

---
Tags: searchkit
---


# Question
Title: Is using CID in a public URL a security risk?
Our Drupal7 site has public customer profile pages created by Views, that are reached via a url that includes the CiviCRM contact ID - ie https://site.com/profile/CID

The pages include company information that is generally publicly available. A client has voiced concern that this *"is a security issues and opens the door to perform database enumeration etc"*.

We can change the URL to use the customer name rather than the CID but I'm interested if our current practice is a real risk that we should be concerned about?

# Answer
If I can go through the various numbers and pull up any information on any contact, yes, that is a security risk. Typically civicrm will tokenize each contact ID. Or you should have the views setup that it will only display information if the logged in contact is a match.

For example, when viewing a public email in browser,

wordpress civi url: https://example.org/civicrm/?civiwp=CiviCRM&q=civicrm%2Fmailing%2Fview&reset=1&id=382&cid=2&cs=tokentoekntoekentokeeen

If you remove the bit after cs=, no contact information will be displayed. If the contact id is not a match for the token, no contact information will be displayed.
> 0 votes

---
Tags: security
---


# Question
Title: Is it possible to paste with formatting in Mosaico?
I totally understand the benefit of plain pasting into Mosaico, but we have to quickly create an email with a ton of links and I simply want to copy, paste, but keep the formatting (bold, italics, etc) and hyperlinks.

Within mosaico, we just do copy paste of the source, and that works for us, but this is coming from a word doc.

Any suggestions?

# Answer
> 2 votes
Answering my own question - this is possible now with the latest 3.x version of mosaico for civicrm.

---
Tags: mosaico, tinymce
---


# Question
Title: Can Authorize.net be used twice when setting up a payment processor?
We're in the process of setting up payment processor(s) in CiviCRM (v. 5.62.1), and are wondering if we can use the same ***Payment Processor Type*** (Authorize.net) more than once? The client has 2 Athorize.net accounts (used for different/specific purposes & and linked to specific, individual bank accounts).

# Answer
> 1 votes
Yes, you can set up multiple payment processors of the same payment processor type.

---
Tags: payment-processor, authorize.net
---


# Question
Title: Invalid field 'contact_id.is_deceased' Apiv4
CiviCRM 5.61.2., wordpress.

* Hovering over icons on search results page brings "where was an error processing your request.." message and **Invalid field 'contact\_id.is\_deceased'** message
* Happens only for "subscribers" wordpress role, even if "CiviCRM: access AJAX API" and "CiviCRM: view all contacts" allowed for everyone ( including anonymous)
* Looks similar to https://lab.civicrm.org/dev/core/-/issues/2507 at first sight but is not the same
* contact\_id.is\_deceased is being called in:
    + /civicrm/api/v3/Email.php
    + /civicrm/CRM/Contact/Form/Task/EmailTrait.php
    + /civicrm/CRM/Profile/Page/Dynamic.php Additionally, in/wp-content/uploads/civicrm/persist/contribute/dyn/crm-l10n.48bc1baa4052e4cf59989414d9b48136.js - but only on my local copy, remote one ( where the issue happens ) does not have this file.

Backtrace:

```
   #line: 711
   trace: {
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:711 {
       Civi\Api4\Query\Api4SelectQuery->getField($expr, $strict = false)
       › if ($strict && $field === NULL) {
       ›   throw new \CRM_Core_Exception("Invalid field '$fieldName'");
       › }
     }
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:656 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:494 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:464 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:304 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:156 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Query/Api4SelectQuery.php:171 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php:124 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/DAOGetAction.php:111 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php:72 { …}
     wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php:158 { …}
     wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php:250 { …}
     wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/Dynamic.php:450 { …}
     wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/Dynamic.php:332 { …}
     wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php:91 { …}
     wp-content/plugins/civicrm/civicrm/CRM/Profile/Page/View.php:159 { …}

```

**What would it be?**

# Answer
> 3 votes
That backtrace seems to point to this change as the culprit, however after several attempts I've been unable to reproduce that error. We can continue discussion on this issue: https://lab.civicrm.org/dev/core/-/issues/4458

---
Tags: wordpress, api, apiv4
---


# Question
Title: Is it possible to calculate tax deductible amounts for contributions with premiums?
I did some research on the US Tax law. It seems that if you make a $10 donation and get a T-shirt (which has a market value of $8), then you can deduct $2 of that donation from your taxes.

The Summary Fields extension can calculate the total amount of tax deductible contributions made by a single person over the course of the year by totaling the values in the `civicrm_line_items` table (and doing math with the `non_deductible_amount` field).

Now, I'm trying to figure out if the Summary Field extension can handle donations that come with premiums.

I created a premium - a T-shirt - and was pleased to see fields to record the market value which I filled in. I setup a "premiums" financial type - and set it to "Tax deductible".

I then setup a contribution page and added the T-shirt premium. When I make the donation and select the premium... I get a single entry in the `civicrm_line_items` table with a financial type of "donation" (which is what the contribution page is configured to use) and `non_deductible_amount` of 0. I was hoping to get a financial type of "Premium" and a `non_deductible_amount` of 8.

Is my expectation wrong? Since this might be different in different legal jurisdictions, perhaps this calculation should be done in an extension instead?

# Answer
> 0 votes
I'm not sure if this is a full answer but here's what I know about it:

Civi is inconsistent regarding non-deductible amounts. I don't remember seeing a spec where it was written out how it should work in various situations. Note also there are conflicting/ambiguous non-deductible fields on both the line item and the contribution, as well as potentially ambiguous financial types on the contribution and line items. And if you edit the contribution the non-deductible is not always in sync after. I personally don't think it's reliable to rely on those fields.

---
Tags: premiums
---


# Question
Title: CiviCRM System Status: You are missing a rule of type Supervised for: Individual
I have the following in the system status warning, can someone please help to explain and solve this, Thanks a lot.

For CiviCRM to function correctly you must have at least 2 dedupe rules configured for each contact type. You are missing a rule of type Supervised for: Individual Configure dedupe rules

# Answer
> 1 votes
Go to contacts \> find and merge duplicate contacts. In the individual rules section add or set one rule to a supervised rule.

A supervised rule is one that casts a wide net when scanning for duplicate contacts in the backend when adding a new contact or scanning for duplicates. It's supervised therefore should only be used intentionally by an admin user reviewing a potential duplicate.

# Answer
> 0 votes
See the user guide for an explanation: https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/#dedupe-rules

But briefly, under "Contacts - Find and Merge Duplicate Contacts" you are missing some rules.

---
Tags: system-status, dedupe-rules
---


title: Quickform AddEntityRef Errors 5.58

text:
# Question
Title: Quickform AddEntityRef Errors 5.58
I'm using Civicrm 5.58.1 on Wordpress 6.2.2. I've had a QuickForm working for quite some time.

$this-\>addEntityRef('Location\_province', ts('Select Province'), \['entity' =\> 'state\_province','api' =\> \['params' =\> \['country\_id' =\> 1039\]\]\]);

$this-\>addEntityRef('trial\_chairperson', ts('Select Trial Chairperson'));

$this-\>addEntityRef('trial\_secretary', ts('Select Trial Secretary'));

All of these now return a "Loading Failed" message to the front end user. User cannot override and enter any text there and these are required fields so the form is now broken.

I know I should update this form to Afform and Angular, but Quickform is easy and its been working for years. Not sure what update would have possibly broken it? Any ideas what I can do to solve this for now?

Thanks Norm

# Answer
I suspect what you're seeing is a permissions problem. You mentioned it doesn't work for Front-End users but it does work on the back-end.

EntityRef fields work by calling Apiv3 via ajax. For that to work, a user must have either "access CiviCRM" or "access ajax api" permission. Then they must also have permission to see the entities you are referencing. To view contacts, that usually means the "view all contacts" permission.

You definitely don't want to give all those permissions to anonymous users! Fortunately there is a new solution to this problem: switch from `$this->addEntityRef()` to `$this->addAutocomplete()`. The new Autocomplete widget uses APIv4 and allows you finer-grained control over permissions. You do not need to grant users any special permission to use it, instead you can give non-permissioned users access to a particular widget via an event listener.

Here are docs on that: https://docs.civicrm.org/dev/en/latest/framework/autocomplete/
> 2 votes

---
Tags: quickform, entityref
---


# Question
Title: Contacts Import issue at CRM_Contact_Import_Form_MapField::getLocationTypeLabel
Not a question as such, rather an observation. WordPress contacts import from CSV, CiviCRM 5.61.2. (not reproduceable on dmaster).

`Uncaught TypeError: Return value of CRM_Contact_Import_Form_MapField::getLocationTypeLabel() must be of the type string, null returned in www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Form/MapField.php:480`

# Answer
**UPD:** Apparently this happens if some Location Types have no Labels.

---

Rather simple fix: change from

* `protected function getLocationTypeLabel($type): string {`

to

* `protected function getLocationTypeLabel($type): ?string {`

in **www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Form/MapField.php:480**

however not sure it's the right thing to do.
> 0 votes

---
Tags: import, data-import, csv, location-type
---


# Question
Title: Certain fields missing from profile when viewing contribution page as anonymous versus logged-in user
I'm including a profile in the configuration of a contribution page to collect information about UK Gift Aid eligibility and the preferences of the donor to sign up to various newsletters.

The profile itself is shown in the screenshot below.

The issue I'm encountering is that while the contribution page displays perfectly when viewed as a logged in user, certain fields are missing from the profile when viewed as an anonymous user.

Good case (logged-in user):

Bad case (anonymous user):

I presume this is a permissioning issue but can't think specifically what might be causing it. **Any help would be hugely appreciated!**

# Answer
Access to custom fields is controlled by a separate permission. You need to grant the `CiviCRM: access all custom data` permission to anonymous users.
> 3 votes

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


# Question
Title: In Formprocessor fill an email template with values from parameters from the form
In the extension Form Processor I'd like to perform the action to send an email. I lookup an email template (with action "Communication: Get message template by name"), and I would like to fill it with some parameters I got from the form, or some action I performed before. How can I insert those parameters?

Can the template contain tokens or placeholders that can be replaced in form processor?

What's the way to go if I want to send out an email containing data from or derived from the contents in the form?

# Answer
It seems like this should be possible with the `Other: Replace tokens in HTML` action, though it seems to only accept a few different entity IDs (the most common ones though).

If you need to add information that's part of the input but not a true "token", it seems possible but onerous. You would:

* make your own "token" - e.g. `<placeholder for submitter's name>`
* use the `Set Value` action to create an input with that text, e.g `placeholder_1`.
* Use the `Other: Replace text` to search your template HTML, *Value* would be `placeholder_1`, `replacement` would be the field you want to insert into your text.
> 1 votes

---
Tags: form-processor, action-provider
---


# Question
Title: Should email receipts (for events) be recorded as an activity for the recipient?
Activity reports with a filter of Receipt do not show receipts sent

Should they be shown? Is there another way to see a report on whether a receipt email is actually sent?

Search kit also does not show such activities

# Answer
No, there isn't a separate activity for the receipt email. Unless something is broken, you would assume that the event registration activity would also cover the confirmation email.
> 1 votes

---
Tags: reports, receipts
---


# Question
Title: Grant tracking has stopped after upgrade
I have upgraded to the last version (now 5.63.2) from 5.57 and the tracking of grants has stopped. We receive grant applications from a webform with civicrm integrated. The website uses Backdrop. All modules and core system are updated.

After the upgrade we can't see the Grants tab in the webform civicrm processing section.

The extension is enabled in the extensions page, but in the Components page there exists all the other options (to enable the other components) but I don't see the option to enable Civigrant.

Any advice would be appreciated,

Andrés

# Answer
CiviGrant recently moved from a component to an extension. It is normal and expected that you can see it in "Manage Extensions" but it is no longer listed in "Components".

The Drupal versions of Webform-CiviCRM were updated to accommodate this change, however the Backdrop version is, AFAIK, not maintained by anyone. It would need a version of this PR: https://github.com/colemanw/webform\_civicrm/pull/721
> 3 votes

---
Tags: civigrant
---


# Question
Title: Can't Access Joomla 3.10.12 Administrator Panel after Site Restore
I restored my site from an Akeeba backup and now I cannot access the site's backend administration panel. Mysite.org/administrator opens the login screen, but I get a 500 error when I try attempt to log in.

Hosting provider: Hostmonster.com Joomla 3.10.12 MySQL Version: 5.7.23-23 PHP Version: 7.4 CiviCRM Verson: 5.49.1

I created a new database and user for the Joomla restore. I had a similar issue once before in a restore so I checked both civicrm.settings.php files. Both files had the old db name, username, and password. I've updated those files with the new db name, username, and password, but I still cannot enter the backend administration. I believe there was another step I took to get the backend working, but I don't remember what it was.

The restored site error log reports:

```
[02-Aug-2023 14:25:11 America/Boise] PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /home2/name/public_html/domain/administrator/components/com_civicrm/civicrm/packages/DB/common.php on line 265

```

The civicrm.config.php file located in public\_html/domain/administrator/components/com\_civicrm/civicrm/ contains the following:

```
<?php
define('CIVICRM_SETTINGS_PATH', '/home2/name/public_html/domain/administrator/components/com_civicrm/civicrm.settings.php');
$error = @include_once( '/home2/name/public_html/domain/administrator/components/com_civicrm/civicrm.settings.php' );
if ( $error == false ) {
    echo "Could not load the settings file at: /home2/name/public_html/domain/administrator/components/com_civicrm/civicrm.settings.php
";
    exit( );
}

// Load class loader
require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register()

```

Having fixed this once before, but not remembering exactly how, I believe I'm not too far from getting this fixed.

How do I get CiviCRM to point to the new db name, username, and password?

Mike

# Answer
> 0 votes
When I tried loging into the backend of my restored site this morning it worked. I didn't change anything in any CiviCRM files after my previous post.

I'm not sure if a cache was cleared or what, but I have access to the backend again.

Mike

---
Tags: joomla, civicrm.settings.php
---


title: 5.64.0 seems to break ContributePage

text:
# Question
Title: 5.64.0 seems to break ContributePage
Is anyone else experiencing this?

I upgraded to 5.64.0 and my page with a Contribution shortcode (\[civicrm component="contribution" id="12" mode="live" hijack="0"\]) generates a fatal Wordpress error. I confirmed that it works correctly under 5.63.1.

> Wordpress sent the following information regarding the fatal eror. WordPress version 6.2.2 Active theme: Detroit Greenways (version 1.0) Current plugin: CiviCRM (version 5.64.0) PHP version 7.4.33
>
> Error Details ============= An error of type E\_ERROR was caused in line 1581 of the file /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php. Error message: Uncaught Error: Class 'Civi\Api4\ContributionPage' not found in /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:1581 Stack trace: #0 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Cms.php(142): CRM\_Utils\_System\_WordPress-\>checkCleanurls() #1 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php(76): CRM\_Utils\_Check\_Component\_Cms::checkCleanurls(false) #2 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(215): CRM\_Utils\_Check\_Component-\>checkAll(Array, false) #3 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(185): CRM\_Utils\_Check::checkStatus() #4 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(93): CRM\_Utils\_Check::checkAll() #5 /home/detroi20/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php(255): CRM\_Utils\_Check-\>showPeriodicAlerts() #6 /home/detroi20/public\_html/wp-conte

# Answer
5.64 moves a whole bunch of stuff into extensions and if the upgrade doesn't go smoothly there can be a mismatch between components and extensions. Check that both civicontribute component and the new extension are enabled.
> 2 votes

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


title: Data prep to import to Spark

text:
# Question
Title: Data prep to import to Spark
We are working with 2 data sets:

1. export from Mailchimp as a csv,
2. export from Excel as a csv. I would like to start importing to CiviCRM Spark with clean data sets. Any tips?

# Answer
> 1 votes
Mailchimp data imports pretty cleanly in my experience. Excel data does not.

For the Excel data, I recommend first doing an *export* from CiviCRM. You'll have the most success if you take the headers from the CiviCRM export and match your Excel data to those headers. E.g. if you have a "name" column, CiviCRM has a "First Name" and "Last Name", so you'll want to split that up.

---
Tags: data-import
---