# Question
Title: CiviEvent + SearchKit = number of free slots in an event?
How to create a SearchKit result of CiviEvent events, where the result contains the number of free slots left in the event?

**What I have:**

* My test setup is newest WP 6.3.2 and newest CiviCRM 5.66.0.
* CiviEvent: several events, with a max no. of participants, and some registrations on those events.
* SearchKit: a search that gives me open events in the next 2 weeks.
The result presents no actions, no sorting, just a static table listing.
* Form Builder: a form to hold the results from the search.
* WordPress: a page that contains the shortcode with my search.

**What I want:**

* The form content should contain a column with the number of remaining available slots, to answer a question like "can I register 4 more people to this, or are there not enough free spaces left?
* How do I build a search query that can take the max no. of participants and then subtract the number of already-registered from that?

# Answer
This feature has been recently added to SearchKit and will be part of the upcoming 5.68 release.
> 3 votes

---
Tags: civievent, searchkit
---


# Question
Title: Latest 5.63.x is 5.63.4 but is not available for download
According to https://civicrm.org/blog/dev-team/civicrm-5650-5644-5634-esr-security-release, a security release was published on 6 Sep 2023 including v5.63.4 but v5.63.4 is not listed at https://download.civicrm.org/release or https://github.com/civicrm/civicrm-wordpress/tags

# Answer
5.63 is the Extended-Security-Release version, which is a subscription service. You can sign up for the ESR service & download that version for a small fee. Read more about it here: https://civicrm.org/blog/kbeireis/esr-long-term-solution

If you do not wish to sign up for extended security releases, you can download the latest version of CiviCRM for free, which contains all security updates.
> 2 votes

---
Tags: upgrade, security
---


# Question
Title: How to get substring of a SearchKit result column?
How to get substring of a SearchKit result column? I want to truncate the event start time from `17:15:00` to just `17:15`.

**What I have:**

* My test setup is newest WP 6.3.2 and newest CiviCRM 5.66.0.
* CiviEvent: several events, with a starting date and time, e.g. `17:15`.
* SearchKit: a search that gives me open events in the next 2 weeks.
The result presents no actions, no sorting, just a static table listing.
* Form Builder: a form to hold the results from the search.
* WordPress: a page that contains the shortcode with my search.

**What I want:**

* The final output contains a column with *event start time including seconds*. It is silly to show an event start time with seconds - and I understand that this comes from the timestamp format in the database.
* I do not see any suitable field transformation that I could apply in the SearchKit.
* In the reports output part of SearchKit, each column has the `Rewrite Text` function using "SMARTY conditions" but it is not clear to me how that works. My latest attempt is `[{TIME_start_date|substr:0:5}]` but that generates no output. **Can you give an example?**
* I cannot think of another way to truncate the time value, or any way to do any kind of substring operation at all.

How can I get rid of the seconds in the time column?

(ignore the missing localisation of the weekday and month words)

# Answer
Agree with Coleman that it would be great to have Format Date in SearchDisplays.

If you want to do this in the Smarty rewrite, you can do something like `{"[start_date]"|date_format:"%H:%M"}`, without the field transformation.
> 3 votes

---
Tags: civievent, searchkit
---


# Question
Title: Outdated tokens in use in message template
I have the following message after upgrading Civicrm to 5.66

"Outdated tokens in use You are using tokens that have been removed or deprecated. Please review your event\_offline\_receipt message template and remove references to the token {$contributeMode} as it has been replaced by {no longer available / relevant} Please review your event\_offline\_receipt message template and remove references to the token {$isAmountZero} as it has been replaced by {no longer available / relevant}"

In the template HTML format section I have;

```
  {if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}

```

Should this be removed?

and...

```
   {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}

```

Should this be also removed?

# Answer
> 4 votes
Yes - those should be removed - they haven't been around for quite a while. We have quite a number of variables being deprecated in upcoming versions I'm afraid as we are replacing them with more manageable variables or tokens where possible. So you are probably best to do the minimum intervention for now

* ie (remove the reference to contributeMode, if you need to have the zero amount check then use `{if {contribution.total_amount|boolean}}` instead of `!isAmountZero`

and then when you get onto 5.68 plan to do a thorough update / recustomisation of your event offline template (which has more deprecations in 5.68, but should be fairly stable after that).

Also note you can delete rather than update the text versions of the template. If you do so a text version will be generated on the fly. Almost no-one or possibly absolutely no-one ever sees the text version

---
Tags: tokens, message-templates
---


# Question
Title: SearchKit: How to display cases with related contacts and roles with more than one case per client?
I am struggling to create a SearchKit for the following usecase: I want to show a list of cases with their clients etc, but also with related contacts with a role on each case, e.g. the client's "Benefits Specialist" in our well-known "Housing Support". This is my approach so far:

As long as a client has only one case, things work as needed in the usecase (like in case id = 2). But as soon as a client has two or more cases, the grouping on case leads to a situation where I have all "Benefit Specialists" of all cases of these clients listed. In my example: Test Specialist 1 has a case role in case 1 and Test Specialist 2 in case 2 and both results are shown in the last column (it would even be worse, if I chose another field transformation).

There is no error here, this works as expected from my configuration. But: I have no idea how to solve the use case with SearchKit. Until now I used Data Processor for that where I just have to use the output handler "role on case" where I can map the case id and that's it. One solution would be to start with the entity contact, but I need the case actions here... Can anyone help?

# Answer
UPDATE: This feature has now been added to CiviCRM. https://github.com/civicrm/civicrm-core/pull/28112

---

It seems like a missing feature, being able to link the relationship to the case. Or more generally, allowing SearchKit selectors to specify another entity in the search (e.g. making "Current Case" available in this dropdown):

It would be great to get that feature sponsored and included in SearchKit!
> 2 votes

---
Tags: searchkit
---


# Question
Title: What's the best way to provide Profile Edit and Create forms in latest WordPress and CiviCRM?
So we are currently using the standard shortcodes to embed Profiles in "Edit" mode within WordPress pages to allow members to update their personal details. We also have multi-value custom data groups which we expose in this way.

There is a forked version of the Caldera Forms plugin here: https://lab.civicrm.org/extensions/caldera-civicrm/caldera-forms

There is also an ACF integration plugin here: https://github.com/christianwach/civicrm-acf-integration

And FormBuilder is also an option, along with the FormProcessor extension: https://civicrm.org/form-builder

Which is currently the recommended option, especially when dealing with multi-value custom data groups?

Looking for the most robust, future proof and secure option.

# Answer
I would rate the combination of FormBuilder and FormProcessor as the most robust, future-proof and secure variant. However, in my opinion there are still quite a few functions missing (see, for example, the "wish list" of CiviSprint participants Leipzig 2023 or the Form Builder roadmap), which is why at the moment it is certainly a matter of weighing up depending on the exact use case. Each of the integrations mentioned has its strengths and weaknesses. Personally, I wouldn't want to miss some of the functions of Caldera Forms + Form Processor and am glad that the Communty fork and the Caldera Forms Collaboration initiative exists until a more complete replacement is available. By the way, this is not meant to sound pessimistic: There is so much happening around SearchKit and FormBuilder every release - many thanks to @Coleman and all who are involved here!
> 1 votes

# Answer
We have been developing and deploying Gravity Forms and CiviCRM integration, which uses Form Processor / Action Provider on the backend. https://github.com/agileware/gf-civicrm

Works great but you need to know what you're doing. RTFM!
> 0 votes

---
Tags: wordpress, profile, caldera-forms
---


# Question
Title: How to modify a custom field DataTable (sorting and appearance) from an extension?
I am having difficulty customising the display of a DataTable for a contact custom field group (multiple-record tab). I am trying to write an extension that would use a bit of JavaScript to interact with the DataTable to do the following:

* Order the table on one of its columns (date descending) when the page is first opened
* Conditionally change the colour of rows based on rules and cell data values

I use multiple-record custom field group tabs extensively for contacts (a very useful feature that initially attracted me to CiviCRM). Although reports could be used to present data with more control, users are looking at the contact's tabs a lot more than they are reports and have asked for the above.

I have attempted to add some script in a hook. The form hooks such as `buildForm` don't fire so I found that I needed to use `alterTemplateFile`. (If it worked it would need extra conditions to apply it to certain tables only and sort on different columns for each.)

```
function customtablemods_civicrm_alterTemplateFile($formName, &$form, $context, &$tplName) {
  if ($tplName == "CRM/Contact/Page/View/CustomData.tpl") {
    $script = " CRM.$('#records-2').dataTable().fnSort([1, 'desc']); ";
    CRM_Core_Resources::singleton()->addScript($script);
  }
}

```

This gives an error pop-up in the browser: `DataTables warning: table id=records-2 - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3`

I guess that this means that my script is being executed before the DataTable is fully initialised by CiviCRM. I went digging to see how CiviCRM creates the DataTable. There is inline script that comes from `templates/CRM/common/jsortable.tpl` but I found that for these tables it doesn't seem to do anything--modifying the JS in this template had no effect. It seems that it is actually `js/jquery/jquery.crmAjaxTable.js` that creates the datatable. Modifying `jquery.crmAjaxTable.js` looks difficult and am hoping to avoid modifying core files due to maintainability.

I then tried using the `crmLoad` event:

```
function customtablemods_civicrm_alterTemplateFile($formName, &$form, $context, &$tplName) {
  if ($tplName == "CRM/Contact/Page/View/CustomData.tpl") {
    $script = "
    CRM.$(function($) {
      $('#crm-main-content-wrapper').crmSnippet().on('crmLoad', function(e, data) {
        $('#records-2').dataTable().fnSort([1, 'desc']);
      } );
    } );
    ";

    CRM_Core_Resources::singleton()->addScript($script);
  }
}

```

It gives a "too much recursion" error in the browser console. The table is never sorted although the correct indication of sorting is given in the column heading. It looks like the sort causes the data to be re-loaded by Ajax which fires the crmLoad event again.

I also tried the DataTables API version in both of the above and it gives the same errors: `CRM.$('#records-2').DataTable().order([1, 'desc']).draw();`

For the row conditional formatting, the DataTables documentation gives an example using the `rowCallback` option. (I would use addClass more like in this example.)

```
$('#example').dataTable( {
  "rowCallback": function( row, data, index ) {
    if ( data.grade == "A" ) {
      $('td:eq(4)', row).html( '<b>A</b>' );
    }
  }
} );

```

However I can't see a feasible approach for an extension to include such an option for the DataTable at the time that it is first created by CiviCRM, and DataTable options generally can't be modified later.

# Answer
I managed to sort on the first column of a dataTable like this:

In the main file of your extension, add the code to add a javascript file. I used the hook "civicrm\_alterTemplateFile" for that.

```
function myextension_civicrm_alterTemplateFile($formName, &$form, $context, &$tplName) {
  if ($formName == 'CRM_Contact_Page_View_CustomData' && $context == 'page' && $tplName == 'CRM/Contact/Page/View/CustomData.tpl') {
    Civi::resources()->addScriptFile( 'com.myorg.myextension', 'js/alterDataTables.js' );
  }
}

```

Then I created a javascript file named "alterDataTables.js" in the "js" folder of my extension.

It contains this code:

```
CRM.$(function($) {
  $(document).ajaxSend(function(event, jqxhr, settings) {
    // get the datatable
    let myDataTable = $('#custom-30-table-wrapper .dataTable');
    if (myDataTable.length !== 0) {
      myDataTable.on('xhr.dt', function (e, settings, json, xhr) {
          // add sorting if there is no sorting
          if (settings.aaSorting.length === 0) {
            myDataTable.dataTable().api().order([0, 'desc']).draw();
          }
        })
        .dataTable();
    }
  });
});

```

Replace #custom-30 with the id of your custom group.
> 1 votes

---
Tags: custom-fields, extension, javascript, datatables
---


title: CIVICRM 5.62 - Frontend Event Calendar

text:
# Question
Title: CIVICRM 5.62 - Frontend Event Calendar
We are making the transition from 5.46 to 5.62 CIVICRM. In 5.46, we are a heavy user of the event calendar. That extension does not appear to work under 5.62. In looking at the extensions directory, I do not see an event calendar extension. How can I go about getting an event calendar display for 5.62?

# Answer
> 1 votes
There are very few differences between 5.46 and 5.62 that would cause extensions to suddenly become incompatible. I think chances are very good your extension will continue working normally.

---
Tags: calendar, civicrm-event
---


# Question
Title: Searching/filtering by the date a contact was added to a group
When viewing a contact's Group tab, you can see the groups as well as the date that they were added to the group.

I've been trying to find a way to search based on the date that a contact was added to a standard group but running stuck. For example, a search for:

* contacts that are added to the "Newsletter Subscribers" group
* only those added within the last month

Is this type of thing possible?

# Answer
> 6 votes
I have a report for this on Github.

EDIT: Ignore comments below; this report works on modern versions of CiviCRM, and Laryn's improvements are now part of my extension.

# Answer
> 2 votes
You can also do this in SearchKit by using the Contact Subscription Histories entity.

---
Tags: groups, search, dates
---


# Question
Title: Editable "Maximum number of multiple records" Custom Field Set option?
It turns out one can only edit the "Maximum number of multiple records" at a Custom Field Set creation time. After that it is only possible via database value update in the `civicrm_custom_group.max_multiple`. Out of curiosity - why is that?

# Answer
> 3 votes
When you first create a custom group and it does not yet contain any data (e.g. no custom records have been saved for any contact) you are allowed to change anything. Once data exists, it is more restrictive to prevent data loss.

However, in checking this I discovered a bug which was causing it to act stricter than it should. The logic is supposed to be that the maximum can be increased but not decreased. The bug was preventing it from being changed at all. Here is the fix: https://github.com/civicrm/civicrm-core/pull/27916

---
Tags: multi-record, multiple-records
---


# Question
Title: How do I deal with a stuck bounce/email-to-activity queue?
I'm using a traditional mail account for bounce processing. I have an email that causes the Scheduled Job to fail. How can I address this?

# Answer
> 3 votes
There are two options.

* If you have access to the bounce mailbox, log in manually and move the problematic email to the "CiviMail.ignored" folder (or just delete it).
* If you don't have access to the bounce mailbox (e.g. it's on Google, and you only have the CiviCRM app password), find this snippet of code in `CRM/Utils/Mail/EmailProcessor.php`:

