# Question
Title: Participants vs Activities vs Cases for custom functionality
I plan to add some semi-custom functionality and I'm not sure if the best way to implement this would be through participants, activities, cases or perhaps even something else.

Here is a sketch of what I hope to put together:

1. A teacher fills out a form to request a field trip for their class, providing various details.
2. The coordinator selects certain requests for approval, assigning an educator to that request. An email is sent to the educator, with the details the teacher submitted.
3. One of the details that the teachers submit are three date options for their field trip. The email to the educator contains a link that takes them to a form that allows the educator to select one of these three dates — or enter an alternate date if none of these dates work (after emailing the teacher, but that doesn't need to be in CiviCRM).
4. Once the date has been selected, the teacher and the educator receive a confirmation email that lists all of the details of their field trip. This email contains a link to pay online and details to submit payment offline (this could also be a separate invoice email). Ideally, invoices that remain unpaid 7 days before the field trip receive a follow up email, but this is not essential.
5. Once the field trip date has passed, the teacher receives an additional email asking them to fill out a feedback form. Ideally, the fact that they have filled out the form is linked to the field trip.
6. Our admin team pays the educator, ideally with the fact that they have been paid attached to the field trip (though we don't need the payment details).

My intent is to use FormBuilder, Search Tasks and CiviRules for this. I think I can sketch this out as an activity or a participant, but neither are ideal. A case seems to make sense as well, but I'm less familiar with cases so this is less clear to me.

I'm not entirely sure how I'll implement the form in Step 3 (selecting one date from a set of three options) in FormBuilder. Worst case, the educator has to copy-paste their selected date into a date field.

I'd appreciate anyone's thoughts on which entity to use or other aspects of the implementation. Thanks!

# Answer
(keeping out of the 'to use FormBuilder or not' part of the question)

If 1/ was an Activity, then Activity can be Assigned to the Educator by the Coordinator (which should/could trigger the email)

If 3/ was three custom date fields, then when the Educator chooses their preference they could then set this Activity to be Scheduled to that date.

For 4/ you could potentially use the Activity Status via civirules to trigger the email which contains a link to a contribution page, with the link setting the amount to pay (can be done but don't recall the parameters to use)

For 5/ you could potentially use a 'follow up' Activity based on the original Activity
> 2 votes

---
Tags: custom-fields, civicase, activities, participants, formbuilder
---


# Question
Title: Mosaico template list table not rendering
I'm having an issue with Mosaico template list table rendering.

I can see the AJAX response containing the template data, but the table isn't rendering the data.

Table data request URL /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fajax%2Fapi4

```
[
    {
        "values": [
            {
                "data": {
                    "id": 1,
                    "title": "Test template",
                    "base": "versafix-1",
                    "category_id:label": "Newsletter"
                },
                "columns": [
                    {
                        "val": null
                    },
                    {
                        "val": null
                    },
                    {
                        "val": null
                    },
                    {
                        "val": null,
                        "cssClass": "text-right"
                    }
                ],
                "cssClass": "",
                "key": 1
            }
        ],
        "labels": [],
        "entity": "SearchDisplay",
        "action": "run",
        "debug": null,
        "version": 4,
        "count": 1,
        "countFetched": 1
    }
]

```

Using WP 6.2, CiviCRM 5.50.4 Mosaico 3.2

Any help much appreciated.

# Answer
> 0 votes
Mosaico 3.2 says it requires CiviCRM 5.59 and it looks like you only have 5.50.4, so it seems likely that's a problem as the page you are having trouble with is SearchKit-based, which is an area of CiviCRM that sees quite a bit of active development and would have changed quite a bit between 5.50 and 5.59.

Welcome to CiviCRM, BTW.

---
Tags: mosaico
---


# Question
Title: I have the dreaded "[unauthorized: Authorization failed" error on a WordPress dev site
We're testing CiviCRM to determine if it's fit for our purpose. Tests were going well until we hit an unexplained snag for which we can't find a definitive fix. The error is as follows ..

**Fatal error: Uncaught CRM\_Core\_Exception: \[unauthorized: Authorization failed thrown in /home/account/site/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php on line 232**

We're running version 5.64.1 in WordPress. The host is a cPanel host using PHP 8.0.

I can't seem to find a clear answer on how to fix this. Can anyone advise on what to do to overcome this, please?

# Answer
> 0 votes
Sorry this is your first experience with CiviCRM! Usually it works fine but yes it's good to know how to recover from a crash. They are usually caused by installing a buggy or incompatible plugin or extension.

The way to track down mysterious errors generally involves enabling the `debug` and `backtrace` settings in CiviCRM. You can do this in the UI by selecting **Administer -\> System Settings -\> Debugging and Error Handling** in the menubar.

Or if CiviCRM is so broken that you can't use the UI, you can do it on the command line:

```
cd path/to/your/wp-content/plugins/civicrm/civicrm/
cv setting:set debug=1
cv setting:set backtrace=1

```

**Note:** these settings should never be left on for a production site!

Then when you see the error again it will have much more detail, and the backtrace will generally lead back to a specific plugin or extension that's causing the problem.

Once you find the culprit you can disable it (or even if you don't, a good guess would be to disable the last extension you installed):

```
cd path/to/your/wp-content/plugins/civicrm/civicrm/
cv dis name_of_extension
cv ext:uninstall name_of_extension

```

---
Tags: wordpress, api, core
---


# Question
Title: Advanced Filter for an Entity Reference Custom Field doesn't filter by Contact Groups
I'm looking to convert a few custom fields from type "Contact Reference" to "Entity Reference".

However when I convert the fields, the autocomplete "advanced filter" stops working.

```
action=lookup&group=106

```

**BEFORE**
As a Contact Reference field, the advanced filter works fine and displays only the contacts in the specified contact group.

**AFTER**
When it becomes an Entity Reference field, the autocomplete displays ANY contact of any type, totally ignoring the filter.

I have tried playing with the advanced filter parameters but no luck. I don't see any relevant documentation.

Any ideas?

# Answer
The difference between the old ContactReference and the new EntityReference fields is that the former uses APIv3 and the latter uses APIv4. There are subtle differences in the parameters of each. If you notice, the help text underneath "Advanced Filter" actually changes a bit when you switch to EntityRef and it gives you a working example of how to filter by contact type and group.

For a full list of available filters, use the APIv4 Explorer (Under **Support -\> Developer** in the menubar). Any fields available in the "Where" clause for Contact.get can be used as filters.
> 1 votes

---
Tags: custom-fields, entity-reference
---


# Question
Title: Adding "Phone" Option to the "New Individual" Section on CiviCRM Homepage
I am looking to add a "Phone" option within the "New Individual" section on the CiviCRM homepage. However, I am unable to locate where this customization can be made. Can you please provide guidance on this matter?

I access the "Administer \> Customize Data and Screens \> Profiles" section. Here, under the "User-defined Profiles" section, I added the "Contacts - Phone - Primary" option to both the "Supporter Profile" and "Your Registration Info" profiles. However, there was no change in the field on the main page. An example screenshot is provided below.

Subsequently, I also added the "Contacts - Phone - Primary" option to the "New Individual" profile under the "Reserved Profiles" section, but there was still no change in the field on the main page. An example screenshot is provided below.

# Answer
> 0 votes
Edited: I thought this was a profile, but it is not. It has the same name as a profile and the same fields, but it is actually a template, see comments below.

---
Tags: profile, joomla, phone, individual
---


# Question
Title: Permanently delete more than 100k trashed records
Is there a proper way to permanently delete more than 100k records already in trash ? For instance, Is there anyway to do this using the API ?

# Answer
> 1 votes
You can do it from the API4 explorer(CiviCRM \>\>\> Support \>\> Developer \>\> API4 explorer).

---
Tags: api, delete, clean
---


# Question
Title: CiviMail unique sender cause problems with spam filters
When I try to send a mailing, the spam filter detects new users (taken from the unique address) and prevents them from sending out.

Is there a workaround for this?

# Answer
> 1 votes
It turned out to be a setting in the outgoing spam filter. One of the rules is to check for new email addresses. If there are many, this may be a problem. But civi creates the email addresses for replies and bounces.

---
Tags: civimail, spam
---


title: Sort (display) expense

text:
# Question
Title: Sort (display) expense
I use the Expenses extension to keep tracking expense in my organization. It was ok when we had only few entries. But now we have more than 40. Is it possible to show newest on top and oldest on bottom...how do i sort out that? Thanks

# Answer
> 0 votes
You can search for expenses using SearchKit, which will allow you to sort and display them any way you desire.

Note that each Expense is broken out into one or more Expense Lines. The Expense stores the date, type, status, etc. and the expense line stores the amount. Depending on how you want to display them, you can use either as the basis of the search and then add ("With") the other. Here is an example search of Expenses WITH Expense Lines:

There is much more you can do with SearchKit, including grouping, filtering, and multiple ways to create a display, but this should get you started. For more general documentation on SearchKit, see https://docs.civicrm.org/user/en/latest/searching/searchkit/what-is-searchkit/

---
Tags: display
---


title: Outdated tokens in use

text:
# Question
Title: Outdated tokens in use
we have the following in the CiviCRM System Status, we tried to solve it with no luck, is it related to some template some where? Can you please help?

1. Please review your contribution\_invoice\_receipt message template and remove references to the token {$display\_name} as it has been replaced by {contact.display\_name}
2. Please review your membership\_offline\_receipt message template and remove references to the token {receipt\_text\_renewal} as it has been replaced by {receipt\_text}
3. Please review your pledge\_reminder message template and remove references to the token {$domain} as it has been replaced by {no longer available / relevant}
4. Please review your pledge\_reminder message template and remove references to the token {$contact} as it has been replaced by {no longer available / relevant}

# Answer
> 0 votes
Did you try the solution from when you asked this question a few days ago?

---
Tags: tokens
---


# Question
Title: Why does Drupal 9 complain when my CiviCRM cron runs?
I have a D9/Civi site and the main Civi cron is set up to run every 5 minutes using `cv` :

`/usr/local/bin/cv api job.execute --user=xxx --cwd=/home/xx/sites/default/web --quiet`

The cron job runs, but I get an email every time which reports:

```
In Drupal.php line 179:

 \Drupal::$container is not initialized yet. \Drupal::setContainer() must be
  called with a real container.

```

How can I stop this from happening? Is it do with the permissions of the selected user?

# Answer
> 3 votes
I have one Drupal 9 site with this problem, and several more that don't. I don't know the root cause of the issue, but I know that adding `--level=cms-full` to the `cv` command fixes the issue.

# Answer
> 2 votes
So, if your civicrm system jobs are all running, then the question is about where the extra Drupal error email is coming from (regardless of whether it gets emailed to you or just displayed on the command line when you don't use --quiet).

The success of the manual run suggests one of your system jobs is generating that message but not quitting in any fatal way.

I'd recommend that you look through your individual system jobs that run with each cron and run them individually via the web interface and see if they give you any clues.

If that doesn't help, or if you're happy enough on the command line, you can just run them each via the command line (the civicrm system cron is just a way of selecting and running individual system jobs).

I'd guess it's coming from an older extension that doesn't play well with modern Drupal, or a Drupal module that's implementing a civicrm system job.

# Answer
> 1 votes
Two thoughts:

* Check the version of `cv`.
* I don't use the `cwd` option so maybe it does something different for boot ordering, and I notice `sites/default/web` is an odd path but you might just have typed that as an example. If that is the right path and it's maybe the use of `cwd`, then an alternate is change your task to be `cd /home/xx/whatever; /usr/local/bin/cv api3 ...etc...`

---
Tags: drupal, cron, drupal-9, cv
---


title: How to upgrade Civix v21.04

text:
# Question
Title: How to upgrade Civix v21.04
I am trying to upgrade the Civix code in one of my extensions but it does not seem to be working. Civix is currently at v21.04.1, and the latest version is 23.08. I am following the directions in the Civix UPGRADE.md file in the 21.04 version on Github at `https://github.com/totten/civix/blob/v21.04.1/UPGRADE.md`

The generate:module command runs OK, and says that it is writing `[my ext].civix.php` but afterwards `civix -v` still reports the same version, and git reports no changes have been made to that file (a space has been removed from one line in `info.xml`). See the attached screenshot.

Any help gratefully received. Tony

# Answer
> 1 votes
`civix -v` tells you the version of civix that you have on your machine (not the version of civix that the extension has been updated to). So the problem is your local version of civix is not up to date.

As it says in the civix readme, to update civix, you just need to download the latest version. Once you've done that, do `civix -v` to confirm you're on the latest version and then you can follow the instructions to upgrade your extension (note these are the up to date instructions, the ones you linked to are out of date).

You can check the civix version of the extension by looking in the `info.xml` file in the extension.

---
Tags: upgrade, civix
---


title: Email timeouts breaking contributions?

text:
# Question
Title: Email timeouts breaking contributions?
On our CiviCRM site, the email servers we were using have been unavailable for several days now. WordPress 6.3, CiviCRM 5.64.0, using WP Mail SMTP plugin to avoid problems with our virtual Linux host being seen as less than ideal to send email from by the various spam protection authorities out there). I noticed that when we could no longer connect to the SMTP provider we were using before, this would cause CiviContribution errors. Transactions still pending, even though payment went through, because it could not send the receipt email. Acknowledging the whole "email should work" resolution, which is being worked on already, is there some way to make sure that the contribution workflow does NOT depend on email servers being reachable, within CiviCRM? The workaround until our mail server issue is resolved was to go back to locally sending mail, so the problem is really in the free version (non-profit, etc.) of WP Mail SMTP never returning, causing the php-fpm timeout. But the contribution itself seems to really want to send that email before it marks the transaction as complete, which I think is a bit backwards. Mark transaction complete and then send email. If the email system throws an error, at least the transaction is done and you can resend the receipt later.

Make sense? Any way to change the process so it happens in this order?

Thanks.

Michael Matthews

# Answer
It looks like around here, specifically for memberships and depending on the exact details, APIv3 Contribution completetransaction is being used, which includes sending the email, then maybe rolls back the contribution being updates to completed when the email sending fails or something along those lines.

Seems like a bug to me, I'd log it at https://lab.civicrm.org/groups/dev/-/issues/.
> 1 votes

# Answer
Agreed that failing to send emails shouldn't have an effect that disastrous.

I've seen this occasionally over the years, but never tracked it down.

A PR to catch errors while sending receipts would be a Good Thing.
> 0 votes

---
Tags: civicontribute, smtp, pending
---


# Question
Title: Outbound Twilio SMS to group - Will send to some, but not all
We have Twilio SMS set up and it works great for the most part.

The issue we are having, however, is trying to send to a group of contacts. The group has 137 individual contacts in it. When I try to set up the SMS to the group, it picks 25 contacts that it can send to and displays an error message at the top that says: "SMS will NOT be sent to 112 contacts - (no phone number on file, or communication preferences specify DO NOT SMS, or contact is deceased)."

Here is what I have done to troubleshoot this:

* All of the contacts in the group have their communication preferences such as it will allow SMS; in other words, DO NOT SMS is not checked for any of the contacts in the group
* All of the contacts have a mobile phone number in their record. The records that do work have a work mobile and the records that do not work have a work mobile.
* None of the contacts are deceased
* I have selected several contacts that it says it cannot send to and tried to send them an individual SMS which works.
* It clearly is not close to the 200/day limit.

What am I missing?

# Answer
Are you using an old version of CiviCRM, before 5.49? It looks like this was fixed in 5.49.
> 1 votes

---
Tags: groups, sms, twilio
---


# Question
Title: Error when Paypal Checkout payment is processed
I'm setting up a membership form using a contribution page. I've installed the "Omnipay multiprocessor support" and have it set up for sandbox payments. When I complete the process and I'm returned to the site, I get a critical error page.

The php error logs show the following error:

```
[25-Aug-2023 19:51:19 Australia/Brisbane] PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php:294
Stack trace:
#0 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(294): array_merge(Array, NULL)
#1 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(1345): CRM_Contribute_Form_Contribution_Confirm->preProcess()
#2 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php(1102): CRM_Contribute_Form_Contribution_Main->skipToThankYouPage()
#3 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(617): CRM_Contribute_Form_Contribution_Main->postProcess()
#4 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(153): CRM_Core_Form->mainProcess()
#5 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(120): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#6 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#7 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Main), 'upload')
#8 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle('upload')
#9 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Core_Controller->run(Array, NULL)
#10 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)
#11 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)
#12 /home/xxx/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke(Array)
#13 /home/xxx/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(380): CiviCRM_For_WordPress->invoke()
#14 /home/xxx/public_html/wp-includes/class-wp-hook.php(310): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#15 /home/xxx/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#16 /home/xxx/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#17 /home/xxx/public_html/wp-includes/class-wp.php(796): do_action_ref_array('wp', Array)
#18 /home/xxx/public_html/wp-includes/functions.php(1335): WP->main('')
#19 /home/xxx/public_html/wp-blog-header.php(16): wp()
#20 /home/xxx/public_html/index.php(17): require('/home/xxx/pub...')
#21 {main}
  thrown in /home/xxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php on line 294

```

This is the first time I've tried to set up civicrm, so I'm a little lost on this one.

Edit: running Civicrm 5.64.1

# Answer
The line in question (line 294 of `<civiroot>/CRM/Contribute/Form/Contribution/Confirm.php` looks like this:

```
$this->_params = array_merge($this->_params, $preApprovalParams);

```

You can fix this error by changing it to this:

```
$this->_params = array_merge($this->_params, $preApprovalParams ?? []);

```

Now this isn't an ideal solution, because that won't survive a Civi upgrade. The root problem appears to be in the OmniPay extension, in the doPreApproval function.

I don't use OmniPay so can't check myself - but looking at that function, it seems like the only way it wouldn't return a value would be if an error occurred, and that would be in your CiviCRM logs. See if your log files show any errors that have a matching timestamp?
> 0 votes

# Answer
Is there a reason you're using Omnipay rather than the inbuilt Paypal processor? (I think I read on Mastodon you saying you were just wanting to integrate Paypal?)
> 0 votes

---
Tags: wordpress, civicontribute, paypal, omnipay
---


# Question
Title: Drupal webform registration processing payment via Stripe but user/contact is not completing registration
Drupal webform for event registrations using Stripe as payment processor is receiving payments but not completing the event registration

Using Drupal 9, Civi 5.64.2, Stripe 6.9

Error in Civi Config and Log is: Aug 28 11:10:20 \[debug\] Pay by Credit Card No matching contributions for event evt\_3Nk750LNY7Ta5lgY1t1RmdEr

Aug 28 11:10:20 \[info\] Contribution 1912 updated successfully

# Answer
Not sure if this is a complete fix or not but found that Civi configuration included an option for pay later which was not used in Drupal because we have had other issues trying that in the past.

By removing the "unused" pay later option we were successfully able to complete a payment with the requisite registration.

A caveat is that the application had already collect payments and completed registrations for 75 registrants before this issue popped up. Strange that it worked and then stopped as nothing was modified at that point or at all after registration started. Putting it down as spooky actions at a distance!
> 1 votes

---
Tags: civievent, registration, stripe
---


# Question
Title: Allowing group management to users with limited permissions
This may be a shortcoming or bug to-do with access control, but maybe I'm missing something.

I've setup Drupal permissions and ACLs and they are working 100% except for one thing: users can only view the groups for which they explicitly have an ACL for. In other words, only users with CMS permission to "View all contacts" can view groups they themselves created.

Am I correct in assuming that this is a shortcoming, or is it a bug? Either way, what are y'alls suggestions for allowing users be able to create, edit and manage their own groups without giving them "View all contacts"? Is there a way to do it using hook\_civicrm\_aclWhereClause?

# Answer
Yes, this is a shortcoming in the current acl system.

One possible workaround for this might be to implement the post hook on the civicrm\_group object. The post hook can take the contactID of the person creating the group and add an ACL giving this person access to the group.

You can implement the above hook in an extension. Probably worth considering including this in core need on a setting
> 2 votes

# Answer
I a temporary workaround until I have time to fix permissions. It hooks the create group form and prevents users from creating groups whom don't have permission to "edit all contacts".

```
function memberperms_civicrm_buildForm( $formName, &$form ) {
    if (strpos($formName, "AddToGroup")
        and
        !CRM_Core_Permission::check('edit all contacts')
    ) {

        // Display Error Message
        CRM_Core_Session::setStatus("Sorry, the group feature is not currently supported for members", "Permission Denied", "error");

        // Redirect to civicrm home
        drupal_goto("civicrm");
    }
}

```
> 1 votes

# Answer
This is old, but just in case anyone finds it, I *think* my Auto Group Extension solves this problem.

> # CiviCRM AutoGroup extension
>
> This extension allows you to choose a set of groups which will be added to new contacts if the logged in contact is also in that group.
>
> e.g. If Staff member Wilma is in the group 'Region: Birmingham' and Wilma adds a new contact, it can automatically add the new contact into 'Region: Birmingham' group.
>
> ## Why this was created
>
> If you are using Access Control Lists (ACLs) to restrict access based on groups, e.g. a client of ours has a regional model whereby staff in different regions only access contacts for that region, then it's annoyingly easy to add a contact and immediately lose access to it because you forgot to add them into your regional group.
> 0 votes

---
Tags: permissions, acl
---


# Question
Title: How to check for address type and NULL with a Smarty token after Smarty changes in 5.63?
I am getting two issues after upgrade from 5.58 to 5.63 related to Smarty in message templates.

In one case, the location\_type\_id no longer seems to valid.

```
{capture assign=type}{contact.address_primary.location_type_id:label}{/capture}
{if $type == Work}{$employer}{/if}

```

> syntax error: (secure mode) 'Work' not allowed in if statement (Smarty\_Compiler.class.php, line 1398)

Perplexingly in the other, != NULL does not see to be a valid operator value combination.

```
{capture assign=donor_port}{contact.custom_65}{/capture}
{if $donor_port != NULL}
Donor Portfolio: {$donor_port}
{/if}

```

> syntax error: (secure mode) 'NULL' not allowed in if statement (Smarty\_Compiler.class.php, line 1398)

Any ideas what the replacements for these are, is there **new syntax documentation?**

# Answer
I'm not sure these changes would be considered a "new" syntax rather than a stricter enforcement of existing syntax, causing heretofore-unnoticed syntax errors to rear their heads.

For the first, the string needs to be quoted. Unquoted strings throw a notice at least, or I think an error in later versions of PHP. So it should be:

```
{if $type == 'Work'}{$employer}{/if}

```

For the second, `{capture}` always captures a string (whatever is inside the `{capture}{/capture}`) so will never be anything other than a string. You could change your conditional to `{if $donor_port != ''}`, or simplify it further to `{if $donor_port}`.
> 3 votes

---
Tags: civimail, smarty
---


# Question
Title: Using a CiviDiscount codes to give different discounts on one donation page price set depending on logged in role/membership tier
Trying something a bit unusual, again. Searched this site and didn't quite find any answers.

What I have in mind is using a contribution page tied with CiviDiscount to act basically as an online store, where you're buying in this case a physical 3D custom printed item. Could do this in WooCommerce (which we also have on our CiviCRM site, cramming lots of functionality in here) but trying to find a free way to do it (non-profit and all).

The idea is to set up a donation page for something that has a fixed cost, but gives membership tier discounts (tiers 0 and 1, no discount; 2 and 3 $5 off, tier 4 $10 off). If I specify membership level discounts, it looks like they'd apply to the membership signup page as well (different contribution page, different price set), which is not what I want. The other wrinkle is, they would need to be an existing member to do this (so people who aren't registered members and signed in can't even do this). Haven't seen a way to prevent a contribution page from taking a contribution from someone who isn't signed in to a valid role (you can mark Events as members only with an extension, but not contribution pages as far as I can tell).

So my idea is to have a couple of defined discount codes that automatically apply to a a specific price set field, one for 'tiers 2 and 3' and one for 'tier 4' above. Attached is a screen shot of what I'm trying to do; just leaving everything blank except the 'members of type' field is what I tried first, but nothing so far has given me the results I'm looking for.

And this:

is what I see on the donation page. Was expecting that to be $15, not $25, as I'm signed in as a Plaid member there.

To stress, I know this whole thing is trying to force something that isn't an online store to act like an online store, so it's absolutely not a common, or one might argue valid, use case. Just trying to figure out if it's even possible. I've used CiviDiscount on events and member signup pages and it worked there. Not sure if a Donation type vs. Membership type makes a difference here.

Thanks.

Michael

# Answer
> 0 votes
If you specify a discount based on membership type and include a price field, then it should only apply to that specific price field. But using CiviDiscount for Contribution Pages is something that sort of works, but I think mostly unintentionally — it was designed for events and memberships and the fact that it works on price sets in general is sort of a bonus.

You might want to try changing the field type, maybe a radio or checkbox would work? You could also try entering the code manually to see if that works.

Not sure on limiting access to a specific contribution page to signed in users only.

---
Tags: cividiscount
---


# Question
Title: CiviEvent - Update/Add people or events after initial registration
Is there any way to have someone update their registration? We have a yearly conference and it's not always know what all the addons are going to be when registration goes live.

Think golf tournament, or private dinner or things like that.

We also have spouse/kids that can attend and many times, they aren't added in the initial registration.

# Answer
No, allowing contacts to change event selections themselves is, frustratingly, a missing feature. If you're interested in helping to implement this, either with contributions of code or funding, I'm sure others would be interested in working with you on this (I know it's a feature that I wish we had).

If it's just a matter of adding more options and not removing, as long as you have "Allow same email and multiple registrations?" checked, they can register again to add the additional options. The downside there is you can't merge the two event registrations on the backend. For the other participants, they can just register again for them, though that's less than ideal as well.

You can, of course, have people get in touch and then you can edit their registrations on the back end and charge them the additional amount required there.

Welcome to CiviCRM, by the way.
> 1 votes

---
Tags: wordpress, civievent
---


# Question
Title: Datepicker issue on Membership and Contribution edit pages
Drupal 10 /CiviCRM 5.64.2

* Membership Expiration Date selection is limited to "today" so it is not possible to select a future date (eg. Dec 2023). Possible years selection range is 2013 - 2023, where both 2013 and 2023 have limited months selection (Jan - Aug), all other years have normal Jan - Dec range
* Contribution Date years selection range is 2003 - 2013 (!) with the same months range issue for the 1st and the last year in range (2003, 2013)

Probably this has something to do with "Settings - Date Preferences" civicrm/admin/setting/preferences/date?reset=1 - by poking around activityDate Start and End offcet, I've been able to reduce possible datepicker range to one day ( today), empty the future years selection completely, etc.
The only possible related message in logs would be this one:

```
[warning] Deprecated function CRM_Core_BAO_PreferencesDate::retrieve, use API.
CRM_Core_Error::deprecatedFunctionWarning
CRM_Core_BAO_PreferencesDate::retrieve
CRM_Admin_Form::preProcess
CRM_Core_Form::buildForm

```

Haven't seen nothing like this before, can't reproduce on https://dmaster.demo.civicrm.org/, what would this be?

# Answer
Looks like a bug for PH\* strict rule

Submitted a PR, can you test and add your comments on the PR?
> 5 votes

---
Tags: drupal, datepicker
---


# Question
Title: 504 error when trying to view results of contact report
first time asker here. Our resident Civi expert is out on sabbatical, so I'm coming to you with no developer knowledge to ask this support question.

My coworker is trying to create a contact report of all organizations in our database under the consulting industry. It all loads fine until they click "View results", then it just loads for ~5 minutes and times out giving them a 504 error.

Here's the page they get stuck at:

Here is the error page:

In case this is relevant, we are also experiencing long load times and sporadic timeouts when trying to load the CKEditor UI to browse images on the server in civimail.

We are using CiviCRM 5.58.1

Not sure if it's needed, but here are the alerts on our system status page:

Thanks so much in advance for your guidance with our issue!

John-Michael Torres U.S. Federation of Worker Cooperatives

# Answer
> 0 votes
I'm not sure why your report isn't loading, hopefully your expert can figure that out after their sabbatical.

Meanwhile...

If all you need is a list of contacts of a certain type, there are many (arguably better) ways to do that without using CiviReport. Try looking in the Search menu for "Advanced Search" or try your hand at the latest and greatest tool, "Search Kit".

That's some general advice to your general question. If you want even better help on this site I recommend you edit your question to be more specific about what exactly you're trying to do (e.g. "I need to export mailing labels" or "I'm trying to create an end-of-year report and I need this data from CiviCRM") and then you'll get more specific advice about how to do it!

---
Tags: civireport
---


title: Thumbnail of contact image?

text:
# Question
Title: Thumbnail of contact image?
Our organization is a choir with around 60 people. We've been adding contact photos (using CiviCRM's built-in Contact Image feature) and I've made a roster page where we can see everyone's name & photos, but some of the images are pretty huge (in MB, not necessarily height/width) so the page with images seems to bog down browsers.

I noticed all the image URLs look like `https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg`, indicating that this is some kind of dynamic API? Is there documentation somewhere for it? Is it capable of resizing to thumbnails or something? When I do it with just CSS resizing on the fly, it seems like not a great solution.

I'm generating the roster list using something like this:

```
  $api->Contact->Get([
    'group' => $group_list,
    'sequential' => 1,
    'rowCount' => 10000,
    'return' => 'custom_4,display_name,email,phone,street_address,city,state_province,postal_code,id,image_URL',
    'sort' => 'custom_4,last_name,first_name'
  ]);

  $images = array_map( function($c) {
    return $c->image_URL ? sprintf('<img src="%s" style="width: 100px" alt="Profile image" />', $c->image_URL) : '';
  }, $api->values);

```

and I'm not sure whether there's any additional info in the API pertaining to the images either.

I'd love it if I could modify that URL to something like `https://myhost.org/civicrm/contact/imagefile?photo=blah.jpeg&maxwidth=100` or something, is anything like that possible?

# Answer
> 5 votes
Try the Image Resize Extension:

> This extension adds image resize capability to CiviCRM for Contact and Custom Field images. The extension handles resizing of all types of images and will put the images into the cache directory.

Also, an alternative to writing your own roster page from scratch is SearchKit which has this exact feature: you can create a Search Display of type "Grid", choose the number of columns for your grid and the size of each image in the grid.

---
Tags: contact-image
---


title: How to debug hanging job?

text:
# Question
Title: How to debug hanging job?
We have an extension (home-baked so long ago that it can be considered legacy, meaning no-one knows enough about it) implementing a job that has started to hang on execution.

I can run the job from the API and get the same behaviour. What would be my next steps towards debugging this issue?

Logs? Pointers to set up for debugging CiviCRM extensions?

# Answer
> 2 votes
You may want to try this:

* CiviCRM logs (in ConfigAndLogs folder)
* PHP/webserver logs ( error logs specifically )
* an extension "api" folder: there should be a "Job" folder - to read a code
* an extension main php file - if the "api" folder contains no code

# Answer
> 1 votes
If the logs aren't informative and you can reproduce the issue locally, then you can debug the extension with a debugger in the same way as you'd debug core.

But the logs should definitely be your first stop. The Log Viewer extension is a convenient way to check the CiviCRM ones.

---
Tags: scheduled-job, debug
---


title: force logfile switch

text:
# Question
Title: force logfile switch
I believe something is wrong with my log file in uploads/civicrm/ConfigAndLog. (civi was looking for a file without the timestamp so I removed the timestamp from the matching log file) Is it possible to force civi to create a new log file?

Thank you

# Answer
> I removed the timestamp from the matching log file

It doesn't break anything to do that, but for reference the ones with the timestamps are old logs that have been rotated and just kept for archiving.

> Is it possible to force civi to create a new log file

It will do it on its own when there's something new to log, as long as the web server user (e.g. apache/www-data/etc) has write access to the folder. It probably does if it rotated old logs.

Note if you're using the logviewer extension and it says "unable to open file" (or something) which is what led you to all this, then that's a known issue with the extension, because there isn't a way to tell the difference between just "no new log entries yet" and "file is missing/error".

On the other hand if you were expecting new entries, then check folder permissions.
> 1 votes

---
Tags: logs
---


title: Api get all option within sub entity

text:
# Question
Title: Api get all option within sub entity
get all options from a sub entity named payment\_instrument within a entity called OptionGroup

# Answer
The best way to learn how to use the API is the Api Explorer which is built into CiviCRM (find it in the **Support -\> Developer** menu. It will write the following code for you:

```
$optionValues = \Civi\Api4\OptionValue::get(TRUE)
  ->addWhere('option_group_id:name', '=', 'payment_instrument')
  ->addWhere('is_active', '=', TRUE)
  ->execute();
foreach ($optionValues as $optionValue) {
  // do something
}

```

With this GUI:
> 3 votes

---
Tags: api, civicrm-entity, apiv4, fieldoptions
---


# Question
Title: CiviCRM Upgrade to 5.60, civicrm_job_log foreign key constraint
During the db upgrade portion of a D7+CiviCRM 5.58.1-\>5.60.0 upgrade, I'm hitting the error below. Anyone else? Clues?

```
ALTER TABLE civicrm_job_log
     ADD CONSTRAINT FK_civicrm_job_log_job_id FOREIGN KEY ( `job_id` ) REFERENCES civicrm_job ( id )  ON DELETE SET NULL [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_iatsdemo_civicrm_ca`.`#sql-1_63`, CONSTRAINT `FK_civicrm_job_log_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_job` (`id`) ON DELETE SET NULL)]

```

# Answer
> 2 votes
You have some rows in civicrm\_job\_log that have job\_id's that don't exist in civicrm\_job. The line just before that is supposed to deal with that but must have failed. I would run `UPDATE civicrm_job_log job_log LEFT JOIN civicrm_job job ON job.id = job_log.id SET job_id = NULL WHERE job.id IS NULL` manually and see what it says.

# Answer
> 2 votes
There was a bug in an upgrader step in CiviCRM 5.60 that causes this problem (and also the potential loss of other historical job log data).

This will be fixed by Civi 5.64.4 (and 5.63-esr) which should come out within the next 24 hours. So if you're version is \<5.60 and you can wait until 7 Sep 2023 to upgrade then this should not be a problem.

# Answer
> 1 votes
If the other SQL update command doesn't fix it, try this: `UPDATE civicrm_job_log SET job_id = NULL WHERE job_id NOT IN (SELECT id FROM civicrm_job);`

# Answer
> 0 votes
After restoring the CiviCRM database from the backup, I did the following:

1. Removed all records from `civicrm_job_log` table by command: `DELETE FROM civicrm_job_log;`
2. Re-run the update process from CiviCRM main window, and it finished successfully.

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


title: Use Order API or use APIv4?

text:
# Question
Title: Use Order API or use APIv4?
I am using a script that creates a MembershipPayment to connect an existing Membership to an existing Contribution (bugfix for CiviSepa). This script produces the following error:

```
Deprecated: Not having valid line items for membership payments is invalid. Caller: CRM_Contribute_BAO_Contribution::updateMembershipBasedOnCompletionOfContribution

```

In order to fix this, I thought I should switch to create the MembershipPayment via Order API instead of using

```
civicrm_api3('MembershipPayment', 'create', [...]);

```

In the CiviCRM documentation, it is clearly recommended to use the Order API for managing Contributions, Memberships etc. At the same time, it is also recommended to use APIv4 instead of APIv3 for all future projects: "APIv3 is now minimally maintained with no new features and regression bug-fixes only. Your code can use a combination of v3 and v4 API calls, but v4 is recommended for all new projects."

The problem is that the Order API doesn't even exist in API v4. I cannot choose the entity Order from the drop down menue in APIv4 Explorer.

Where does this contradiction come from? Which advice should I follow?

# Answer
The advice to use Order API is still sound and should be followed. As of this post it has not yet been ported to APIv4 so you'll have to use v3 until that work is complete. Progress on the port can be tracked at GitLab: Apiv4 Order api.
> 2 votes

---
Tags: civimember, api, apiv4
---


# Question
Title: Is there an "Deliver report by email" equivalent for SearchKit?
CiviCRM provides an api by which we can create Scheduled Jobs to send CiviReport output via email on scheduled basis.

Is there any out-of-the-box functionality (probably via an extension, I would guess), that would provide similar behavior for SearchKit output from a saved search?

# Answer
There doesn't seem to be an extension, but see this recent discussion on chat for an option from Demerit, which I'm pasting here:

"I don't recommend this as a real solution, but for something quick and dirty you can put this in a file and schedule it with cron. Adjust params as needed."

```
#!/bin/sh
cv api4 --user=admin_cms_user SearchDisplay.download savedSearch=saved_search_name display=search_display_name format=csv > report.csv
echo "some text for the body" | mail -s "here you go" -S "from=info@myorg.org" -a report.csv recipient@example.com
rm -f report.csv

```
> 4 votes

---
Tags: email, civireport, searchkit
---


title: Contact ID / User ID in Contact screen

text:
# Question
Title: Contact ID / User ID in Contact screen
In the contact screen, we have a field Contact ID / User ID, after investigation we found out the user id is the user id defined in Wordpress, for example 10145 / 13. In other words, the contact with ID 10145 is also an user defined in Wordpress with user id = 13. We found out by looking at the wp\_users table. Can someone let us know how this Contact ID / User ID was created and it was stored in which table? Thanks

# Answer
These are stored in the `civicrm_uf_match` table.

There are a bunch of different ways that the Wordpress user id could have been created. You can create Wordpress users with a profile, you can sync your Wordpress users to CiviCRM (Admin \> Users & Permissions \> Synchronize Users to Contacts), through extensions like CMS User, through webforms on Drupal, etc.
> 3 votes

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


# Question
Title: How to fix DB Constraint Violation related to Payment Processor
The setup is CiviCRM 5.61.2 on Drupal 7.97. Using Stripe for payment with the latest version of the extension.

We are getting the following error whenever we try to do anything.

```
[error]
$Fatal Error Details = array:3 [
  "message" => "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
  "code" => null
  "exception" => CRM_Core_Exception {#2244
    -errorData: array:8 [
      "error_code" => -19
      "sql" => ""
      "debug_info" => """
        SELECT a.id as `id`, a.domain_id as `domain_id`, a.name as `name`, a.title as `title`, a.frontend_title as `frontend_title`, a.description as `description`, a.payment_processor_type_id as `payment_processor_type_id`, a.is_active as `is_active`, a.is_default as `is_default`, a.is_test as `is_test`, a.user_name as `user_name`, a.password as `password`, a.signature as `signature`, a.url_site as `url_site`, a.url_api as `url_api`, a.url_recur as `url_recur`, a.url_button as `url_button`, a.subject as `subject`, a.class_name as `class_name`, a.billing_mode as `billing_mode`, a.is_recur as `is_recur`, a.payment_type as `payment_type`, a.payment_instrument_id as `payment_instrument_id`, a.accepted_credit_cards as `accepted_credit_cards`\n
        FROM civicrm_payment_processor a\n
        WHERE (a.is_active = "1") AND (a.domain_id = "1")\n
        ORDER BY a.is_default DESC, a.name\n
         [nativecode=1054 ** Unknown column 'a.frontend_title' in 'field list']
        """
      "entity" => "PaymentProcessor"
      "action" => "get"
      "is_error" => 1
      "error_message" => "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
      "debug_information" => ""
    ]
    #cause: null
    -_trace: null
    #message: "DB Constraint Violation - payment_processor_type_id should possibly be marked as mandatory for PaymentProcessor,get API. If so, please raise a bug report."
    #code: -19
    #file: "/home/mydomain/www/www/sites/all/modules/civicrm/api/api.php"
    #line: 135
    trace: {
      /home/mydomain/www/www/sites/all/modules/civicrm/api/api.php:135 {
        civicrm_api3(string $entity, string $action, array $params = [])
        › if (is_array($result) && !empty($result['is_error'])) {
        ›   throw new CRM_Core_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
        › }
      }
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:305 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:400 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Financial/BAO/PaymentProcessor.php:450 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Config.php:441 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php:455 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:319 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /home/mydomain/www/www/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
      /home/mydomain/www/www/includes/menu.inc:527 { …}
      /home/mydomain/www/www/index.php:21 { …}
    }
  }
]

```

Another symptom is that we can't access contributions of individual member - just give a blank and we get a Network Error "Unable to reach the server. Please refresh this page in your browser and try again"

## Any help appreciated.

Revision in response to whether upgrades have been run. Seems so.

MORE INFORMATION When I go to edit the Payment Processor (see screenshot below), it won't save. Looking at the table civicrm\_payment\_processor, there does not appear to be a field for the Frontend Title in the form which is a required field.

# Answer
> 2 votes
If you check the civi log from the date you ran the upgrade I expect something failed.

This is risky sometimes but you can try:

* Make a db backup.
* In api explorer choose Domain.create, and set civi version. In this case to 5.60.0.
    + It will also ask for name but pick id instead and put 1.
* Visit the upgrade screen and run updates.

# Answer
> 0 votes
I am just writing this here as I had a similar issue and this could be helpful to someone.

This site is on Joomla. I could not even access the Civi component without a server error. So what was done - restore the civi backups /administrator/components/civicrm and components/civicrm and run the installation again and do the DB run script (cleared the templates\_c folder also each time).

Also had this issue where the civi version was not properly getting updated so had to change it manually on civicrm\_domain

---
Tags: error, payment-processor
---


title: Error upgrading to 5.65

text:
# Question
Title: Error upgrading to 5.65
I'm using Drupal 7.98, upgrading CiviCRM to 5.65. PHP 7.4. Im getting this fatal error

TypeError: Return value of Civi\ActionSchedule\MappingBase::getLabel() must be of the type string

IS anyone else getting this? Upgrade to 5.64 works fine.

# Answer
Apply this patch https://github.com/civicrm/civicrm-core/pull/27354 until a fixed release is out.
> 3 votes

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


# Question
Title: Incorrect message "CiviCRM Security Upgrade Needed" after upgrade to 5.65.0
Drupal 7, just updated from 5.58

The message in the system status claims the site is 5.60, though the footer says it's 5.65, and the db updates have run fine.

FWIW, on this upgrade, none of the core components got enabled as extensions, though enabling them didn't fix this issue.

This has (so far) not occurred for all similar sites, but has affected a few site with reasonably old civicrm installs (i.e. about 10 years old).

I'm mostly baffled that the system status message things the site is still 5.60, even the old civicrm-version.php file, though marked as deprecated, is correctly showing 5.65.

# Answer
> 2 votes
Delete sites/default/files/civicrm/upload/version-msgs-cache.json.

---
Tags: upgrade
---


title: $EventID is string, not int

text:
# Question
Title: $EventID is string, not int
I'm having issues with the scheduled reminder function. I have set up an email to be sent out 96 hours before the event start date. When configuring the reminders, the system throws errors in the cron job. It complains that the $EventID is delivered as a string instead of an integer. Here's the error message:

```
PHP Fatal error: Uncaught TypeError: CRM_Event_Tokens::getEventTokenValues(): Argument #1 ($eventID) must be of type ?int, string given, called in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Event/Tokens.php on line 95 and defined in var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Event/Tokens.php:115

```

The error occurs long before the scheduled time is reached. However, the definition is given as an integer on line 115. As you can see, I'm using WP with CiviCRM 5.59.4.

I would appreciate any advice.

# Answer
> 3 votes
I took a look & I think you are probably on a higher php version than we are testing with - this patch should address it for you https://github.com/civicrm/civicrm-core/pull/27363

---
Tags: tokens, scheduled-reminders, cron-job
---


# Question
Title: Where is the permission to access pricesets?
I remember there was a permission to access price sets via drupal roles. But in the latest version that permission seems missing. Can anyone help please how can I give permission to update price set to a user with a different role than admin?

Thanks

# Answer
> 3 votes
A user can manage price sets if they have Access CiviEvent and Edit all events (actually they can access it with just Access CiviEvent with the URL or a manually added menu item, but in order for it to appear in the menu by default they also need Edit all events). It appears in the Events menu, but it allows access to price sets of all kinds, not just for events.

---
Tags: permissions, price-sets, user, roles, access
---


# Question
Title: Setup CiviCRM cron job for Bitnami NGINX Debian WordPress
Having problems deploying CiviCRM. Do not fully understand how to implement documentation.

I ran this

`sudo crontab -e`

and added this to the file

`*/1 * * * * daemon /opt/bitnami/php/bin/php /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php > /dev/null`

Then I restarted the machine

Still shows in CiviCRM system status ‘Set-up Cron’

How many things have I just done wrong, and how can I do it right?

# Answer
I found a fix

Here are the steps you need to follow to set up a Cron job for your WordPress Bitnami Nginx website:

1. Choose a CMS User: Create a new WordPress user that will be used to run the cron jobs. For example, you can create a user named 'cronuser'. Make sure this user has all the necessary permissions.
2. Install WP-CLI: WP-CLI is a command line tool for managing your WordPress site. You can install it using the following commands:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
3. Test WP-CLI: You can test if WP-CLI is working properly by navigating to your WordPress directory and running the following command:

wp --info
4. Prepare the WP-CLI Command: The command to execute the Job.execute API call using WP-CLI is:

wp --user=cronuser --url=http://example.org --path=/path/to/wordpress/ civicrm api job.execute auth=0

(Replace 'cronuser' with the WordPress user you created, 'http://example.org' with your website's URL, and '/path/to/wordpress/' with the path to your WordPress installation.)

5. Test the Command: You can test the command by running it in your terminal. If it runs without errors, you can proceed to the next step.
6. Setup the Cron Job: Open your crontab file by running crontab -e in your terminal. Add the following line to run the command every 5 minutes:

\*/5 * * * * wp --user=cronuser --url=http://example.org --path=/path/to/wordpress/ civicrm api job.execute auth=0

(Replace the values as you did in the previous step.)

7. Save and Close: Save the crontab file and close it. Your cron job is now set up and will run every 5 minutes.

(Remember to replace the placeholders in the commands with your actual data. Also, make sure the user you are using for the cron job has the necessary permissions in your WordPress site.)
> 1 votes

---
Tags: wordpress, cron, setup
---


# Question
Title: Upgrading to 5.65 on Joomla gives Fatal Error
When upgrading a Joomla-based installation to 5.65.0 we got this fatal error:

```
Fatal error: Declaration of Civi\ActionSchedule\Mapping::getValueHeader() must be compatible with Civi\ActionSchedule\MappingInterface::getValueHeader(): string in .../administrator/components/com_civicrm/civicrm/Civi/ActionSchedule/Mapping.php on line 177

```

What's up?

# Answer
**Short answer:**

Remove the offending file (which is `[cms.root]/administrator/components/com_civicrm/civicrm/Civi/ActionSchedule/Mapping.php`) since it is no longer used and interfering with the code in the new version of the CiviCRM code.

**Longer answer:**

Sometimes a new version no longer needs a file, so that file is not in the new distribution. This old file might, if left on the system, interfere with normal operation. Or as in this case completely trash it.

The Joomla upgrade procedure is actually an install, and there is no mechanism for removing files.

So when upgrading CiviCRM on Joomla it is important to note the particulars described in the manual for Joomla.

A procedure that (almost) always will work is the following:

1. Take a full backup of your site with Akeeba Backup (you should always do that before modifying a Joomla installation)
2. Take your site off-line
3. Move the CiviCRM installation to a backup location, e.g `sudo mv administrator/components/com_civicrm/civicrm civicrm-backup`, or if you are feeling lucky, just delete that directory
4. Install the new CiviCRM distribution
5. Bring your site online

Since this procedure does not delete the whole CiviCRM component your settings files will be kept in place, so you should be done.

Background: The Joomla CiviCRM can be seen as comprised of two parts, the actual CiviCRM code (residing in `[cms.root]/administrator/components/com_civicrm/civicrm`) and the Joomla component wrapper (the code that is required to make CiviCRM play nice inside a Joomla install).

The only time the above procedure is risking problems is if any of the "Joomla component files" are subject to such change. But that is very unlikely, I would say, it is mostly the core CiviCRM that moves between releases.
> 3 votes

---
Tags: upgrade, joomla
---


# Question
Title: Saving Payment Processor directs to 404 page / Payment Processor Card Options Hidden
I've noticed a few odd symptoms but I'm not sure what the cause is:

* When I try to save the Payment Processor add/edit page, I get a 404 page (although the information does save).
* When adding a Payment Processor, the Card Type Options are hidden, although the description is still there (see screenshot below) - this is when adding the Stripe option, but not Stripe Checkout or PayPal
* If we try to add more than one Payment Processor to a Contribution Page, the options are hidden in the form for anonymous users, but there are no specific permissions that would affect this, so we can't submit the form (it's a required field). This happens regardless of which two options we offer, e.g. PayPal and Stripe Checkout

None of this is leaving anything useful in the logs so that's not much help.

It's currently running CiviCRM 5.62.1 and WordPress 6.3.1

Any suggestions for where to look?

# Answer
I think this is likely related to this issue, which was fixed in 5.63. Can you try upgrading to at least 5.63.4? There was a security release last week anyways and that's the minimum version to get the security updates.
> 1 votes

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


# Question
Title: Can't get cron.php to run using the commands
Hi I was following this guide CiviCRM Page to try and get the mail scheduler to work for CiviMail. I tried doing HTTP Request and WP-CLI methods, but both had issues.

For WP-CLI, I used: wp --user=username --url=https://URL --path=/homepages/.../htdocs/wordpress civicrm api job.execute auth=0 This just hung and didn't do anything.

For HTTP: I used: wget -O - -q -t 1 'https://url/wp-content/plugins/civicrm/civicrm/bin/cron.php ?name=username&pass=password&key=key'. This didn't hang, but also didn't return or do anything. When I tried to put the url in the browser, it returned and Error 500 after a lot of time trying to load.

I am using IONOS as my hosting for Wordpress and am using CiviCRM 5.65.1.

Any help would be appreciated. Thank you!

# Answer
One thought is that the you are not running the cli version of php on the command line. Different hosts have different settings, and I don't know IONOS.

I use the following to be sure I get the php cli version I need:

```
/usr/bin/php8.1 /usr/local/bin/wp --user=civicron --url=https://example.corg --path=/home/example/public_html --timezone=America/New_York cv api job.execute auth=0

```

I can usually find if the cli version by trying at the command line:

```
which php

```

and

```
wp --info

```

The latter command should show the same version of php in the `which php` command and will have a section like this:

```
PHP binary: /usr/bin/php8.1
PHP version:    8.1.23
php.ini used:   /etc/php/8.1/cli/php.ini

```

On my system I can clearly see from the ini file that it's the CLI version.

on a cPanel server I get:

```
PHP binary: /opt/cpanel/ea-php81/root/usr/bin/php
PHP version:    8.1.22
php.ini used:   /opt/cpanel/ea-php81/root/etc/php.ini

```

Often cron will not respect the path which is why I tend to explicitly call the script with `/usr/bin/php /usr/local/bin/wp` as opposed to just `wp`.

If you have any doubts, ask IONOS for the full path to the command line version of php.
> 2 votes

---
Tags: wordpress, civimail
---


# Question
Title: Unable to add multiple groups to mailings
Recently, when using CiviMail, I have been unable to include or add more than one group for the mailing recipient or exclude fields. It only allows me to select one group, and if I try and add another it replaces the existing one. This is affecting both the mosaico mailing and traditional mailing. It is not affecting selecting multiple groups on other screens apart from the two mailing screens.

When copying existing mailings, the recipients field now always says "undefined", though it still shows the correct number of recipients in red next to the recipient selection field.

I am running CiviCRM 5.64.3 with Drupal 9.5.10.

I have tried disabling all the extensions and this has made no difference. I have also tried re-installing from my composer.json file. This worked for a few days, and then stopped working again. There are also no errors showing in the Chrome console log.

I think the issue may have developed when I upgraded from 5.61 to 5.64, but I'm not sure. There are also no errors coming up in the Drupal log or the Civi log or the php error log.

# Answer
> 4 votes
Related to this issue: lab.civicrm.org/dev/core/-/issues/4507, where the fix was to run `composer civicrm:publish`

---
Tags: civimail, groups
---


# Question
Title: Issue with API CSV importer and activity imports
WP 6.03, CiviCRM 5.51.3, API CSV importer 1.1. I'm attempting to import an activity via this extension since I need to include the assignee (which isn't included in the standard activity import). The queue runner hangs each time without completing.

These are the fields I'm including: activity type (I've tried both the ID and the label), activity date, source contact (using contact ID), target contact (using contact ID), assignee contact (using contact ID), status, subject, priority.

Inspecting the log shows me this error:

$CRM\_Queue\_ErrorPolicy\_reportError = Array ( \[is\_error\] =\> 1 \[is\_continue\] =\> 0 \[exception\] =\> Error 1: Uncaught TypeError: Argument 1 passed to civicrm\_api4() must be of the type string, null given, called in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php on line 1470 and defined in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php:62

Stack trace:

#0 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1470): civicrm\_api4(NULL, 'getFields', Array)

#1 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1408): CRM\_Import\_Parser-\>getFieldMetadata('source\_contact\_...', true)

#2 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1364): CRM\_Import\_Parser-\>getFieldOptions('source\_contact\_...')

#3 /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Import/Parser.php(1857): CRM\_Import\_Parser-\>getTransformedFieldValue('source\_contact\_...', '56186')

#4 /home/XXXX/www/www/wp-content/uploads/civicrm/extensions/nz.co.fuzion.csvimport/CRM/Csvimport/Import/ in /home/XXXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php, line 62 \[last\_task\_title\] =\> Processed 1 rows out of 1 )

This would seem to suggest that I'm missing a required field but it's really difficult to tell, and of course there's no error guidance generated. Any ideas where my problem lies?

# Answer
> 0 votes
On 5.63 and 5.67 (dmaster) this works with the API CSV extension 1.12. May have been an issue on 1.1.

---
Tags: import, activity, csv
---


title: can there be a private email activity?

text:
# Question
Title: can there be a private email activity?
i'm planning on creating a new activity type "private phone call" so I can use the activity acl extension to restrict access to these by user level. Is there any way to achieve the same thing for emails?

# Answer
Thanks for your help Coleman but I've found the strangely named "edit Triggering activity" which does exactly what I need. Cheers Lesley
> 1 votes

---
Tags: activities, acl
---


# Question
Title: HTML templates not working after upgrade from Drupal 7 with dompdf 1.2.1 to D9 with dompdf 2.0.3
In our Drupal 7 CiviCRM system I created HTML templates to produce PDFs that precisely positioned text on an A4 sheet (such as a tear-off return coupon and mailing address for a window envelope). This worked fine for years. Then we upgraded to Drupal 9 and dompdf 2.0.3. When I tried it with the new system there was no formatting and it appeared to simply dump the raw text into a PDF. The templates haven't changed. I expected I might have to re-locate an image used as a letterhead, but not the mess that came out.

Any clues, please?

# Answer
> 1 votes
It seems the later version of dompdf is less forgiving of minor lapses in HTML syntax. In the template there were a few instances of the absolute position information specified as *4.1 cm* or *25 px* instead of *4.1cm* or *25px*. The extra spaces obviously did not cause problems in the earlier version of dompdf but now causes dompdf apparently to ignore the position parameters. So my problem was caused by about 5 spaces in the wrong places and once removed the templates functioned as expected.

---
Tags: pdf, printmerge, dompdf
---


title: SMS and "view in browser"

text:
# Question
Title: SMS and "view in browser"
We communicate with the families we serve via SMS, email has proven much less effective. Is there a way to send via SMS a link to a fully formatted, personalized message? Akin to a "view in browser" button from CiviMail, but where the content of the SMS is short/simple and the link opens a richer message.

CiviCRM 5.64.4, Drupal 7.97

# Answer
> 2 votes
If you have a CiviMail and you get the view link for it and add a contact id and checksum tokens as you would normally (so you'll end up with something like `/civicrm/mailing/view?reset=1&id=NNN&cid={contact.id}&{contact.checksum}`), then you'll have a personalized message in the browser (this is the same URL as you would get for the "View in browser" link).

So just create an email mailing, send it to yourself, then send the link to view the mailing via SMS.

But that is a rather long URL, unfortunately.

---
Tags: sms, civisms
---


# Question
Title: After upgrade to 5.65 PHP fatal error: Missing PaymentProcessor and ContributionPage classes?
Various problems with Contribution pages and payment processors since upgrading to CiviCRM 5.65 (from 5.49). In the PHP error log I see:

PHP Fatal error: Uncaught Error: Class 'Civi\Api4\PaymentProcessor' not found in /home/footprk1/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/PaymentProcessor.php:65

PHP Fatal error: Uncaught Error: Class 'Civi\Api4\ContributionPage' not found in /home/footprk1/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:1579

I'm noticing that these classes seem to have moved from plugins/civicrm/civicrm/Civi/Api4 to plugins/civicrm/civicrm/ext/civi\_contribute/Civi/Api4. Seems like maybe the system is still looking in the old directory for these classes?

# Answer
Check that all the new core extensions (at Administer - System Settings - Extensions) are enabled for their corresponding components. e.g. if you have the CiviContribute component enabled, then the civi\_contribute extension should also be enabled. If it didn't get enabled during upgrade then the upgrade didn't go properly.
> 0 votes

---
Tags: civicontribute, upgrade
---


# Question
Title: After CiviCRM 5.65.1 upgrade, Contributions tab is blank but contributions show up in Activities tab
Just upgraded to CiviCRM 5.65.1 and now when I open contacts who I know have contributions, the tab shows the number of contributions, but the box below the tab that should list the contributions is blank and I get an error: "Unable to reach the server. Please refresh this page in your browser and try again."

The contributions show up in the Activities tab instead.

Anyone else having this problem?

Also I dug around in my PHP error log and found these two critical errors:

PHP Fatal error: Uncaught Error: Class 'Civi\Api4\PaymentProcessor' not found in /home/footprk1/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/PaymentProcessor.php:65

PHP Fatal error: Uncaught Error: Class 'Civi\Api4\ContributionPage' not found in /home/footprk1/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:1579

# Answer
Try enabling Civi contribute extension from the Extension page if its not already installed
> 2 votes

---
Tags: civicontribute, upgrade
---


# Question
Title: Custom fields not appearing in advanced search
I have a custom field set called "My Custom Info." In this set I had fields named "Group" and "Mentor" along with 4 other fields but, for a good reason, I deleted Group and Mentor and replaced these with Group1 and Mentor1.

Group1 and Mentor1 appear in the Custom Field Preview pane & when viewing the individual records (along with the other 4 fields) with a contact search.

BUT Group1 and Mentor1 DO NOT appear as a column option for a Constituent Summary report nor in Advanced Search (for instance, I cannot search within Group1). The other 4 fields DO appear.

In other words, I can run an advanced search with a custom view and the correct data for Group1 and Mentor1 appear for each record. But if I try to do an advanced search for just one of the Group1 values, My Custom Info omits both Group1 and Mentor1 but shows the other 4 options.

What have I done to My Custom Info that is causing this?

Using CiviCRM 5.59.3

# Answer
> 1 votes
In the custom field config there's a box for "is searchable". It's unchecked by default to avoid hitting mysql limits and for performance.

---
Tags: custom-fields, civireport, advanced-search
---


# Question
Title: Installing latest version (5.62.1) wordpress edition failure
I am trying to install civiCRM for my wordpress website. I followed the instructions multiple times on how to install civicrm, but it ends in the same way. When I activate civicrm in the plugin menu on wordpress and hit the green install button, I get redirected to a page not found error (HTTP 500). I have tried older versions and same thing. I am currently hosting on Ionos if that matters.

Thank you for the help!

# Answer
I had that problem, but I reverted my Ionos PHP to 7.4 and it seemed to work.
> 1 votes

# Answer
We ran a CiviCRM/Wordpress install on Ionos for 10 years without issue--no technical issues with Ionos. Are you using one or two databases? We used two Mysql dbs which we created with PHPMyAdmin before installing WP.

BTW, last year we got fed up with Ionos's forced/charged PHP upgrades (and everything that entailed for CiviCRM/Wordpress) so switched to CiviCRM/Wordpress on AWS Lightsail--free for non-profits (see AWS credit available through TechSoup).
> 0 votes

---
Tags: wordpress, installation
---


# Question
Title: Creating Wordpress user pw in Registration Form
I'm trying to let users create a Wordpress account inside of the civicrm registration form. I created the form and it shows the username field and it works no problem - I can see the account created in Civicrm and Wordpress. But, there is no way for a user to create a password in the form. I saw that this may be intentional on a gitlab post. Is there a work around to this so the user can create a password by themselves in the civicrm registration form.

Thank you!

# Answer
> 0 votes
This was intentional for wordpress. The person needs to click the link in the email.

You can see the code that controls this in https://github.com/civicrm/civicrm-core/blob/91ac1dc25c9e24422c6bc9feabca9e5c16b4856d/CRM/Utils/System/WordPress.php#L1034. It always returns FALSE.

---
Tags: wordpress, user-account
---


title: Can we get distinct by using API4?

text:
# Question
Title: Can we get distinct by using API4?
Is it possible to get distinct using apiv4? For example $result = civicrm\_api4('Contact', 'get' \<- getdistinct? Thanks

# Answer
> 1 votes
Depending what you're trying to do you might be able to just use group by, like if you want a list of all the distinct last names in your database:

```
\Civi\Api4\Contact::get()
  ->addSelect('last_name')
  ->addGroupBy('last_name')
  ->execute();

```

If you want to get fancy you can create a searchkit, where you set it up with distinct, and then run it via code to get the results. See https://github.com/civicrm/civicrm-core/blob/91ac1dc25c9e24422c6bc9feabca9e5c16b4856d/ext/search\_kit/tests/phpunit/api/v4/SearchDisplay/SearchRunTest.php for some fancy examples, but at its simplest you could create the searchkit via the UI, then just run it with something like below. See api4 explorer for more params.

```
$result = SearchDisplay::Run()
      ->setSavedSearch('the_saved_search_name')
      ->setDisplay('the_search_display_name')
      ->execute();

```

# Answer
> 0 votes
APIv4 supports distinct when used with aggregation, but doesn't add the keyword DISTINCT to select queries.

---
Tags: apiv4
---


# Question
Title: How to set TODAY as default date for a custom date field placed on a contribution page?
How to set default date today on a custom date field that is added on a contribution page via profile?

I have tried to add this in my extension but doesnt seem to work and getting populated as 01/01/1970 set after form submitted . Any help would be appreciated. Thanks

```
function club_civicrm_buildForm($formName, &$form) {
    if ($formName == 'CRM_Contribute_Form_Contribution_Main'
        && in_array($form->getVar('_id'), [42])
      ) {
        $defaultDate = date("d/m/Y");
        $defaults['custom_315'] = $defaultDate;
        $form->setDefaults($defaults);
      }
    }

```

# Answer
> 2 votes
I was able to achieve this by including this JS snippet in the extension instead, posting here incase it helps someone.

```
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
$('#custom_315').val(today);

```

EDIT: It also works with following build form function, Thanks to Pradeep for the hints.

```
    function club_civicrm_buildForm($formName, &$form) {
        if ($formName == 'CRM_Contribute_Form_Contribution_Main'
            && in_array($form->getVar('_id'), [42])
          ) {
           //Populate Date using the function
            $defaultDate = date("Ymd");
            $defaults['custom_315'] = $defaultDate;
            $form->setDefaults($defaults);
           //alternatively addScriptFile function to inject js
            Civi::resources()->addScriptFile('club', 'club.js');
          }
        }

```

---
Tags: custom-fields, profile, extension, contribution-page
---


title: CiviMail ACL permissions question

text:
# Question
Title: CiviMail ACL permissions question
We are slowly building our back office team, and so I am having to struggle my way through permissions and ACLs.

I would like to have a user who can:

1. View any user's record (and we limit their view using the Contact Summary Layouts extension)
2. NOT edit a user's record -- because that lets them see all the data we are hiding with Contact Summary Layout
3. BUT send mail with CiviMail

My understanding is that CiviMail requires the user to have EDIT permission on groups that they will send to. We have defined 5 groups that this user should be able to send mail to, and we have given that user EDIT permission on those groups. However, this also seems to allow them to edit the user's individual record and see data they shouldn't.

**Question:** Am I understanding the ACLs correctly?

I have thought of two ways around this:

1. Don't give our backoffice staff the ability to view contacts at all in the CiviCRM UI. Build Drupal views for them to see whatever data they want to see. Then they only get access to CiviMail in the CiviCRM UI. Not sure if this is truly possible but that's one thought.
2. Have our backoffice staff have one user that can view users but cannot use CiviMail, and a different user account that can do CiviMail but not view individual contact records (and therefore not edit them).

**Question:** Do either of these two options make sense?

And **Question:** And is there any better option?

Thank you so much!

# Answer
> 1 votes
You should be able to create a role that has the permission "View all Contacts" as well as "edit groups" and "access civimail". That should allow them to do what you described (see contacts but not edit them and use CiviMail) without ACL-Permissions.

There may be solutions to archieve your goals with Drupal Views but I expect that approach to be more complicated - also I think you need "view contact" permission to use groups in CiviMail.

Some more thoughts:

* Contact Summary Layout is only hiding information from the UI but not technically restricting access. There may be ways for users to work around that and access information they are not supposed to.
* If possible I would strongly recommend to avoid ACL-permissions - imho it is very complex and somewhat limited. If you are interested have a look at this thread as well as those linked in it.

---
Tags: civimail, permissions
---


# Question
Title: Joomla - Admin login fails to work after latest CiviCRM update
I have just upgraded CiviCRM to v5.65.1 in my Joomla site (v4.3.4). Now, since that update I can no longer login to my admin backend - I get the following error displayed: 0 Class "Civi\Core\Container" not found

I have backed up the database files using the function in PHPMyAdmin, but need to rebuild the CiviCRM installation. Looking at the FTP backend, a lot of the CiviCRM files are zero bytes.

How do I restore my installation?

# Answer
I asked this question on the Joomla forum and was told to set the enabled flag for the CiviCRM apps to zero within phpMyAdmin.

This did work and I was then able to apply the update that failed earlier to CiviCRM.

Maybe this is something that the developers should include in the documentation?
> 0 votes

---
Tags: upgrade, joomla, error-page
---


# Question
Title: Can't store is_confirmation_enabled via API
I can't for the life of me store the value of is\_confirmation\_enabled for creating a new event via API. This is in a PHP file that creates new events on the front end of Joomla based on input collected in a 3rd party (Joomla-based) form. The event gets created just fine with all the data points as entered by the user, but the is\_confirmation\_enabled always ends up being "no". Tried API 3 and 4 - same results. If I try via API explorer, it works. Really lost here ... may have to resort to a SQL query to update the event record, instead, which would be a bummer. Here's my code:

```
$results = \Civi\Api4\Event::create(FALSE)
  ->addValue('id', '')
  ->addValue('title', $evtInfo['Title'])
  ->addValue('start_date', $evtInfo['StartDate'])
  ->addValue('end_date', $evtInfo['EndDate'])
  ->addValue('event_type_id', $evtInfo['Type'])
  ->addValue('Additional_Event_Info.Pace', $evtInfo['Pace'])
  ->addValue('Additional_Event_Info.Trail_Page', $evtInfo['TrailPage'])
  ->addValue('is_online_registration', $evtInfo['Registration'])
  ->addValue('Additional_Event_Info.Chapter', $evtInfo['Chapter'])
  ->addValue('description', $evtInfo['Description'])
  ->addValue('is_active', $evtInfo['Status'])
  ->addValue('is_public', TRUE)
  ->addValue('default_role_id', 1)
  ->addValue('is_template', FALSE)
  ->addValue('template_title', '')
  ->addValue('is_share', FALSE)
  ->addValue('is_confirm_enabled', TRUE)
  ->addValue('is_email_confirm', TRUE)
  ->addValue('confirm_email_text', 'Thank you for registering for Evergreen MTB event - please see the details below.\r\n\r\n-Evergreen MTB')
  ->addValue('confirm_from_email', 'events@evergreenmtb.org')
  ->addValue('confirm_from_name', 'Evergreen MTB Events')
  ->execute();

```

Thank you for any pointers.

# Answer
As humiliating as it is, I want to post an answer to keep the suggestions in the comments and to perhaps give someone a hint who may make a similar mistake to mine. I had another line of code later in the file changing the is\_confirm\_enabled value to "0" ... yup, I did say humiliating. Cheers.
> 1 votes

---
Tags: civievent, api, apiv4
---


# Question
Title: How do auto email out reports every end of the month
I am trying to be able to send out a report automatically via email every month. Is there any possibility that I could do this?

# Answer
If you're asking about a CiviReport (under the Reports menu), then yes, you can do this from the Email Delivery tab of the report. Click the little ? there to see instructions for setting up a cron job to send the report monthly.
> 1 votes

---
Tags: email, civireport
---


# Question
Title: Cannot Access Joomla 4.34 Backend - An error has occurred. 0 Call to a member function register() on int
After upgrading to Joomla 4.34 I cannot access the backend of my website.

My shared hosting account (Hostmonster) runs MySQL 5.7.23-23, which has limited me to CiviCRM 5.39 and running PHP 7.4. I've been looking into upgrading my hosting account to one that runs MySQL 5.7.5+ so that I can upgrade to the latest version of CiviCRM and use PHP 8+.

When I tried upgrading to PHP 8, I received this error: Sorry, there was a problem we could not recover from. The server returned a "500 - Whoops, looks like something went wrong."

Through file manager I set debug to "true" in the configuration.php file and received the below "Call stack" following the "An error has occurred. 0 Call to a member function register() on int" message.

I asked ChatGPT how to fix it and ChapGPT indicated that it was an issue with CiviCRM, but since I can't get into the backend, I can't try several of the solutions that were suggested.

I'm looking for options to gain access to the administration area of my website again. Once I do, I will upgrade my hosting account so that I can upgrade CiviCRM.

What do you suggest? Can I "Turn Off" the CIVICrm Component through file manager? Would that work?

Thanks,

Mike

---

"An error has occurred. 0 Call to a member function register() on int" message. Call stack

# Function Location

1 () JROOT/administrator/components/com\_civicrm/civicrm/CRM/Extension/ClassLoader.php:82 2 CRM\_Extension\_ClassLoader-\>register() JROOT/administrator/components/com\_civicrm/civicrm/Civi/Core/Container.php:618 3 Civi\Core\Container::boot() JROOT/administrator/components/com\_civicrm/civicrm/CRM/Core/Config.php:85 4 CRM\_Core\_Config::singleton() JROOT/plugins/user/civicrm/civicrm.php:109 5 plgUserCivicrm-\>civicrmResetNavigation() JROOT/plugins/user/civicrm/civicrm.php:91 6 plgUserCivicrm-\>onUserLogin() JROOT/libraries/src/Plugin/CMSPlugin.php:284 7 Joomla\CMS\Plugin\CMSPlugin-\>Joomla\CMS\Plugin{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486 8 Joomla\Event\Dispatcher-\>dispatch() JROOT/libraries/src/Application/EventAware.php:111 9 Joomla\CMS\Application\WebApplication-\>triggerEvent() JROOT/libraries/src/Application/CMSApplication.php:866 10 Joomla\CMS\Application\CMSApplication-\>login() JROOT/libraries/src/Application/AdministratorApplication.php:341 11 Joomla\CMS\Application\AdministratorApplication-\>login() JROOT/administrator/components/com\_login/src/Controller/DisplayController.php:82 12 Joomla\Component\Login\Administrator\Controller\DisplayController-\>login() JROOT/libraries/src/MVC/Controller/BaseController.php:678 13 Joomla\CMS\MVC\Controller\BaseController-\>execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143 14 Joomla\CMS\Dispatcher\ComponentDispatcher-\>dispatch() JROOT/administrator/components/com\_login/src/Dispatcher/Dispatcher.php:45 15 Joomla\Component\Login\Administrator\Dispatcher\Dispatcher-\>dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361 16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143 17 Joomla\CMS\Application\AdministratorApplication-\>dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186 18 Joomla\CMS\Application\AdministratorApplication-\>doExecute() JROOT/libraries/src/Application/CMSApplication.php:293 19 Joomla\CMS\Application\CMSApplication-\>execute() JROOT/administrator/includes/app.php:61 20 require\_once() JROOT/administrator/index.php:32

# Answer
You can fix this by clearing caches. Try one or both of the following:

1. On the command line `cd path/to/civicrm` and then `cv flush`.
2. Delete the contents of the `templates_c` directory.
> 1 votes

---
Tags: joomla
---


# Question
Title: Changing the colour of text inside text boxes
As standard after a new install on backdrop, the text on dashboards and some help text is white on a very light background, meaning you can't see it very well.

How would I change the colour of the text to Black or blue? I had a quick look in the css and found I could do it, but I don't know where it is stored or if that would only affect the single page when I need the change to be site-wide.

Thanks

# Answer
FYI: https://docs.civicrm.org/sysadmin/en/latest/customize/theme/

If this is happening with a default installation, I suggest you create a gitlab issue. It would be great if you can also do a PR but if not, include whatever proposed CSS fixes you have in the issue ticket.

To override the default CSS you can go to `Administer > System Settings > Resource URLs` and set the 'Custom CSS URL' to eg `[civicrm.files]/css/civicrm.extra.css` and then put your CSS changes in that file.

You might want to look at some of the alternative themes
> 3 votes

---
Tags: dashboard, templates
---


title: How to obtain the ESR For Wordpress

text:
# Question
Title: How to obtain the ESR For Wordpress
I signed up for the CiviCRM ESR Program and paid the $20.00, and was given access to the Extended Security Release Group on lab.civicrm.org. I am showing the latest ESR version is 5.63-ESR. How do I download the full installation package for Wordpress of the 5.63-ESR? The Readme.MD file says I need to download the full install at https://civicrm.org/download; so what is the lab.civicrm.org for? I am also not seeing the ESR offered on https://civicrm.org/download. Please advise.

# Answer
If you go into the core folder then near the top right it will say something like "38 releases". Click that. Then you'll see downloads for all the cmses.

Direct link: https://lab.civicrm.org/esr/core/-/releases
> 2 votes

---
Tags: installation
---


# Question
Title: Why is my Contributions tab missing from contact summary screens?
I've just become aware that an up to date installation is not showing the Contributions tab on contact summary screens.

I'm seeing no errors in the browser console, not anything in the CiviCRM log. The only thing I am aware of with respect to contributions is that a colleague recently made some changes to the Financial Types and Financial Accounts to better align with our accounting system (Quickbooks). Could that have caused this issue?

As far as I can see the contribution records are all there, just that I can't get access them from the contact record.

# Answer
> 1 votes
What I failed to check was the fact that a colleague had used the Contact Layout Editor to tweak the setup of the contact summary screen, and had removed the tab from the layout. The joys of team-working and poor documentation. Doh!

---
Tags: civicontribute
---