# Question
Title: Search view that shows the mutual relationships between two contacts
We need to be able to see the common relationships between two contacts. Or essentially, who they both know and organizations they both have a relationship with.

For example, between Contact A's relationships and Contact B's relationships, display those relationships they have in common.

We would want this to be a tab or an on demand function if possible, like plugging in two contacts in a form to see the result.

We use search kit and form builder for a number of things and I feel like the solution is right in front of me but just can't seem to design a search to do it.

Also using Wordpress version of Civi.

# Answer
> 2 votes
This is possible with SearchKit. I can't recall how to create a URL that lets me copy a SearchKit, but I'm attaching a screenshot and instructions.

* Search for **Contacts**.
* Add a **With (required)** to **Contact Related Contacts**.
* Add a **With (required)**. Now, when you select the new entity, you'll see *Contact Related Contacts* listed twice - once under *Contacts* and once under **Contact Related Contacts**. Select the one under *Contact Related Contacts*.
* In both cases, remove the condition that specifies the relationship type, since you want any relationship.

So now, you have a search that's looking at three people:

```
Contact 1 <==> Contact 2 <==> Contact 3

```

When you search for Contact 1 and Contact 3, the search results for Contact 2 will be the person(s) that have a relationship with both.

Once you have the basic search down, you can modify the columns returned, and add a display to hide all this from the users, so they can just select contacts 1 and 3 by the criteria of your choice (contact ID, names, etc.).

---
Tags: relationships, searchkit
---


# Question
Title: CiviEvent - Error when registering: Could not find valid value for id
This is my first question on a stackexchange-like website, so bare with if I fail to mention something important about my question.

**The situation**

At the moment, I’m working on my very first CiviCRM-system in combination with Wordpress. My client currently uses CiviCRM in combination with Drupal, so I migrated the CiviCRM-database. The system mainly focusses on CiviEvents. The below is tested while not logged in as a Wordpress-user.

**The problem**

The problem I’m facing is that when I want to subscribe on a CiviEvent with the standard register-form provided by Civi, I end up getting redirected to this URL and this error is presented:

---

Redirected to:

```
http://localhost/DNN/?page=CiviCRM&q=civicrm%2Fevent%2Fregister&_qf_ThankYou_display=true&qfKey=74c1a421f35974b95728fb7b661a9d79_1904

```

---

Presented error: Could not find valid value for id

---

The registration does come through though. So apparently, saving the registration is going well.

When I debugged this issue I found that this error is thrown when the class **CRM\_Event\_StateMachine\_Registration** is instantiated and the following is executed:

```
$id = CRM_Utils_Request::retrieve('id', 'Positive', $controller, TRUE);

```

*(file: CRM/Event/StateMachine/Registration.php)*

The method **retrieve** tries to extract the value for **id** from either $\_GET, $\_POST or $\_REQUEST. In this case, he tries to extract it from $\_REQUEST. The contents of $\_REQUEST is:

```
Array
(
    [page] => CiviCRM
    [q] => civicrm/event/register
    [page_id] => 6
    [noheader] => 1
    [qfKey] => ecb991dac9477d393014910b1472fb2b_9259
    [entryURL] => http://localhost/DNN/?page=CiviCRM&q=civicrm/event/register&page_id=6&page=CiviCRM&id=506&reset=1
    [scriptFee] =>
    [scriptArray] =>
    [_qf_default] => Register:upload
    [MAX_FILE_SIZE] => 33554432
    [phone-Primary-2] => 0612345678
    [current_employer] => Test-employer
    [first_name] => Test-firstname
    [last_name] => Test-lastname
    [street_address-2] => Test-street-address
    [postal_code-2] => Test-postal-code
    [city-2] => Test-city
    [participant_source] =>
    [email-Primary] => test@test.com
)

```

As you can see, **id** is indeed missing. So I think the real question is: why isn’t Civi sending the id in this request? It is a standard, by Civi provided functionality after all.

Does anyone have any idea why I’m getting this message?

For completeness, this the backtrace from the point this error is thrown:

```
0 - Request.php - Line: 95 - dnn_backtrace () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php
1 - Registration.php - Line: 52 - retrieve () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php
2 - Registration.php - Line: 47 - __construct () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php
3 - Invoke.php - Line: 307 - __construct () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php
4 - Invoke.php - Line: 86 - runItem () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php
5 - Invoke.php - Line: 54 - _invoke () - /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php
6 - civicrm.php - Line: 1189 - invoke () - /DNN/wp-content/plugins/civicrm/civicrm.php
7 - civicrm.basepage.php - Line: 134 - invoke () - /DNN/wp-content/plugins/civicrm/includes/civicrm.basepage.php
8 - - Line: - basepage_handler () -
9 - plugin.php - Line: 571 - call_user_func_array () - /DNN/wp-includes/plugin.php
10 - class-wp.php - Line: 622 - do_action_ref_array () - /DNN/wp-includes/class-wp.php
11 - functions.php - Line: 877 - main () - /DNN/wp-includes/functions.php
12 - wp-blog-header.php - Line: 14 - wp () - /DNN/wp-blog-header.php
13 - index.php - Line: 19 - require () - /DNN/index.php

```

---

## EDIT

I forgot all about the error-logging Civi does. This is the error that is logged after registration.

```
Aug 18 14:31:54  [info] $Fatal Error Details = Array
(
    [message] => Could not find valid value for id
    [code] =>
)

Aug 18 14:31:54  [info] $backTrace = #0 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(363): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Utils/Request.php(96): CRM_Core_Error::fatal("Could not find valid value for id")
#2 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
#3 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php(47): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
#4 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(307): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
#5 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
#6 /DNN/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#7 /DNN/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:3))
#8 /DNN/wp-content/plugins/civicrm/includes/civicrm.basepage.php(134): CiviCRM_For_WordPress->invoke()
#9 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#10 /DNN/wp-includes/plugin.php(571): call_user_func_array((Array:2), (Array:1))
#11 /DNN/wp-includes/class-wp.php(622): do_action_ref_array("wp", (Array:1))
#12 /DNN/wp-includes/functions.php(877): WP->main("")
#13 /DNN/wp-blog-header.php(14): wp()
#14 /DNN/index.php(19): require("/DNN/wp-blog-header.php")
#15 {main}

```

# Answer
This is a bit of "surprise" but essentially for 4.6 and beyond Civi event registration for Wordpress won't work unless you either 1) use a 'base page' or a 2) WP short code

Solution #1 has two steps.

1. create a WP page with the 'civicrm' permalink
2. set a 'base page' within CiviCRM

See attached images.
> 11 votes

# Answer
I stumbled on this issue on CiviCRM 5.44 sites on WordPress, and the issue was that the site did not have "Clean URLs" enabled, since it was using an old civicrm.settings.php.

Make sure that the civicrm.settings.php has this bit of code:

```
  if (!defined('CIVICRM_CLEANURL')) {
    if ( function_exists('variable_get') && variable_get('clean_url', '0') != '0') {
      define('CIVICRM_CLEANURL', 1 );
    }
    elseif ( function_exists('config_get') && config_get('system.core', 'clean_url') != 0) {
      define('CIVICRM_CLEANURL', 1 );
    }
    elseif( function_exists('get_option') && get_option('permalink_structure') != '' ) {
      define('CIVICRM_CLEANURL', 1 );
    }
    else {
      define('CIVICRM_CLEANURL', 0);
    }
  }

```

and then in WordPress permalink settings, make sure that it uses the "post name" to form permalinks (this might not be strictly necessary according to docs, but I found that it helps), and save the permalinks setting form, so that the permalink cache is flushed.

Finally, Event Registration pages will be accessible using URLs that look like:

https://example.org/civicrm/event/register/?id=123&reset=1
> 7 votes

# Answer
I was having a similar problem. I noticed the base url for WordPress was not set.

If you haven't set that, try setting that in **Administer \> CMS Database Integration** and let us know if that fixed your issue.

Make sure the event is not the home page, that seems to cause problems with the base url.
> 3 votes

# Answer
On 4.7.9 + WP 4.5.3 I had this problem.

I have a paid event, with PayPal as payment processor, but also the Pay Later option is enabled.

Registrations proceed fine when paid with PayPal. I only get this error when a user ticks the Pay Later option.

I tried using a WP shortcode as CiviTeacher mentioned but that did not work. I *had* to set a Base Page - i.e., Administer | System Settings | CMS Database Integration could not be blank.

It doesn't have to be civicrm, it can be anything you want. You can use http://www.domain.org/event or something similar.

Then you have to create a Page in WordPress with this URL as the permalink. I then put the event shortcode on this page and it works great!

In my case I then set up an intro page at http://www.domain.org/ with a "Registration" link to http://www.domain.org/event.
> 1 votes

# Answer
If you upgrade from CiviCRM \< 4.6, and have a WP frontend with links to Civicrm pages (e.g. an event calendar) that are full URLs, you'll need to edit those links: from 'http://example.com/?page=Civicrm...' to 'http://example.com/civicrm/?page=Civicrm...' to get the basepage.
> 1 votes

# Answer
I had this problem intermittently for some time when embedding event registration forms using a Wordpress shortcode. It has to do with page caching. CiviCRM parses the shortcode to capture the event ID and adds the id value to the global $\_GET object. If the page is loaded from cache (usually when the back/forward button is pressed) the code that parses the shortcode does not run, and the event ID is not added to $\_GET.

I was able to fix this issue by making a page cache exception with the caching plugin I'm using.

I think this behavior is essentially a bug and CiviCRM should output a hidden form variable with the event ID so that it still gets passed to the "Thank You" page if the registration form is loaded from cache.

This is where Civi parses the shortcode and assigns the environment vars: civicrm/includes/civicrm.shortcode.php:

```
// Preprocess shortcode attributes.
$args = $this->preprocess_atts($atts);

// Sanity check for improperly constructed shortcode.
if ($args === FALSE) {
  return '<p>' . __('Do not know how to handle this shortcode.', 'civicrm') . '</p>';
}

// invoke() requires environment variables to be set.
foreach ($args as $key => $value) {
  if ($value !== NULL) {
    set_query_var($key, $value);
    $_REQUEST[$key] = $_GET[$key] = $value;
  }
}

```

Here are 3 solutions that are verified working:

**1) Use the "civicrm\_buildForm" hook with a template Region to add a custom template to Event Registration and Contribution forms (recommended).**