```
    // process fifty at a time, CRM-4002
    while ($mails = $store->fetchNext(MAIL_BATCH_SIZE)) {
      foreach ($mails as $key => $mail) {

```

Directly after the `foreach` line, put this line in:

```
$store->markIgnored($key); die;

```

Then manually run the Bounced Messages scheduled job. The job will move the next email (which will be the "stuck" one) to `CiviMail.ignored`. Then remove the line and on the next run mail will continue as usual.

---
Tags: civimail, bounce, bounce-processing
---


# Question
Title: Civicrm 5.57.0 Error on Contact Notes View
Civicrm 5.57.0 on Wordpress 6.1.1 Within a single contact you can leave notes. since the last update, if you want to view the notes, this error appears in the log file and nothing come up. When I press edit, the content of the note comes up. This is now the workaround to view the notes, just to press edit.

```
Jan 13 08:14:53  [error]
$Fatal Error Details = array:3 [
  "message" => "Expected to find one Note record, but there were multiple."
  "code" => null
  "exception" => CRM_Core_Exception {#8316
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: "Expected to find one Note record, but there were multiple."
    #code: 0
    #file: "/var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php"
    #line: 1232
    trace: {
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Utils/Array.php:1232 {
        › else {
        ›   throw new \CRM_Core_Exception("Expected to find one {$recordTypeLabel}, but there were multiple.");
        › }
      }
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/Result.php:90 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Note.php:37 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Note.php:187 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/civicrm/wp-content/plugins/civicrm/civicrm.php:1199 { …}
      /var/www/civicrm/wp-includes/class-wp-hook.php:308 { …}
      /var/www/civicrm/wp-includes/class-wp-hook.php:332 { …}
      /var/www/civicrm/wp-includes/plugin.php:517 { …}
      /var/www/civicrm/wp-admin/admin.php:259 { …}
    }
  }
]

Jan 13 08:14:53  [debug] $backTrace = #0 /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(441): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/civicrm/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /var/www/civicrm/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:4))
#3 /var/www/civicrm/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke("")
#4 /var/www/civicrm/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
#5 /var/www/civicrm/wp-includes/plugin.php(517): WP_Hook->do_action((Array:1))
#6 /var/www/civicrm/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#7 {main}

```

# Answer
**I found a fix:**

I found out that this error is related to CiviMobileAPI. If this extension is deactivated everything works again. I found this error message regarding this:

\[php:warn\] \[pid 235173\] \[client\] PHP Warning: foreach() argument must be of type array|object, null given in /var/www/civicrm/wp-content/uploads/civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/ApiWrapper/Note.php on line 35, referer: https://domain.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview&reset=1&cid=3&selectedChild=note

Edit the file:

civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/ApiWrapper/Note.php

https://lab.civicrm.org/extensions/civimobileapi/-/merge\_requests/72/diffs
> 2 votes

---
Tags: wordpress, contacts, error
---


# Question
Title: Get Phone or Email with API4 not possible?
I played around with the ApiExplorer for API4 While the doc says default select would be * it doesn't return all contact details. So I added the SELECT for phone\_primary and email\_primary and joined the phoneDB. This worked for one phonenumber, but all the other phonenumber which can be set for a contact (e.g. fax,mobile) don't show up.

Anyway, I tried to use the curl example from the ApiExplorer and it worked so far it returns all contacts and a lot senseless details. However, limit the request is not working at all. It always returns all contacts. Also phone and email are always missing no matter what I do.

My Postman request looks like this:

> https://demo.circle-interactive.co.uk/civicrm/ajax/api4/Contact/get?select= \["email\_primary.*", "phone.*", "first\_name", "last\_name", "phone.mobile\_provider\_id", "organization\_name"\]&join= \[\["Phone AS phone", "LEFT"\]\]&limit=5
>
> This are my params in Postman: {"select": \["email\_primary.*", "phone.*", "first\_name", "last\_name", "phone.mobile\_provider\_id", "organization\_name"\], "join": \[\["Phone AS phone", "LEFT"\]\],
> "limit": 5}

This is what API-Explorer shows as valid curl example. But it's not working as curl or Postman request. As mentioned a lot senseless contact details are returned but phone and email are always missing in the result.

> CRM\_URL='https://demo.circle-interactive.co.uk/civicrm/ajax/api4/Contact/get' CRM\_AUTH='X-Civi-Auth: Bearer MY\_API\_KEY'
>
> curl -X POST -H "$CRM\_AUTH" "$CRM\_URL"
> -d 'params=%7B%22select%22%3A%5B%22email\_primary.%2a%22%2C%22phone.%2a%22%2C%22first\_name%22%2C%22last\_name%22%2C%22phone.mobile\_provider\_id%22%2C%22organization\_name%22%5D%2C%22join%22%3A%5B%5B%22Phone%20AS%20phone%22%2C%22LEFT%22%5D%5D%2C%22limit%22%3A5%7D'

While emails and phonenumber are returned in the ApiExplorer for API3 with a similar request, the curl example for API3 is not working at all. (Invalid url)

I don't get it where the problem is. Are this ApiExplorer examples still up to date? Any suggestions?

# Answer
This looks like a 2-parter so I'll just answer your first question about how to fetch all emails & phones for a contact. Please start a new post for your curl question.

APIv4 *does* fetch all fields (aka `SELECT *`) by default, but only fields that actually belong to the entity. If you inspect the `civicrm_contact` table in SQL you'll see that `email` is not actually a column. Rather it's a join to another table.

APIv4 can do a lot of fancy stuff with joins, but you have to ask it to (if it did *all* the fancy stuff by default it would probably blow up your server or at least significantly slow it down).

It's all a bit too much to explain in one StackExchange answer, so I recommend you go and check out the docs on:

1. Implicit Joins
2. Explicit Joins

And in addition to the API Explorer, try playing with SearchKit. It's a bit more user-friendly and can generate the types of aggregate joins you wanted (e.g. fetching multiple emails per contact) with just a few clicks. Then click on the "Query Info" tab and SearchKit will show you the APIv4 params it has generated to do all the fancy stuff you asked for.
> 2 votes

---
Tags: contacts, email, apiv4, phone, missing
---


title: In-Kind Donations linking to an Event

text:
# Question
Title: In-Kind Donations linking to an Event
I’m trying to figure out the best way to track an in-kind donation of an event from a patron. For example, a patron may help us by allowing us to use their space to run a charity dinner.

I was thinking about creating a new financial type of ‘in-kind donation’, adding event details in the notes of the contribution itself… but I’d really like to properly link it to the event for reporting purposes? Should I set up a campaign, link both the donation and event to that in a custom field? I could therefore link several different types of in-kind donations to that event campaign as well.

Any help much appreciated.

Mike

# Answer
2 solutions come to mind:

1. The traditional way would be to create 1 Campaign per Event. You do not need any custom fields for this, as both Events and Contributions can be associated with a Campaign. For clarity, give the Campaign the same name as your Event, then you can select the Campaign for every donation and it will effectively be linked to your Event (as both the event and the contribution will point to the same campaign).
2. A simpler alternative that requires less data-entry would be with a custom field linking the contribution directly to the event. You can create a new custom field of type "Entity Reference" that extends Contributions and references Events. This type of custom field is newly available in CiviCRM version 5.60.
> 1 votes

---
Tags: civievent, donations, financial-types
---


title: Setting up the cron on Hostinger

text:
# Question
Title: Setting up the cron on Hostinger
I have so far been unsuccessful in setting up a cron in Hostinger. These are the three options I've set up so far. I think the path in the second one is incorrect but I was expecting either the first or third one should work?

I also tried putting the command in a file that is called by the cron, but it didn't like the cv.phar or drush commands. The only error messages I'm getting now are time zone notices (e.g. like the timezone error reported here)

Has anyone successfully set up a cron in Hostinger (shared hosting)?

# Answer
Have you resolved your issue on Hostinger? I'm facing the same challenge.

After creating my PHP type cron job in Hostinger, I added a simple echo command at the very beginning of CiviCRM's cron.php and saw it in the output results, therefore I can see the file is being called by cron. However, if I move my echo command below the first line `require_once '../civicrm.config.php';` I don't see my echo any longer. That file does exist in the parent folder so not sure where it's failing but I'm still digging.

## UPDATE (Solved!)

TL;DR - If you have WordFence, it may just be as simple as turning off WordFence's reCAPTCHA on *the login and user registration pages*.

After what seems like an eternity of troubleshooting and hundreds of attempts using various commands, here's what I found that resolved my issue, skipping the gritty details of my troubleshooting steps...

1. I first created a new WordPress subscriber user making sure the password was super long and without any of the reserved characters as outlined on CiviCRM's page. To keep things a little more secure, there are other special characters you can use in the password.
2. I then replaced my PHP cron command with a wget command, passing in username/password/site\_key variables with the command similar to the one in your first screenshot. I grabbed my sitekey from `wp-content/uploads/civicrm/civicrm.settings.php`.

Feel free to copy/paste the command below replacing YOURSITE.COM / USERNAME / PASSWORD / SITEKEY with your own values:

```
wget -O - -q -t 1 'https://YOURSITE.COM/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=USERNAME&pass=PASSWORD&key=SITEKEY'

```
3. I then found what might be the actual problem. Wordfence reCAPTCHA was preventing me from running the command. Once I turned it off, my scheduled civi cron job began running without any issues. So, try unchecking *Enable reCAPTCHA on the login and user registration pages* found under the Login Security section.

I'm still going to play with this until I'm 100% satisfied because this solution only has me about 90% satisfied... I'll need to sleep on this some but at this point, it's working.
> 1 votes

---
Tags: cron, hosting
---


