# Question
Title: Meaning of "Search Cases with Upcoming Activities" in "My Cases" dashlet
For a case with overdue (not yet completed) scheduled tasks, checking the "Search Cases with Upcoming Activities" in the "My Cases" dashlet correctly displays the next upcoming task which happens to be in the past (overdue). Unchecking this box, however, displays the third-to-last activity, which is as it happens also in the past (overdue) but comes well after the very next (overdue) task shown when this box is checked. My question is what is the function of the dashlet when the "Search Cases with Upcoming Activities" box is unchecked, and why would it show the third-to-last task in the sequence of tasks for my particular ongoing case. Many thanks!

# Answer
> 1 votes
Below is the query it runs, with the relevant parts being

```
LEFT JOIN civicrm_case_activity ca4
          ON civicrm_case.id = ca4.case_id
LEFT JOIN civicrm_activity t_act
          ON t_act.id = ca4.activity_id
          AND t_act.is_current_revision = 1
      ...
GROUP BY case_id ORDER BY activity_date_time ASC

```

but this query isn't full-group-by compliant and also I think the GROUP BY is in the wrong place. Also `case_id` is ambiguous since it could apply to the `AS case_id` in the select or the civicrm\_case\_activity.case\_id field or the civicrm\_case\_contact.case\_id field.

So it seems like there's something off about the query.

```
SELECT civicrm_case.id as case_id, civicrm_case.subject as case_subject, civicrm_contact.id as contact_id, civicrm_contact.sort_name as sort_name, civicrm_phone.phone as phone, civicrm_contact.contact_type as contact_type, civicrm_contact.contact_sub_type as contact_sub_type, t_act.activity_type_id as activity_type_id, civicrm_case.case_type_id as case_type_id, civicrm_case.status_id as case_status_id, t_act.status_id as status_id, civicrm_case.start_date as case_start_date, GROUP_CONCAT(DISTINCT IF(case_relationship.contact_id_b = 2, case_relation_type.label_a_b, case_relation_type.label_b_a) SEPARATOR ', ') as case_role, t_act.activity_date_time as activity_date_time, t_act.id as activity_id, case_status.label AS case_status, civicrm_case_type.title AS case_type       FROM civicrm_case
        INNER JOIN civicrm_case_contact ON civicrm_case.id = civicrm_case_contact.case_id
        INNER JOIN civicrm_contact ON civicrm_case_contact.contact_id = civicrm_contact.id
        LEFT JOIN civicrm_case_type ON civicrm_case.case_type_id = civicrm_case_type.id
        LEFT JOIN civicrm_option_group option_group_case_status ON ( option_group_case_status.name = 'case_status' )
        LEFT JOIN civicrm_option_value case_status ON ( civicrm_case.status_id = case_status.value
          AND option_group_case_status.id = case_status.option_group_id )
        LEFT JOIN civicrm_case_activity ca4
          ON civicrm_case.id = ca4.case_id
        LEFT JOIN civicrm_activity t_act
          ON t_act.id = ca4.activity_id
          AND t_act.is_current_revision = 1        LEFT JOIN civicrm_phone
          ON civicrm_phone.contact_id = civicrm_contact.id
            AND civicrm_phone.is_primary = 1
        LEFT JOIN civicrm_relationship case_relationship
          ON ((case_relationship.contact_id_a = civicrm_case_contact.contact_id AND case_relationship.contact_id_b = 2)
          OR (case_relationship.contact_id_b = civicrm_case_contact.contact_id AND case_relationship.contact_id_a = 2))
            AND case_relationship.is_active
            AND case_relationship.case_id = civicrm_case.id
        LEFT JOIN civicrm_relationship_type case_relation_type
          ON case_relation_type.id = case_relationship.relationship_type_id
            AND case_relation_type.id = case_relationship.relationship_type_id WHERE (1)
 AND civicrm_case.is_deleted = 0
 AND civicrm_contact.is_deleted <> 1
 AND (case_relationship.contact_id_b = 2 OR case_relationship.contact_id_a = 2)
 AND case_relationship.is_active
 AND civicrm_case.status_id IN (1,3)
GROUP BY case_id  ORDER BY activity_date_time ASC LIMIT 0, 10

```

---
Tags: civicase, dashlet
---


# Question
Title: how to disable passport generate document option in civicrm in users profile
I want to disable passport generate document in CiviCRM users dashboard only. Can you please help me how I can do it this option is not available in permissions and display preferences also.

this is my Accounting person's dashboard but I want he could'nt be able to generate passport document so I want to disable this.

# Answer
> 1 votes
You can remove the Access CiviOffice permission, assuming they don't need to use CiviOffice otherwise.

---
Tags: civicrm-entity, document-management
---


# Question
Title: How can I export Mosaico html without tabulation?
I'm trying to export emails I've created in a way that can be pasted into an already existing webpage, but it seems impossible as Mosaico utilizes tables to display information. Is it possible to export the email templates without tabulation? I'm trying to do this so that I don't have to format the information twice.

# Answer
You could try something an online utility that strips table tags from HTML and paste in your Mosaico mailing HTML. If you're just looking for basic text formatting like headings, paragraphs, bold, bulleted lists and so on, that might work, but if you have more complex formatting, I suspect you might not find that's a great solution. Worth a try though!
> 0 votes

---
Tags: email, mosaico
---


# Question
Title: Activities created by API not emailing assignee
Creating an activity with either API (api3, api4) does not trigger an email to the assignee. Is this by design or is there a problem with my instance of CiviCRM? Activities generated via the GUI and via webform do send emails to assignees. The checkbox to "Notify Activity Assignees" in Administer \> Customize Data and Screens \> Display Preferences is checked.

CiviCRM 5.61.4, Drupal 7.97

# Answer
> 0 votes
Not sure it is necessarily by design, but adding activities via API doesn't send emails to assignees. Seems like it should if you have the option checked.

You could post an issue and even potentially fix this yourself, if you're able.

# Answer
> 2 votes
Yes, you're right, API calls do not send email notifications. Like Lars, I'm not sure whether that's intentional or not - but either way you'll have to do that yourself once you've created the activity. Here's some code you can adapt to your needs - the basic gist is that there are two CiviCRM settings that have a bearing on whether the email gets sent, followed by the send procedure itself.

---
Tags: api, activities
---


# Question
Title: Changing the activity type of existing activities
I have a particular custom activity type that has around 2000 or so submissions. We're thinking about splitting this activity type into two separate activities. They would have all the same custom fields at this point, but in the future will probably diverge more.

I don't see an option in the UI to change the Activity Type of an existing activity. So a couple of questions:

1. Am I overlooking it or is it just sort of a niche case and doesn't exist?
2. Assuming the existing Activity type and the new one are presently identical, is it safe to change the activity ID in the database directly? Is there anything else that would need to get changed?

# Answer
You can change activity type in SearchKit from Actions - Update Activities. That's safer than doing it directly in the database. This option doesn't exist in the UI otherwise - there would be a chance of data loss if you changed from an activity type with a custom field to one without it or potentially with built-in activity types.

I'd definitely try this on a few test cases before doing all 2000, just to make sure nothing weird happens.
> 1 votes

# Answer
You can use searchkit to do it, doing a search on activities and then using "Update Activities" from the actions dropdown at the top of the results table.

As you've noted they have the same custom fields, but yes in general that would be an issue if they didn't since it may lead to loss of data.
> 1 votes

---
Tags: activities
---


# Question
Title: I cannot find the iATS configurations page
We are using CiviCRM 5.58.1 on WordPress 6.2.2

We use iATS. Someone else on this forum said there is a configuration page and they posted the below screenshot. However, I cannot find this page anywhere on my CiviCRM install. I feel this screenshot is outdated. Can someone please direct me to the new page so I can update our iATS configurations.
Thank you

Menu not showing iATS settings

# Answer
That screenshot shows the edit form for a specific recurring contribution with IATS (which you get to by going to the Contact, Contributions tab, Recurring Contributions sub-tab, then Edit). The general IATS configuration is at Administer - CiviContribute - IATS Payment Settings.
> 0 votes

---
Tags: iats
---


# Question
Title: We need help with importing & mapping a .csv data extract from a 3rd party system
I'm looking for someone who knows CiviCRM's data importing and mapping processes. We have a .csv extract of data requiring some cleansing, importing and mapping. From what we can tell so far the process is multiple steps. We have captured these steps but we wish to determine if it can be developed into a more repeatable process.

We have a test file and schema overview available.

Look forward to hearing from anyone who thinks that can resolve/fix this challenge.

Regards

Warwick

# Answer
I use a text editor with macros to automate the clean up of csvs and then create fields in CiviCRM to receive them. In the CiviCRM import process, simply match the csv fields to the CiviCRM fields.
> 0 votes

---
Tags: import, field-mapping, data
---


# Question
Title: How to send renewal reminder but only to people who have not bought a new membership type
We introduced a new set of membership types and are naturally phasing out the old types (they will expire, on a rolling basis, but can not be renewed). We want to send people of the old types a scheduled reminder with a notice to renew at the new levels (X days before expiry), but only if they have not already renewed at the new levels. I thought I could do a Search Builder to make a smart group of all contacts who were "not in" the current levels and restrict it to that, but it is encountering some silly logic error and continued to send them reminders. How would you approach this?

Recap. Send renewal reminders to old membership types, but only if they have not renewed.

Thank you. Latest Civi and D7.

Worst case, I can add text to reminder that says "If you have already renewed, please ignore" but that is annoying.

# Answer
Better to use SearchKit than Search Builder, which is old and sometimes does strange things. I think you want to search for Contacts with (required) Memberships in the old types and without Memberships in the new types, then you'll get just contacts who only have the old types. Definitely verify before using, NOT IN can be tricky.
> 1 votes

---
Tags: civimember, scheduled-reminders
---


title: Adding New Contact with Employer

text:
# Question
Title: Adding New Contact with Employer
When adding a new individual with a current employer we are getting the following error:

> Error thrown
>
> Call to undefined method CRM\_Contact\_BAO\_Relationship::legacyCreateMultiple()

The individual contact is created but no link to the employer. If we try to add the current employer on the contact summary screen we get the following:

> Network Error Unable to reach the server. Please refresh this page in your browser and try again.

We can add the relationship under the relationship tab.

We upgraded CiviCRM to 5.61.4 from 5.58.1 and cleared the cache. No change after that. There is nothing in the PHP logs of the CiviCRM logs. Behavior seems to be unique to this site. Nothing has changed recently.

WordPress site running Version 6.2.2

Thanks in advance for any thoughts.

# Answer
`CRM_Contact_BAO_Relationship::legacyCreateMultiple()` was removed last year after being deprecated for seven years. Are you perhaps using Grant Applications? Looks like it still has to be removed from there.

Might want to post an issue there and provide a fix if you're able.
> 3 votes

---
Tags: contacts
---


# Question
Title: Is the CiviCRM WhatsApp integration extension available now?
Is the CiviCRM WhatsApp integration extension available now and how do you integrate CiviCRM with WhatsApp?

# Answer
User 'sluc23' created a 'whatsapp' extension: https://civicrm.org/extensions/whatsapp but there is no content. That sometimes happens when someone intends to publish an extension but doesn't get round to it. I'd suggest asking on the ~extensions channel on https://chat.civicrm.org
> 1 votes

# Answer
iXiam has self-funded and developed the WhatsApp extension and it is near ready to be deployed to a few organizations. However, it requires a fair deal of setup and integrating with a provider to be able to send messages; it’s not just plug and play. With that said, we are open to publicly releasing the extension if there are parties that want to put funding behind it to cover the development cost and steps to making it public.

Feel free to get in touch with us for a demo: https://www.civi-go.net/en/contact.
> 0 votes

---
Tags: civicrm.settings.php
---


# Question
Title: Formbuilder in Wordpress - field entries disappear when trying to input data
I've built a form in formbuilder - only Individual data, some core fields, some custom fields.

WordPress 6.2.2 and CiviCRM 5.57.1 currently

When I try to view the form, it looks OK and I can select an entry for 'Existing Contact', but then any other information disappears as soon as I type or select an option. I can see it for perhaps a second and then it disappears.

The console has some angular errors:

I've tried a couple of options, e.g. disabling the Asset Caching and forcing SSL, but that's not helped. No other issues with the site, e.g. Status Page is fine, dashboard is fine, etc.

ETA: The network tab shows the two requests constantly loading for the existing contact/autofill:

I don't have an settings in the form in the Autofill option.

Any help will be gratefully received

# Answer
> 1 votes
Just to confirm, I updated the site yesterday to 5.60 and the error is now fixed!

Bit obvious to try that first...

---
Tags: wordpress, formbuilder
---


# Question
Title: Undefined array key "email_greeting_display"
I'm trying to visualize a *contact (organization)* and I'm receiving the following warning in the *"Communication preferences"* section.

> Warning: Undefined array key "email\_greeting\_display" in /bitnami/wordpress/wp-content/uploads/civicrm/templates\_c/es\_MX/%%77/77A/77AF58B9%%CommunicationPreferences.tpl.php on line 53

However, this does not influence when updating the data and does not cause me major problems.

I've completely removed any trace of `define('WP_DEBUG', true);` in the **wp-config.php** file

# Answer
> 0 votes
This is the same problem as your previous question. Did you also check php.ini? Bitnami has instructions on their site to find php.ini and edit it. If you can figure out where the problem is, maybe we could let Bitnami know, because it seems like a configuration problem on their end, unless you've changed it.

---
Tags: wordpress, php, message-templates, civicrm.settings.php, php7
---


title: Getting reminders of expired activities

text:
# Question
Title: Getting reminders of expired activities
Activities in Cases (or even without) often have dates which serves as due dates or deadlines. In a few views (Manage Case and the case Dashboard e.g) expired activities stand out because they are rendered in red.

To get more visibility of expired activities I'd like to send a reminder email to the assigned contact when an activity expires.

I search for this but could not find anything on that topic, does that functionality already exist?