```
add_action( 'civicrm_buildForm', 'onBeforeFormBuilt' );

function onBeforeFormBuilt($formName) {
    $formSubmitMap = array(
        'CRM_Contribute_Form_Contribution_Main' => array('contribution-main-not-you-block', 'CRM/Custom/ContributionFormId.tpl'),
        'CRM_Event_Form_Registration_Register' => array('event-register-not-you-block', 'CRM/Custom/EventFormId.tpl')
    );

    if ( in_array($formName, array_keys($formSubmitMap)) ) {
        $formType = $formSubmitMap[$formName];

        CRM_Core_Region::instance($formType[0])->add(array(
            'template' => $formType[1],
        ));
    }
}

```

Contents of ContributionFormId.tpl:

```
<input type="hidden" name="id" value="{$contributionPageID}">

```

Contents of EventFormId.tpl:

```
<input type="hidden" name="id" value="{$event.id}">

```

**2) Modify core code (not recommended).**

If you want to allow your registration page to be cached and you're willing to modify Core code, here is a quick hack: civicrm/CRM/Core/Form.php (after qfKey section):

```
if (isset($_REQUEST['id'])) {
    $this->addElement('hidden', 'id', $_REQUEST['id']); }
}

```

**3) Use Javascript to perform a hard reload when the page is loaded from cache (not recommended).**

```
function purgeCache() {
    if ( function_exists('has_tag') && function_exists('get_the_id') && has_tag('logged-in-no-cache', get_the_id()) ) {
        // If this page has a tag "no-cache", force browser to NOT load from cache
        $currQs = parsedUrl()['query'];

        echo "
        <script>
            // Back buttom was pressed prior to loading this page
            if (window.performance) {
                if (window.performance.navigation.type === 2) {
                    location.reload(true);
                }
            // Use History to force cache purge
            } else if (window.history && history.pushState) {
                history.pushState('page-load', '', '" . (!empty($currQs) ? $currQs . '&' : '?') . "w3tc_flush_post&post_id=" . get_the_id() . "');
            }
        </script>";
    }
}

```

I haven't verified the history.pushState approach, but it should work OK.
> 1 votes

# Answer
I'm not sure of the cause, but I have a workaround. I'm guessing that you are using the direct link that Civi tells you to copy and paste from the event management page. Using that gives me the error too. However I created a WP page, embedded the event registration as a shortcode, and made it through registration and confirmation without errors.
> 0 votes

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