# Question
Title: civicrm_api3('Contact', 'create', in hook_civicrm_pre?
Getting a loop and consequently out of memory while executing the code:

```
  function hook_civicrm_pre($op, $objectName, $id, &$params){
      if ('Individual' === $objectName && 'edit' === $op) {
     $myconditions = [];
     // make a few API calls checking Relationships, custom field balues, ets, gathering the data
     // print_r($myconditions) = $myconditions[TRUE, TRUE, TRUE];

   $condition = !in_array(false, $myconditions) ? 1 : 0;

     // An individual custom field value update
       $result = civicrm_api3('Contact', 'create', [
                    'contact_type' => 'Individual',
                    'id' => $id,
                    'custom_999' => $condition,
                  ]);
   CRM_Core_Error::debug_var('Line '.__LINE__, print_r($result, true));
  }
 }

```

Have tried also

```
foreach ($params as $key => $value) {
  if (0 === strpos($key, 'custom_999')) {
    $params[$key] = $condition;
}

```

}

Which doesn't seem to pick up the latest changes, eg., works only 2nd saving. Can't see what's wrong here.

# Answer
Running a contact update from within a contact update will cause an infinite loop. Instead of firing a new update action, just adjust the parameters of the action that's already happening. The `&$params` variable is passed by reference so you can modify it before the contact is written to the database.
> 3 votes

---
Tags: api, hooks
---


title: Scheduled Jobs stopped working

text:
# Question
Title: Scheduled Jobs stopped working
CiviCRM v 5.66.0 Wordpress v 6.3.2 PHP V 8.1.25

Yesterday, all scheduled jobs were working fine but today Scheduled Reminders and Stripe: Cleanup have both stopped working with the following error logs

Stripe: Stripe: Cleanup Finished execution of Stripe: Cleanup with result: Failure, Error message: datefmt\_create: invalid locale: U\_ILLEGAL\_ARGUMENT\_ERROR

Scheduled Reminders: Send Scheduled Reminders Finished execution of Send Scheduled Reminders with result: Failure, Error message: datefmt\_create: invalid locale: U\_ILLEGAL\_ARGUMENT\_ERROR

Both have the same error message. Could anyone please help me in discovering what may have caused these errors?

There's nothing in ConfigAndLog All other jobs are working fine so CRON job seems OK

# Answer
FURTHER UPDATE:

CiviCRM 5.67.0 solves the various issues that I found. Thanks very much for fixing.

Chris

UPDATE: This was originally a "me too" comment but now is a partial answer.

The problem occurs here:

wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php

The problem seems to be that PHP 8.1.25 (and 8.2.12 I think) throw an exception if $locale is invalid for IntlDateFormatter() https://github.com/php/php-src/issues/12561

For me, $locale was coming through as "C" which is invalid. For now, I've added in this extra line 104:

$locale = "en\_GB";

This gets the Send Scheduled Reminders job working - and hopefully some other things that I'm told weren't working, such as some event booking.

I did previously try the CiviCRM 5.66.2 release but that didn't help.

Is there some setting within CiviCRM (or the server) which I need to set to get the $locale coming through properly? I'd recommend that the code be updated so that it can cope with a duff $locale.

Chris

---

I am seeing the same Send Scheduled Reminders job error on a live site since yesterday morning on CiviCRM 5.65.2. And I get the same error on a test site when I try today to upgrade from 5.65.2 to 5.66.1:

datefmt\_create invalid locale: U\_ILLEGAL\_ARGUMENT\_ERROR

Test site error report: WordPress version 6.3.2 Active theme: Twenty Seventeen (version 3.3) Current plugin: CiviCRM (version 5.66.1) PHP version 8.1.25