(Also, everywhere an activity is shown it should render in red if expired. This does not happen specifically in "Search Activity" and "Search Case". I assume I'd need to put that as a feature request. Or PR.)

# Answer
The scheduled reminders functionality should do the trick

Administer \> Communications \> Schedule Reminders

The scheduled reminders functionality relies on the ‘Send Scheduled Reminders’ scheduled job so it must be enabled.

Administer \> System Settings \> Scheduled Jobs
> 2 votes

---
Tags: activities
---


title: Where are translations for drop-downs?

text:
# Question
Title: Where are translations for drop-downs?
In some places, e.g. the configuration of scheduled reminders, there are drop-down selection boxes that sometimes are translated.

We have a Swedish side and the particular drop-down I'm looking at is in Swedish. However, if I change the UI language to English, that is still in Swedish.

I'm a translator for the Swedish internationalisation so I looked for the strings in Transifex, but found nothing. \[UPDATE: the text is in Transifex, but the translation did not match, that´s why did not find it...\]

I also know of "Administer-\>Customize Data and Screens-\>Dropdown Options" but those are not for this type of drop-downs.

So where can I find those translations so that I can modify them?

\[UPDATE: maybe this is about when drop-down texts are populated, cached etc. ...\]

# Answer
> 1 votes
That drop-down is pulling options from the activity\_contacts option group. So it sounds like your option group is in Swedish and doesn't have English labels available.

---
Tags: translation, drop-down
---


# Question
Title: Permission Error when using Stripe payment process as unauthenticated user
I've created an events page for an event with fees. The fess are processes via a Stripe payment processor. When I'm logged onto CiviCRM, as an administrator, I can enter my credit card details and submit the form, and everything works perfectly well. However, when I attempt the same browsing incognito, although I'm able to access the events page and enter my credit card details, as soon as I hit the submit button a dialogue box pops up with the message error. I've check the logs and indeed two entries are created when the error is generated but I'm unable to interpret what they mean. I guess it's something to do with permissions. **Would anyone have any suggestions how I could go about more precisely diagnosing and resolving this issue?** I'm including the contents of the relevant log entries below. Thank you.

\[error\] $Fatal Error Details = array:3 \[ "message" =\> "You do not have permission to access this page." "code" =\> null "exception" =\> CRM\_Core\_Exception {#7937 -errorData: array:1 \[ "error\_code" =\> 0 \] #cause: null -\_trace: null #message: "You do not have permission to access this page." #code: 0 #file: "/home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php" #line: 615 trace: { /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:615 { › $civicrm\_wp\_title = ts('You do not have permission to access this page.'); › throw new CRM\_Core\_Exception(ts('You do not have permission to access this page.')); › } } /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:62 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:239 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm.php:1199 { …} /home/embracingage/www/www/wp-includes/class-wp-hook.php:308 { …} /home/embracingage/www/www/wp-includes/class-wp-hook.php:332 { …} /home/embracingage/www/www/wp-includes/plugin.php:565 { …} /home/embracingage/www/www/wp-includes/class-wp.php:797 { …} /home/embracingage/www/www/wp-includes/functions.php:1334 { …} /home/embracingage/www/www/wp-blog-header.php:16 { …} /home/embracingage/www/www/index.php:17 { …} } } \]

\[debug\] $Fatal Error Details = array:3 \[ "message" =\> "You do not have permission to access this page." "code" =\> null "exception" =\> CRM\_Core\_Exception {#7937 -errorData: array:1 \[ "error\_code" =\> 0 \] #cause: null -\_trace: null #message: "You do not have permission to access this page." #code: 0 #file: "/home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php" #line: 615 trace: { /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:615 { › $civicrm\_wp\_title = ts('You do not have permission to access this page.'); › throw new CRM\_Core\_Exception(ts('You do not have permission to access this page.')); › } } /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:62 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:239 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …} /home/embracingage/www/www/wp-content/plugins/civicrm/civicrm.php:1199 { …} /home/embracingage/www/www/wp-includes/class-wp-hook.php:308 { …} /home/embracingage/www/www/wp-includes/class-wp-hook.php:332 { …} /home/embracingage/www/www/wp-includes/plugin.php:565 { …} /home/embracingage/www/www/wp-includes/class-wp.php:797 { …} /home/embracingage/www/www/wp-includes/functions.php:1334 { …} /home/embracingage/www/www/wp-blog-header.php:16 { …} /home/embracingage/www/www/index.php:17 { …} } } \]'''

# Answer
In the documentation at https://docs.civicrm.org/stripe/en/latest/install/

it says

> To accept payments the user must have the following permissions as a minimum:
>
> * access Ajax API
> * make online contributions

It is unclear to me whether you have done this or not.
> 3 votes

---
Tags: civievent, payment-processor, stripe
---


# Question
Title: Changing the repeat count/end-date on an event
I have a repeating weekly event that was set up with 30 repeats, the last one is next week. I need to extend the repetition - it's going to be weekly for the foreseeable.

On the Configure event » Repeat screen, I can't choose a value \>30, but I can set an end date far in the future.

However, doing that and pressing Save gives a confirm screen saying:

> ⚠ There are participants registered for repeating events being removed from the set. Those with participants will be converted to standalone events, and those without registration will be deleted.
>
> A repeating set will be created with the following dates.
>
> ➊ (table listing existing, past events!)
>
> ➋ (table listing events with future start dates)

I'm a bit confused by the ⚠ warning because there shouldn't be any removed from the set, yet it states that there are; yet I can't see which events those would be?

The first table, ➊ is confusing coming under the "will be created" intro text; these are already created. The second ➋ looks right - these are the dates for future events that I would expect to be listed.

Is it just the wording that's wrong? Perhaps that warning that seems to state it's removing events is not logic-based and doesn't matter? Or is there a way to see the events being removed? Perhaps that's what ➊ is supposed to be?

Clarifications gratefully received!

EDIT: it gets quirkier! The above was observed by editing the last event in the series of repeating events. If I configure the *first* event of the repeating series, put a future date in, then it's weirder still: it seems to list a lot of past-dates in table ➋ and a sub-set of events in table ➊??? Also, one of the events listed to be removed is the original event itself. And it also lists certain dates in both the to-remove and the to-add tables.

EDIT 2:

The first table is listing the events that are to be *removed*.

It's mis-positioned under the title about adding events because of a missing `</table>` tag. (I've done a merge request to fix that)

# Answer
> 1 votes
Having spent an hour looking through the code and doing a couple of tests, here's what I think the answer is, but v. grateful to others who can say with more conviction.

1. The confusing title-table mismatch is a simple HTML bug. I've done a merge request to fix that. The first table is indeed a list of events that will be:
2. At least on Civi 5.58.1 there's a bug that causes submitting this form to crash. I've reported this but can't fix it as I don't know what that code was ever trying to do. On my single test (may not work for you!) commenting Line 408 seems to get it to work...

---
Tags: civievent, repeating-events
---


# Question
Title: SearchKit - can I return the first four characters of a string?
I would like to run a report of UK postcodes with aggregation. The first four characters of the postcode give an area of perhaps a few square miles, the last three characters are specific to a street so not very helpful.

Is it possible to do this in SearchKit by rewriting the text or using the field transformation to do this? I did wonder about using the Data Segmentation but we can have up to 70 different variations (and this isn't always predictable) so this would have to be perhaps 40-50 of the most common ones and then 'Other' as a catch all. Setting up the criteria for 'Other' could also be problematic if we have to say != one of 40 other defined patterns.

We currently use Views with some simple raw SQL :

> Left(civicrm\_address.postal\_code,4)

...but a colleague has spotted that the numbers don't add up properly. I can try to troubleshoot that but I'd rather recreate it in SearchKit if it's possible.

*(If you're interested, the issue in Views is that the subtotal appears to be correct and matches a search of contacts in the main database, but if I copy and paste the list into Excel and run a SUM formula, it's about 5% out).*

# Answer
I've put up a PR to make `LEFT()`, `RIGHT()` and `SUBSTRING()` available. If you don't want to wait for the release with these, just put a copy of those files into the right place.

That will let you show the truncated string in SearchKit but you can't add the `Group By` directly although SearchKit *does* understand it. So ...

1. Set up the rest of your search and add a Group By using the relevant `postal_code` (ignore the truncation part for now)
2. Save your search, go to the main search listing and click `Export`.
3. Use the `Copy to clipboard` button
4. Close the pop-up, and click `Import` on the Saved Searches listing.
5. In the pop-up, paste what you just exported.
6. Go the `groupBy` section and change `address_primary.postal_code` to `LEFT(address_primary.postal_code, 4)`

7. Finish with `Import`
8. Now open the search. You should see the grouping correctly displayed eg:

... and the results should be grouped as you want. :-)
> 4 votes

# Answer
Civi provides a smarty modifier that's the same as php substr, so if you add a search display to your searchkit you can check the box for rewrite on the field and use that modifier, like:

`{'[postal_code]'|substring:0:4}`

The single quotes are important.

The exact token depends your query. It might be something like `[Address.postal_code]`. You can use the `</>` dropdown to insert it.

P.S. I am seeing some strangeness though. It works for `1:4`, but not `0:4`. Odd.
> 0 votes

---
Tags: drupal-views, searchkit
---


title: Can't add dashlets on empty dashboard

text:
# Question
Title: Can't add dashlets on empty dashboard
When I remove all dashlets from my dashboard the droppable areas seems to be gone and I can no longer add any dashlets to it. There is no javascript error in the browser console. Having a least one dashlet in each column works fine.

I am on Drupal 9 and CiviCRM 5.62.0.

# Answer
> 3 votes
This is an issue of the Finsbury Park Theme: https://lab.civicrm.org/extensions/finsburypark

It doesn't occur on the default Theme and Shoreditch.

---
Tags: dashboard, dashlet
---


# Question
Title: dashboard and dashlets drag and drop broken. can drop any dashlet in dashboard
Good morning,

I'm new to Civicrm and I'm hooked! I was configuring the reports and dashlets for the Civicrm dashboard. At first everything was fine, but I decided to remove all the dashlets I already had in the dashboard to add the ones I needed. Since I removed them, I can't drop them on the dashboard anymore... I see all the dashlets and I can move them, but I can't drop them anywhere and I don't see any column where to drop them (according to the civi manuals). I'm stuck, I don't know what else to try, does anyone have the same problem? I work with wordpress.

Cheers to the community, you guys are awesome.

Translated with www.DeepL.com/Translator (free version)

# Answer
For me it's been an issue of the Finsbury Park Theme: https://lab.civicrm.org/extensions/finsburypark

It doesn't occur on the default Theme and Shoreditch.
> 2 votes

---
Tags: reports, dashboard, dashlet
---


# Question
Title: Intermittent failure to grant correct ACLs
We have a Drupal 9 site with approx 50 active users and some relatively complex ACLs (\>100 rules). For the vast majority of users, all works fine but we have a very small number of users who it fails for - one user in particular is affected almost daily and a handful of others are affected every couple of weeks or so. It's triggered when the user logs in, and they cannot see a particular group of contacts. To 'fix' it, a colleague has to remove them from the group and re-add them - and then the correct access is restored. However, it's intermittent and doesn't happen every time.

We've got as far as identifying something in the error logs -

```
21267 (
21268     [callback] => Array
21269         (
21270             [0] => CRM_Core_Error
21271             [1] => exceptionHandler
21272         )
21273
21274     [code] => -3
21275     [message] => DB Error: constraint violation
21276     [mode] => 16
21277     [debug_info] => INSERT INTO civicrm_acl_contact_cache (user_id, contact_id, operation) SELECT 0 as user_id, contact_a.id as contact_id, 'View' as operation  FROM civicrm_contact contact_a WHERE     ( (
21278             `contact_a`.id IN (
21279                SELECT contact_id FROM civicrm_group_contact WHERE group_id IN (154) AND status = 'Added'
21280
21281              )
21282           ) )  AND (contact_a.is_deleted = 0) GROUP BY contact_a.id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d9`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_us      er_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
21283     [type] => DB_Error
21284     [user_info] => INSERT INTO civicrm_acl_contact_cache (user_id, contact_id, operation) SELECT 0 as user_id, contact_a.id as contact_id, 'View' as operation  FROM civicrm_contact contact_a WHERE     ( (
21285             `contact_a`.id IN (
21286                SELECT contact_id FROM civicrm_group_contact WHERE group_id IN (154) AND status = 'Added'
21287
21288              )
21289           ) )  AND (contact_a.is_deleted = 0) GROUP BY contact_a.id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d9`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_us      er_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
21290     [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_acl_contact_cache (user_id, contact_id, operation) SELECT 0       as user_id, contact_a.id as contact_id, 'View' as operation  FROM civicrm_contact contact_a WHERE     ( (
21291             `contact_a`.id IN (
21292                SELECT contact_id FROM civicrm_group_contact WHERE group_id IN (154) AND status = 'Added'
21293
21294              )
21295           ) )  AND (contact_a.is_deleted = 0) GROUP BY contact_a.id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d9`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_us      er_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
21296 )
21297

```

As well as `[debug] $API Request Authorization failed` at the same time. Can someone help me figure out where to look?

# Answer
> 1 votes
*Warning: half an answer at best!*

> ```
> CONSTRAINT `FK_civicrm_acl_contact_cache_user_id`
> FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`)
> ON DELETE CASCADE
>
> ```

This suggests that the user\_id value doesn't exist in the contact table.

And this makes sense because the user\_id here is 0; and there will not be a contact with ID 0.

But I don't understand when or why `user_id` 0 specified?

---
Tags: acl, debugging
---


# Question
Title: Sent mail is %randomstring%@yourdomain.tld
We just upgraded to the latest civi 5.62.0 and after doing so when we send an email out of the system it sends a seemingly random string @ our domain name as the "from". Here's an email header:

```
b.53.4009.d2f1d0d5b9a05516@ourdomain.tld
b.51.4008.e06411d46896dda8@ourdomain.tld
...and so forth and so on always different but it seems to increment upward.

```

This system uses PHP version 8.1.20 which meets or exceeds the recommendation of 7.4. Extensions All extensions are up-to-date:

```
Access Control by Financial Type for Reports: Version 2.0
AuthX: Version 5.62.0
Civi-Import: Version 5.62.0
CiviCRM Administration UI: Version 5.62.0
CKEditor4: Version 5.62.0
Custom search framework: Version 5.62.0
Event Cart: Version 5.62.0
ExtendedReport: Version 5.21
Financial ACLs: Version 5.62.0
FlexMailer: Version 5.62.0
Form Core: Version 5.62.0
Membership Renewallinks: Version 1.1
reCAPTCHA: Version 5.62.0
SearchKit: Version 5.62.0
Sequential credit notes: Version 5.62.0
Theme: Greenwich: Version 5.62.0

```

Is there a bug in a file that creates the mail that creates a random string@...? I also disabled the original system default email and created a new one with the same odd result.

I downloaded a copy of the mariadb / mysql database and searched through it but I only see our configured mail in there correctly. This is beyond my scope of knowledge.

Can anyone assist in tracking down what file in the system is doing this and some code to tweak this behavior?

Thanks!

# Answer
Emails have two "from" addresses. One is the 'smtp-from' or 'envelope-from', and the other one ('header from') is the one that you see in your email program.

The email addresses you are referring to are for "bounce tracking", and normally, they would be set as the smtp-from, but not the header-from, and you wouldn't see that as the recipient, you'd see the address you (the sender) put as the (header) from address.

If the issue is that you are now seeing the smtp-from/envelope-from address as the header-from (after the php upgrade), then I suspect it has to do with some handling of the mail after it leaves civicrm, i.e. by whatever php has setup for it's mail. There's probably some simplified mail agent that drops the header from and then it gets replaced by the smtp-from.

I'll go out on a limb and guess that your previous setup might not have included bounce handling anyway.
> 2 votes

---
Tags: civimail
---


title: Multiple group profile sign up

text:
# Question
Title: Multiple group profile sign up
My organisation are moving over to CiviCRM. We currently offer a range of different newsletters about different themes and issues. I will obviously need a group for each theme, and I want to build a profile that allows users to opt into the different groups based on their preferences.

However, I can only work out how to add a user to a single group when they fill in a profile, but I don't want them to have to enter their details multiple times, and I want them to be able to change their preferences later (I think via the GDPR plugin). Has anyone done similar? How did you manage this?

My approach now would be to have custom fields for each theme/issue that they select, and these are pulled into smart groups. But I'm not sure how a user could later manage their own preferences.

Thanks!

# Answer
You can create a profile that would be used for the user to create or update their preferences with custom fields as you suggest (checkboxes or a multi-select drop-down). You would then either have to create them as users in your system so that they could edit them later by logging in or make use of the user id and checksum functionality to allow them to access their own settings without needing a login.

A sample url might be http://example.org/civicrm/profile/edit?reset=1&gid=IDNUMBER&{contact.checksum}&id={contact.contact\_id} You could potentially send it via email in response to a request in a public form or even include it as a link at the bottom of the newsletter itself.

You'll find the information you need to make more use of checksums and other tokens here: https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/
> 1 votes

# Answer
If you set your Groups to be 'mailing list' AND you set them to be 'public pages' then you should be able to

a/ add the Group(s) field to any profile

which you can temporarily see at https://dmaster.demo.civicrm.org/civicrm/profile/create?gid=1&reset=1

or

b/ direct people to /civicrm/mailing/subscribe?reset=1 and see all the Public Mailing Lists

the example for this should be at https://dmaster.demo.civicrm.org/civicrm/mailing/subscribe
> 3 votes

---
Tags: profile, groups, newsletter, subscribe
---


# Question
Title: is it possible civicrm templates_c files to be stored under the server /tmp folder?
Has someone tried it? On a 1st try I've noticed extensions stop working. For example if I set define( 'CIVICRM\_TEMPLATE\_COMPILEDIR', '/tmp/civicrm/templates\_c/'); would it work? (instead of ABSPATH.'wp-content/uploads/civicrm/templates\_c/) I need it for a civicrm install under WPEng hosting where they do not allow php script to write into another php script within wordpress. Hence re-generating the templates\_c files is a problem.

# Answer
Just don't use WPEng hosting for civicrm.
> 1 votes

---
Tags: wordpress, templates, cache
---


# Question
Title: civicrm_post hook not firing upon contact creation
I am writing a custom plugin for wordpress that stores contact data when a new individual is created in CiviCRM. I wrote a test function to see if the 'civicrm\_post' hook fires when a new individual is created, but the body inside the function doesn't execute (ie. nothing is logged to console)

This is the code:

```
function appeal_generator_civicrm_post($op, $objectName, $objectId, &$objectRef) {
        echo "<script> console.log('contact has been adjusted') </script>";
}

add_action( "civicrm_post", "appeal_generator_civicrm_post", 10, 4 );

```

I have also tried the postCommit hook as well as copy-pasted the demo code for the civicrm\_post hook that is on the civicrm website, but nothing executes when a new individual is created.

I have checked that the plugin is correctly setup within the /wp-content/plugins directory and that it is activated on wordpress, and there are no errors in the server logs.

Is there a different hook I should be using or is there a setup issue with the plugin?

# Answer
The hooks run in php not javascript, so it won't log anything to the js console.

If you want to log, use `\Civi::log()->debug('hello');` and then look in the ConfigAndLog directory in the logs there.

Or use `error_log('Hello');` and then check whereever that goes (usually the web server log).

Or even more low-level:

```
$fp = fopen('/path/to/my-own-log-file', 'w');
fwrite($fp, 'Hello');
fclose($fp);

```
> 3 votes

---
Tags: wordpress, hooks
---


# Question
Title: CiviRule condition base on contribution page?
I'd like to send users a notification email when someone donates from a specific contribution page - is this possible? I don't see contribution page in the list of condition options in CiviRule.

# Answer
Lars' answer is correct, but there are some caveats for sending notifications based on the contribution page.

* You must use the "Contribution" as your trigger entity, not "Contribution Page". That may be obvious.
* You have to use "is changed" in the trigger, not "is added". Contributions are first created with a "Pending" status, then the card is charged, and if successful, changed to "Completed". If you use "Contribution is Added" you'll send notifications even if their payment failed.
* Because "Contribution is changed" any time you make a change on the back end, you must add an additional condition: "Compare Old Contribution Status to New Contribution Status". Set it to `Old value != Completed and new value = Completed`. That way, it only triggers once, when the charge completes successfully.
* If your notification contains tokens that reference subsidiary entities (memberships, participants, soft credits) you must add a delay of 1 minute (or more) to the notification. Other entities are created after the contribution, and won't exist yet if you send immediately.

Your setup should look somewhat like this screenshot (this rule doesn't need a delay, and the field value comparison should be `=`, not `!=`):
> 2 votes

# Answer
You can use Field Value Comparison to check the Contribution Page.

Field Value Comparison is the slightly more manual way to check basically any field you want in CiviRules — it opens up a lot of options. Always test because things might not work quite as you expect with fields that can have multiple values and other more complex situations, but Contribution Page should be pretty straightforward.
> 1 votes

---
Tags: civirules
---


# Question
Title: How to make Specific permssions for roles
I am using civicrm as my main source of managing my documents and all. What I do want is that I have a sales team that I don't want to show the specific pages or tabs. I already installed the role plugin but I want to make custom permissions. Can anyone please help me out with this.

# Answer
The answer varies depending on the tabs and pages we're talking about, so additional context would be helpful.

However, if it's acceptable to hide but not disallow access to someone who's specifically trying to bypass your restrictions, the Contact Layout Editor extension allows customizing who sees which tabs on a per-group basis (CiviCRM groups, that is).
> 0 votes

---
Tags: webform-civicrm, permissions, civicrm-home, roles
---


# Question
Title: error "Cannot add TextRun in TextRun." when generating docx file in CiviCase
I have customized CiviCase for a client who is using it to manage project grants. Things have gone pretty well overall. There are many custom fields and several related document templates in use. "Print/Merge Document" works fine when generating a pdf, but often fails when generating a docx file.

The error that is generated on screen is simply "Cannot add TextRun in TextRun.", but looking into the CiviCRM log shows a little more detail and that the error is in the 3rd-party phpoffice code (which I've never heard of before today).

```
    $Fatal Error Details = array:3 [
  "message" => "Cannot add TextRun in TextRun."
  "code" => null
  "exception" => BadMethodCallException {#12247
    #message: "Cannot add TextRun in TextRun."
    #code: 0
    #file: "/var/www/sitename/wordpress/wp-content/plugins/civicrm/civicrm/vendor/phpoffice/phpword/src/PhpWord/Element/AbstractContainer.php"
    #line: 266
    ...
    /var/www/sitename/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Utils/PDF/Document.php:90 {
       CRM_Utils_PDF_Document::html2doc($pages, $fileName, $format = [])
    ›   $section = $phpWord->addSection($pageStyle + ['breakType' => 'nextPage']);
    ›   \PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
    › }

```

The error only occurs when one of the custom fields of type "Rich Text Editor" is populated. All of the simpler fields seem fine. I'm not familiar with this code and so am not really sure whether this is a bug (and out of my power to fix) or some glitch in my custom fields that should be corrected.

Any thoughts?

UPDATE: Converting the rich text field type to multi-line text didn't fix the problem. Accented characters were converted to html entities and paragraph tags were added (or maybe kept) in the filed conversion. However, deleting the content and re-adding it as UTF-8 text with the accents into the multi-line field did prevent the error. I guess there is a bug in the phpoffice code with respect to html entities. Changing the field type is not a fix, but I may be able to live with it if there is no better solution.

Running CiviCRM 5.61.0 on WordPress 6.2.2 on Debian Bullseye

# Answer
If you're feeling brave - we're using version 0.18.3 (Feb. 2022 release) of PhpWord in Civi. If you know how to use Composer, you could upgrade to PhpWord 1.1 (May 2023 release).

If you don't know Composer, you can also probably delete the phpword directory in `/vendor/phpoffice` and unzip the new one in there.

Hopefully this is obvious, but don't do either of these on a live site! Use a test site.
> 1 votes

---
Tags: civicase, printmerge
---


# Question
Title: How can a Report to Display State Abbreviations?
The report "Membership Details" at civicrm/report/instance/23 shows "State/Province" in the results, but we want to see the State abbreviation instead.

# Answer
You can either user alterReportVar hook to alter the result or add a new column via the same hook to display State Abbreviation.
> 2 votes

# Answer
A no-coding solution is to rebuild the report in SearchKit.

You need to explicitly join to the State/Provinces, but once you do, you can add a display, then use the "Rewrite" on the state/province, changing it to abbreviation with this token: `[Address_StateProvince_state_province_id_01.abbreviation]`. Below the screenshots is an export of my query and display, you can import it to use as an example.

Attached are screenshots showing this in use.

### My Query Configuration

### My Display Configuration

```
[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "example_abbreviation",
          "label": "example abbreviation",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "Address",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "Address_StateProvince_state_province_id_01.name"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "StateProvince AS Address_StateProvince_state_province_id_01",
                "LEFT",
                [
                  "state_province_id",
                  "=",
                  "Address_StateProvince_state_province_id_01.id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ],
  [
    "SearchDisplay",
    "save",
    {
      "records": [
        {
          "name": "Addresses_Table_1",
          "label": "Addresses Table 1",
          "saved_search_id.name": "example_abbreviation",
          "type": "table",
          "settings": {
            "description": null,
            "sort": [],
            "limit": 50,
            "pager": [],
            "placeholder": 5,
            "columns": [
              {
                "type": "field",
                "key": "id",
                "dataType": "Integer",
                "label": "Address ID",
                "sortable": true
              },
              {
                "type": "field",
                "key": "Address_StateProvince_state_province_id_01.name",
                "dataType": "String",
                "label": "Address State/Province: State",
                "sortable": true,
                "rewrite": "[Address_StateProvince_state_province_id_01.abbreviation]"
              }
            ],
            "actions": true,
            "classes": [
              "table",
              "table-striped"
            ]
          },
          "acl_bypass": false
        }
      ],
      "match": [
        "name",
        "saved_search_id"
      ]
    }
  ]
]

```
> 2 votes

# Answer
Using the civicrm\_alterReportVar hook, this can be coded fairly easily. Here is very simple code (for WordPress) to adjust the state from the full name to the abbreviation, using the CiviCRM API:

```
// Implements hook_alterReportVar
add_filter( 'civicrm_alterReportVar', 'DNS_alterReportVar_callback', 10, 4 );
function DNS_alterReportVar_callback($varType, &$var, $reportForm) {
  if ('rows' == $varType && 'Detail' == $reportForm->getname()) {
    foreach($var as $k => $row) {
       $stateProvinces = \Civi\Api4\StateProvince::get()
         ->addSelect('abbreviation')
         ->addWhere('name', '=', $row['civicrm_address_address_state_province_id'])
         ->execute();
       $var[$k]['civicrm_address_address_state_province_id'] = $stateProvinces[0]['abbreviation'];
    }
  }
}

```
> 1 votes

---
Tags: civireport, reports
---


# Question
Title: Drupal Webform calculating to Zero for paid event
Using CiviCRM 5.58.1 and Drupal 7.97 I have a field that calculates the total cost using conditionals in the webform: \[subscriptions\]\[civicrm\_1\_participant\_1\_participant\_fee\_amount\] (I also did try to take it out of the fieldset in case that was messing up the calculation. This did not change the result)

As far as I know, this form, before I began to edit it for current event and price changes, DID work. Now the "Continue to payment page" comes up **as zero**, except for any additional contribution entered by the user. (I had this problem recently on another CiviCRM site, and gave up and changed to using an event page instead of a webform.)

**How it looks to user:**

Subscriptions Subscription series ordering * 2

Subscription series price * x $150

Subscription Series Cost * $300

*Above Subscription Series Cost is the `civicrm_1_participant_1_participant_fee_amount` field*

Additional tax deductible contribution $

**Continue to payment page**

2023-2024 Subscription Series **Total $ 0.000**

Above example should charge the user $300, not $0!!

# Answer
> 0 votes
Hopefully someone who knows more about this might be able to give you a better answer. My experience (also on D7) has been that this is finicky and sometimes does not work, as you are experiencing. What has sometimes helped for me is to remove all these fields from the form by removing the participant and contribution from the CiviCRM tab and then re-adding them. It seems to also sometimes help to put everything on one page (and remove them all from fieldsets or put them all in the same fieldset). Probably there is something specific going wrong, but I've never been able to figure out exactly what it is.

---
Tags: civievent, webform-civicrm
---


# Question
Title: Constant Authorization failed error + crashing Wordpress
> LAMP CentOS (CPanel) PHP-FPM PHP 7.3 Wordpress 6.2.2 Civi version: civicrm-5.62.1-wordpress "the\_website" = redaction from the actual user + website :)

I keep running into this problem ever since we upgraded the last two times. The last time I upgraded was because of this same error. It works for a while then breaks seemingly for no reason! Can I disable this api4 security check? It's crashing the site constantly! I had upgraded the site to PHP 8.1 but CIVI was using some kind of mail tracking header for "no\_reply@the\_website.net" to some kind of GUID\_tracker@the\_website.net", so I back rev'd to PHP 7.3 and that fixed the odd email problem. Then it started crashing the site for no reason.

```
Error:
thrown in /home/the_website/civi.the_website.net/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php on line 232 [23-Jun-2023 06:02:15 UTC] PHP Fatal error:  Uncaught CRM_Core_Exception: [unauthorized: Authorization failed

```

My cron is killed that does an api call to send mail and when I tried to run the flush cache command manually just to see what it does, it also fails.

```
[~/civi.the_website.net/wp-content/plugins/civicrm/wp-cli]# /opt/cpanel/ea-php73/root/usr/bin/php ~/civi.the_website.net/wp-content/plugins/civicrm/wp-cli/cv.phar flush --cwd=/home/the_website/civi.the_website.net/
In Kernel.php line 232:
Authorization failed
flush [-T|--triggers] [--level LEVEL] [--hostname HOSTNAME] [-t|--test] [-U|--user USER]

```

^ I also tried it with the "admin" user flag, same results

Again, this worked fine and dandy after yesterdays upgrade and the website became usable again. Then, after some time, perhaps with some other thing running on civi in the background, it breaks at like 6am every morning like it did on Wednesday. Can someone help me to turn off these security checks until these bugs get worked out?

Here is my cron which calls the admin user but still fails: \*/5 * * * * /opt/cpanel/ea-php73/root/usr/bin/php ~/civi.the\_website.net/wp-content/plugins/civicrm/wp-cli/cv.phar api job.process\_mailing --user=admin --cwd=/home/the\_website/civi.the\_website.net/ \> ~/civi.the\_website.net/cron.log

I'm hurt'n LOL, thanks!

# Answer
> 1 votes
The cron job needs to call `wp` not `civicrm/wp-cli/cv.phar`

I'd suggest  `*/5 * * * * /opt/cpanel/ea-php73/root/usr/bin/php wp cv api job.process_mailing --user=admin --path=/home/the_website/civi.the_website.net/ auth=0`

In place of `wp` you may need to full path to the wp-cli script on the server. I have to install this myself on most cpanel servers. Instructions are here: https://wp-cli.org/#installing

CiviCRM's documentation is at https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#wp-cli

Added from Comments:

> that's what it was! I restored the /home/user\_dir/subdomain.domain.net/wp-content/uploads/civicrm \> edited the civicrm.settings.php to reflect a new password without special characters \> changed the db user password to that and it came right up. Warning to any and all, no special characters in your mysql / maria db password!

---
Tags: wordpress
---


# Question
Title: Cannot save tags on SearchKit saved search
We're having an odd problem with saving tags on SearchKit saved searches that I cannot replicate on dmaster. If you try to save a search with changes to the search itself or to only the tags, it works fine. If you change the search and change the tags, the tag changes are not saved and in fact all tags are removed from the search - which is a real pain! The save button just says saving indefinitely, though the changes to the search are saved (except the tags).

When this happens, I note a console error: `POST [Our site]/civicrm/ajax/api4 503 (Service Unavailable)`, followed by a `Possibly unhandled rejection: undefined`. But it is unclear to me why `[Our site]/civicrm/ajax/api4` would be called (as opposed to `[Our site]/civicrm/ajax/api4/entity/`). This URL does in fact return a 503 on our site and returns `Could not find valid value for calls` on dmaster (where this problem does not occur).

This is on 5.56.2 on D7, but it has been occurring since at least 5.49.

# Answer
Turns out this was somehow due to the CiviCRM Entity Drupal module (we had 7.x.2.3). Not entirely sure what was happening as I can't reproduce it locally, but disabling the module fixes the problem.

This was logged: `Error: Cannot use object of type CRM_Core_DAO_EntityTag as array in civicrm_entity_civicrm_post() (line 3601 of /var/www/html/sites/all/modules/contrib/civicrm_entity/civicrm_entity.module).`
> 0 votes

---
Tags: searchkit
---


# Question
Title: CiviCRM WordPress OAuth2 Google Workspace Labeling
CiviCRM v5.62.0 WordPress v6.2.2 OAuth2 working properly.

My problem is that it labels ALL of my email either label:inbox-civimail-ignored (none yet) or label:inbox-civimail-processed (all thus far). When this happens it clears out the inbox, marks everything read and I have to select All Mail to view my emails and then try to figure out what is what. We rarely have any email related to CiviCRM, but have to make sure we do not miss a new registration or whatnot. Deleting the labels does nothing because ANY email that comes in triggers this labeling.

Where can I go in the code to get rid of this labeling?

Thank you!

# Answer
By changing the Bounce email to a different email address, in this case a simple Gmail and not Google Workspace, I can report that it does nothing. It is worthy to note that fundamentally, our issue is that we pay enough money for the branded email and domain as it is. So, as using an alias wasn't financially sound, it ended there.

What worked was simply shutting off the Scheduled Job, Process Inbound Emails (API call: fetch\_activities). Like I say, we are not dealing with tens of thousands of folks yet and when we do, we will simply buy the new email and turn the jobs back on.

I attribute the solution to @petednz-fuzion for making me understand that it was the Bounce email address that may have caused the original issue! Thank you, sir!
> 1 votes

---
Tags: wordpress, oauth
---


title: Add civirule for Chasse

text:
# Question
Title: Add civirule for Chasse
I'm trying to configure Chasse for some automated email campaigns for new supporters. I understand I need to add a new CiviRule action (we installed Chasse after CiviRule but it has added a new rule as this documentation has said it would) https://docs.civicrm.org/chasse/en/latest/starting/#manually-installing-the-civirules-action Can anyone talk me through manually adding the required rule? Thanks!

# Answer
> 2 votes
Go to Support - Developer - Api Explorer v3. Select Entity CiviRuleAction, Action create. Add in the top three parameters as indicated on the page you've linked to (you don't need is\_active, that'll be set by default). Click Execute.

---
Tags: civirules
---


# Question
Title: Create User Record action on a Contact summary page throws error. Is this a bug?
This is with CiviCRM 5.60.0 on Drupal 9.5.5.

On the Contact Summary page there is an action to "Create User Record"

When this is clicked it gives an error:

After this the system shows the following:

* The original Contact has not had a Drupal User added.
* There is a new Contact with the same email address as the original, but also using that email as the Contact's name.
* The new Contact is linked to a new Drupal User record.

It looks to me like a de-duplication problem. Our Unsupervised De-dupe rule requires both the Contact's Name and Email address to match (or Name and Postcode to allow for legacy Contacts without a recorded email address). If I change this to Email only then there is no error, and the Drupal User record links correctly.

Thank you, Tony.

In case it is of use this is the backtrace logged against the error. (I can't see how to attach as a file.)

```
$backTrace =

#0 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Error.php(952): CRM_Core_Error::backtrace("backTrace", TRUE)

#1 /home/lalg/www/d9dev1/vendor/pear/pear-core-minimal/src/PEAR.php(945): CRM_Core_Error::exceptionHandler(Object(DB_Error))

#2 /home/lalg/www/d9dev1/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...")

#3 /home/lalg/www/d9dev1/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-5, 16, (Array:2), "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...")

#4 /home/lalg/www/d9dev1/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...", "DB_Error", TRUE)

#5 /home/lalg/www/d9dev1/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))

#6 /home/lalg/www/d9dev1/vendor/pear/db/DB/mysqli.php(943): DB_common->raiseError(-5, NULL, NULL, "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...", "1062 ** Duplicate entry 'alfieri3xy@virginmedia.com-1' for key 'UI_uf_name_do...")

#7 /home/lalg/www/d9dev1/vendor/pear/db/DB/mysqli.php(413): DB_mysqli->mysqliRaiseError()

#8 /home/lalg/www/d9dev1/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...")

#9 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-packages/DB/DataObject.php(2696): DB_common->query("INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...")

#10 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-packages/DB/DataObject.php(1245): DB_DataObject->_query("INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_...")

#11 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/DAO.php(683): DB_DataObject->insert()

#12 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/BAO/UFMatch.php(40): CRM_Core_DAO->save()

#13 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/BAO/CMSUser.php(50): CRM_Core_BAO_UFMatch::create((Array:4))

#14 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Contact/Form/Task/Useradd.php(113): CRM_Core_BAO_CMSUser::create((Array:10), "email")

#15 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Form.php(578): CRM_Contact_Form_Task_Useradd->postProcess()

#16 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()

#17 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Contact_Form_Task_Useradd), "next", "Next")

#18 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Form_Task_Useradd), "next")

#19 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Task_Useradd), "next")

#20 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle("next")

#21 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Contact/Page/View/Useradd.php(35): CRM_Core_Controller->run()

#22 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(319): CRM_Contact_Page_View_Useradd->run((Array:4), NULL)

#23 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:18))

#24 /home/lalg/www/d9dev1/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))

#25 /home/lalg/www/d9dev1/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:4))

#26 /home/lalg/www/d9dev1/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke((Array:4))

#27 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:4), "")

#28 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2))

#29 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()

#30 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

#31 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2))

#32 /home/lalg/www/d9dev1/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()

#33 /home/lalg/www/d9dev1/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

#34 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#35 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#36 /home/lalg/www/d9dev1/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#37 /home/lalg/www/d9dev1/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#38 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#39 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#40 /home/lalg/www/d9dev1/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#41 /home/lalg/www/d9dev1/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE)

#42 /home/lalg/www/d9dev1/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

#43 {main}

```

# Answer
> 0 votes
This is fixed now in 5.63. See ticket mentioned in comments: https://lab.civicrm.org/dev/drupal/-/issues/186

---
Tags: duplicate-contacts, drupal-9
---


title: - Could not find valid value for id

text:
# Question
Title: - Could not find valid value for id
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. DB Error: unknown error Return to home page.

There's nothing in the DB log.

I tried the Settings/Cleanup Caches and Update Paths/ panel doing both Cleanup Caches and Reset Paths, but to no avail.

This was from civi that was upgraded. I read that this can be caused by a problem when the database does not upgrade properly.

Since i didn't have much data, I did a fresh install, so a clean 5.94.4 and recreated custom fields, two profiles and two events.

When registering for the events i still get the same error on my clean install.

Backtrace gives me the following: CRM\_Core\_Exception: Could not find valid value for id in /home/mobility/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Event/StateMachine/Registration.php on line 27

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Could not find valid value for id

\**** I did find this reference, seems this problem has been seen since 2015? CiviEvent - Error when registering: Could not find valid value for id

Are there any current solutions? My CiviEvent setup is quite vanilla. HELP!

# Answer
I reduced the number of fields in the profile - I was at 40 and brought it down to 35. I had a big text block of Terms and Conditions with a "Do you accept the Terms & Conditions", with a "Yes" radio button as required field. and that was just too big. I just had a successful registration for our championship, from Hawaii no less!
> 1 votes

# Answer
We encountered the same problem after the upgrade to CiviCRM version 5.62.1 on Joomla 3.10.11. Event registrations are impossible now. We didn't see this error in previous versions.
> 0 votes

# Answer
Are you using YOOtheme Pro? And its extension Essentials for YOOtheme by ZOOlanders?
Try deactivating the plugin: https://lab.civicrm.org/dev/core/-/issues/4394#note\_92175
> 0 votes

---
Tags: civievent, joomla, database
---


# Question
Title: "Could not find valid value for id" after event registration on WordPress 5.9.1 and CiviCRM 5.47.2
When participants confirm the registration to an event (paid, in this case, but the error is the same for free ones), an error appears (the one in the title). The bug stack in the logs:

```
CRM_Core_Exception: Could not find valid value for id in /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php on line 27

0   CRM_Utils_Request::retrieve('id', 'Positive', Object(CRM_Event_Controller_Registration), true)  /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php:27
1   CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), true)   /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php:27
2   CRM_Event_Controller_Registration->__construct('Event Registrati…', true, 'null', null, 'false')    /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:314
3   CRM_Core_Invoke::runItem(Array) /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
4   CRM_Core_Invoke::_invoke(Array) /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
5   CRM_Core_Invoke::invoke(Array)  /var/www/wordpress/wp-content/plugins/civicrm/civicrm.php:1199
6   CiviCRM_For_WordPress->invoke() /var/www/wordpress/wp-content/plugins/civicrm/includes/civicrm.basepage.php:380
7   CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))    /var/www/wordpress/wp-includes/class-wp-hook.php:307
8   WP_Hook->apply_filters(null, Array) /var/www/wordpress/wp-includes/class-wp-hook.php:331
9   WP_Hook->do_action(Array)   /var/www/wordpress/wp-includes/plugin.php:522
10  do_action_ref_array('wp', Array)    /var/www/wordpress/wp-includes/class-wp.php:771
11  WP->main('')    /var/www/wordpress/wp-includes/functions.php:1310
12  wp()    /var/www/wordpress/wp-blog-header.php:16
13  require('/var/www/wordpre…')    /var/www/wordpress/index.php:17
14  {main}

```

And the error that the users see is `Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.` `Could not find valid value for id`

Note that I've looked at other questions and answers related to this, and, among others, I made sure that CiviCRM uses a valid Wordpress page in `Administer -> System Settings -> CMS Database Integration` (called 'civicrm'), that caching is disabled, and that clean URLS are activated, as they suggested.

The way I get to the event page is by first navigating to the list in `https://mydomain.tld/civicrm/event/list/`, and then selecting one event in the list.

I tried to also create a new blog post, insert the short code `[civicrm component="event" id="8" action="info" mode="live" hijack="0"]`, and click on `Register`, but I get the very same error...

There's one comment that may be relevant, but I didn't understand how to act on; who knows, maybe it's relevant, but I don't know what it means to "re-enter the links to Events in the shortcode for the WP calendar".

Thanks in advance.

# Answer
> 1 votes
Partial success: If I set the `Shortcode Display Mode` setting to `Remain in Shortcode Mode`, then registration completes successfully without the error *if I access the event via a short code*.

However, I still get the error if I register to an event that I access via the list in `https://mydomain.tld/civicrm/event/list/` (and then selecting one event in the list and clicking Register).

# Answer
> 1 votes
Can you also see if you have Cleaner URLs enabled?

This post CiviEvent - Error when registering: Could not find valid value for id details the settings and what issues that has fixed.

Cleaner URLs are the default now, but if your site has been upgraded from an older version they may not be enabled.

# Answer
> 0 votes
Are you using YOOtheme Pro? And its extension Essentials for YOOtheme by ZOOlanders?
Try deactivating the plugin: https://lab.civicrm.org/dev/core/-/issues/4394#note\_92175

---
Tags: wordpress, civievent
---


# Question
Title: How to override token {action.resubscribe} for Mailings
I would need to **override** the value of the token **{action.resubscribe}** in the automated mailing message template when the contact is sent the **unsubscribe confirmation email**, as it doesn't contain the right email address.

How could I change this value?

Any help with that would be very much appreciated.

# Answer
> 1 votes
The token **{action.resubscribe}** is taken from the field "***domain***" in the table ***civicrm\_mail\_settings***. It contained the old domain.

By changing this value to the new domain we managed to fix the problem so that the unsubscribe confirmation email contains the right email address if the contact wants to re-subscribe.

---
Tags: civimail, tokens, mailing, unsubscribe
---


title: Allow organisations to edit profile

text:
# Question
Title: Allow organisations to edit profile
My organisation is an umbrella group for a number of organisations around the world. We're wanting to use CiviCRM to administer a network of organisations, alongside our own individual supporters.

I want to be able to send a periodic checksum email to representatives from the organisations who make up our network, to make sure the various details we hold on them are correct. I've set up the profile but when I try to access a test organisation via a Checksum email I get the message " This profile is configured for contact type 'Member\_organisation'. It cannot be used to edit contacts of other types."

Does anyone have any guidance on how we can achieve this? Ideally the person editing the profile won't have to have their own record on our CiviCRM database.

Thanks!

# Answer
I think I worked out the problem - I needed to change the permissions in Drupal to allow access to profiles. When I send a test organisation a test email to my own account, I can access the profile with the current data we hold viewable and editable.
> 1 votes

---
Tags: profile, permissions, access
---


title: Mailing never starts - is this a bug?

text:
# Question
Title: Mailing never starts - is this a bug?
Group emails from one of my CiviCRM installations are not being delivered (ever), which has caused some embarrassment. Messages can be composed as usual, but are never scheduled and there's no "runner" display. Pausing and restarting the mailing results in the status changing from "Scheduled" to "Running" and clicking "Report" shows the expected number of intended recipients but the "Successful Deliveries" count is always zero. In case it's relevant, I did notice that the option to send "immediately" is not selected by default (which I think it always is on sites that work), but it can be selected manually.

Obviously, I have enabled the "Send Scheduled Mailings" job and tried triggering that both manually and from a cron job. The log shows success but with a count of zero.

I have also tried obvious things like disabling all extensions, resetting caches and paths, comparing all settings with other installations that do work, searching the forums, bug reports and so on. I've checked that outgoing mail is configured correctly and I can send test emails. There's nothing in the error logs. Nothing makes any difference, it seems to be a bug.

The problem is reproducible in the sense that it's not intermittent, but I haven't been able to reproduce it on a clean installation.

I'd be prepared to move everything to a new installation to work around this but it's a heavily used instance with lots of contacts, invoices and so on and I know of no way to export all those and reimport them later to a working instance. Everything else seems to be working as usual.

Reproduction steps

* Create a group containing some test contacts.
* Go to **Mailing \> New Mailing** and compose a test message, with the group from the previous step selected as Recipients.
* Click **Send test** and check that a test message is correctly delivered.
* Click **Next** then select **Immediately** or a date and time 5 minutes in the future.
* Click **Submit Mailing**.
* Wait for cron to run or go to **System Settings \> Scheduled Jobs** and trigger **Send Scheduled Mailings**. Check that the result is success.
* Check that the message is now in **Mailing \> Scheduled and Sent Mailings**. Click **Report**. Observe that **Intended recipients** is not zero but **Successful deliveries** is always zero.

**Current behaviour**

Nothing happens. No messages delivered, nothing in error logs.

**Expected behaviour**

Messages are sent once the scheduled job is triggered, perhaps with a batch limit. Eventually the whole job completes and the status changes to "Completed".

**Environment information**

Browser: *Chrome 114.0.5735.135* CiviCRM: *Master/5.62.1* PHP: *8.1* CMS: *WordPress 6.2.2 running on Ubuntu 22.04* Database: *MariaDB 10.6.12* Web Server: *OpenLiteSpeed 1.7.17*

**Updates**

The mailing report shows "Status: Scheduled" even though the schedule is in the past and a manual "Send Scheduled Mailings" job has been triggered and reports success. This looks like a scheduling issue.

Having turned on "NOTICE" PHP debugging I see dozens of "Undefined array key" warnings. As far as I can tell they shouldn't be causing this problem and there's no easy way to fix them, but here are the first few examples in case it's relevant:

2023-10-07 15:22:44.774502 \[NOTICE\] \[3336769\] \[2a00:23c4:80aa:9901:6d1d:6953:a92e:8aa2:55029:HTTP2-273#beechesit\] \[STDERR\] PHP Warning: Undefined array key "campaign" in /home/beechesit/public\_html/wp-content/uploads/civicrm/templates\_c/en\_GB/%%CA/CA3/CA322A60%%Report.tpl.php on line 147

Another update in case it's relevant: I moved the installation to a new server and now I'm seeing these errors when running the CiviCRM cron job:

PHP Warning: Undefined property: CRM\_Core\_DAO::$mailing\_id in /home/beechesit/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php on line 41

Another update in case it's relevant - the "Notes" tab has disappeared from all my contacts.

I'm trying to move everything to a fresh installation but it's a very complicated process! In particular, it's hard to match contributions to contacts and a lot of information is not exportable and is being lost, for example creation dates. This has become a disaster :-(

# Answer
If the mail never went out, it's likely that there's a crash occurring during the sending of the mail. This can be particularly difficult to track down, but there is often an entry in your PHP log (or WP debug log, if it's enabled). More rarely, there's an entry in the CiviCRM "ConfigAndLog" log.

If you have Smarty processing for CiviMail enabled, you may want to disable it to see if the problem persists - the most common cause I've seen for a crash here is that there's malformed Smarty in an email.

Another cause I've seen is an unusual SMTP response from the server - though in your case we can rule that out.

Some more info to help with troubleshooting:

* Does the problem occur on a very simple test message?
* If you find PHP errors in the log, please share.
> 1 votes

---
Tags: mailing, failure
---


title: CiviCRM Extension MS Office 365

text:
# Question
Title: CiviCRM Extension MS Office 365
we are using 5.4.21 based on WordPress and we are using the extension MS Office 365 Release 1.

We are following the instruction of the readme (https://lab.civicrm.org/extensions/msoffice365/-/blob/main/README.md), but we have the problem that we can´t find where to download the manifest file.

Could you please help us?

Thanks

Stefan

# Answer
> 0 votes
I don't believe a manifest exists, the app must be created in the Azure UI.

---
Tags: wordpress, extension
---


# Question
Title: Experience of including checksum in all emails
I would be interested to hear any advice or experience of including a checksum link in all emails sent to our various newsletter lists. We're interested in doing this because we have quite a variety of email lists on different topics. This means an opt-out link (which we obviously include as well) is quite a blunt tool for controlling what sort of content people receive. We would rather regularly offer them the option of updating their preferences if they're not getting the email newsletters they want from us. Does anyone include a regular email checksum link in their emails? Have you run into any problems doing so?

# Answer
> 1 votes
I've run checksum on all emails to over 160K recipients without issue. Just make a profile or respective CMS form (Drupal webform / Caldera Form) that allows them to select the public email groups you want them to opt into or out of.

I like to extend the checksum expiration to say 30 days.

---
Tags: checksum
---


title: CIVI CRM APIv4 Image retrieval

text:
# Question
Title: CIVI CRM APIv4 Image retrieval
I am creating a Python script that retrieves images from CiviCRM. I don't just want the image name (which I retrieve with the uri field already) but the entire image url. How is that possible? I have tried the this (How to retrieve contact image URL in CiviCRM with the API) and that didn't give me the result I was looking for. please see code below:

import requests
import json
import os
import time
from util import *

server_time = datetime.datetime.now()
directory = os.environ.get('LOCAL_DIRECTORY')

def main():
    def image_response(mime):
        url = 'https://members.MY_CIVI_CRM_SITE.com/civicrm/ajax/api4/File/get'
        params = {
            'select': [
                'id',
                'mime_type',
                'uri',
            ], 'where': [['mime_type', '=', f'image/{mime}']],
            'limit': 100
        }
        headers = {
            'Content-Type': 'application/x-www-form-urlencoded',
            'X-Civi-Auth': 'Bearer MYBEARERTOKEN'
        }

        all_contacts = []

        # Retrieve data in batches of 100 using pagination
        offset = 0
        total_contacts = 0
        while True:
            try:
                params['offset'] = offset
                data = {'params': json.dumps(params)}
                response = requests.post(url, headers=headers, data=data)
                content = response.text

                contacts = json.loads(content)['values']
                all_contacts.extend(contacts)

                # Update progress and break the loop if the retrieved contacts are less than the limit (i.e., the last batch)
                num_retrieved = len(contacts)
                total_contacts += num_retrieved
                print(
                    f"Retrieved {num_retrieved} images. Total images: {total_contacts}")

                if num_retrieved < params['limit']:
                    break

                offset += params['limit']
            except requests.exceptions.HTTPError as err:
                exception_message = f'HTTP error occurred: {err}'
                log_function(exception_message)
                time.sleep(30)
                # Continue with the next iteration of the loop

            except requests.exceptions.RequestException as err:
                exception_message = f'An error occurred during the request: {err}'
                log_function(exception_message)
                time.sleep(30)
                # Continue with the next iteration of the loop

            except Exception as err:
                exception_message = f'An exception error occurred during the request: {err}'
                log_function(exception_message)
                time.sleep(30)
                # Continue with the next iteration of the loop

        return all_contacts

    jpeg_images = image_response('jpeg')
    png_images = image_response('png')

    all_images = jpeg_images + png_images

    # Save contacts to a JSON file
    with open(f'{directory}/image_list.json', 'w') as file:
        json.dump(all_images, file, indent=4)
    message = "All images retrieved and saved to image_list.json"
    print(message)

    script_finish_time = datetime.datetime.now() - server_time
    script_finish_time_split = str(script_finish_time).split('.')
    script_complete_message = f'Script completed in {script_finish_time_split[0]}'
    print(script_complete_message)

    print("Phone numbers saved to image_list.json.")

if __name__ == "__main__":
    main()```

# Answer
> 0 votes
You have to use Attachments, which is only available in API 3. See previous question here.

---
Tags: civievent, civicontribute, civimember, webform-civicrm, civireport
---


title: 5.62.0 configuration options?

text:
# Question
Title: 5.62.0 configuration options?
The release notes for 5.62.0 say that this update requires attention to configuration options but I can't see anything more about what it is that requires attention. There's no mention of 5.62.0 on the version-specific upgrade tasks page. Is there something I need to pay attention to when upgrading?

# Answer
> 2 votes
When that's mentioned in the release notes, it's not that everyone must make configuration changes, but it's good to read through and pay attention to what items mention configuration changes, because choices have been made, new options added, etc.

In the case of 5.62.0, the things I'd look out for are:

* if you have custom code depending upon legacy custom searches, that's now in an extension (enabled by default, but still something that could be an issue)
* the enabled components (e.g. CiviMail, CiviCase) now take effect across all domains in a CiviCRM installation rather than as separate options for each domain
* the warning that will appear if you have activity revisions in CiviCase

As you can see in each of those issues, developers and reviewers take care that for most sites most things are smooth/consistent, but it could still come as a surprise if you do have less common configurations.

---
Tags: upgrade
---


# Question
Title: Undefined variable $store in Joomla.php on line 56 - CRM_Core_Permission_Joomla error
I am experiencing an issue with Joomla integration while using CiviCRM. I am getting the following error on line 56 of the "Joomla.php" file:

PHP Warning: Undefined variable $store in /home/userxxx/public\_html/administrator/components/com\_civicrm/civicrm/CRM/Core/Permission/Joomla.php on line 56

This error indicates that the variable `$store` is not defined when trying to set the `$api_key` variable. However, I have noticed that I haven't previously defined the `$store` variable.

Relevant code snippet:

```
$api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST');

```

I am seeking assistance with resolving this issue. How should I properly define the `$store` variable?

Any help with this would be greatly appreciated. Thank you in advance.

Best regards,

# Answer
It's just a warning, not an error, but looks like a problem that should be fixed, you could report it on Gitlab and maybe even fix it yourself.

I think `$store` could probably not be passed at all since the default is NULL (the other params after it are also default), but maybe there is some reason to set it NULL first, as it is in other places.
> 3 votes

---
Tags: joomla, error, php, logs
---


# Question
Title: CiviRules "Update Date Value" - I cannot select any source or target field
I am trying to create a Civi rule that will be triggered by "Membership is changed" and then set the end date of this membership to a new value. (This rule is needed as a workaround for another bug in how CiviSepa interacts with one-time membership contributions.)

When I create an Action for this rule, I select "Update Date Value", as this seems to be the action most close to what I need (modify end date). I get redirected to a page asking for "Source Field", "Target Field", "Operation" and "Operand". When I click on the down-arrow on the right side of "Source Field" and "Target Field", no drop-down menue is opening. Instead, only a grey line appears when I click, and disappears when I click again. The same happens when I select the action "Advanced Update Date Value".

Does anybody know what could be the problem here? I get no error whatsoever. The rule has no Conditions and no Delay-Action, it contains nothing but a name and a trigger.

Edit: I tested this on a CiviCRM demo page running the version 5.62.0. In this demo system, I was able to add a Rule with the trigger "Membership is changed" and the action "Update Date Value". I was able to choose "Start Date" in "Source Field" and "End Date" in "Target Field".

# Answer
> 1 votes
Membership dates are stored as SQL DATE types, for historic reasons, and most other dates in CiviCRM are stored as an SQL DATETIME. I suspect CiviRules doesn't support DATE, only DATETIME.

So if I'm correct, to fix this, someone would either need to update CiviRules to support DATE or update CiviCRM to use DATETIME for memberships (which probably should be done anyways).

---
Tags: civimember, civirules
---


# Question
Title: WordPress - Sorry, you are not authorized to access this page
1. I installed a clean WordPress with Version 6.2.2.
2. I installed the CiviCRM from https://download.civicrm.org/civicrm-5.62.1-wordpress.zip
3. After I click on activate the plugin I get a short time the attached screenshot and then I get the message
**Sorry, you are not authorized to access this page.**
4. Notice: I looked in the database and the tables for CiviCRM were not created

Can someone help me with my problemm please ?

# Answer
> 1 votes
## Solution was:

1. Delete WordPress and Database (Before I have used table\_prefix=civicrm\_)
2. Create new database with table\_prefix=ccrm\_
3. Install wordpress via terminal
4. Install CiviCRM via terminal and unzip
5. Set folder permission /wp-content/plugins/civicrm/ to 0777
6. Activate plugin CiviCRM and follow the instructions
7. Set folder permission /wp-content/plugins/civicrm/ back to 0755

## **Now, how can I install the GERMAN translation ???**

I can´t find a civicrm-x.x.x-l10n.tar.gz file on https://civicrm.org/download as described on https://docs.civicrm.org/sysadmin/en/latest/upgrade/wordpress/#install-localization-files-optional

# Answer
> 0 votes
Welcome to CiviCRM. Did you run the installer as described in the Installation Docs?

# Answer
> 0 votes
Yes, the same way as described in the Docs.
I also Have changed the permission of the directory "/wp-content/plugins/civicrm" to 0777.

I think the Requirements check is successful but then I get the message **Sorry, you are not authorized to access this page**.

---
Tags: installation
---


title: Providing Case Link on Message Template

text:
# Question
Title: Providing Case Link on Message Template
Upon assigning a role on a case, I wish to be able to send an email to the role. The email should include a link to the case. However, I am having trouble identifying what should the link be. The link that I am inputting is usually redirecting me to the wrong case. Could someone help me with this issue that I am facing? The following is a screenshot of the url that I have tried:

# Answer
You're missing the `cid=` in the url. It looks like you have the casetokens extension installed - you could try `{case_roles.client_contact_id}` or maybe `{case_roles.client_id}`?
> 0 votes

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


# Question
Title: Getting aggregation to work in D9/D10 Views with CiviCRM relationships
Using CiviCRM Entity commit 5295af29e5bac4575f991683b1c061b96a0e0713 (HEAD -\> 8.x-3.x, origin/HEAD, origin/8.x-3.x)

Trying to get this to aggregate properly -\>

But this should only show 3 rows with the final row:

Other 50-60 yrs 2

Gender is the CiviCRM Core field. Age Range is a CiviCRM Custom (select) field.

When compared to D7 -\> we are noting **2 MIN()** getting injected into the query:

```
SELECT "civicrm_contact_civicrm_participant"."gender_id" AS "civicrm_contact_civicrm_participant_gender_id", "civicrm_contact_civicrm_participant__civicrm_value_contact_custo_3"."age_range_61" AS "civicrm_contact_civicrm_participant__civicrm_value_contact_c", "civicrm_contact_civicrm_participant__civicrm_value_contact_custo_3"."id" AS "civicrm_contact_civicrm_participant__civicrm_value_contact_c_1", COUNT(DISTINCT civicrm_participant.contact_id) AS "civicrm_participant_contact_id", MIN(civicrm_participant.id) AS "id", MIN(civicrm_contact_civicrm_participant.id) AS "civicrm_contact_civicrm_participant_id"
FROM
{civicrm_participant} "civicrm_participant"
LEFT JOIN drupal_karin.civicrm_contact "civicrm_contact_civicrm_participant" ON civicrm_participant.contact_id = civicrm_contact_civicrm_participant.id
LEFT JOIN drupal_karin.civicrm_value_contact_custo_3 "civicrm_contact_civicrm_participant__civicrm_value_contact_custo_3" ON civicrm_contact_civicrm_participant.id = civicrm_contact_civicrm_participant__civicrm_value_contact_custo_3.entity_id
WHERE "civicrm_participant"."event_id" = '32'
GROUP BY civicrm_contact_civicrm_participant_gender_id, civicrm_contact_civicrm_participant__civicrm_value_contact_c, civicrm_contact_civicrm_participant__civicrm_value_contact_c_1
LIMIT 11 OFFSET 0

```

UPDATE: If I remove the custom field Age Range from the equation (and only leave the native CiviCRM Core Gender field) -\> then the View produces the proper count:

# Answer
It's grouping by civicrm\_contact\_civicrm\_participant\__civicrm\_value\_contact\_c\_1 which is the custom field row id, but it's not being group\_concat'd in the select. So it's going to have a row for each different contact. Or I'm not sure why it's even being included in the query.
> 1 votes

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


title: Custom logic for fields

text:
# Question
Title: Custom logic for fields
One of the requirements for a project was for the system to generate a unique ID for each of the members coming in. The logic of the unique ID is slightly complex. The unique ID will take the first alphabet of the surname and increment the number after the alphabet. Example John Tan, membership number will be T001 (Tan is his surname). Another example Ryan Tay, membership number will be T002 (Tay is his surname). If name if Tristan Ram, membership number will be R001 (Ram is his surname).

Just wondering whether is this possible? And how can I create such custom logic in CiviCrm?

# Answer
> 1 votes
I think you'll want to add a small extension that does this. So, you could add a custom field for this unique ID to memberships. Then you can set a hook\_civicrm\_postCommit for when a new membership is created and then use the API to check for the highest unique ID for that letter and set the new unique ID accordingly.

Alternatively, you could possibly add this as a custom CiviRules action.

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


# Question
Title: civiEvents forces patrons fill out the form for every single ticket they buy. Is there something better?
I need to be able to have different ticket levels and allow patrons to purchase any number of tickets under *ONE* name/registration. Is there anything in civiCRM that can offer that?

# Answer
You can use a price set with multiple Text / Numeric Quantity fields to allow registrants to specify 8 tickets for one thing and 3 tickets for the other thing.

Here's an example of a price set with Text / Numeric Quantity fields:
> 2 votes

---
Tags: civievent
---


title: Calculate RFM in CiviCRM

text:
# Question
Title: Calculate RFM in CiviCRM
there is a way or an extension to calculate the RFM (Recency, Frequency and Monetary) score for the contacts, and maybe to store them in the DB. I read that SmartGroup can be used with this purpose, but after some tests, I cannot figure how.

# Answer
You'll need a custom report template for that! We have written donor segmentation reports with all kinds of metrics - RFM is just another set of metrics/calculations;

This is still a really good reference to get started on custom reports: https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/
> 1 votes

# Answer
iXiam has developed a custom extension to segment based on the RFM variables you set. This creates clusters to allow you to identify what type of donors the organization has and its evolution via a cluster movement report.
> 1 votes

# Answer
Are you aware of the Summary Fields extensions, which you can find here, and which provides fields for contacts including

* Total Lifetime Contributions
* Total Contributions this Year
* Total Contributions last Year
* Amount of Last Contribution
* Date of Last Contribution
* Date of First Contribution
* Largest Contribution
* Count of Contributions
* Average Annual (Calendar Year) Contribution
> 0 votes

---
Tags: contacts, contributions
---


title: How to add Search Kit to CRM profile

text:
# Question
Title: How to add Search Kit to CRM profile
Do you need to add Search Kit to your CRM profile? My permissions have recently been upgraded to Administrator but still cannot see Search Kit.

# Answer
(a) Under Administer - Users and Permissions - Permissions, you'll see a link for either Drupal Access Control or Wordpress Access Control depending on your CMS. Click that and see if the role has "SearchKit: edit and delete searches".

(b) Is searchkit installed? Check under Administer - System Settings - Extensions.
> 2 votes

---
Tags: custom-reports
---