# Question
Title: How can I access multiple values returned by a Form Field in Form Processor?
I am trying to configure CiviCRM Form Processor. I am using a form with a field of type "option group" (let's call it the `Products` field) where customers can choose a product. They can choose multiple products at a time, which are handed over to CiviCRM as an array of strings (according to API Explorer). I want to create a CiviCRM Activity for each of these options chosen in the `Products` field.

I already created an Action of type "Create/Update Activity" for each product, based on the condition "Array parameter contains" and I chose the `Products` field as the parameter. This works. But my problem is, when creating the Activity, a custom field should be automatically set with the product name a.k.a. option group value. That is, I do not only want to check if the output array of the `Products` field *contains* a certain value, but I also want to use that value when creating the Activity.

I tried to use the pre-built Action "Others: Explode List" with the `Products` field as a param, to get access to each single product / option group value. But the API Explorer threw the error that this Action was given multiple values instead of a single one. So I suppose the `Products` field returns multiple values already.

Now I wonder how I can use these values in my `create Activity` Actions? When I am editing an Action, I do have the choice to fill fields with the value of `Input::products`. But which value is that, if `Products` field returns multiple? How do I access the second value, for example?

I am thankful for any hint.

# Answer
Our solution to this problem has been to add some code to the (custom) Wordpress plugin that sends the data from the online form to CiviCRM via API call. Just before that API call, we checked if an order contains more than one product, and if so, split it into several different API calls instead.
> 0 votes

# Answer
There may be a better way, but I would use `Other: Implode List` to get a string, then `Other: Modify Value with Regular Expression` to exract the individual fields to their own outputs. However, you would need a separate "Create Activity" step for each activity, and thus would need to know the maximum number of activities you might create ahead of time.
> 1 votes

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


# Question
Title: Events Calendar Extension on Wordpress: jQuery is not defined
Wordpress 5.8 CiviCRM 5.40.3 CiviCRM Events Calendar - Extension 4.1

Working with the Event Calendar extension from osseed. Followed the instructions for Wordpress here: https://github.com/osseed/com.osseed.eventcalendar

Everything seems to work as expected until you try to edit a page that's already been created with an Event Calendar shortcode. Then the console is suddenly flooded with "jQuery is not defined" errors.

Steps to recreate the error:

1. Follow Event Calendar Extension installation instructions
2. Create new page
3. Add shortcode
4. Save, publish, admire your wonderful new calendar
5. Go back and Edit the page.

Originally, I thought this might be an interaction with Elementor. But I've tested it again with the native Wordpress editor and I get the same result.

Has anyone else seen anything like this? Any thoughts on how to proceed?

User @ajasper has provided the following screenshot which includes more details about the errors.

# Answer
A simple workaround:

1. Deactivate the plugin "Wordpress Event Calendar"
2. Edit your page in Elementor (this was previously impossible due to interactions between Elementor and the outdated calendar plugin)
3. Re-activate the plugin

Works like a charm.
> 0 votes

---
Tags: wordpress, civievent, extension
---


# Question
Title: Why is the Sorting tab missing from CiviReport?
What configuration is required in order to display the "Sorting" tab in CiviReports? Is there a plugin for a Wordpress-based install to allow for column-based sorting?

# Answer
It may be possible that no sorting fields are defined for the reports hence it doesn't appear to show.
> 1 votes

---
Tags: civireport, reports, custom-reports, sort-order, column
---


# Question
Title: Display specific data in a wordpress widget/shortcode?
I have specific data that I've made available via the REST API using the data access plugin. I'd like to include this data via shortcodes or something similar in pages in WordPress.

For example, I have some aggregate data - like member counts - that I want to include in a an overview page, so I want to be able to just get the actual piece of data itself - the individual number, so I can place it wherever I want on the page.

Most of the integrations seem to revolve around showing tables of data.

Is this something that's doable in WordPress? I've been considering changing this site over to Drupal (for other reasons), is this something that's easier to do in Drupal?

# Answer
In wordpress you can do it using dataprocessor extension and CiviCRM UX plugin. You can build the views using dataprocessor and use CiviCRM UX plugin to create a shortcode which can be used in wordpress.

Drupal: Yes possible using drupal views and even using dataprocessor
> 1 votes

---
Tags: wordpress, data
---


# Question
Title: Getting Cron to run scheduled jobs with Drupal 9 in cPanel
I am trying to setup cron to run job.execute that I have setup in CiviCRM scheduled jobs. Drupal

https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cron

> Cron setup¶ In order for the scheduled jobs configured within the CiviCRM UI to run automatically, you'll need to configure a cron job which executes the Job.execute API call.

I have seen other examples but... http://mydomain.com/sites/all/modules/civicrm/bin/cron.php as shown in other examples does not exist on my site.

The only cron.php I have found is in the following location: /home/user/vendor/civicrm/civicrm-core/bin/cron.php

My site is in this location /home/user/public\_html/

CiviCRM settings are in this location /home/user/public\_html/sites/default/civicrm.settings.php

using the crontab method what would the be to execute my scheduled job?

\*/5 * * * * \<job.execute\> \*/5 * * * * job.execute \*/5 * * * * \<something\_something\_job.execute\>

I know these are not correct, what is the correct command? These instructions were not specific on how to get this working unless I am missing something right in front of my face...

Any help would be appreciated, thank you for your time!

# Answer
You can use for this `drush` or `cv.phar`. Detailed instructions for either can be found here:

https://civihosting.com/blog/how-to-make-a-cron-job-for-civicrm/
> 1 votes

# Answer
Try

```
/usr/local/bin/php /home/user/public_html/sites/all/modules/civicrm/bin/cli.php -u <cpanel admin username> -p <cpanel admin password> -e Job -a execute

```
> -1 votes

---
Tags: cron, scheduled-job, drupal-9
---


title: CiviMail : SPF REcord/SPAM issue

text:
# Question
Title: CiviMail : SPF REcord/SPAM issue
I am trying to configure/use civimail. When I send an email from CivCRM, it goes directly to the spam foler of the recipent. Looking at the mail header, I see Received-SPF: Fail (protection.outlook.com: domain of hamap.org does not designate 212.129.46.140 as permitted sender). Looking at CiviCRM documentation, I understand thar I need to create a SPF record using openSPF but OpenSPF does not exist anymore. Can someone tell me how to create a SPF record or something similar? Thks.

Configuring Sender Policy Framework (SPF)

By default, the Internet allows any mail server to send any email claiming to be from anyone. This makes it easy for spammers to forge addresses and send spam using your email address (or any other). SPF allows you to create a special DNS record listing the IP addresses of the mail servers that can legitimately send email from @yourdomain.org.

If your domain name already has an SPF record, make sure that it includes the IP address of your CiviCRM mail server (which might be a different from the host used for the web server or from your mail servers), and if it doesn't, add this IP address.

If you don't have an SPF record, consider adding one. You will need to add at least your mail server and CiviCRM server (if they are different) to the SPF record.

You can read more about SPF at http://www.openspf.org.

# Answer
You don't set up the SPF record at www.openspf.org. That was just a link for more information in the docs and it looks like it no longer exists. I'd start with https://en.wikipedia.org/wiki/Sender\_Policy\_Framework to understand what its about but you can also google a range of other resources around on setting up email that would be useful. There is also DMARC and DKIM and the whole lot is quite complicated, but necessary to make sure all your email gets delivered.

Its also worth trying to email to other domains as not all of them require senders to have SPF records, to see that everything else is working. What you need to do will depend on what method you are using to deliver the mail so there are quite a few variations - you need to ensure the right IP address is included in the SPF record.
> 0 votes

---
Tags: civimail, spam, failure
---


# Question
Title: Membership Start date and end date does not exist for recurring contributions(of type member dues)
I have an issue wherein if someones selects recurring option for member dues, it does not show membership start and end date. Is that a normal behaviour ?
CiviCRM 5.40.3
Payment Processor - Stripe

# Answer
> 1 votes
The membership start date and End date will be populated once Civi gets response from the Stripe about the payment. Once the related contribution is set to completed the membership start date and End date will be set.

Incase the contribution status is updated correctly but not the membership than probably the date update must have failed while doing the related component update.

---
Tags: civimember, stripe
---


# Question
Title: Trying to change Status Override on memberships but the record never completes
I am trying to change membership from Permanent Override to No or Override on a Specific Date, but the change isn't accepted. I have Admin access. Is there a background setting that might be impacting this?

# Answer
> 2 votes
I've had a possibly related experience, where the status wasn't being updated automatically, and it seemed to be related to whether it's been overridden in the past. I noticed this related-sounding issue;

https://lab.civicrm.org/dev/core/-/issues/2974

and tried a more recent civicrm version and that fixed some aspects (the system job didn't update the status, but just editing the membership record fixed the status).

---
Tags: civimember, status
---


# Question
Title: After upgrade to 5.44 menu and some elements won't load without debugging enabled
After an upgrade from 5.38 to 5.44 on a Drupal 8 site the menu and dashboard failed to load. Other page elements, like the footer and header did load. Status page was also inaccessible, but mysite/civicrm/admin and other administrative pages could be accessed. However, edit windows for contacts would just show the spinning throbber and never load, nor would other ajax components work such as help popups, etc. Turning on Debugging, without taking any other action solves all the problems, but obviously I don't want to leave debugging on. Does anyone have thoughts on what might be causing the problem?

**UPDATE** After checking the console I see that the page is throwing a pile of 403 errors when it attempts to access angular files in /civicrm/persist/contribute/dyn/ BUT ONLY when debugging is disabled. When I turn on debugging the 403 errors disappear.

# Answer
> 2 votes
Long story short, it was a permission issue. A change to groups on my institutions relatively new server left Apache without execute permission on some files and folders in myTheme/civicrm/files. The change was actually a good thing that had been requested some time ago, but I was unaware it was implemented. Reinforcing group read/write/execute on those files solved it. The only remaining mystery is why it was working before the upgrade since the change by our IT person was implemented a few weeks ago.

---
Tags: upgrade, menu, ajax, debugging
---


# Question
Title: Minute as a time unit for scheduled reminders
Right now the smallest unit is the hour, so I can schedule a reminder 1 hour before or after something.

What do I do if I wanted to send a reminder 30 minutes before something? Is this possible right now?

If not, how difficult would it be to make an extension that would introduce **minute** as a time unit for reminders? Would this be difficult to achieve? Are there any clever workarounds?

# Answer
Minutes as a scheduled reminder unit is available in CiviCRM 5.44+.
> 3 votes

# Answer
It's a legitimate question although even if you could do it per minute, you'd then have to have cron run every minute, which is technically possible but might be a bit excessive.

If you're talking about reminders for activity assignees, an alternative might be to turn on the setting at Administer - Customize - Display Prefs - Include ICal Invite to Activity Assignees. Then they can put it in their calendar and they can set it to remind them as desired.
> 0 votes

---
Tags: scheduled-reminders, civirules, core
---


# Question
Title: Cannot upload images using CKEditor on message template after 5.45 upgrade
It was all working fine prior to upgrade. Now I am stuck and cannot upload images using message template CK Editor. Keep receiving this message when dragging picture on the window and getting an error message when using upload function. All other uploading throughout civicrm seems to works fine. Anyone had similar issues? How did you fix it please? Thanks

> Error message
>
> Error: Class 'kcfinder\CRM\_Core\_Config' not found in kcfinder\uploader-\>\__construct() (line 118 of /home/webadmin/public\_html/cmm-uat/sites/all/modules/civicrm/packages/kcfinder/core/class/uploader.php).

# Answer
Revert the session id fix until core team has a fix
> 3 votes

---
Tags: error, message-templates, images, upload
---


# Question
Title: Why I cannot see the activities registered to a contact in her dashboard (frontend)?
Why I cannot see the activities registered in a contact profile, in his dashboard (frontend), when I can find it as a contact in the backend?. I´m a very newbie with this amazing software. Thanks

When I see the contact dashboard from the front end, there says under the title: your Activities.... You are not registered on any activity, But when I go to that contact dashboard through the administration backend, the activities are there!!. So I don't understand, really... I need some experts to help. Thanks a lot.

# Answer
I think by "registered" you mean "assigned". Check the "assigned to" field on those activities - in order for the activity to appear on the contact dashboard the person needs to be listed in the "assigned to" field.

As per comments below you're wanting the "with contact" to be the field that controls their activities. You can do this with search kit:

Note also I've added a "display" page you can see in the left sidebar. The link to that page is the link you would put in the menu for users to see their activities. This is on https://dmaster.demo.civicrm.org and should be there for the next 15 hrs or so if you want to see it there.
> 0 votes

---
Tags: activities, user-dashboard
---


# Question
Title: Registering donor while using other payment processors
do you have any knowledge on whether it is possible to register a user who is using for payment a processor that isn't listed in official guides? We receive donations using Paypal but also through Corvus payment gateway, Paycek (for cryptocurrencies) and another that is more "local".

The way I see it, a donor would be able to register on our webpage and through that give a donation using PayPal which should then be registered in his profile but I am unsure if such thing is possible using the other routes because there are no developed plugins in civiCRM ecosystem. I am guessing, that such data will have to be manually added if we don't want to develop a plugin?

The donations are either one-off or recurring.

Any help and/or pointers would be more than welcome.

# Answer
> 0 votes
One way to do it would be to have the other payments that aren't actually tied to CiviCRM go through the 'pay later' option. Then they would go in with the status of pending pay later. Then in your instructions, you could give the link they would need to use in order to actually pay for it (assuming that you have one to give). Then their information would be in the system and all you would need to do is go in and edit it to complete and input the information regarding when/how they paid.

---
Tags: contributions, payment-processor
---


# Question
Title: Contribution page repeatedly 'Page Not Found'
Help!

Both our donate and membership contribution pages keep failing and saying 'Page Not Found'. https://www.museumofcambridge.org.uk/civicrm/contribute/transact/?reset=1&id=1

We use Wordpress.

Can't find a reason. Has come on and off again with no clear cause.

Test page also not working.

Have cleared cache and did not improve.

Any advice much welcomed!

# Answer
> 3 votes
our IT volunteer seems to have fixed it, and said:

The fix is to go to Administer \> System Settings \> CMS Database Integration from the menus.

And press Save, checking that the writable field on the page (WordPress Base Page setting) says civicrm

We're still not 100% sure what's happening, but that was our fix!

Thanks to those that helped :)

# Answer
> 1 votes
It would seem to me that the URL link is wrong. Could you go into CiviCRM Admin and Contributions/ManageContributionPages/ and on the title of the page you are referring to, click on 'configure'. At the bottom of the page in 'Title and Settings', the correct URL is shown. Copy that URL and make sure that link is used in your wordpress menu settings. Also make sure that this contribution page is Active. Hope this helps.

---
Tags: wordpress, contributions
---


# Question
Title: How to find out when Contact added to a Group
I'm trying to find out when people were added to a SmartGroup. I want to be able to see when they joined the group so I can see when their membership is expiring.

Anyway to do this? I have tried doing searches via Manage Groups as well as in Reports, but I can't seem to find any dropdown/filter for 'Date Added to Group' e.g.

Any help would be appreciated!

J

# Answer
> 4 votes
If its a smart group I don't think you'll be able to do what you want as its actually a saved search and each time you look at membership its recalculated so there is no concept of when the contact joins the group.

If it were a normal group, there is a plugin https://github.com/MegaphoneJon/org.cpehn.subscriptionhistory that produces a report gives details of when an individual joins and leaves the group. Its not working for me at the moment (CiviCRM 5.35.1 on WordPress) though it did when I originally tried it, showing a full history of be added to and removed from a group. Maybe the author https://civicrm.stackexchange.com/users/12/jon-g-megaphone-tech can help?

---
Tags: civimember, groups, smartgroups, date-range
---


# Question
Title: Users can't register for events on day of -- why?
We have a lot of users who register at the very last minute. Often, when they try to register for an event on the day of the event, but before the event has started, CiviCRM tells them registration is closed.

I'm surprised that by default registration closes for an event before the event starts. Surely the default is that you can register for an event right up to the configured start time?

I was wondering if this might be due to a time zone issue on the server. Is there a right way to set the date on the server side? It is currently 6:40 pm Pacific where our organization is. If I do a `date` command on our server, I get: `Tue Jan 11 02:40:02 UTC 2022`.

I don't see anywhere in CiviCRM administration screens that I can see what it thinks the current date/time is. Is there such a place?

If I look in Drupal's status report, I see this: `The timezone has been set to America/Vancouver.` and if I go to Drupal's `/admin/config/regional/settings` configuration I do see that it says the current date and time in our office's location. And if I look at Drupal recent log messages, it lists a log message with a date/time within 1 minute of the current time.

So that all indicates to me that Drupal (and I presume Civi) knows the correct date & time at our office.

So then why can't a user register for an event on the day of the event but an hour or two before it has started?

(I know I can fix this by just setting the "Registration End Date" field in the Online Registration tab to the day after the event starts, for example, but this is annoying to have to set for every event, I often forget to set it right, and it just "feels wrong" that this should be happening.)

Thank you!

# Answer
Judging from this issue: https://lab.civicrm.org/dev/core/-/issues/2122#note\_68300 I think you are correct that it's a timezone issue.

Specifically, date/times in civievent do not include timezones (an old design flaw!), so many calculations involving date/times will use an implicit timezone from mysql or php (both of which can be confusingly different from each other and the 'server' timezone).

You could try fixing it with a configuration in your mysql ini file to set a timezone, but that might generate new confusion.

What you're seeing in Drupal where it "knows" your timezone adds an extra layer of confusion, TBH ...
> 1 votes

---
Tags: civievent, online-registration
---


# Question
Title: How to automatically create relationship between Drupal role user and a group of civi contacts?
I have webform where volunteers signup for newsletter. They land on group called "Volunteer".

Our volunteer co-ordinator users are in a drupal role called "Coordinator"

What I want is, those "Coordinator" users would ONLY be able to access the contacts from the group "Volunteer". I can easily achieve this by using related permission extension https://github.com/eileenmcnaughton/nz.co.fuzion.relatedpermissions .

But I am failing to automate the process of creating a relationship between the volunteers and Drupal users. If any new Drupal user is added to the same role, the relationship would automatically be created. I am open to alternatives. Any suggestion would be greatly appreciated. Thanks

# Answer
Perhaps a case for a normal civi ACL - perhaps using CiviRules to put your Volunteer Managers in to the ACL Group which then has access to see those in the Volunteer Group.
> 1 votes

# Answer
Use the Silent User Registration extension https://lab.civicrm.org/extensions/silentuserreg This will create the user in Drupal

Before you install the extension, replace the Createcmsuser.php file in CRM \> Silentuserreg \> CivirulesAction with the code below. This will create the UF Match that you are looking for to link it to the user in Civi

Follow the extension instructions to set it up. I would have your CiviRule trigger off When contact is added to group or something like that.

```
<?php

```

/\**

* Carls Notes
* This file is to create a CRMUser and then a UFMatch record. File Location=secure/sites/all/files/civicrm/extensionsions/silentuserreg-master/CRM/Silentuserreg/Silentuserreg */ /**
* Class for CiviRules Create User Action
*
* @author Jon Goldberg (jon@megaphonetech.com)
* @license AGPL-3.0 \*/ class CRM\_Silentuserreg\_CivirulesAction\_Createcmsuser extends CRM\_Civirules\_Action {

/\**

* Method processAction to execute the action
*
* @param CRM\_Civirules\_TriggerData\_TriggerData $triggerData
* @access public
*

*/ public function processAction(CRM\_Civirules\_TriggerData\_TriggerData $triggerData) { $cid = $triggerData-\>getContactId(); $userInfo = \Civi\Api4\Email::get() -\>addSelect('id', 'email', 'contact.display\_name', 'is\_primary') -\>addWhere('is\_primary', '=', TRUE) -\>addWhere('contact\_id', '=', $cid) -\>setCheckPermissions(FALSE) -\>execute() -\>first(); $userExists = (bool) count(\Civi\Api4\UFMatch::get() -\>addWhere('contact\_id', '=', $cid) -\>setCheckPermissions(FALSE) -\>execute()); if (!$userExists) { $userParams\['cms\_name'\] = $userParams\['nickname'\] = $userInfo\['contact.display\_name'\]; $userParams\['email'\] = $userInfo\['email'\]; $userParams\['cms\_pass'\] = CRM\_Silentuserreg\_Util::randomPassword(); $nid=CRM\_Core\_BAO\_CMSUser::create($userParams, 'email'); // create the UF Match record $ufmatch\['uf\_id'\] = $nid; $ufmatch\['contact\_id'\] = $cid; $ufmatch\['uf\_name'\] = $userInfo\['email'\]; CRM\_Core\_BAO\_UFMatch::create($ufmatch); } } /**

* Method to return the url for additional form processing for action
* and return false if none is needed
*
* @param int $ruleActionId
* @return bool
* @access public \*/ public function getExtraDataInputUrl($ruleActionId) { return FALSE; }

}
> 0 votes

---
Tags: contacts, permissions, relationships, acl, user
---


# Question
Title: How Can I make the source field as dropdown
I remember there used to be an extension that would make the source field as a dropdown instead of an editable field, cant seem to remember how it's called! Anyone?

EDIT: I think It’s the contribution source field. When adding a contribution this extension would make the source field a dropdown instead of a text. The dropdown would be the list picked up from existing data from contribution source field.

# Answer
> 3 votes
https://github.com/twomice/com.joineryhq.textselect

Depending what you're trying to achieve, using campaigns is an alternative (which is already a dropdown) that may make sense.

See https://civicrm.org/blog/stoob/new-ways-track-referral-source for putting it all together.

---
Tags: extension
---


# Question
Title: Design flaw in current employer and job title
Apparently there is a design flaw in the current employer and job title fields in Civi.

"If you enter or amend these fields through the edit of a contact, a corresponding employment relationship will be established. Unfortunately, if you create an employment relationship directly then the two fields do not get updated. Likewise, if an employment relationship becomes non current or is deleted, then the two fields do not get updated."

Does anyone know about this and how can I get around it? I am entering job titles for contacts. Civi says it saves them. When I open the contacts the next day, the updates have not occurred.

# Answer
My experience is that 'Employer' field *does* get populated after adding the relationship directly. However the Job Title field is not related to the relationship and that wouldn't get populated, as it's a field on the contact record only.
> 2 votes

# Answer
Surely the point here is that the Job Title field should be linked to the Employee/Employer relationship record and not the contact record. In cases where an individual may have more than one employee relationship, they will also quite likely have different job titles in each context. This is a case of confusion for at least one org that I work with.

The Current Employer field is another weird one. It does not get auto-populated if an employee/employer relationship is created, but if a current employer is manually added, and a matching relationship record doesn't exist, one does get created. Current Employer implies that there can be only one, which is of course nonsense. Probably should be able to be turned off on a preferences page.
> 1 votes

---
Tags: contacts, fields
---


# Question
Title: Is there any way to apply two "NOT Like" conditions in Civicrm API?
Hi I am using Civicrm api v3. I am trying NOT Like condition with single condition it is working. But i need to apply two conditions with string1 and string2.

```
    $contribution = civicrm_api3('Contribution', 'get', [
        'sequential' => 1,
        // 'financial_type_id' => "Donation",
        'receive_date' => ['BETWEEN' => ["01-01-2021 00:00:00", "31-12-2021 23:59:59"]],
        'contact_id' => $contact_id,
        'contribution_status_id' => "Completed",
        'source' => ['NOT LIKE' => "%string1%"],
       'source' => ['NOT LIKE' => "%string2%"],
        'options' => ['limit' => 5000, 'sort' => "receive_date ASC"],
    ]);

```

# Answer
You can do multiple not like statements using api4
> 3 votes

---
Tags: api, php
---


# Question
Title: Move data from field to another field as a batch
I recently have taken over managing CiviCRM for an orchestra in Holland. Some fields have been used inconsistently, for example Nickname and First Name. I now need to copy all data in Nickname to First Name. That would be no problem running a SQL query, but I am afraid that would be too bold a step in CiviCRM. How do I go about? Is there an extension to do the job?

# Answer
I don't think there's an extension but there is an api (https://docs.civicrm.org/dev/en/latest/api/). If you do it in SQL it wouldn't autoupdate other items like the "display\_name", so you could write a little php script using the api to do it, and then run it with `cv php:script`. Basically you would want Contact.get and then Contact.create, e.g. something like (untested! Make a backup!)

```
$contacts = civicrm_api3('contact', 'get', ['contact_type' => 'Individual']);
foreach ($contacts['values'] as $c) {
  civicrm_api3('contact', 'create', [
    'id' => $c['id'],
    'first_name' => $c['nick_name'],
  ]);
}

```

You may also want to e.g. check that nick\_name isn't blank for that record. May need to experiment.

FYI contact.create means "update" when you give it an `id`.
> 1 votes

# Answer
You could do it just with API Explorer 4 using chaining:

I've added a couple of 'where' clauses for minor sanity - you might want to adjust those.

This finds all the contacts satisfying the 'where' clauses and for each one, runs an update where `$id` and `$nick_name` in the chain clause refer to the values from the contact just looked up.

Take a backup & test carefully!
> 2 votes

---
Tags: extension, database, mysql, fields
---


# Question
Title: CDN Tax Receipt issuance for more than 1 donor-auto process
Can CDN tax receipts be emailed directly to the donors at once- auto process?

# Answer
> 1 votes
I'm not sure what you mean - the title implies "batch", but then the question body suggests you mean at the time the donor makes a contribution.

If you mean "automatically at the time the donor makes a contribution", then there is the "Attach receipts to automated workflow messages" setting in the CDN tax settings under Administer - CiviContribute. If you turn that on the donor will receive a tax receipt as soon as they finish the donation.

If you mean batch to several donors at once, if you do a contribution search, then you can select some or all, and then in the Actions dropdown there are some choices for Issue Tax Receipts.

---
Tags: cdn-tax-receipts
---


title: Donation report by exception

text:
# Question
Title: Donation report by exception
Is there a report available in CiviCRM to show list of donors with or without tax receipts issued instead of viewing each donor one by one?

# Answer
> 2 votes
Yes, under Reports - Contribution Reports, choose New Contribution Report. Then there are choices for Not Issued and Issued. You can then choose some options and Save that report for future use.

(Based on your other questions I assume by "tax receipt" you mean "CDN Tax Receipt" from the CDN Tax Receipts extension.)

---
Tags: donations
---


# Question
Title: Path to image in CDN tax receipt extension
The images I use in my CDN tax receipts are stored as a full path but the container code that comes after /srv/bindings/ changes from time to time which makes it that the files are not found.

How can I store these images as relative paths?

# Answer
> 1 votes
I know this question is old but noting that recent versions of the cdntax receipts extension store them as relative paths (since 1.6.0). Upgrading will automatically update the stored path.

---
Tags: extension, cdn-tax-receipts
---


# Question
Title: How to obtain a list of contact who have never opened any bulk email
I'd like to generate a list of all contacts who have received a mailing and have never opened any of them... How can I do that?

# Answer
Something like via Adv Search

* create Group A based on eg CiviMailing \> Delivery Status = Successful
* create Group B based on eg CiviMailing \> Trackable opens = Opened

by my reckoning this should mean you can then find everyone who has had a deliver and exclude everyone in that group who has ever opened

* use Custom Search Include/Exclude to say "Group A minus Group B" /civicrm/contact/search/custom?csid=4&reset=1

May not be exactly what you need but may give you an approach to try. If you have trouble finessing making your Groups via Adv Search then try Search Builder

Alternatively SearchKit may be able to do this in a single query (would need to be on a very recent version of civicrm)

Note: the concept of 'opened' is tricky as it will depend on how each person's mail app treats mail. So a more certain (but different) search may be to exclude all those who have clicked a trackable url.
> 2 votes

---
Tags: civimail
---


# Question
Title: How to remove the recurrence of an event?
We have created (without doing it on purpose) an event by asking for a recurrence (repeating event). It's a mistake... I would now like to delete this recurrence, how do I do this? knowing that in the "Repeat" menu of the event, the "End" field is mandatory... Thanks a lot for your help

# Answer
Welcome to CiviCRM stack exchange. You can't get rid of everything to do with the repeat tab, but you can get rid of all but one occurence. If you go to manage events then you will see the recurrences listed separately and you can delete all but the first one (or whichever you want to delete). Its not quite the same as if you'd never set repeat, but as far as front end users (and in most respects back end users) it makes no difference.
> 2 votes

---
Tags: repeating-events
---


title: CiviCRM Map Of Members WordPress

text:
# Question
Title: CiviCRM Map Of Members WordPress
I have CiviCRM v5.44.0 running on WordPress 5.8.3 and am using Leaflet Map and Leaflet Map CiviCRM Integration with the Data Processor extension and Geocoder extension. Thus far, I am unable to get the map to display any of my members. I specifically set one member with the Membership Type and Logo. Everything I am doing is based upon:

https://civicrm.org/fr/node/11212

My map code is as follows:

```
[leaflet-map lat=32.186806687571355 lng=-100.63476562500001 zoom=3 zoomcontrol !detect-retina]
[leaflet-civicrm-api entity=Contacts action=get lng_property='longitude' lat_property='latitude' profile=local popup_text='<img src="{logo}"><br/><strong>Name: </strong>{organization_name}<br><strong>Services: </strong>{services}'][/leaflet-civicrm-api]

```

To that point, Services has 3 options just like the example. Logo is an upload field for a logo. Organization Name is the name of the company that the person works for.

API entity is set to Services and the fields have all been added according to post instructions.

Only a blank map appears.

The CiviCRM is a plugin running on WordPress inside of the main domain and set to local. The page is located here:

xxxxxx

Also, end up with these errors after clearing the cache and triggered by WP Plugin Integration between Leaflet Map and CiviCRM (version 1.0.7):

An error of type E\_COMPILE\_ERROR was caused in line 21 of the file /home/xxxxx/public\_html/wp-content/plugins/integration-between-leaflet-map-and-civicrm/shortcodes/class.civicrm-api-shortcode.php. Error message: require\_once(): Failed opening required 'LEAFLET\_MAP\__PLUGIN\_DIRshortcodes/class.shortcode.php' (include\_path='.:/opt/alt/php74/usr/share/pear')

Any help would be appreciated.

# Answer
> 3 votes
Not sure why; however, when I uninstalled and reinstalled the plugins everything works now. Ghost in the Machine I suppose.

---
Tags: wordpress, map
---


title: How can I update events

text:
# Question
Title: How can I update events
How can I update events already set up? Please send me the steps to update the informationon the events page.I am unsure the steps for updating the page.

# Answer
Welcome to CiviCRM SE. I think you should find all this in the docs at https://docs.civicrm.org/user/en/latest

But quick answer is, in the back end, select **Manage Events** in the **Events** menu. They select **Configure** for the event in question. Should be obvious from there...
> 2 votes

---
Tags: civievent
---


title: 'Assigned to' option in Inbound e-mails

text:
# Question
Title: 'Assigned to' option in Inbound e-mails
We're trying the inbound e-mail to activity functionality and it works fine.

The only limitation until now is that the 'source' and 'assigned to' contact seems to be the same.

We need to have a process that adds an activity assigned to 'C', created by 'A' with contact 'B'.

Is this possible out of the box? Would you use a CiviRule to change assignee?

(we've been through documentation and SE and couldn't find such a situation, that seemed at first obvious to me)

# Answer
> 1 votes
Would https://docs.civicrm.org/dev/en/latest/hooks/hook\_civicrm\_emailProcessor/ work? It will let you update the assignee on the activity after it gets saved.

e.g.

```
function myextension_civicrm_emailProcessor( $type, &$params, $mail, &$result, $action = null ) {
  if ($type != 'activity') {
    return;
  }
  $contact_id = 36377; // this is contact C
  $params = array(
    1 => array($contact_id, 'Integer'),
    2 => array($result['id'], 'Integer'),
    3 => array(CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Assignees'), 'Integer'),
  );
  CRM_Core_DAO::executeQuery("UPDATE civicrm_activity_contact SET contact_id = %1 WHERE activity_id = %2 AND record_type_id=%3", $params);
  // or use api if preferred
}

```

---
Tags: inbound-email
---


title: Trustworthy voting system using CiviCRM

text:
# Question
Title: Trustworthy voting system using CiviCRM
TLDR: Is it possible to use CiviCRM as a trustworthy voting system?

In my organisation we need to do votes (changing bylaws, regulations, electing functionaries etc) and I am researching possibility to use CiviCRM for that. We use CiviCRM 5.36 on WordPress 5.7.2.

I have tried:

1. CiviCampaign - Survey: no way, it is for offline use, we need online
2. CiviCampaign - Petition: I eventually could publish a petition in a WordPress page that is visible only for members (WP users automatically synchronized with CiviCRM members using WP plugin "CiviCRM Member Sync"; page accessibility is managed by the WP plugin "Groups"), that could work, but the problem is that a CiviCRM admin can easily change vote of a member, what we do not want...
3. CiviCRM extension Elections: works only for elections of people for elected functions, not for general voting

Now I am considering some WordPress plugin or standalone voting web application, but before that - do you know of some way how now use CiviCRM as trusted voting platform?

Should:

1. no need to manually synchronize membership status / list of members

Could:

1. no need to create new pages in WP for new votings

In case it is not possible directly using CiviCRM, it would help at least to have automatic synchronization of membership status from CiviCRM (aka integration with WordPress).

Thanks!

# Answer
I don't see how you would create anything that an admin (or anyone with access to the database) could not change. Perhaps this could work: create an "event" and put the voting fields in the profile used for that event. You could use some of the existing extensions to allow only members to register/vote for that "event." The confirmation sent to the "voter" could be bcc'd to others for confirmation/verification/audit purposes.
> 2 votes

---
Tags: wordpress
---


title: rules that send emails generate errors

text:
# Question
Title: rules that send emails generate errors
I have continued to have problems getting one particular Rule to work. It is supposed to trigger whenever a new contact is added, and do two things: Add those new users to a specific group, and send them a welcome email, using a template that works well when we send it individually.

For a while, the rule would run, but it would send TWO emails. Then, for no obvious reason, it started not sending the emails at all (although the rule would trigger and add the new account to the correct group). Looking at the log, I'd see this:

\[rule\_title\] =\> Send welcome email to new sign-ups \[original\_error\] =\> Civirules api action exception: One of parameters (value: ) is not of the type Positive. API call: Email.send with params: from\_name="", from\_email="", template\_id="72", disable\_smarty="", location\_type\_id="", from\_email\_option="1", alternative\_receiver\_address="", cc="", bcc="", file\_on\_case="", contact\_id="2063", extra\_data="Array" \[reason\] =\> Failed to execute action

I tried to modify the rule in various ways, and now when I try to add a contact I get the error: "There has been a critical error on this website. Please check your site admin email inbox for instructions."

We are using CiviCRM 5.45.1. System Status: Ok on Wordpress version: 5.8.3.

Any suggestions?

# Answer
Using Scheduled Reminders would be an alternative approach.

when you set up a SchRem one of the 'entities' you can choose is 'contact' and once you choose that you then get options like 'created date' so in theory can do 0 hours after Created Date (or try .1 or 1 or something if zero doesn't cause it to fire)
> 1 votes

---
Tags: civirules
---


title: Activity import gets the century wrong

text:
# Question
Title: Activity import gets the century wrong
When I import activities from a CSV using a date format that includes a 2-digit year (for example, mm/dd/yy), dates such as "01/18/22" get imported as January 18, 1922 instead of January 18, 2022.

It looks like years from 00 to 20 are assumed to be in the 21st century (2000-2020), but 21-99 are assumed to be in the 20th century (1921-1999).

How can I work around this?

# Answer
For the moment, the best workaround is to edit the activity dates in the CSV to have four-digit years before importing.
> 1 votes

---
Tags: import, activities, activity, dates, data-import
---


title: Errors on opt out or unsubscribe

text:
# Question
Title: Errors on opt out or unsubscribe
I am seeing errors with optouts and unsubscribes similar to this. It is inconsistent - some requests succeed but some fail with "There was an error in your request" as described there. The query string on the optout or unsubscribe looks like: "jid=3292&qid=1930772&h=b600fd5ef64ce4b4". Doing a DB query I can find the matching 'id' and 'job\_id' in the civicrm\_mailing\_event\_queue table, but the hash does not match, so the attempt to verify the parameters produces the error. So it seems as though in these cases the hash value is either corrupted in transit or is overwritten in the database. I'd be interested to know if anyone else can validate that behavior. Thanks. This is on CiviCRM 5.43.0 and Wordpress 5.8.2, with flexmailer and mosaico enabled.

Edit: just to be clear, the returned hash value does not exist anywhere in the civicrm\_mailing\_event\_queue table so I don't know how it is being generated.

# Answer
It's hard to imagine how the hash could be corrupted in transit, but easier to imagine how it could be overwritten in the database. I recommend enabling advanced logging (**Administer menu » System Settings » Misc**) so that you can see the old values of records in `log_civicrm_mailing_event_queue`.
> 1 votes

---
Tags: civimail, flexmailer
---


# Question
Title: ERROR Class 'CRM_Search_Upgrader' not found since upgrading CiviCRM to 5.45.1 on Wordpress 5.8.3
I upgraded from CiviCrm 5.38 to 5.45.0 on my staging server which is on Wordpress(5.8.3). I get a Error Thrown ...Class 'CRM\_Search\_Upgrader' not found when I access:

1. CiviCRM from the Wordpress Admin panel for the first time and when I refresh the page CiviCRM comes up.
2. Administration\>\>System status - nothing comes up apart from the wait icon. (https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F#/status)
3. The extensions option thru the administration menu. Administration\>\>\>System Settings\>\>Extensions (https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fextensions&reset=1)

For the upgrade I followed the notes on https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/

Extensions were also brought back as per the notes above. The extensions are:-

1. ca.civicrm.logviewer
2. mosaicotweaks
3. purgelogs-1.1.0
4. uk.co.compucorp.civicrm.booking
5. uk.co.vedaconsulting.mosaico
6. webtracking-1.3

I don't think that uk.co.compucorp.civicrm.booking is working or has been updated as we were testing this some time ago but abandoned it as there was no support.

Caches have been cleared, CiviCrm menu rebuilt and rebuilt database triggers through the CiviCRM Admin Utilities.

I did get the message that the upgrade was successful during the upgrade process through CiviCRM Admin Utilities.It shows that I am running 5.45.0 on the bottom of https://example.org/wp-admin/admin.php?page=CiviCRM

1. Has anyone come across the same issue on Wordpress and be able to assist please with a solution?
2. Do I revert back to CiviCRM 5.36 and wait for the next version CiviCRM 5.46 on my staging server?

Thanking the team in advance.

# Answer
> 2 votes
Aha! Thanks for the list of extensions. You have afform\_admin enabled and in 5.45 it started requiring search\_kit. So it must be looking for it after upgrade.

If you've already upgraded and have access to the mysql database, you can do `update civicrm_extension set is_active = 0 where full_name='org.civicrm.afform_admin';` to disable afform-admin temporarily so you can get to the screens.

If you haven't upgraded yet, this needs to be fixed in core but in the meantime before upgrading you can either disable afform-admin, or install search kit.

---
Tags: wordpress, extension, upgrade, error, accessibility
---


# Question
Title: ERROR Class 'CRM_Search_Upgrader' not found since upgrading to 5.45.1 Joomla
When I try to navigate to "system status" nothing shows up now after upgrading to 5.45.1. I get a blank screen.

When I select "administrator" then select "extensions" I receive the error Class 'CRM\_Search\_Upgrader' not found and I'm asked to go back to control panel.

When I select Civicrm from the Joomla "components" menu I sometimes off and on get the same error message.

I have no idea how to fix this. Please if you answer, walk me through in baby steps if you know how to fix it. Thanks in advance.

# Answer
> 1 votes
Here is what worked best for me based off comments and suggestions posted. I'm unfamiliar with MySQL, so I went into my file manager through my hosting and deleted the "Afform" folder found at administrator \> components \> com\_civicrm \> civicrm \> ext

After I deleted the folder and refreshed the civicrm home page my "system status" and "extensions" were no longer blank and throwing errors that Afform files were missing. I then was able to install the "Search Kit" in the extensions as recommended. I then reinstalled the Afform folders from the most recent downloads. I'm not sure if this route helps others, but thought I'd try to explain.

If anyone wants to reply and educate me on how to work the above suggestions, I would be grateful for the tutorial. I'm able to access phpmyadmin. From there I have access to all the database tables, and I have SQL tab at the top. I was just unsure what to do next. Thanks to all who helped answer my question!

# Answer
> 2 votes
I've seen this sporadically and have had to run extension upgrades for Search Kit.

If you go to the system status screen `/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fa%2F#/status` You should see if any extension updates are needed.

You can force the extension upgrades by going to `/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fextensions%2Fupgrade&reset=1` or running `cv ext:upgrade-db` if you have cv and ssh access.

---
Tags: joomla, upgrade, error, search, system
---


# Question
Title: Do I need to change our database collations?
I just stumbled upon this problem, which was due to fields in some tables having conflicting collations. Thanks to the answer to that question I solved our immediate problem.

But looking around I see a lot of fields in a lot of tables have differing collations. Should I fix all those too, or does that create a risk for other problems?

If I should "reset" all collations, is there a simple way to do that with all fields in all tables without `cv` (which we currently don't have)?

# Answer
It's not a problem for every field, although if you want emoji support then it matters for a different reason (and you would want utf8mb4\_unicode\_ci everywhere, except some special-purpose fields which are BINARY, e.g. utf8mb4\_bin).

You could try the api explorer System.utf8conversion action, which will try to convert tables to utf8mb4, but note it doesn't have any knowledge of extension's tables. Also if the database is big it might time out doing it through the UI, but you said you don't have `cv`.

0. Make a backup.
1. Go to civicrm/api3
2. For entity choose system
3. For action choose utf8conversion.
4. Leave the defaults.
5. Click execute.

To do extension's tables you can run it again and for the parameter `CSV list of table patterns` give it the list of the tables created by the extension.
> 4 votes

---
Tags: database, datatablescollation
---


# Question
Title: How can I get a report to show when contacts were added to a Group?
I have a profile that assigns contacts to a Group so I can later identify those contacts for reporting purposes.

However, I'd really like to get a report includes the date that they were added to the Group.

Is there a way to do this?

# Answer
> 2 votes
You can use Subscription report extension to list the contact added in a group

---
Tags: civireport
---


title: Upgrade drupal 7 to backdrop

text:
# Question
Title: Upgrade drupal 7 to backdrop
I am trying to upgrade a Drupal 7 site with CiviCRM to backdropCMS, but am struggling.

Am looking https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-backdrop/ and https://docs.backdropcms.org/documentation/step-3-upgrade-the-drupal-site

Am not switching drupal to backdrop, am upgrading it.

What I did sofar: Leave civicrm module and webform\_civicrm module enabled, upgrade to backdrop. Tried to install an empty backdrop, because of https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-backdrop/ Which failed, because civicrm does not want to install, it asks for a civicrm.settings.php

I created it, filled in the empty civicrm database, that did not work. Used the existing civicrm database, disabled civicrm and enabled again. Now Civicrm seems to start working.

But webform\_civicrm data seem completely lost.

How should I do the upgrade from D7 to Backdrop and preserve CiviCRM and webform\_civicrm data and functionality?

# Answer
@Catorghans, starting a community wiki here with your response on the Backdrop Zulip chat (feel free to edit/expand):

> * Yep, this is a working procedure: first create a `civicrm.settings.php` in `backdrop-root/`
> * leave `civicrm` module enabled. Use the same CiviCRM version for Backdrop as you had for Drupal 7
> * run the Backdrop upgrade.

This also means that webform\_civicrm does a proper upgrade.
> 1 votes

---
Tags: migration, drupal-7, backdrop
---


# Question
Title: Can the OAuth extension be used with GSuite for outbound email?
I was under the impression the relatively new OAuth extension would provide support for using GSuite for outbound email, but thus far I've only found documentation detailing it's use for processing bounces or inbound email activities.

Is this possible? If so, how do you configure the delivery mechanism once the OAuth record is authorized?

# Answer
> 1 votes
No not yet. It's being tracked at https://lab.civicrm.org/dev/mail/-/issues/59

---
Tags: email, g-suite
---


# Question
Title: CiviCRM Blank Screen and Error on Dashboard
I am trying to install CiviCRM on wordpress hosted by our own server. The install would seem to have installed. However, we get a blank screen on the dashboard after install. I have reinstalled it a few times but get the same thing, a blank screen. I enabled debugging and this is the error I get:

Warning: include(/volume1/web\_packages/wordpress/wp-content/uploads/civicrm/templates\_c/en\_US//%%E6/E65/E656EDCD%%wordpress.tpl.php): failed to open stream: No such file or directory in /volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1273 Warning: include(): Failed opening '/volume1/web\_packages/wordpress/wp-content/uploads/civicrm/templates\_c/en\_US//%%E6/E65/E656EDCD%%wordpress.tpl.php' for inclusion (include\_path='/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/flexmailer/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/legacycustomsearches/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/ckeditor4/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/recaptcha/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/financialacls/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/eventcart/:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/ext/greenwich/:.:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/packages:/volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/volume1/web\_packages/wordpress/ in /volume1/web\_packages/wordpress/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1273

Any help would be greatly appreciated! Thanks!

# Answer
I think I had this issue when my templates\_c folder didn't have the correct permissions on my server.

On my bitnami server, I had to do this (source):

```
sudo chown -R bitnami:daemon TARGET
sudo find TARGET -type d -exec chmod 775 {} \;
sudo find TARGET -type f -exec chmod 664 {} \;
sudo chmod 640 TARGET/wp-config.php

```
> 0 votes

---
Tags: error
---


# Question
Title: CiviCRM 5.44 WordPress 5.8.2 Initialization Error
After install of CiviCRM 5.44 on WordPress 5.8.2 I receive the following message:

Initialization Error

Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> simpleHandler )

```
[code] => -18
[message] => DB Error: no such table
[mode] => 16
[debug_info] => SELECT id, name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id

```

FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'credolvo\_WPORV.civicrm\_setting' doesn't exist\] \[type\] =\> DB\_Error \[user\_info\] =\> SELECT id, name, value, domain\_id, contact\_id, is\_domain, component\_id, created\_date, created\_id FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'credolvo\_WPORV.civicrm\_setting' doesn't exist\] \[to\_string\] =\> \[db\_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM\_Core\_Error::simpleHandler prefix="" info="SELECT id, name, value, domain\_id, contact\_id, is\_domain, component\_id, created\_date, created\_id FROM civicrm\_setting WHERE (domain\_id = 1) AND (is\_domain = 1) \[nativecode=1146 \** Table 'credolvo\_WPORV.civicrm\_setting' doesn't exist\]"\] )

When I look at the database, the only civi table is civicrm\_address\_format.

Other Vital Stats: Hosting Company: Blue Host Version 7.4 MySQL Version 5.6.41-84.1

I could really use some help on this.

# Answer
Turns out, the mySQL database version could not support the CiviCRM install version. BLuehost uses 5.6.41-84.1 and 8.0 or better is required.
> 0 votes

---
Tags: wordpress, installation, 5.44.0
---


# Question
Title: Show Contribution Note on top level of table view of contributions tab
When you go the Contributions tab of a specific contact (under View Contact), the Note field from Additional Details of the contribution does not show up in the table. Can addtional fields, like Note, be added to this table?

The table contains Amount, Type, Source, Recevied, Thank you sent, Status and then if you uncollapse it you also see Amount, Type, Payment Method and Transaction ID.

In order to view the Note that is associated with the contribution, I have click on Activities tab and then find the specific contribution in the list and then click View to see the details and find the Note.

Is it possible to modify the columns displayed in a table in contributions tab of view contact?

EDIT: Just realized I do not need to go to Activities tab to get to the Note, but still need to click on View from the Contributions tab to see it, so still want to know if it can be displayed in the table itself.

EDIT: using v5.44.0 on WordPress.

EDIT: I think for my purposes, the SOURCE field might work fine instead of NOTES field, which already shows on top level of table view.

# Answer
> 1 votes
So "easy solution" was to import my Note field and put it into the Source field instead of Note as the Source is shown on the top level when viewing contributions.

This wont work if you need the Source field for something else though.

# Answer
> 3 votes
Welcome to CiviCRM SE. Unfortunately there isn't an easy way to do through GUI. If you are programmer you can add a one using pageRun() or searchColumns() hook

HTH

Pradeep

# Answer
> 3 votes
The Form Builder extension has this as a design goal, and I expect that later this year this should be possible without code.

Since your SE history suggests you *are* a programmer, I'm going to build on Pradeep's answer. I have a custom CiviCRM extension I just posted to Github that adds several columns to the contribution tab - including the "Note" field. I suspect you can get what you need by simply removing unnecessary portions. If you're new to Civi extension coding, you can check the documentation but in short - you should only need to modify `agbucontribution.php`, the `.civix.php` is boilerplate.

---
Tags: wordpress, contributions
---


# Question
Title: Rule to "Find and Merge Duplicate Contacts" returns unexpected results
I have created a new individual rule, "Test Rule" where the only field (criteria) selected is "Email." I have assigned a weight of 10 to the email field and a total value for the rule also at 10.

My expectation is that only those contacts with the **same** email address would be returned after the search.

However, after running the rule, several contacts are identified as duplicates but they do not share the same email address.  I have highlighted those "duplicates" with different emails in red. Note that these red contacts have both different names and different emails, so I would not expect them to be included in a search where the only criteria is matching email.

I have also highlighted contacts with the same email, but different names in green. The contacts in green are what I would expect, same email, but different names.

Considering my rule is based on email only, why are contacts with different emails being returned as duplicates?

Note: This issue occurs with multiple rules used. The rule included here was created specifically to explain this issue and submit this question.

Thank you.

# Answer
The results of the search lists the "primary" email associated with the contact record. While the primary email presented in the search may not match, viewing the individual contact details--and all emails associated with a contact record--reveals that a duplicate email is indeed listed.
> 5 votes

---
Tags: duplicate-contacts
---


# Question
Title: Unable to hide PHP Intl error from front end
On my Wordpress site CiviCrm events pages are displaying the following message on the front end:

> Missing PHP INTL extension As this system does not include the PHP intl extension, CiviCRM has fallen back onto a slightly less accurate and deprecated method to format money

My hosting provider doesn't support PHP Intl which is not a big deal as we're not collecting money on the site. How can I get rid of this error message? Preface that I am a total noob, and really need explicit instructions on where to place code etc. TIA

# Answer
I'm not sure that message could be disabled from the Admin UI, but i believe you can disable it with deleting this line or commenting that out (put `//` to the beginning to the line).

This file has to be located somewhere on the server under the `CRM/Utils` directory. (i believe your hosting provider can help you locating it) Before editing it, create a backup from the file.

Overwriting a crm-core file is not a good solution because if you deploy a new version of CRM, your changes might be overwritten, so you have to apply the patch again.
> 2 votes

---
Tags: wordpress, errorhandling
---


# Question
Title: Importing Contributions wont allow duplicate Transaction ID or Invoice ID - must be unique?
I am trying to import CSV file with a bunch of contributions that I have downloaded from Stripe, but it is requiring that Transaction ID and Invoice ID be unique across all Contributions.

When creating the CSV file (using a script), I will create a seperate line for each item in an individual Stripe transaction.

So if a single transaction on Stripe for $100 shows Building Fund $75 and General Fund $25, then in my CSV file that is generated, I create two seperate lines with basically all identical information except the Amount and the Financial Type. Since both these items come from the same Stripe transaction, they both have the same Transaction ID (I am using Stripe Charge ID for this).

When I try to import the Contributions I get error log file with this: "*Duplicate error - existing contribution record(s) have a matching Transaction ID or Invoice ID. Contribution record ID(s) are: 2*"

I am importing as INSERT NEW CONTRIBUTIONS and my mapping is match on EMAIL only (I have made sure there are not duplicate emails in my contacts).

Has anybody else come across this issue?

# Answer
> 1 votes
The error message says TransactionID or InvoiceID not AND as you say in your question.

To get round this I would just edit your CSV so that you add a suffix "-1" "-2" etc to one of these fields where they would otherwise be the same. That way you can still see they are related when you look at them later.

# Answer
> 0 votes
It appears that Transaction ID, Invoice ID and Credit ID are all designed to be unique on a per Contribution basis, and that this is by design.

I suppose its a feature request on my part to have an option where they do not need to be unique.

But in the meantime, the only solution is to make each Transaction ID unique somehow by adding additional text to it like "1of2" and "2of2".

Per Mick Kahn answer!

# Answer
> 0 votes
This is what line items are designed for. The contribution table will have $100 with the transaction id, invoice id etc with a financial type of X (we use Donation). Then the line item table has two entries. One for $75 for Building Fund and another entry of $25 for General Fund. In the import process this requires multiple imports. Once for the contribution table and once for the line item table.

# Answer
> 0 votes
As mentioned in my comment, this scenario would involve firstly importing the Contribution, then importing the Line Items.

I believe the latter can be achieved using this extension (as in, it says it can import Line Items, but I have never had cause to use it. Seems you can use either the Contribution ID or the Trxn ID or the Invoice ID to run that import

---
Tags: civicontribute
---


# Question
Title: Any Paid courses on CiviCRM extension development?
Any organizations out there offering a full hands on course on developing extensions for CiviCRM? I'm willing to pay for such a course.

# Answer
> 5 votes
From my personal experience for developing an extension you need to be aware

1. PHP, Mysql, JS etc
2. How CiviCRM works.
3. How data are stored in various database table.
4. Working of QUICKFORM/Smarty or Angular i.e Forms, pages, search, settings etc.
5. When and How CiviCRM hooks are invoked.
6. Logic building, Symphony framework, OOPL...

There are lots of tutorials for above on the internet, its very way to build an extension unless you don't have knowledge/experience about above points.

# Answer
> 3 votes
In the past a CiviCRM sprint would include a developer training but as there are no CiviCRM sprints in this covid period......but I am hopeful there will be one in Berlin in the spring which would potentially also have a developer training.

---
Tags: extension, training
---


title: CiviCase: Migrate historical logs

text:
# Question
Title: CiviCase: Migrate historical logs
Since installing the new CiviCase extension (very nicely done, btw!), we see the following warning in our System Status:

> This database includes ~10 historical activity revisions based on the legacy format. This may not work correctly with some filters or reports. Consider migrating or archiving this data.

Anyone know what this means and how we can migrate/archive the data? I can't seem to find information on this topic.

Also, we set up this extension via git clone (which is what the instructions say), but that method doesn't seem to alert us when the extension is updated in the System Settings / Extensions page. Any way to get an extension notify on new releases? For now, I'm just re-pulling via git every so often.

# Answer
> 1 votes
At administer - civicase - civicase settings there's a setting for `Enable Embedded Activity Revisions`. The civicase extension suggests turning that off and instead using administer - system settings - misc - logging.

Migrating 10 log records probably isn't worth it, and the revisions setting hasn't worked properly in the UI for a few years now anyway so you probably don't have a complete set of revisions unless your case activities are mostly created by customizations/api, but if you want to test out the migrator there's one at https://lab.civicrm.org/extensions/caseactivityrevisionmigrator

# Answer
> 0 votes
Same issue here. After switching to the new civiCase extension, I deleted all previous cases.. Still I see this notice about archiving the data. I switced off Enable Embedded Activity Revisions and went to administer - system settings - misc -... but I do not see wich options I should activate? There is no "logging". Any help would be great!

---
Tags: civicase
---


title: How do I get Detailed Logging working?

text:
# Question
Title: How do I get Detailed Logging working?
Using the documentation, I've created a new database for my detailed logging data - I already had one for the CMS (Drupal) and one for Civi - and I've added the details for that database into my civicrm.settings.php file. I've turned on detailed logging via the Preferences page. I can see that the database has been populated and is storing lots of records.

So far so good.

But when I try to view the Change Log for any contact record, all I get is a spinning Civi icon.

Have I missed a step? How do I debug (there's nothing visible in the Civi log)?

running CiviCRM 5.45.0

# Answer
Reading around the issue reported above I came across this extension - https://github.com/eileenmcnaughton/nz.co.fuzion.innodbtriggers \- which I've now installed, and it appears to have resolved my issue. I'm now seeing a prompt result when looking at the change log.

Maybe this extension is essential when setting up detailed logging using a separate database?
> 3 votes

---
Tags: logging, db-logging
---


# Question
Title: Is it the case that to change a field type in CiviCRM there are only 3 steps?
does this post in the old forum from Lobo still hold true?

1. change the value in civicrm\_custom\_field
2. change the column type in the value table
3. truncate civicrm\_cache

# Answer
> 5 votes
Sometimes its possible to change the field type from UI, but it totally depends upon from what field type you want to convert to.

An easy win would

1. Single select to radio or vice versa(change the value in civicrm\_custom\_field)
2. Multi select to checkbox or vice versa(change the value in civicrm\_custom\_field)

If the change would involve data type like text to int or float etc it would involve

1. Change the value in civicrm\_custom\_field
2. Convert the data for the the field from old data type to new data type
3. change the column type in the value table

Additionally things to think about:

If you have trigger based logging enabled you need to ensure that the data types work such that inserts into the log\_civicrm\_value\_group\_name\_group\_id work properly you might end up having to drop and recreate the table.

If you are moving to a text/memo type field then you'll need to drop any indexes.

If doing a number of these you might find the following useful.

To generate the sql to drop the indexes:

```
mysql -BN db_name -e "SELECT DISTINCT concat('alter table civicrm_value_group_name__group_id drop index ', INDEX_NAME, ';') FROM INFORMATION_SCHEMA.STATISTICS where table_schema = 'db_name' and table_name = 'civicrm_value_group_name__group_id' and (INDEX_NAME like '%489' or INDEX_NAME like '%499' or INDEX_NAME like '%500')"

```

To generate the sql to alter the table:

```
mysql -BN db_name -e " select column_name from  civicrm_custom_field where id in (489,499);" | awk '{printf("alter table civicrm_value_group_name_group_id modify %s new_data_type ADDITIONAL PARAMS HERE;\n", $1)}'

```

For Additional params check an existing (or new) field of the type you are aiming for.

And to update the fields themselves.

```
mysql db_name -e "update civicrm_custom_field set data_type = 'New Data Type', html_type='New Type'  where id in (489,499);"

```

Note again compare against an existing field of the desired type and match against it's values.

---
Tags: custom-fields
---


# Question
Title: importing multi select options into Activity custom fields
I'm trying to import a set of Multi Select Options on a Custom Field that's attached to Activities, but I can't find a way to do it.

I've tried replacing the csv field with the label strings, the values, comma separating both of these, space separating them and quoting them (with all of the above) but cannot get the multi select options to import.

I've moved on to the API - but can't find how to pull (or set) customValue fields for activities.

Finally - Mysql. I can insert a created string directly by placing the values into the civicrm\_value\_xxx\_id table against the entity\_id (activity id), separated by `. CHAR(01) .` statements, as in (for a single 'test' line on a local install):

```
UPDATE civicrm_value_activity_opti_4
SET option_group_field_7 = CONCAT(CHAR(01), '1', CHAR(01) , '10', CHAR(01), '100', CHAR(01))
WHERE entity_id = 625;

```

...but this seems laborious and like there should be a more simple way to insert multiple selected options into an activity custom field (as it's going to require a bit of scripting to pick up the details of each of the (30000?) activities.

Does anyone here know what I'm missing, or if there is a more straightforward way to import the multi-select options?

# Answer
Its a known issue in CiviCRM and is logged at https://lab.civicrm.org/dev/core/-/issues/2706

Also CSV import extension don't support this(https://github.com/eileenmcnaughton/nz.co.fuzion.csvimport/issues/32).

You can apply the below patch to work

```
diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php
index a1d3cdfa8b..3373ceabbc 100644
--- a/CRM/Activity/Import/Parser/Activity.php
+++ b/CRM/Activity/Import/Parser/Activity.php
@@ -177,6 +177,11 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
         elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['data_type'] == 'Boolean') {
           $params[$key] = CRM_Utils_String::strtoboolstr($val);
         }
+        elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['serialize'] == TRUE) {
+          $val = trim($val);
+          $val = str_replace('|', ',', $val);
+          $params[$key] = explode(',', $val);
+        }
       }
       elseif ($key === 'activity_date_time') {
         $params[$key] = CRM_Utils_Date::formatDate($val, $dateType);

```
> 3 votes

---
Tags: custom-fields, data-import, multiple-choice
---


# Question
Title: Site visitors who submit a profile are added to a group get a 404 error instead of a confirmation screen
We use several profiles that people use to signup for our newsletter, apply to volunteer, etc. They were working properly: respondents saw a confirmation screen, Contacts were created and added to Groups, notification emails were sent. Now the respondents see a 404 error instead of a confirmation screen, but all the other functionality still works (Contacts added to Groups, notification emails sent.) The problem occurs with all the Profiles that add people to groups. This is the text that the submitters see: "The requested URL was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." If it's not obvious, we're relatively new users. CiviCRM 5.45.0 with WordPress 5.8.3 Thank you.

# Answer
> 1 votes
There are two ways to fix this

1. **Easy way**

create a Thank you for submission page in wp with some thankyou for submitting the form message. Edit the profile and set the redirect to url under the 'Advanced Settings' section to thankyou page url you just created.

2. **Clean Url**

Make sure that the base page is set - go to https://torontorailwaymuseum.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fuf&reset=1

Review the Base Page setting and value, it cannot be blank

Make sure there is a published page that matches the one in that page

If there is no value there, add one, civicrm is the default and then create a WP page with that slug

Make sure the page is public and visible to all

Once you've done that (or confirmed the base page exists) Visit this page https://torontorailwaymuseum.com/wp-admin/options-permalink.php

Confirm that your permalinks are set to anything EXCEPT Plain

If it is set to Plain change to one of the other options and save

If it is not set to plain, you can exit the page

Flush CiviCRM Caches go to https://torontorailwaymuseum.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2FupdateConfigBackend&reset=1 and click cleanup caches

---
Tags: profile
---


# Question
Title: Is there a search index that needs to be updated so CiviCRM Advanced search can find custom field data that was added directly to the database?
Is there a search index that needs to be updated so CiviCRM Advanced search can find custom field data that was added directly to the database?

I created a custom field for Individuals (which is set to searchable).

If I enter the data from within an Individuals account, and then use the Advanced search, it finds the data no problem in that custom field.

However, I wrote a php script to import a large amount of data and add it to this custom field directly in the database (did not use CiviCRM API at all). When I go into an Individual account, I can see that the custom field is populated properly. But when I go to Advanced search and try to find any of the data using that custom field, it says "No Matches found".

What needs to happen for this data to be indexed and searchable?

EDIT: I am using wordpress (just updated to v5.9), and am wondering if it could be a cache related issue, although I not using any caching plugins.

EDIT: Issue was that data imported direct into database included a newline character on the end of each one... had to remove the newline character and then Advanced search started working as expected.

# Answer
> 3 votes
The search on text field should be exact match. Are you searching by exact name? Hope so there isn't any space at the start or end of the string!

---
Tags: custom-fields, database
---


title: How do you deploy civicrm from git?

text:
# Question
Title: How do you deploy civicrm from git?
For folks that maintain their own patches to civicrm-core stored via git, how do you deploy? For many years, I've been sourcing `distmaker/dists/common.sh` and running things manually (`dm_generate_vendor`, etc). I'm wondering if there's a better way.

I think I'm looking or the opposite of gitify. I've looked at releaser which seems like the right idea, but I'm scared off by the comments ("If you're not using it to manage the official releases on civicrm.org, then... eh... good luck...").

Is there anything simple that I'm missing?

# Answer
> 1 votes
Civi generate tarballs of master or last/future release branch nightly. You could try downloading them from here

HTH

Pradeep

---
Tags: deployment, git
---


# Question
Title: civicrm_contact_push_notification_messages table huge
We installed Civimobile as a test, and aren't yet using it. It does look great!

We have noticed a file on our server of gigantic proportions: civicrm/civicrm\_contact\_push\_notification\_messages.ibd: 18GB

Is this just generated by the Civimobile API? And if so, have we done something wrong in our setup that it has become so large? I think the extension was enabled for about 4 weeks, and has been disabled for about 6 weeks. And we haven't been using the CiviMobile app at all when the extension was enabled.

How can we reduce the size of this file, or remove it? We don't want to use up that much space on our server if we don't have to.

Thanks for your help.

Civicrm 5.24, Drupal 7.69

# Answer
seamuslee wrote 11 months ago on https://lab.civicrm.org/extensions/civimobileapi/-/issues/57 : One thing I have found is editing the scheduled job Civimobile clean old push notification messages and setting a command / API parameter

count\_of\_day=1

which means keep only 1 days worth of notification messages can help.

Works :)
> 1 votes

# Answer
We are having this same issue. The civicrm\_contact\_push\_notification\_messages table has grown to 4GB with 14million records in just 14 days. There is a 'Civimobile clean old push notification messages' scheduled job but it only cleans notifications older than 90 days.

This appears to be causing timeouts on our server due to low resources. Is there any way we can turn this excessive logging off?
> 0 votes

---
Tags: database, civimobile
---


title: Drupal 7 update breaks CiviCRM

text:
# Question
Title: Drupal 7 update breaks CiviCRM
My site is currently running Drupal 7.82 and CiviCRM 5.45.1.

When I try to update Drupal to 7.87, I get an error (below) and after that, CiviCRM is gone from the site.

> Error: Call to undefined function civicrm\_initialize() in civicrm\_member\_roles\_menu()
>
> (line 17 of /var/www/vhosts/sweetwatercollaborative.org/httpdocs/sites/all/modules/civicrm/drupal/modules/civicrm\_member\_roles/civicrm\_member\_roles.module).
>
> The website encountered an unexpected error. Please try again later.

Any help much appreciated. Thanks -JC

# Answer
> 3 votes
SOLVED. Here's how...

• revert to saved version of website

• update "Webform CiviCRM Integration" module

• update all modules Civi uses... Chaos Tools, Views

• update drush version from 7.4.0 to 8.4.10. This allowed me to change the $DRUSH\_PHP environment variable to use PHP 7.3, eliminating this warning I was getting "CiviCRM requires at least PHP 7.2. (Currently using PHP 7.1.33)"

• perform the Drupal update again, as per https://www.drupal.org/docs/7/update/updating-drupal-using-drush

---
Tags: error, upgrade, drupal-7
---


# Question
Title: Upgrade fails: Unknown column 'entity_modified_date'
CiviCRM is currently running on version 5.42.1. I wanted to upgrade to 5.45.0 but here the upgrade script fails with following message:

```
[callback] => Array
    (
        [0] => CRM_Core_Error
        [1] => exceptionHandler
    )

[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` =
'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in
'field list']
    [type] => DB_Error
    [user_info] => UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate'
    , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']
        [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="UPDATE  `civicrm_managed`  SET
    `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` =
    NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']"]

```

I found out that this field is added in CRM\_Upgrade\_Incremental\_php\_FiveFortyFive-\>upgrade\_5\_45\_alpha1() (as far as I understand). May this be a conflict with the order of creating the field in table and updating the data in table later on?

By now only content from Extended Report plugin is in this civicrm\_managed table. I don't know what the purpose of this table is in general but maybe this is the reason why this issue did not appear for others but for me as I have this more or less exotic plugin installed?!

# Answer
I think this may be a bug in the CiviCRM update process. It is trying to add the `entity_modified_date` before this column is created.

I've raised an issue in https://lab.civicrm.org/dev/core/-/issues/3045

A patch is available which fixed the issue for me. You could try applying this to your site to see if that works for you too.

Alternatively, you could try upgrading to CiviCRM 5.44 then upgrading to CiviCRM 5.45 (this also solved the issue for me).
> 2 votes

---
Tags: extension, upgrade
---


# Question
Title: Logs in a separate database: would CiviCRM hangs if Logs database got corrupted?
Well, subject has pretty much all of the question. Anyone with firsthand experience please?

# Answer
> 2 votes
Logs in a separate database is fine. It's what we do at Veda to make the databases more portable and easier to backup.

Before CiviCRM 5.16, the log tables were in Archive format, which is prone to corruption. Starting with CiviCRM 5.16 the logs are in InnoDB format - but remain in Archive format if logging was already enabled. If possible, switch the log tables to InnoDB format using the InnoDB Logging extension.

If you can't (size of the log tables will grow, especially when indexes are added) then yes, if the tables become corrupt the database transactions will fail but this is the same regardless of if the log tables are in the same schema or not.

Hope that helps

---
Tags: mysql, logs
---


title: Tracking Volunteers

text:
# Question
Title: Tracking Volunteers
I work within the outreach department of my organization and one of our primary functions is tracking volunteers and their hours per year. Does anyone track this in civi? What function (s) do you use to track this data?

\*Note I am not trying to track volunteers under events (as we have many events/activities that can be counted as volunteer hours) I just want to be able to input volunteer information and their accumulated hours per month for the year.

\*P.S currently we are tracking everything in excel

# Answer
> 2 votes
Hi Khaela and welcome on SE.

You can use 'Activities' for example and create a new type of activity labelled `Volunteering`.

Every time someone helps, he or a leader could use it and fill in the `date` and `duration` with status `completed`. Then you can create and export all the fancy exports you need for reporting.

This could also be recorded with a front-end form if your volunteers don't have any user access to CiviCRM.

Just one simple process with core functionalities.

---
Tags: civivolunteer
---