(I've reverted the test site.)

Can anyone suggest a fix to help me upgrade - which will hopefully fix the problem?

Thanks in advance, Chris
> 2 votes

# Answer
Upgrading to 5.66.1 appears to fix this issue, see here.
> 1 votes

---
Tags: wordpress, scheduled-reminders, stripe, scheduled-job
---


# Question
Title: HTML and EMAIL content and no Graphics or formatting in emails
Recently upgraded to 5.66 and now Civimail sends an email with the text and html content in the email, also any graphics not shown. Note the email address is also odd. Below is a copy of the email as it arrived in the inbox. Looks perfect in the Ckeditor.

viz:\>\>\>\> start of email b.3079.78886.e06a54f96fd8d0f9@aaaa.org

13:00 (4 hours ago)

to me --=\_ca63d17a869f264c3d3540d004645f59 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8WILLIAMSTOWN

my name..

WILLIAMSTOWN ABC

Dear Ian,

test

My Name

Williamstown ABC

To unsubscribe: Unsubscribe \[1\]

_ Powered by Civicrm\_

## Links:

\[1\] https://aaaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3079&qid=78886&h=e06a54f96fd8d0f9

--=\_ca63d17a869f264c3d3540d004645f59 Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8

AAA Victoria
```
                    <h1 style="text-align: center;"><span style="color:#ffffff;"><span style="font-family:arial,helvetica,sans-serif;">Williamstown ABC</span></span></h1>
                    </td>
            </tr>
    </tbody>

```

Dear Ian,

test

My Name

Williamstown SEC

To unsubscribe: Unsubscribe
*Powered by Civicrm* --=\_ca63d17a869f264c3d3540d004645f59--
> > > > > > end of email

I did have an error about tokens in a template ("Events - Registration Confirmation and Receipt (off-line)") which i fixed by removing some lines but I do not think this has anything to do with emailing. I have upgraded drupal from 7.94 (23/01/23) to 7.98 (22/10/23) and Civicrm from 5.46.2 to 5.66 (22/10/23) and PHP from 7.4 (3/3/22) to PHP 8.1 (23/10/23).

FULL EMAIL - ONLY CHANGED URL \>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>

```
Received: by 2002:a05:7208:d046:b0:6f:1b0b:ec43 with SMTP id y6csp795300rba;
        Thu, 26 Oct 2023 19:14:35 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IGFE9zZ0UzdR2hWAWbe5wLa9/FXr7L7nIkLZQk74Pcv3OGflG+oQiQ+XgoENdvJ4mdWS5Os
X-Received: by 2002:a17:902:ed13:b0:1c6:294c:f89c with SMTP id b19-20020a170902ed1300b001c6294cf89cmr1255621pld.63.1698372875397;
        Thu, 26 Oct 2023 19:14:35 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1698372875; cv=none;
        d=google.com; s=arc-20160816;
        b=YNO9v4KuL6bS+Uv0rC6ensv3mscivhwV54eH4365DEmNfmIH5YKSuiJNtRRADgEkrG
         iWjIEJd4aKAL5JdDipK9XqFek0H+N0ICKSdmEEr+A3fPKxonc3ySGqXvJrYcup5oveU6
         MmVGGMUsbhn0tzwpqYC5JIPRmT0o1hggMWLCRdkbb2FPTBXDc6iVVOWEk/B1rsdDd6Y8
         Twi5DCcdQPJXGD9SfaZkhMsWNqJiUJ5Z6QB6IjpogDDZXhaIK/YD+h8otQrJ6HZRvgn8
         sXTqS3hoDTKn0BjoLXe+0s2G0SCVDjy7DnfuUlYE6Vo1iNKA8rRETt8vow2Jj7FRr5/a
         ugJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=date:from:message-id:mime-version:subject:to:dkim-signature;
        bh=n3hoZgLMtpCH667iF67ZF+zS2h7fgvrEaqE6MAw3Zm0=;
        fh=drJV50q+9Zk9lNqEZoeH10Cz6R3jYl/H2elpBjvjCww=;
        b=mZUa69DzrCLcEuk7GfO8MQu+i+BpfYFlCGrAY2LkzmujQovBolaImcWwfK+TUfjTit
         wB1U+MdWPkZuFV9ULwbgjauYDSsXSmKiANDpBhR8dSSTUurdflDZV62JYQ/RTUq+8DXB
         ujMd8Znvxyd9ktbByUyG8wYbviAkaGpOeEZc4du/zlqUFM/sCy+qn1xWc7pNoE77euM4
         VjkYOEvsNTNt1aTGYU6j/Mgv9wAfFyM3KcKnjdTFGlwbAGsydHEiBPBbkkls0MIhz249
         giE3iXUS7y1+vtpLPFVkRwydWPWX32cp3ygAQFNqGYHfxLb3wDZudsE0niV/3NcimzI6
         7xGw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=UA+04yfg;
       spf=pass (google.com: domain of b.3086.78893.b6ac1c49b1035d76@aaa.org designates 35.89.44.34 as permitted sender) smtp.mailfrom=b.3086.78893.b6ac1c49b1035d76@aaa.org
Return-Path: <b.3086.78893.b6ac1c49b1035d76@aaa.org>
Received: from omta35.uswest2.a.cloudfilter.net (omta35.uswest2.a.cloudfilter.net. [35.89.44.34])
        by mx.google.com with ESMTPS id d5-20020a170903230500b001bc079974dbsi464704plh.355.2023.10.26.19.14.34
        for <aaa@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 26 Oct 2023 19:14:34 -0700 (PDT)
Received-SPF: pass (google.com: domain of b.3086.78893.b6ac1c49b1035d76@aaa.org designates 35.89.44.34 as permitted sender) client-ip=35.89.44.34;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=UA+04yfg;
       spf=pass (google.com: domain of b.3086.78893.b6ac1c49b1035d76@aaa.org designates 35.89.44.34 as permitted sender) smtp.mailfrom=b.3086.78893.b6ac1c49b1035d76@aaa.org
Received: from eig-obgw-6003a.ext.cloudfilter.net ([10.0.30.151]) by cmsmtp with ESMTPS id wAA0qrs4EhqFdwCMsqJ1SF; Fri, 27 Oct 2023 02:14:34 +0000
Received: from harrier.websitewelcome.com ([192.185.83.107]) by cmsmtp with ESMTPS id wCMqqQSVpRqxCwCMrqJO8g; Fri, 27 Oct 2023 02:14:33 +0000
X-Authority-Analysis: v=2.4 cv=IY2U5Ema c=1 sm=1 tr=0 ts=653b1d09 a=PEXN0kqERGfpDbwOsM9Lrw==:117 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=dXCnJTF15noA:10 a=bhdUkHdE2iEA:10 a=O4E_PBewnzIA:10 a=4v_fjtIuAAAA:8 a=WpWwP1NjkZ-qq9kLDQ0A:9 a=hhnteAknvzHUoGrS:21 a=yQD-zf_IIDVdLvJsLJma:22 a=G0u7fxU7sV0lX6SvgOtL:22
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aaa.org ; s=default; h=Date:From:Message-Id:MIME-Version:Subject:To:Sender:Reply-To: Cc:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=n3hoZgLMtpCH667iF67ZF+zS2h7fgvrEaqE6MAw3Zm0=; b=UA+04yfgivrbar/fXa7JQ11fRD J3mb0Db569O4stBlG60JYbpHxhLM/LLq+qdDCFJfU8up3qpMcwin95a9Uu8MvdrpHORmgoXZwI9J4 a3XdrvJDm8K1VHGM2kKPoVF5HpD8KLDFtmvjOHB+Mi/w+cESBUATRomPXnxtFSUso2THN3t1BWqvz H91zF/qoSPD+4QHJ2kGiN7jHsMmlor66Mk9hay6Y+Sn9A68y+0TA8OEQVnPcqKVdRgdtAh4EduWyW gokPwViUluqh5B89Mj7BKPTJfHKlZKP2BPopFlIL+B+ZMVk9LJrRfU8jGgPtNxBvKUj6xFfCVIrK0 ohIFxQKw==;
Received: from aaa by harrier.websitewelcome.com with local (Exim 4.96.2) (envelope-from <b.3086.78893.b6ac1c49b1035d76@aaa.org>) id 1qwCMq-000FJJ-29 for aaa@gmail.com; Thu, 26 Oct 2023 21:14:32 -0500
To: <aaa@gmail.com>
Subject: [CiviMail Draft] Williamstown Liberals SEC Newsletter
X-PHP-Script: aaa.org/drupal/index.php for 101.181.98.11 X-PHP-Originating-Script: 5705:mail.php
MIME-Version: 1.0 List-Unsubscribe: <mailto:u.3086.78893.b6ac1c49b1035d76@aaa.org> Precedence: bulk job_id: 3086 From: "Liberals" <liberals@aaa.org> Return-Path: b.3086.78893.b6ac1c49b1035d76@aaa.org X-CiviMail-Bounce: b.3086.78893.b6ac1c49b1035d76@aaa.org Content-Type: multipart/alternative;
  boundary="=_d02e2e40878c24e4a573b81e90d7d140" Date: Fri, 27 Oct 2023 13:14:32 +1100
Message-Id: <E1qwCMq-000FJJ-29@harrier.websitewelcome.com>
From: b.3086.78893.b6ac1c49b1035d76@aaa.org
Date: Thu, 26 Oct 2023 21:14:32 -0500
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - harrier.websitewelcome.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [5705 32008] / [47 12]
X-AntiAbuse: Sender Address Domain - aaa.org
X-BWhitelist: no
X-Source-IP:
X-Source-L: No
X-Exim-ID: 1qwCMq-000FJJ-29
X-Source:
X-Source-Args:
X-Source-Dir: aaa.org:/public_html/drupal
X-Source-Sender:
X-Source-Auth: aaa
X-Email-Count: 1
X-Org: HG=hgreseller;ORG=hostgator;
X-Source-Cap: bGlid2VzdDtncm5sZ2h0O2hhcnJpZXIud2Vic2l0ZXdlbGNvbWUuY29t
X-Local-Domain: yes
X-CMAE-Envelope: MS4xfC3O35AjnQHks5YDqYCx4yYlUfmnBfC1wgcmB6zEVaMfyvNxFsrKq67nuHAvlRnigakg1LZ+i/Pj5biWLJZPmf5OXxpsKewS9ew1ICjVDebG3qVpto/d CLmkYoa5CsPQig5frsRj/am0ItLsX2i5k7bPDrg1AqFV0Y2YE26jtJo+gXeibxP+HJHF86jD0POH1Cwn8yHoprczDtGwOyFcZo82go6yJ/+KIw+2aLjoO90o uLXYKzknE82xnSeIVHwJBg==

--=_d02e2e40878c24e4a573b81e90d7d140
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

aaa OF VICTORIA

WILLIAMSTOWN SEC

Dear ,

Ian Hocking

Williamstown SEC

To unsubscribe: Unsubscribe [1]

_ Powered by Civicrm_

Links:
------
[1] https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3086&qid=78893&h=b6ac1c49b1035d76

--=_d02e2e40878c24e4a573b81e90d7d140
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=utf-8

<table align="center" border="1" bordercolor="#ccc" cellpadding="10" cellspacing="0" style="border-collapse:collapse;">
    <tbody>
        <tr>
            <td style="vertical-align: middle; background-color: white;"><img alt="" src="http://aaa.org/drupal/sites/default/files/civicrm/persist/contribute/images/LiberalLogo_Clear.png" style="width: 150px; height: 119px;" /></td>
            <td style="text-align: left; background-color: rgb(6, 120, 201);">
            <h1 style="text-align: center;"><span style="color:#ffffff;"><span style="font-family:arial,helvetica,sans-serif;">aaa of Victoria</span></span></h1>

            <h1 style="text-align: center;"><span style="color:#ffffff;"><span style="font-family:arial,helvetica,sans-serif;">Williamstown SEC</span></span></h1>
            </td>
        </tr>
    </tbody>
</table>

<p> </p>

<p><span style="font-size:14px;">Dear ,</span></p>

<p> </p>

<p> </p>

<p>Ian Hocking</p>

<p>Williamstown SEC</p>

<p> </p>
To unsubscribe: <a href="https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3086&qid=78893&h=b6ac1c49b1035d76">Unsubscribe</a> <br/>
<br/>
<font color="maroon"><i> Powered by Civicrm</i>
<img src="https://aaa.org/drupal/civicrm/mailing/open?qid=78893" width='1' height='1' alt='' border='0'>
--=_d02e2e40878c24e4a573b81e90d7d140--

```

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

With PHP 7.4

```
Original message
Message ID  <E1qwbOw-001l3z-0v@harrier.websitewelcome.com>
Created on: 28 October 2023 at 15:58 (Delivered after 2 seconds)
From:   Liberals <liberals@aaa.org>
To: aaa@gmail.com
Subject:    [CiviMail Draft] Last chance to reserve your spot: Coffee & chat with Jim
SPF:    PASS with IP 44.202.169.32 Learn more
DKIM:   'PASS' with domain aaa.org Learn more

Download original
Copy to clipboard

Delivered-To: aaa@gmail.com
Received: by 2002:a05:7208:55a9:b0:6f:1b0b:ec43 with SMTP id bi41csp320852rbb;
        Fri, 27 Oct 2023 21:58:25 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IFYwYanSymosVxaU8NOx58Vw6wzV8RCdZVCgDe8/4D2WUbCbtx70wW4OANDOii4r2dR176y
X-Received: by 2002:a05:620a:6017:b0:76e:ffaa:a816 with SMTP id dw23-20020a05620a601700b0076effaaa816mr4480639qkb.75.1698469104834;
        Fri, 27 Oct 2023 21:58:24 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1698469104; cv=none;
        d=google.com; s=arc-20160816;
        b=ALc8zdz0uK3//M9Jqmtz7mFKyK1Y8ANGwLQ8oAWofFpawjab7kMZQ4JNwc7x/5xJoZ
         UoU5SC2PkVZmW5fPEFWGJxn7F3BakFFf6iMpGL7V7N5t3cKFYtzwOVfIT94WPOtT2+34
         qNUqx8ZZuKPGGHhk/2ni36+CBYeKTrX0avLYLgZwvhIhZi33AJzWpDOVNueNMPRUkJfB
         4Dp7ET/gKMSeXeqfxpirx92CG82yIw//8SVYmzNcrer1zfcRHI7ulmpX0dvPXcedHTut
         qIew3Mrxt+dbFW2Jc4kvDR5QIDtRUTtMIc6iOAvSvC34CTMadtV/Sf19eZ+YH38BE+bV
         A8bQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=message-id:date:from:job_id:precedence:list-unsubscribe
         :mime-version:subject:to:dkim-signature;
        bh=w2/NrMu6sILn0cxnSxQ/HpRcwQl/BglztCKHEMIcflI=;
        fh=drJV50q+9Zk9lNqEZoeH10Cz6R3jYl/H2elpBjvjCww=;
        b=lpUWQt2a/0Tn37/DnU7346DRgBywxzJPOcIN/9P+oCgVqNsY4er+YUmrgifw00I/3q
         FbbFb5N75YD8eprOYmWarEYv9UnNrD6iZxvgcVAvdKwy7IQtemXJwO8UgaHTXzFKOY6m
         SBAkqPhXV9kydDsg4xEAI1JOXlJKsdjwREUy+L/W77qmA9mKTT8j8CAlWd3YMsTT75/Q
         vFPb5yb/TG15KQ67WmGnW6mM8o7qCpnna1VhPAKeBXQw0X2UKUstfNaKKqtrZXoVYV9Y
         pj2UySXFUQXDLOj/IvIH7AUvNtwZ35GWw+/fo2ShboWxU7Ir3YrLMNLXOpTIGpJXjPqb
         CwEQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=UaUpCfaE;
       spf=pass (google.com: domain of b.3092.78899.1aff3f44f6650f6b@aaa.org designates 44.202.169.32 as permitted sender) smtp.mailfrom=b.3092.78899.1aff3f44f6650f6b@aaa.org
Return-Path: <b.3092.78899.1aff3f44f6650f6b@aaa.org>
Received: from omta033.useast.a.cloudfilter.net (omta033.useast.a.cloudfilter.net. [44.202.169.32])
        by mx.google.com with ESMTPS id f27-20020a05620a15bb00b00779e70e2777si1650691qkk.519.2023.10.27.21.58.24
        for <aaa@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 27 Oct 2023 21:58:24 -0700 (PDT)
Received-SPF: pass (google.com: domain of b.3092.78899.1aff3f44f6650f6b@aaa.org designates 44.202.169.32 as permitted sender) client-ip=44.202.169.32;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=UaUpCfaE;
       spf=pass (google.com: domain of b.3092.78899.1aff3f44f6650f6b@aaa.org designates 44.202.169.32 as permitted sender) smtp.mailfrom=b.3092.78899.1aff3f44f6650f6b@aaa.org
Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id wMRaqVibmjtZ3wbOyqM720; Sat, 28 Oct 2023 04:58:25 +0000
Received: from harrier.websitewelcome.com ([192.185.83.107]) by cmsmtp with ESMTPS id wbOwq6McgOk5SwbOxquKq1; Sat, 28 Oct 2023 04:58:23 +0000
X-Authority-Analysis: v=2.4 cv=E+DeGIRl c=1 sm=1 tr=0 ts=653c94ef a=PEXN0kqERGfpDbwOsM9Lrw==:117 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=-S1hUXpT4R_DRAgF:21 a=dXCnJTF15noA:10 a=bhdUkHdE2iEA:10 a=O4E_PBewnzIA:10 a=4v_fjtIuAAAA:8 a=YpcfGz_jEuMbHcW-mY0A:9 a=QEXdDO2ut3YA:10 a=okE-M7gcAAAA:8 a=y5Oy8Mt9Lh3VICWxy-sA:9 a=oC8CuAte2NgTU6n1:21 a=yQD-zf_IIDVdLvJsLJma:22 a=G0u7fxU7sV0lX6SvgOtL:22 a=No-rZXW96PReiIdYbifg:22 a=nb-ZEjrkFBj5XG7Gp5Uu:22
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aaa.org ; s=default; h=Message-Id:Date:Content-Type:From:List-Unsubscribe: MIME-Version:Subject:To:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Subscribe:List-Post:List-Owner:List-Archive; bh=w2/NrMu6sILn0cxnSxQ/HpRcwQl/BglztCKHEMIcflI=; b=UaUpCfaEfl7Xj4qC/HzfdVa5Aa XXTkBmasnxJOq/FNX5YZJP+rqzdq7DJwLMXc7SGxLr8VQecW4s/640LWAhB8nts44NdJl/hh612lt CWnDGxZGaZr2MpHVnzjiGjvXnYY2Grciisib2VwODQohh3nRi0SPk9qNlQNRfOkA7qnXBzmW/qOgm Gm2OhAhUuXQpHiP/A8nTAqIlEadzTN/QU9uB3O/q+CalFlQS4avbCwNJavWhkL4WWQuqI8g387LHV J2PMeh/1jFgAro8/GBYah8zQvTXsp4oDzJOGt4oYHDy3iQcCvpnfFucknAhaTAsY953YX0v+OqMqa ejJH1CQg==;
Received: from aaa by harrier.websitewelcome.com with local (Exim 4.96.2) (envelope-from <b.3092.78899.1aff3f44f6650f6b@aaa.org>) id 1qwbOw-001l3z-0v for aaa@gmail.com; Fri, 27 Oct 2023 23:58:22 -0500
To: <aaa@gmail.com>
Subject: [CiviMail Draft] Last chance to reserve your spot: Coffee & chat with
  Jim
X-PHP-Script: aaa.org/drupal/index.php for 101.181.98.11
X-PHP-Originating-Script: 5705:mail.php
MIME-Version: 1.0
List-Unsubscribe: <mailto:u.3092.78899.1aff3f44f6650f6b@aaa.org>
Precedence: bulk
job_id: 3092
From: Liberals <liberals@aaa.org>
X-CiviMail-Bounce: b.3092.78899.1aff3f44f6650f6b@aaa.org
Content-Type: multipart/alternative; boundary="=_b8812c2ba5e87465f331ccc26b63babe"
Date: Sat, 28 Oct 2023 15:58:22 +1100
Message-Id: <E1qwbOw-001l3z-0v@harrier.websitewelcome.com>
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - harrier.websitewelcome.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [5705 32008] / [47 12]
X-AntiAbuse: Sender Address Domain - aaa.org
X-BWhitelist: no
X-Source-IP:
X-Source-L: No
X-Exim-ID: 1qwbOw-001l3z-0v
X-Source:
X-Source-Args:
X-Source-Dir: aaa.org:/public_html/drupal
X-Source-Sender:
X-Source-Auth: aaa
X-Email-Count: 6
X-Org: HG=hgreseller;ORG=hostgator;
X-Source-Cap: bGlid2VzdDtncm5sZ2h0O2hhcnJpZXIud2Vic2l0ZXdlbGNvbWUuY29t
X-Local-Domain: yes
X-CMAE-Envelope: MS4xfJ9XniiFUdwS4FiS6jZS0RSFTCbMg9bIEXRRZlYCfAnYnrxnQC7qY2az/Iv2bg8biN7nI3MQL63xhyln8kK17rplxDA9NT2Dq7swoBLlx+f04erwkQPJ j6pBotjDkEdju1LNcELLAkcSYiJfcNzoXYpK559Cy3TwDhRmNn0cQ+83B5EgA8dv9g6CMRIPy+sUXruAeod/gtDPd3lXj5GO5RVSWmwJw5+XM6yQYw5KF2MT 0AHFA8cTKW5G4eMt8ZVIRQ==

--=_b8812c2ba5e87465f331ccc26b63babe
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

DON'T MISS OUR COFFEE AND CHAT WITH Jim
Join Jim for the first of the 'coffee and chat' series hosted
by Gellibrand FEC, Williamstown SEC, and Williamstown Branch.

Time/date: 10-11:30AM, SATURDAY 28TH OCTOBER

Location: WILLIAMSTOWN COMMUNITY & EDUCATION CENTRE, 14 THOMPSON STREET,
WILLIAMSTOWN

Jim will have an open discussion with us about the policy direction and other topics of interest to members.

The ticket price of $5 includes coffee.

BOOK YOUR PLACE NOW AT: https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78899 [1]

 To unsubscribe: Unsubscribe [2]

_ Powered by Civicrm_

Links:
------
[1] https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78899
[2] https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3092&qid=78899&h=1aff3f44f6650f6b

--=_b8812c2ba5e87465f331ccc26b63babe
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=utf-8

<table border="0" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
        <tr>
            <td>
            <p><strong><span style="font-size:14px;"><span style="font-family:Arial,Helvetica,sans-serif;">Don't miss our coffee and chat with Jim</span></span></strong></p>

            <p>Jim for the first of the 'coffee and chat' series hosted by <u>Gellibrand FEC,</u> <u>Williamstown SEC</u>, and <u>Williamstown Branch</u>.<br />
            <br />
            Time/date: <strong>10-11:30am, Saturday 28th October</strong></p>

            <p>Location: <strong>Williamstown Community & Education Centre</strong>, <strong>14 Thompson Street, Williamstown</strong></p>

            <p>Jim will have an open discussion with us about the Federal Liberal Party's policy direction and other topics of interest to members.<br />
            <br />
            The ticket price of $5 includes coffee.</p>

            <p><strong>Book your place now at</strong>: <a href="https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78899" rel='nofollow'>https://www.trybooking.com/CLOUU</a></p>
            </td>
        </tr>
        <tr>
            <td> </td>
        </tr>
    </tbody>
</table>
To unsubscribe: <a href="https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3092&qid=78899&h=1aff3f44f6650f6b">Unsubscribe</a> <br/>
<br/>
<font color="maroon"><i> Powered by Civicrm</i>
<img src="https://aaa.org/drupal/civicrm/mailing/open?qid=78899" width='1' height='1' alt='' border='0'>
--=_b8812c2ba5e87465f331ccc26b63babe--

```

With PHP 8.2

```
Message ID  <E1qwbNE-001kWw-1D@harrier.websitewelcome.com>
Created on: 28 October 2023 at 15:56 (Delivered after 2 seconds)
From:   b.3091.78898.3f5397f6454f5d1e@aaa.org
To: aaa@gmail.com
Subject:    [CiviMail Draft] Last chance to reserve your spot: Coffee & chat with Jim
SPF:    PASS with IP 44.202.169.34 Learn more
DKIM:   'PASS' with domain aaa.org Learn more

Download original
Copy to clipboard

Delivered-To: aaa@gmail.com
Received: by 2002:a05:7208:55a9:b0:6f:1b0b:ec43 with SMTP id bi41csp320489rbb;
        Fri, 27 Oct 2023 21:56:38 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IHWlixturqe0X/mDxjKoyJ7LeQ6YF+3GJ2Z6Y6QPm7uXwID9GYwkH9WOtX55ZD53Lk/QWmm
X-Received: by 2002:a05:6214:19c3:b0:65b:fa3:4a01 with SMTP id j3-20020a05621419c300b0065b0fa34a01mr5748005qvc.62.1698468998462;
        Fri, 27 Oct 2023 21:56:38 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1698468998; cv=none;
        d=google.com; s=arc-20160816;
        b=jaUnzIV1F9jnOCGl9UaxobTQSUOLVoUp6YwS+d0jDiIcwOLZfjeVbUDlnayJGkXaOB
         pMFuTc/qxYLt114IRHxj4zrCQSWAFSC9X/ZIj1jvAc6MiblD0GLRF6Bpy1Qg8F+x80U5
         dSEwTkKYafsajMI5DJlGE3xaulQXvGT5ykdeHsIvLFesEcTfhsBveseeY8h6+gXqeFET
         HB+VDnGc1qxFgsSfG+CkU4AdetZjX+jNpfIHPHdpNzR2bfQaOLXudX5UwF9w6zIG5nvD
         d+sXa4Ydq/LGSq1pqzkWc3bWNYLiaOkY6x9u6XUVUGBs9N+7QWFsjrcd/iBun4M1u3U5
         3n2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=date:from:message-id:mime-version:subject:to:dkim-signature;
        bh=53OKc6ZumZZVTfZ8NWUhigUiMUEBwSNavJS671Ukom8=;
        fh=drJV50q+9Zk9lNqEZoeH10Cz6R3jYl/H2elpBjvjCww=;
        b=BoJpPb5xqNEY8DBHdB9nu4vssVesPex5MoxUDnp4l1ggmIIemPmI6yBHlpClHBjseJ
         OnXsUEK3/wz5qqFYssnzIdd3j6hbfRC0xPPcrlIBDOJqcBRvgrTxltJtHf9gpfj8cPqO
         vnmo6+2i2iTFvuN+Tp/0KFWIZACuhEQClZeZXedcDwYbtTlxAZYISWtRWmkOISbfu19D
         2CG8y/lIyd+B4g2e/v4mVLljfhwuhFB8jtLPuO4TBn3/r11ybuHQF3wUk98MKOCqqSy8
         Z/vcoN8YhwmCjm7oiMQc47kt4zrSCLKiEcEjkDEZwrFOrGbWm7tVPtU8xmsQncLhUOSx
         IUjA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=pMr+hS2q;
       spf=pass (google.com: domain of b.3091.78898.3f5397f6454f5d1e@aaa.org designates 44.202.169.34 as permitted sender) smtp.mailfrom=b.3091.78898.3f5397f6454f5d1e@aaa.org
Return-Path: <b.3091.78898.3f5397f6454f5d1e@aaa.org>
Received: from omta035.useast.a.cloudfilter.net (omta035.useast.a.cloudfilter.net. [44.202.169.34])
        by mx.google.com with ESMTPS id h9-20020ac87d49000000b00419674b991asi1771935qtb.505.2023.10.27.21.56.38
        for <aaa@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 27 Oct 2023 21:56:38 -0700 (PDT)
Received-SPF: pass (google.com: domain of b.3091.78898.3f5397f6454f5d1e@aaa.org designates 44.202.169.34 as permitted sender) client-ip=44.202.169.34;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@aaa.org header.s=default header.b=pMr+hS2q;
       spf=pass (google.com: domain of b.3091.78898.3f5397f6454f5d1e@aaa.org designates 44.202.169.34 as permitted sender) smtp.mailfrom=b.3091.78898.3f5397f6454f5d1e@aaa.org
Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id wPlrqbCxZgpyEwbNFq6NOg; Sat, 28 Oct 2023 04:56:37 +0000
Received: from harrier.websitewelcome.com ([192.185.83.107]) by cmsmtp with ESMTPS id wbNEqFF6gruMPwbNFq4RON; Sat, 28 Oct 2023 04:56:37 +0000
X-Authority-Analysis: v=2.4 cv=ZNHEJF3b c=1 sm=1 tr=0 ts=653c9485 a=PEXN0kqERGfpDbwOsM9Lrw==:117 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=-S1hUXpT4R_DRAgF:21 a=dXCnJTF15noA:10 a=bhdUkHdE2iEA:10 a=O4E_PBewnzIA:10 a=4v_fjtIuAAAA:8 a=okE-M7gcAAAA:8 a=mnKYI0rjSfJg827Tvb8A:9 a=oC8CuAte2NgTU6n1:21 a=yQD-zf_IIDVdLvJsLJma:22 a=G0u7fxU7sV0lX6SvgOtL:22 a=No-rZXW96PReiIdYbifg:22 a=nb-ZEjrkFBj5XG7Gp5Uu:22
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aaa.org ; s=default; h=Date:From:Message-Id:MIME-Version:Subject:To:Sender:Reply-To: Cc:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=53OKc6ZumZZVTfZ8NWUhigUiMUEBwSNavJS671Ukom8=; b=pMr+hS2qbCxjOVjz/qxEyfNjag 8zuAn1u0kEb2N++O8c7mbblFR0Re7RlZ0tBJm0YEauxNpTQ6C2wytWzhSN183OymibJtv6368hieS UBpkLIvLnuhf7Rk1UCI7W51Hm8FiLWwdIyhjilv7sNScg5kLUMXp6O90s4MsBID7XZeh1TkLcGGQt Tmx118OfvcRrP1Pd3SGW9S9eFGtrw1SCTg4aCnH9RZg50X8gPRsSm6cmkr7cmG7JJPPFHHP1zkgvj Tu1xAKdm4Cy28eYVFfo/u7AKMlrIwWj3IebeCAGoWpV5KlRmmh5c5qylg8985Obe0tsy3JLk4NwVd oapq9V2g==;
Received: from aaa by harrier.websitewelcome.com with local (Exim 4.96.2) (envelope-from <b.3091.78898.3f5397f6454f5d1e@aaa.org>) id 1qwbNE-001kWw-1D for aaa@gmail.com; Fri, 27 Oct 2023 23:56:36 -0500
To: <aaa@gmail.com>
Subject: [CiviMail Draft] Last chance to reserve your spot: Coffee & chat with
  Jim
X-PHP-Script: aaa.org/drupal/index.php for 101.181.98.11 X-PHP-Originating-Script: 5705:mail.php
MIME-Version: 1.0 List-Unsubscribe: <mailto:u.3091.78898.3f5397f6454f5d1e@aaa.org> Precedence: bulk job_id: 3091 From: "Liberals" <liberals@aaa.org> Return-Path: b.3091.78898.3f5397f6454f5d1e@aaa.org X-CiviMail-Bounce: b.3091.78898.3f5397f6454f5d1e@aaa.org Content-Type: multipart/alternative;
  boundary="=_a6836d14709272c4387b47be6f69b83e" Date: Sat, 28 Oct 2023 15:56:36 +1100
Message-Id: <E1qwbNE-001kWw-1D@harrier.websitewelcome.com>
From: b.3091.78898.3f5397f6454f5d1e@aaa.org
Date: Fri, 27 Oct 2023 23:56:36 -0500
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - harrier.websitewelcome.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [5705 32008] / [47 12]
X-AntiAbuse: Sender Address Domain - aaa.org
X-BWhitelist: no
X-Source-IP:
X-Source-L: No
X-Exim-ID: 1qwbNE-001kWw-1D
X-Source:
X-Source-Args:
X-Source-Dir: aaa.org:/public_html/drupal
X-Source-Sender:
X-Source-Auth: aaa
X-Email-Count: 5
X-Org: HG=hgreseller;ORG=hostgator;
X-Source-Cap: bGlid2VzdDtncm5sZ2h0O2hhcnJpZXIud2Vic2l0ZXdlbGNvbWUuY29t
X-Local-Domain: yes
X-CMAE-Envelope: MS4xfKU9cRZu++gtUj0fZQT+9FKtRohKGuxbNsk5F24q+C5LW7U2zXpz2N9lfzHZx3COvZg6Q/7z0HroDSQgsINtS1GMfF0brjwT6d7H+RWuJJN0VDnEmEIq wF9Hs3GAfqogaW1aTtrK3PwxnyCCphJZW3VpBbJp7pF8B2Ay2fibRl++xYK4emkvJZi+UGQQGxpB9+3fr4Gu6tzcUdWIR+aIzJCduCso8zUumKJ+nvuflbf0 MQjaa2EIB4WnMVTaNwZtTg==

--=_a6836d14709272c4387b47be6f69b83e
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8

DON'T MISS OUR COFFEE AND CHAT WITH Jim FINANCE

Join Jim for the first of the 'coffee and chat' series hosted
by Gellibrand FEC, Williamstown SEC, and Williamstown Branch.

Time/date: 10-11:30AM, SATURDAY 28TH OCTOBER

Location: WILLIAMSTOWN COMMUNITY & EDUCATION CENTRE, 14 THOMPSON STREET,
WILLIAMSTOWN

Jim will have an open discussion with us about the Federal Liberal
Party's policy direction and other topics of interest to members.

The ticket price of $5 includes coffee.

BOOK YOUR PLACE NOW AT: https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78898 [1]

 To unsubscribe: Unsubscribe [2]

_ Powered by Civicrm_

Links:
------
[1] https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78898
[2] https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3091&qid=78898&h=3f5397f6454f5d1e

--=_a6836d14709272c4387b47be6f69b83e
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=utf-8

<table border="0" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
        <tr>
            <td>
            <p><strong><span style="font-size:14px;"><span style="font-family:Arial,Helvetica,sans-serif;">Don't miss our coffee and chat with Jim for Finance</span></span></strong></p>

            <p>Join Jim for the first of the 'coffee and chat' series hosted by <u>Gellibrand FEC,</u> <u>Williamstown SEC</u>, and <u>Williamstown Branch</u>.<br />
            <br />
            Time/date: <strong>10-11:30am, Saturday 28th October</strong></p>

            <p>Location: <strong>Williamstown Community & Education Centre</strong>, <strong>14 Thompson Street, Williamstown</strong></p>

            <p>Jim will have an open discussion with us about the Federal Liberal Party's policy direction and other topics of interest to members.<br />
            <br />
            The ticket price of $5 includes coffee.</p>

            <p><strong>Book your place now at</strong>: <a href="https://aaa.org/drupal/civicrm/mailing/url?u=551&qid=78898" rel='nofollow'>https://www.trybooking.com/CLOUU</a></p>
            </td>
        </tr>
        <tr>
            <td> </td>
        </tr>
    </tbody>
</table>
To unsubscribe: <a href="https://aaa.org/drupal/civicrm/mailing/optout?reset=1&jid=3091&qid=78898&h=3f5397f6454f5d1e">Unsubscribe</a> <br/>
<br/>
<font color="maroon"><i> Powered by Civicrm</i>
<img src="https://aaa.org/drupal/civicrm/mailing/open?qid=78898" width='1' height='1' alt='' border='0'>
--=_a6836d14709272c4387b47be6f69b83e--

```

# Answer
> 3 votes
I've just been looking at the same problem. This is caused by changing to php8. php's internal `mail()` function has changed how it handles line endings.

The `additional_headers` should be separated with CRLF (\r\n). The pear library ends up separating them with just LF (\n). php7 is lenient and reformats these correctly, but php8 does not resulting in some headers (including the MIME boundary specifier) being output as a single line and therefore not correctly interpreted by mail clients.

As a quick fix, edit `vendor/pear/mail/Mail.php` and change line 225 at the end of `prepareHeaders()` from:

```
        return array($from, join($this->sep, $lines));

```

to

```
        return array($from, join("\r\n", $lines));

```

We need to get that into a proper fix.

# Answer
> 1 votes
Looking at your message, the problem is that there are missing line breaks in here:

```
MIME-Version: 1.0 List-Unsubscribe: <mailto:u.3086.78893.b6ac1c49b1035d76@aaa.org> Precedence: bulk job_id: 3086 From: "Liberals" <liberals@aaa.org> Return-Path: b.3086.78893.b6ac1c49b1035d76@aaa.org X-CiviMail-Bounce: b.3086.78893.b6ac1c49b1035d76@aaa.org Content-Type: multipart/alternative;
  boundary="=_d02e2e40878c24e4a573b81e90d7d140" Date: Fri, 27 Oct 2023 13:14:32 +1100

```

Each of these should actually be on a separate line, like so

```
MIME-Version: 1.0
List-Unsubscribe: <mailto:u.3086.78893.b6ac1c49b1035d76@aaa.org>
...
Content-Type: multipart/alternative;
  boundary="=_d02e2e40878c24e4a573b81e90d7d140"
Date: Fri, 27 Oct 2023 13:14:32 +1100

```

For this reason, the MIME boundary (`=_d02e2e40878c24e4a573b81e90d7d140`) isn't being respected in the body of the email. Why that is happening is not clear to me though.

Which version did you upgrade from? Does the same happen with bulk email (CiviMail, Mosaico) and with Send an Email?

# Answer
> 0 votes
What are you using to send the email? We've most often seen this with the internal mail script (on the server). If you can't use a third-party provider like Sendgrid or Sparkpost, you might try /sendmail as an alternative.

---
Tags: civimail
---


title: How to generate a Mosaico mailing?

text:
# Question
Title: How to generate a Mosaico mailing?
A specific client sends out a newsletter every month. It contains a selection of articles from their website and a list of upcoming events.

Ideally, I would like to develop an extension that generates every month a draft Mosaico mailing with the content of the month.

Staff can then edit this newsletter using Mosaico (e.g. correct a title that's too long, remove/add an article manually...) and send out the mailing.

I see that the table civicrm\_mailing contains a column template\_options with JSON and that the property "mainBlocks" contains an array of blocks.

I could reverse engineer an existing template, but I was wondering if there is an API or a bunch of classes to create a Mosaico message?

# Answer
A while ago SYSTOPIA and (mainly) Rich (artfulrobot) built two extensions that aimed at collecting external content and storing it in CiviCRM (newsstore) as well as one extension (NewsStore Mailer) which allows to create regular mailings with pre-defined templates that use those "content items".

The use case sounds very similar to what you have in mind. Unfortunately, the customer decided to not use the feature before we were able to fully test / finalize it. There may be incompatibilities with current CiviCRM versions, too.

However, they may be wort a look as a lot of work went into those and it looked very promising. Would love to see those used.
> 1 votes

---
Tags: mosaico
---


title: CSV Download from a custom pop up

text:
# Question
Title: CSV Download from a custom pop up
I have a function that lists score for a dog:

```
<h3>Your Dog's Scores</h3>
{crmButton href="#" class="button-name" title="Download CSV" icon="icon-class-name"}Download CSV{/crmButton}
<table border='1' cellpadding='5' cellspacing='5'><tr class="crm-entity" id="Scores" style='border-bottom: 1px solid black'><th>Registered Name</th><th>Event</th><th>Level</th><th>Stream</th><th>Score</th><th>Max Points</th><th>Pass</th></td></tr>
{*{crmAPI var='dogs' entity='RegisteredDogs' action='get' contact_id = $contactid} *}
{foreach from=$scores key=arrayIndex item=score}
  <tr>
  <td>{$score->DogName}</td>
  <td>{$score->Event}</td>
  <td>{$score->LevelDescript}</td>
  <td>{$score->Stream}</td>
  <td>{$score->Score}</td>
  <td>{$score->MaxPoints}</td>
  <td>{$score->Pass}</td>
  </tr>
{/foreach}

</table>

```

This works really well. The pop-up window shows the scores and lists them out. The issue is I'm being asked if I can export the displayed data as a CSV file. I see on the top bar that there is a 'print' icon - is there a 'Download' option available? My second option was to use a separate button (as you can see the crmButton on the second line).

The array $scores has the results from a SQL query in the PHP (above is the smarty template code).
Is there an easy way to add the csv download option? Can I call a function with the href in the button? Perhaps I just need to write a php function to do this? Any help would be appreciated.

# Answer
I hope I'm not barking up the wrong tree, but could you pawsibly try SearchKit? It's a doggone helpful tool that can render your table without any of that custom Smarty code (which can be ruff to maintain), and it has a built-in "Download Spreadsheet" action to fetch and retrieve CSV, XLSX, or ODS.

Bone Appétit!
> 2 votes

---
Tags: extension, php, smarty, csv, custom
---


title: Illegal argument error

text:
# Question
Title: Illegal argument error
Wordpress with php 8.1

Fatal error: Uncaught IntlException: datefmt\_create: invalid locale: U\_ILLEGAL\_ARGUMENT\_ERROR in /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php:105

This give me an error for unable to reach the server if I want to modify or fill an event subscription form

further log informations

Stack trace:

```
#0 /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(105): IntlDateFormatter->__construct()

#1 /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(204): PHP81_BC\{closure}()

#2 [internal function]: PHP81_BC\{closure}()

#3 /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php(185): preg_replace_callback()

#4 /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/Log.php(887): PHP81_BC\strftime()

#5 /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/Log/file.php(294): Log->formatTime()

#6 /home/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(601): Log_file->log()

#7 /home/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(573): CRM_Core_Error::debug_log_message()

#8 /home/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(442): CRM_Core_Error::debug_var()

#9 /home/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException()

#10 /home/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke()

#11 /home/wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress->invoke()

#12 /home/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()

#13 /home/wp-includes/plugin.php(517): WP_Hook->do_action()

#14 /home/wp-admin/admin.php(259): do_action()

#15 {main}
  thrown in /home/wp-content/plugins/civicrm/civicrm/vendor/pear/log/php-8.1-strftime.php on line 105

```

Thank you for help

# Answer
> 2 votes
Yes it's a problem with php 8.1.25. See https://lab.civicrm.org/dev/core/-/issues/4739

---
Tags: profile, error, pear
---


title: Civievent live page giving error 500

text:
# Question
Title: Civievent live page giving error 500
this isn't really an issue, just a quick PSA. I have the latest wordpress and civicrm 5.66.1. When trying to access civievent live/test registration page, I kept getting an error 500. However, I changed my website to php8.0 and everything seems to be working. It was php8.1 before. Again, just a heads up for anyone running into this issue.

# Answer
> 1 votes
The 55.6.x version has a bug in pear, see at the post of mine Illegal argument error

---
Tags: civievent, error, php
---


title: Change Log for Contributions in Civicrm

text:
# Question
Title: Change Log for Contributions in Civicrm
Is there a way that I have generate a change log in terms of what contribution is added, edited, deleted? I understand that there is the detailed change log in civicrm, however seems like it doesn't include tracking of Contribution entity.

Could anyone assist me with this please?

# Answer
If you have enhanced logging enabled, your database will have tables like `log_civicrm_contribution` which you can examine, but there is no UI to display that.
> 1 votes

# Answer
When creating or editing contributions (such as changing it's status, type, amount etc.) a financial transaction will be created.

They could be considered a "change log for contributions" and are often used for accounting purposes (e.g. exporting them for your accounting software).

As many organisations don't need them, they are not prominently exposed in the UI. However, out of the box, there are some reports and export features for them, and of course you could use the search kit to display / use them in various ways.

If you would like to learn more about financial transactions and how to use them I would recommend the following sources:

https://civicrm.org/blog/erikhommel/to-have-or-not-to-have-financial-transactions https://docs.civicrm.org/dev/en/latest/financial/financialentities/ https://docs.civicrm.org/user/en/latest/contributions/key-concepts-and-configurations/
> 1 votes

---
Tags: logs
---


title: How to add Activity Tag(s)

text:
# Question
Title: How to add Activity Tag(s)
How do you add a new Activity tag(s)?

I can see how you add a tag at /civicrm/tag but when I add one it doesn't show up as a option when creating an activity? Is there somewhere else that you add a tag that specifically for activities?

Thanks.

# Answer
New tags are for contacts by default, but you can change that by setting "Used For" activities instead of contacts:
> 1 votes

---
Tags: activities, tags
---


# Question
Title: Upgraded to Joomla 4, now unable to upgrade CiviCRM
After upgrading to Joomla 4.2.6, I am now unable to update CiviCRM current version, 5.54.2. I contacted my CiviCRM hosting company and they were not able to resolve the issue either.

The following correspondence is from the hosting company:

"We tried to upgrade your CiviCRM normally, as per: https://docs.civicrm.org/sysadmin/en/latest/upgrade/joomla/

but the "Upgrade the database" step failed with an error. This broke the entire administrative interface of Joomla as well. The following error was displayed:

0 Class "JApplication" not found

We enabled error logging in PHP, but no error is recorded in /home/site-name/private/php-errors.log. We also changed in /home/site-name/www/www/configuration.php the error reporting level to maximum.

CiviCRM tries to access this class:

plugins/authentication/civicrm/civicrm.php: $menu = JApplication::getMenu('site');

However, we could not find where it is defined. It might not be available in Joomla 4, as here:

https://api.joomla.org/cms-3/classes/JApplication.html

it says:

3.2 Use CMSApplication instead unless specified otherwise

So what we did was to restore your site to as it was."

---

There it is. Any help is greatfully appreciated,

Keith

Adrian-

I followed your advise and updated CiviAuthenticate from your branch (https://github.com/aydun/CiviCRM-CiviAuthenticate/blob/j4/README.md#version-5) and everything went well and was working fine until I updated CiviCRM from 5.54.2 to 5.56.2. On the CiviCRM backend I received the following message:

Sorry, there was a problem we could not recover from. The server returned a "500 - Whoops, looks like something went wrong."

I changed PHP settings from 8 to 8.1 and received this message:

An error has occurred. 0 syntax error, unexpected token "readonly", expecting identifier. The Civi front-end was showing an error as well.

Prior to the upgrade the Joomla Pre-Update Check for Joomla 4.2.6 showed the following:

CiviCRM User Management- Potential Upgrade Issue CiviCRM System Listener- Potential Upgrade Issue System Novarain Framework- Potential Upgrade Issue Authentication - CiviAuthenticate Potential Upgrade Issue System Convert Forms- Potential Upgrade Issue

I disabled these plugins until after the upgrade, except for CiviAuthenticate that was updated of course. The rest of the plugins I reactivated because I had to reactivate CiviCRM System Listener. The other plugins I'm not sure about. Also not sure what you mean by "configure CiviAuthenticate."

Any advice?

Thank you Adrian for your response. Keith

---

Update! The problem is not only updating CiviCRM after upgrading to Joomla 4, I can't update CiviCRM while running Joomla 3.10 either. I'm currently running CiviCRM 5.54.2 and I've tried to update to CiviCRM versions 5.56.2, 5.57.1 and 5.58.0 and they break the system. The latest attempt using 5.58.0 installed fine until I did the update database routine and was promptly presented with a blank screen. Joomla is nagging me to update to PHP 8 but I'm not sure if CiviCRM likes it. I'm back to PHP 7+.

Thanks for any help, Keith

# Answer
That looks like you have the CiviAuthenticate plugin installed.

The current version of that is not compatible with Joomla 4, but there is a new version in progress. It will hopefully end up on this branch shortly (via this PR) but until then you can try my branch

Your upgrade sequence wants to be something like:

1. Make a note of your membership type and status settings
2. Switch to standard Joomla authentication, disable CiviAuthenticate
3. Upgrade to Joomla 4
4. Upgrade CiviAuthenticate to the new version
5. Configure CiviAuthenticate

Do that on a copy of your live site first and please leave some feedback on the PR.
> 1 votes

# Answer
Below are the steps I followed to resolve this issue. These steps worked for me, and if there's no risk for you, you can try them as well.

**Important**: Before starting these procedures, be sure to take a complete backup. I perform backups via SSH using the command: `for i in `cat /etc/trueuserowners | awk ' { print $1 } ' | tr -d :` ; do /scripts/pkgacct $i ; done` When I need to restore, I enter the `/home` directory and use the command: `/usr/local/cpanel/bin/restorepkg --skipaccount cpmove-joomla.tar.gz` for restoration.

1. First, download the latest CiviCRM version for Joomla, extract the ZIP file, and place it in the `/tmp/` directory.
2. Backup the files `/components/com_civicrm/civicrm.settings.php` and `/administrator/components/com_civicrm/civicrm.settings.php` to your computer.
3. Rename the com\_civicrm folder in the `/components/` and `/administrator/components/` directories to `com_civicrm2` or any other name of your choice.
4. Access **Joomla** \> **System** \> **Extensions** \> **Manage Extensions** and disable all extensions related to CiviCRM (do not uninstall, just disable).
5. Start the update from **Joomla** \> **System** \> **Extensions** \> **Install from Folder** using the path `/home/joomlaa/public_html/tmp/com_civicrm`. After installation, you will receive an error message; please disregard it.
6. Restore the backup copies of `/components/com_civicrm/civicrm.settings.php` and `/administrator/components/com_civicrm/civicrm.settings.php` to their respective locations.
7. Delete everything under the `/media/civicrm/templates_c` path.
8. Download the latest version of localization files and place them under `/administrator/components/com_civicrm`.
9. Access **Joomla** \> **System** \> **Extensions** \> **Manage Extensions** and re-enable all extensions related to CiviCRM (usually just CiviCRM).
10. Refresh the page where you received the error in Step 5 and start the database update. This time, the database update will proceed without any PHP errors, and the installation will be completed smoothly.

After these steps, I didn't experience any data loss or configuration changes.

If everything is successful, you can use SSH commands `rm -rf /home/joomla/public_html/components/com_civicrm2` and `rm -rf /home/joomla/public_html/administrator/components/com_civicrm2` to delete the folders you renamed for backup purposes.
> 1 votes

---
Tags: upgrade, joomla
---


# Question
Title: Mailing event queue error when upgrading from CiviCRM 5.66 to 5.67
Following up the php 8.1 issue ***PHP Fatal error: Uncaught IntlException: datefmt\_create: invalid locale: U\_ILLEGAL\_ARGUMENT\_ERROR*** have tried to jump to the latest 5.67.0 and got the one below, sticking with the "5.67.alpha1" version.

```
UPDATE civicrm_mailing_event_queue q INNER JOIN civicrm_mailing_job job ON job.id =
 q.job_id SET q.mailing_id = job.mailing_id, q.is_test=job.is_test
WHERE q.id >= 1000006 AND q.id <= 1500005 AND q.mailing_id IS NULL
[nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails
 (`civicrm_prod`.`civicrm_mailing_event_queue`, CONSTRAINT
 `civicrm_mailing_event_queue_ibfk_1` FOREIGN KEY (`mailing_id`) REFERENCES
`civicrm_mailing` (`id`) ON DELETE SET NULL)]

```

Checking for records violating the constraint returned zero results SELECT * FROM civicrm\_mailing\_event\_queue q WHERE q.mailing\_id IS NULL AND q.mailing\_id NOT IN (SELECT id FROM civicrm\_mailing);

Temporary workaround is to run the query manually with the "Enable foreign key checks" disabled, however this might be not quite right. Anyone else having the same luck? Any word of advice please? Thanks.

# Answer
There are orphan data in civicrm\_mailing\_job table. Below query should return you the count

```
SELECT count(*)
FROM civicrm_mailing_job j
  LEFT JOIN civicrm_mailing m
    ON m.id = j.mailing_id
WHERE m.id IS NULL;

```

To delete you can use

```
DELETE j.*
    FROM civicrm_mailing_job j
      LEFT JOIN civicrm_mailing m
        ON m.id = j.mailing_id
    WHERE m.id IS NULL;

```
> 6 votes

---
Tags: wordpress, upgrade
---


# Question
Title: Trouble with editing contributions with multiple line items
In a Drupal 7 site we are using webform\_civicrm for paid event registrations. The webform creates the contribution with the participant fee (civicrm\_participant line item) as well as other additional (civicrm\_contribution) line items. All is well until one goes to the edit form of the contribution and saves, this recalculates the total amount and tax amount and only includes the first line item (participant fee). Occasionally other line items have been manually added to the contribution with the line item edit extension and those are also civicrm\_participant line items, but also ignored.

I did some digging in the civi core code. In the contribution edit submit function it looks as if only civicrm\_participant line items are fetched if the contribution is recognised as a participant contribution. And while all the participant line items are added to the $params array, if the price set is quick config it seems deliberate that only the first one is used for the total amount and tax amount. All of our webform\_civicrm generated line items fall under the reserved quick config price set 1.

I ended up using some code to check and correct total\_amount, tax\_amount and net\_amount in a hook\_civicrm\_pre implementation, but I would love it if someone could shed some light on where the fault lies here.

# Answer
The short answer to my question (after discussion with CiviCRM and webform\_civicrm devs) is that quick config price sets were designed for single line item contributions, webform\_civicrm uses quick config for all contributions as there's no better alternative. So currently there is an unresolved compatibility issue with tentative plans to change Civi core to be more flexible. The triaged issue on the core repo is here.
> 0 votes

---
Tags: civicontribute, webform-civicrm, line-items
---


# Question
Title: How to stop people from registering other people
There are a number of places where CiviCRM gives a user the opportunity to register someone else for an event. In our case, this is undesirable behaviour.

We have tried using CSS to hide those messages, by replacing the .msg-text with text of our own, but inevitably this also causes us to hide important messages that shouldn't be hidden.

Is there a way in Civi to just prevent registering other people altogether? Or on a per-event basis perhaps?

Specific examples:

* If you have already registered for an event, and you go to the event page, Civi gives you an option to register someone else. So we used CSS to hide .msg-text.
* However, if you have an event that has a registration limit, the same .msg-text CSS placeholder is used to say the event is full.

Is there a better way to do this?

Thank you

# Answer
Yea, its difficult to hide the message from the status using CSS. You write JS to remove the tag inside the .msg-text. But the user will still be able to register using the URL

We have an extension that over-rides the status message and restricts the user to registering using cid=0 from the URL.
> 3 votes

---
Tags: civievent
---


title: Summary report conversion

text:
# Question
Title: Summary report conversion
Can you convert a detailed report to a summary report, and visa versa? I have looked everywhere and can not find out how to do it. Many thanks Mike

# Answer
If you mean take a detailed report and from it create a summary report with the same criteria, there is no provision to do this. You just have to add the criteria manually to the new report.
> 2 votes

---
Tags: civireport
---


# Question
Title: Move payment for civievent to the confirmation page
Is there a way to move the payment options to the confirmation page for events? I am using the onmnipay extension to work with paypal checkout. In order to move on to the confirmation screen, the user must pay first. This also makes it difficult for users to register more than one person at a time. Any help would be appreciated, Thank you!

# Answer
> 1 votes
As of 5.63 there is a setting at Administer - CiviEvent - CiviEvent Component Settings to enable this.

---
Tags: civievent, payment-processor, omnipay
---


# Question
Title: Import Contacts Issue After Joomla 4.4.0 Upgrade - Stuck at 'Running Queue
I am using CiviCRM 5.64.2. A few days ago, I upgraded Joomla from version 4.3.0 to 4.4.0. Normally, I used to import a list of user data that I receive daily with a CSV file separated by semicolons using the 'Import Contacts' option. I did this for two days after the Joomla update. Today, I am unable to import with both the old and newly created CSV files. The process hangs at the screen as seen in the screenshot.

When I click the Retry button, nothing changes. When I click the Skip button, it terminates the process and does not import any data.

The data source, Mapping Steps, and Preview steps all look normal. However, when I click 'Import,' there is no progress in the 'Running Queue' screen. Previously, using this method, I could import 400-500 records at once, but now it won't import even a single one. I have also tried this on a different system with the same Joomla and CiviCRM versions, and the issue persists. I request your support to find a solution to this problem.

It could be related to the CiviCRM update, but there is an issue with the update. Detailed information about this problem can be found at Upgraded to Joomla 4, now unable to upgrade CiviCRM.

Information about the errors in the Error.Log file is also available at https://lab.civicrm.org/dev/joomla/-/issues/51#note\_92343.

# Answer
Below are the steps I followed to resolve this issue. These steps worked for me, and if there's no risk for you, you can try them as well.

**Important**: Before starting these procedures, be sure to take a complete backup. I perform backups via SSH using the command: `for i in `cat /etc/trueuserowners | awk ' { print $1 } ' | tr -d :` ; do /scripts/pkgacct $i ; done` When I need to restore, I enter the `/home` directory and use the command: `/usr/local/cpanel/bin/restorepkg --skipaccount cpmove-joomla.tar.gz` for restoration.

1. First, download the latest CiviCRM version for Joomla, extract the ZIP file, and place it in the `/tmp/` directory.
2. Backup the files `/components/com_civicrm/civicrm.settings.php` and `/administrator/components/com_civicrm/civicrm.settings.php` to your computer.
3. Rename the com\_civicrm folder in the `/components/` and `/administrator/components/` directories to `com_civicrm2` or any other name of your choice.
4. Access **Joomla** \> **System** \> **Extensions** \> **Manage Extensions** and disable all extensions related to CiviCRM (do not uninstall, just disable).
5. Start the update from **Joomla** \> **System** \> **Extensions** \> **Install from Folder** using the path `/home/joomlaa/public_html/tmp/com_civicrm`. After installation, you will receive an error message; please disregard it.
6. Restore the backup copies of `/components/com_civicrm/civicrm.settings.php` and `/administrator/components/com_civicrm/civicrm.settings.php` to their respective locations.
7. Delete everything under the `/media/civicrm/templates_c` path.
8. Download the latest version of localization files and place them under `/administrator/components/com_civicrm`.
9. Access **Joomla** \> **System** \> **Extensions** \> **Manage Extensions** and re-enable all extensions related to CiviCRM (usually just CiviCRM).
10. Refresh the page where you received the error in Step 5 and start the database update. This time, the database update will proceed without any PHP errors, and the installation will be completed smoothly.

After these steps, I didn't experience any data loss or configuration changes.

If everything is successful, you can use SSH commands `rm -rf /home/joomla/public_html/components/com_civicrm2` and `rm -rf /home/joomla/public_html/administrator/components/com_civicrm2` to delete the folders you renamed for backup purposes.
> 2 votes

---
Tags: contacts, joomla, import, data-import
---


# Question
Title: Where's the smart group profiler in 5.67?
The release notes for 5.67 says 'Smart groups: a smart group profiler was added to help identify slow smart groups'. Where is this profiler? - I can't see it in the menu, and it doesn't seem to be an extension.

# Answer
Set CIVICRM\_SLOW\_SMART\_GROUP\_SECONDS to 5 or something in civicrm.settings.php and then whenever the smart group cache is filled it will log warnings in ConfigAndLog when a group takes longer than that to compute.
> 1 votes

---
Tags: smartgroups
---


# Question
Title: SearchKit - Can't figure this out - works until I add a second join
I asked a question about CSV downloads and was suggested to look at SearchKit to make this work. I have a SQL command that works, but just lists the contents.

```
select civicrm_registered_dogs.registered_name as DogName, civicrm_dog_scores.Event as Event, civicrm_trial_levels.description as LevelDescript,  civicrm_dog_scores.Stream as Stream, civicrm_dog_scores.Score as Score, civicrm_trial_levels.MaxPoints as MaxPoints, civicrm_dog_scores.Pass from civicrm_dog_scores
inner join civicrm_registered_dogs ON civicrm_dog_scores.DogId = civicrm_registered_dogs.id
inner join civicrm_contact ON civicrm_contact.id = civicrm_registered_dogs.contact_id
inner join civicrm_trial_levels ON civicrm_dog_scores.Rules = civicrm_trial_levels.Id
where DogId=".$id." ORDER by Event"`

```

First thing I did was make sure the custom table definitions were correct and the foreign keys were correct. I think I have it all correct.

> ```
> <field>
> <name>Rules</name>
> <type>varchar</type>
> <length>5</length>
> <comment>FK to Trial Levels</comment>   </field>   <primaryKey>
> <name>Rules</name>
> <autoincrement>false</autoincrement>   </primaryKey>   <foreignKey>
> <name>Rules</name>
> <table>civicrm_trial_levels</table>
> <key>Id</key>   </foreignKey>   <field>
> <name>DogId</name>
> <type>int unsigned</type>
> <comment>FK to Registered Dogs</comment>   </field>   <primaryKey>
> <name>DogId</name>
> <autoincrement>false</autoincrement>   </primaryKey>    <foreignKey>
> <name>DogId</name>
> <table>civicrm_registered_dogs</table>
> <key>id</key>   </foreignKey>
>
> ```

Above is the scores table segment that defines the Rules field and the foreign key to the trial\_levels table. I included the DogId for comparison. The trial levels look like this:

```
<table>
  <base>CRM/Dogregistry</base>
  <class>TrialLevels</class>
  <name>civicrm_trial_levels</name>
  <comment>FIXME</comment>
  <log>true</log>
  <field>
    <name>Id</name>
    <type>varchar</type>
    <length>5</length>
    <required>true</required>
    <comment>Unique TrialLevels ID</comment>
    <html>
      <type>Number</type>
    </html>
  </field>
  <primaryKey>
    <name>Id</name>
    <autoincrement>false</autoincrement>
  </primaryKey>
  <field>
    <name>Description</name>
    <type>varchar</type>
    <length>50</length>
    <comment>Description</comment>
  </field>
  <field>
    <name>Level</name>
    <type>INT</type>
    <length>6</length>
    <comment>Level</comment>
  </field>
  <field>
    <name>MaxPoints</name>
    <type>INT</type>
    <length>6</length>
    <comment>Maximum points</comment>
  </field>
  <field>
    <name>PassPoints</name>
    <type>INT</type>
    <length>6</length>
    <comment>Pass points</comment>
  </field>
  <field>
    <name>Weight</name>
    <type>INT</type>
    <length>6</length>
    <comment>Weight</comment>
  </field>

</table>

```

In SearchKit, I can create a search for DogScores, select the join to registered\_dogs and I get results. The Output from an export of the search:

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Dog_Scores",
          "label": "Dog Scores",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "DogScores",
          "api_params": {
            "version": 4,
            "select": [
              "id"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "RegisteredDogs AS DogScores_RegisteredDogs_DogId_01",
                "LEFT",
                [
                  "DogId",
                  "=",
                  "DogScores_RegisteredDogs_DogId_01.id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

As soon as I add the Trial Levels table I no longer get any output and under the QueryInfo block it no longer shows the SQL Like it did in the working search. Below is the NON-working search:

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Dog_Scores",
          "label": "Dog Scores",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "DogScores",
          "api_params": {
            "version": 4,
            "select": [
              "id"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "RegisteredDogs AS DogScores_RegisteredDogs_DogId_01",
                "LEFT",
                [
                  "DogId",
                  "=",
                  "DogScores_RegisteredDogs_DogId_01.id"
                ]
              ],
              [
                "TrialLevels AS DogScores_TrialLevels_Rules_01",
                "LEFT",
                [
                  "Rules",
                  "=",
                  "DogScores_TrialLevels_Rules_01.Id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

```

I'm not sure why its doing what it is - any pointers would be very welcome! I know it is a long post but wasn't sure where to even start to figure out why - there didn't seem to be any logs providing errors or anything.

TIA

# Answer
The solution is that after updating your schema xml files, you need to run the command `civix generate:entity-boilerplate`. This will update your generated DAO files so that SearchKit can use the metadata.
> 1 votes

---
Tags: extension, searchkit, formbuilder, custom
---


title: Conditional email receipt subject line

text:
# Question
Title: Conditional email receipt subject line
I am using a contribution page to sell an item. I would like to enable the receipt section so that people get an email confirmation of their purchase.

My problem is that our receipt (on-line) template uses the subject line "Thank you for your donation - tax receipt for \[contribution page title\]"

Obviously this is not a donation and no tax receipt will be issued (the non-deductible amount equals the purchase price).

I don't know enough to edit the current code to achieve this, hoping someone can help.

I do need to keep the "if pay later" then "invoice" part as well.

`{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Thank you for your Donation, Tax Receipt for{/ts}{/if} - {$title} - {contact.display_name}`

# Answer
> 0 votes
Checked on one of our sites and what I am seeing is that for Financial Type 6 we are using

> {if $ft\_id == 6}

---
Tags: contribution-page, receipts
---


# Question
Title: Civicrm German Language not displaying even when set to German after upgrade to 5.65.2
Salut. I have all language files and databases in the right place, I can choose German in the language selector, but the menu and everything else stays English (even when I switched to single-language instead of multi-language system, with focus German). Also when I choose the option to prioritize the language from the CMS (Wordpress in German), it still displays in English. No problem before the upgrade to 5.65.2 What can I do? Thank you for any hints.

# Answer
> 2 votes
---

First message:

---

**Possible solution - will be tested here - :**

* disable in the admin interface all except language EN
* remove the installed language files in /l10n/ and /sql/
* ... (to check what is inside the MySQL data base...)
* install again using the extension " uplang ".

**here what I have tested so far for the same problem:**

**CIVICRM: Same problem here for new installed**

* DRUPAL 10.1.5.
* CIVICERM 5.66.0
* Language files: Had been installed manually.
* Configuration: "Language is inherited" from DRUPAL setting.

**DRUPAL: All 4 languages working properly:**

* EN DE FR ES
* Based on "Language Switcher" of DRUPAL.
* + (for CIVICRM: Same name. Not yet checked in detail.)

**CIVICRM: Working fine for EN FR ES**

* If DE is selected, then CIVICRM continues to use the last language, e.g. EN FR ES.

**CIVICRM: I installed in addition**

* then afterwards the version "German (Switzerland)". There was no corresponding additional checkbox then in the CVCRM admin interface for Localization.

**CIVICRM: I installed uplang . So far no effect.**

* I tried several other possible solutions. So far no success.

---

---

second message - some hours later:

---

---

**The problem has been settled.**

Due to various configuration steps until the final success, the cause of the final success can not be identified reliably.

**The probable success cause is:**

* I enabled "German (Switzerland)"
* and I disabled: the language option just "German"

**Besides this, the following configuration steps were tried, too:**

* Disable, enable both German variants in the list of optional languages.
* Set for CIVICRM the German language to the "contact" language, then revert to the setting "inherit the CMS DRUPAL setting".

**Software problem?** And I played with other options. But the most probable success cause is: Setting to "German (Switzerland)". In both cases, the DRUPAL language switcher sets to /de/

So DRUPAL only knows 1 option for "de" and CIVICRM knows 2 options. This might be the reason.

---
Tags: wordpress, language
---


# Question
Title: CIVICRM menu not showing any output on frontend Joomla
Recently i updated site to Joomla 4 and also updated CIVI CRM to latest version All works fine with upates steps. Issue is on frontend no CIVI crm menu item working on Joomla 4 It just show on content output from the menu. if turned off system URL

With SEF OFF or if copy the menu system URL its works fine /index.php?option=com\_civicrm&view=Dashboard&task=civicrm/user&reset=1&itemid=294

Any clue where its get broken in CIVI. The routing seems not working

# Answer
I am struggling with the same issue. Probably you use URL rewriting to get rid of /index.php/. But in the case of CiviCRM pages the page doesn't work without /index.php/. With 1000s of articles in the site and 100s of pages I can't go back to switching off rewriting. Anyone who knows how to work around this issue?
> 0 votes

# Answer
fixed as menu link will be change when its active via a Joomla menu module and show a different url. CIVI menu url are not sef.
> 0 votes

---
Tags: joomla
---


# Question
Title: How to download SearchDisplay results as a PDF via API4
I'm looking to take periodic PDF snapshots of a SearchDisplay's output for archiving purposes.

I see Demerit's option as a possible solution, but in my tests so far the `cv api4 SearchDisplay.download` call only generates a blank output file.

My code is similar to this sample code:

```
cv api4 SearchDisplay.download savedSearch=saved_search_name display=search_display_name format=csv > report.csv

```

When I run the same command in the API Explorer v4 with output to `array`, I see the correct values.

But when I run the same code via a bash script, the output file is empty. It does generate the output file, but it's blank. I get the same empty file when I run the script with other output formats like `csv` and `pdf`.

It's probably something simple. I'm just stuck. Any ideas?

Thanks.

Civi 5.65.0 + Drupal 10.

# Answer
> 5 votes
you need to specify `--user` parameter in the cv API call otherwise the fetch will be treated as anonymous user and will return blank results if the results don't have access to an anonymous user. Providing `--user` will give you result if the cms user specified has access to the data.

eg `--user=cmsusername`

HTH

Pradeep

---
Tags: searchkit, pdf
---