title: Hitting issue with Joomla 4

text:
# Question
Title: Hitting issue with Joomla 4
I have several sites using Civicrm, one of which is a new Joomla4 website. CiviCRM is running smoothly but I have run into 2 issues.

The big issue is ACL permissions in Joomla. I am able access ACL for all installed components, however, when I go to CiviCRM in the Joomla ACL, I get the following message:

0 Failed opening required '/home/username/public\_html/libraries/joomla/form/fields/rules.php' (include\_path='.:/opt/cpanel/ea-php80/root/usr/share/pear')

When checking, the libraries/joomla folder does not exist. It exists in Joomla 3 and upon setting up a Joomla 4 test site, the directory doesn't exists.

This seems to be a joomla issue that is specific to CiviCRM so I wanted to ask here if anyone had thoughts on how to proceed. Obviously I need access to Joomla ACLs with CiviCRM.

# Answer
> 2 votes
Until the fix is integrated into the master branch, to repair this issue, you'll need to apply the patch located at https://github.com/civicrm/civicrm-joomla/pull/67

To do so:

```
cd [Joomla root]/administrator/components/com_civicrm/civicrm/joomla
wget https://github.com/civicrm/civicrm-joomla/pull/67.patch
git apply --stat 67.patch
git apply --check 67.patch
git apply 67.patch

```

NOTE: When you run the "stat" the response should look like this:

```
 libraries/joomla/form/fields/civiperms.php |  132 +++++++++++++++++-----------
 1 file changed, 82 insertions(+), 50 deletions(-)

```

When you run "check" there should be no errors spit out. Assuming no errors, then go ahead and run the patch with the apply command.

Labu apetīti!

P.S.: I applied this exact procedure to my own site and it worked as I expected.

---
Tags: joomla
---


# Question
Title: Upgrade to 5.57.1 Fails With Error executing task "Fix dangerous delete cascade"
I am trying to upgrade from CiviCRM 5.31.1 to 5.57.1 with Drupal 9. I am running MySQL 5.7.41.

I downloaded the new version of CiviCRM with Composer. I then used CV to execute upgrade:db.

The upgrade started normally read out 46 dots under "Executing upgrade..." and then printed "Error executing task "Fix dangerous delete cascade." The remainder of the error is In Error.php line 955: DB Error: unknown error.

When looking at the log in ConfigAndLog I find:

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

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]
    [type] => DB_Error
    [user_info] => ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="ALTER TABLE `civicrm_activity` ADD CONSTRAINT `FK_civicrm_activity_original_id` FOREIGN KEY (`original_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE SET NULL [nativecode=1292 ** Incorrect datetime value: '0000-00-00 00:00:00' for column 'activity_date_time' at row 2037]"]
)

```

I have Googled this and I see a few things for MySQL but I am not sure how to apply them. I cannot find anything close for CiviCRM and nothing directly related for Pear either.

I would appreciate help figuring this out.

Thanks!

# Answer
> 3 votes
That's kind of interesting since it seems like it doesn't have anything to do with the upgrade statement and is more about some weird data in the database. Either you used to have SQL\_MODE set to allow zero datetimes and now you don't, or the database was moved from another system at some point. But either way 0000 doesn't make sense for activity date. You have a couple choices:

* Update SQL\_MODE to remove these values from the config: `NO_ZERO_IN_DATE`, `NO_ZERO_DATE`, but then you still have weird dates, just they'll be allowed, OR
* Update the data so it doesn't have any zeros, but the trick will be what datetime to use since you won't know what it should be without knowing the context for the activity. You might be able to get something good enough by using the earliest modified date from civicrm\_log which will at least be close some of the time: `UPDATE civicrm_activity a LEFT JOIN (SELECT m.entity_table, m.entity_id, min(modified_date) AS mindate FROM civicrm_log m GROUP BY m.entity_table, m.entity_id) t ON (t.entity_table = 'civicrm_activity' AND t.entity_id = a.id) SET a.activity_date_time = t.mindate WHERE a.activity_date_time = '0000-00-00 00:00:00';`. Make a backup first, which you probably already have from before the earlier upgrade.

---
Tags: upgrade, database
---


title: Status page angular load error

text:
# Question
Title: Status page angular load error
I've just upgraded a test site from 4.7.15 to 4.7.21 on Drupal before going live. The System Status page isn't showing as expected and the console has this log:

GET failed for ..../sites/mysite/files/civicrm/persist/contribute/dyn/angular-modules.33b51763aa1098ba\_etc\_etc.js

This file doesn't exist. Note the Drupal site is not in sites/default/ but I have set the Civi Resource URLs correctly (hopefully) and cleared the Drupal and Civi caches. Any suggestions?

I've previously (and now) done some messy tweaking of $filesURL in CRM\_Utils\_System\_Base to cope with not being in "default".

TIA Chris

# Answer
> 17 votes
We had one site that had 'lost' all it angular pages, eg CiviMail and System Status.

In our case the angular cache files were returning 404 on the New Mailing page. (and 'inspector' was showing a lot of red angular errors)

It was building the cache files in sites/default/files/civicrm/images, but then searching for them in sites/default/files/civicrm/persist/contribute

The issue here was a mismatch between the resource url setting for Image Upload URL and the directory setting for Image Directory. Strangely (!!) these folders are being used for caching of angular files.

# Answer
> 9 votes
I was able to solve this, at least for now, on my WordPress 4.8/Civi 4.7.22 site using this suggestion from Tim Otten:

> another work-around should be going to "Administer =\> System Settings =\> Debugging" and disabling the "Asset Cache"

Of course in the long term we'd like to take advantage of the Asset Cache. But for now at least we have our angular-based screens back.

# Answer
> 2 votes
I had this issue as well and tried all the suggestions above to no avail.

Eventually, I found that because I had redirected my site to www.mysite.com instead of mysite.com I was getting this error:

"No 'Access-Control-Allow-Origin' header is present on the requested resource."

I updated the resource URLs to absolute paths with: https://www.mysite.comsites/default/files/civicrm/persist/contribute

That update fixed the issue for me.

# Answer
> 1 votes
I just want to add, I have spent three days on a very similar issue and tried everything. I finally fixed it by installing OAuth (not obvious, but on a whim, based on a comment in Mattermost, I figured it was worth a shot).

Just thought it would be useful to add it here for others who get into the same problem.

# Answer
> 1 votes
Ran into a similar issue in D9, and used this:

> composer civicrm:publish

# Answer
> 1 votes
Another option to try - my menu was missing, status page was blank, and I've tried everything listed above - near the bottom of the Resource URLs page is the option to force SSLs. I switched this to 'Yes' and my menu is back.

# Answer
> 0 votes
I just experienced this and found it was a permissions issue - my website user didn't have write access to the `persist/contribute` directory.

I followed Noah's advice above to disable the Asset Cache, and when I visited the System Status page (**Administer menu » Administration Console » System Status**), it reported the permission issue.

---
Tags: core, upgrade, angular
---


# Question
Title: Log viewer issue after upgrading to 5.57.1
I just updated some CiviCRM staging/test sites to 5.57.1 and my log viewer seems to be broken. This is Drupal 7 site

I get something like the following error for all sites:

```
Unable to read entries from logfile at /var/www/html/mysite/sites/default/files/civicrm/ConfigAndLog/CiviCRM.1_3d2d307c1a3c8afb45487079.log

```

If I look in the directory `ConfigAndLog` I can see the file permissions are `644` owner is `www-data`. The Directory is `664` with `www-data` as owner.

The log file listed above is not there though, instead I find two active log files:

```
CiviCRM.1_2f42dac95054c9bfcda8461a.log
CiviCRM.389f69036b9921e16e572d2f.log

```

One appears to be the summary and one the stacktrace.

They are an hour or so old. Their last entries are messages confirming a successful upgrade to 5.57.1... yay.

I have cleared every imaginable cache many times. What is going on here? Is log creation failing? I had to update my SITE\_KEY configuration on this upgrade, could that have broken it? Any other suggestions?

# Answer
> 3 votes
That error is a bit misleading and usually just means "you have no new messages yet" and I think that's what it means this time. There was a recent change in core to prefix log file names with the domain id, so that's where the `1_` is coming from. The hash is different from the earlier one because you said you cleared cache which will change that hash.

If you want to double-check, just add `\Civi::log()->info('hi');` in any civi form file, then visit that page, then check the log. For example, just after line 240 in CRM/Activity/Form/Activity.php add `\Civi::log()->info('hi');` (in 5.57.1 it's line 233 but doesn't matter - just somewhere in that function), and then visit Contacts -\> New Activity. Then check the log. It should say "hi" in the log.

---
Tags: permissions, logs, logging, configandlog
---


title: Civicrm separate database login syntax

text:
# Question
Title: Civicrm separate database login syntax
I am installing Civi on localhhost. I want to set up a database separate to Wordpress. I am using these credentials: mysql://root:HIDDEN@localhost/cividata. The database username is root, without a password. I get the same issue as described here; Can't connect to separate database. Would it be possible for someone to tell me what the correct syntax should be? Instead of HIDDEN should I use '' Thanks.

# Answer
My problem turned out to be special characters in the password. Once I changed the password the connection worked fine. To connect to the database, I just changed the path in this line in civicrm-settings.php file to:

define('CIVICRM\_DSN', 'mysql://username:password@localhost:3306/databasename?new\_link=true');
> 0 votes

# Answer
The answer to the question about the syntax needed on install when wanting a separate database is as follows. I struggled with this myself today, which was on a Drupal 7 site.

mysql://example\_dbuser:password@localhost/example\_dbname

where of course example\_dbuser is the user name, password is the password without special characters and example\_dbname is the separate civicrm database name.
> 0 votes

---
Tags: wordpress, installation, mysql, passwords
---


# Question
Title: Why am I forced to enter a title for the registration confirmation page even if I don't use it?
I have to manually enter a title for the registration confirmation page, even if I say I do not want a confirmation page.

"Please enter a Title for the registration Confirmation Page"

I recall this field used to be prefilled, now its blank at default.

I was able to replicate in demo master. Wordpress.

# Answer
> 3 votes
I have submitted a PR that fixes this issue (which was a recent regression).

---
Tags: civievent
---


# Question
Title: FormBuilder form is not visible on public page
I am building a form with the help of the FormBuilder extension in CiviCRM. Currently I am using Version 5.57.0 in Wordpress 6.1.1 and I need to embed the form in a public page and I am adding the shortcode with the name of the form explained in the documentation

> \[civicrm component="afform" name="afformFormularioEducaciN"\]

but the problem is that **the form is not visible on the public page**:

**the form if it is visible** when i am connected in an admin session:

It is important to tell you that the configuration of the form in FormBuilder is (I assume) the correct one:

Permission: **Add Contacts**

Security: **Open Access** Allowed Actions: **Create**

Form page: https://www.redmaternoinfantil.org.mx/educacion/

# Answer
> 1 votes
This has worked for me: I have created a profile to embed a shortcode with the help of the indicated documentation https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/

> \[civicrm component="profile" mode="y" gid="x"\]

---
Tags: wordpress, contacts, forms, formbuilder
---


title: Tracking Repeat Attendees

text:
# Question
Title: Tracking Repeat Attendees
I am looking to report on how many of our event attendees have previously attended an event, but I can't seem to find a way in search-kit.

Search for "contacts who have registered for \[event x\] who also attended any other event".

Is this possible?

# Answer
Welcome to SE!

Yes, search for Contacts and link twice to 'Contact Participants'.

If you want those who attended two particular events:

If you want those who attended the Fall Fundraiser and another (any) event:

You probably want to add some other conditions like participant status.
> 3 votes

---
Tags: search, reports, searchkit
---


title: CiviCRM video courses

text:
# Question
Title: CiviCRM video courses
CiviCRM is a great piece of software, but its reputation could be greatly improved giving video material to newcomers. Is there any project or team to involve on this?

# Answer
> 1 votes
Welcome to SE!

As Erik says, there are a variety of videos available, but those are mostly recordings of events.

I agree with you that a set of videos aimed at newcomers would be useful. A curated list of existing ones would be a start.

If that is something you have an interest in and would be willing to help with then maybe start a discussion in the ~community channel on chat.

# Answer
> 0 votes
thanks for your question! Not sure what you expect exactly when you are asking if any team is involved in this :-) In an open source community like CiviCRM is there is no central co-ordination of activities nor are we aware of all organizations doing stuff with CiviCRM (until they communicate this within the community ofcourse).

Having said this, there are several video's around CiviCRM:

https://docs.crm-showcases.org/

https://www.youtube.com/@civicrmintkort50 (all in Dutch)

https://www.youtube.com/playlist?list=PLwjTdfZDtG9dtmyC51aYKl5ta2rBmATeN

https://www.youtube.com/@CiviCRM-project

---
Tags: installation, usability, training
---


# Question
Title: Hiding the WordPress 'do not delete this page' page
We've been using Drupal 7 for years, but need to move off before EoL, so I'm testing WordPress as an alternative. I found an explanation of the 'do not delete this page' page in this answer, but no mention of how to exclude it from menus. All I can find in WordPress an option to make it private, but presumably that will prevent it from being seen by users when it's needed? Do I need a third-party plugin to exclude it from the menu?

# Answer
Use a menu that doesn't have "Automatically add new top-level pages to this menu" checked. Or, yes, use a plugin. This simple one or something like it should do the job. Pop it in your "must use" plugins folder at `wp-content/mu-plugins` \- create that directory if it doesn't exist.
> 1 votes

---
Tags: wordpress, base-page
---


# Question
Title: How to import contact via CSV and trigger CiviRule for Trigger "Address is added"
I set up a CiviRule that when an Address is added for a Contact some relationships are created depending on the zip code for that Contact.

Now I create some Contacts via an import of a CSV file. I assign the correct rows to be mapped into the Home Address and I can see the correct data in the Contact after importing.

~Unfortunately, the Trigger "Address is added" in CiviRule is not triggered, and the rule is not executed.~

How can I make sure that the rule is triggered correctly?

I found out that the Trigger "Contact of any type is added" is in fact triggered during the import. but for that one I cannot add a "Field value filter" for a field that belongs to the address (eg. the zip code).

Any ideas on that?

UPDATE: I tried to reproduce the behavior, and now "Address is added" was triggered. My working hypothesis is, that I imported a contact that was already there and thus (via duplicates) was only updated, but no adress really added. I close this question as answered.

# Answer
The trigger is potentially not fired because the import process does not fire the corresponding **post** hook for the address. So Civirules simply does not "see" that an address is created. If that is true you could say that it is not so much a problem of Civirules but more a problem of the import, although that does not help you.

That might be the case but you could try with a "addess is changed" trigger to see if that works?

If you are familiar with debugging it is pretty straightforward to check if the Address **post** hook is fired. Are you?
> 1 votes

---
Tags: contacts, import, civirules, csv
---


# Question
Title: Know the change made in the Change History
I can see the history of the people who have modified the contact and when they did it, but... How do **I know what this change is?**

For an administrator it is important to know what modifications were made.

# Answer
> 2 votes
See https://docs.civicrm.org/sysadmin/en/latest/setup/logging. You would need to turn on that optional feature.

---
Tags: wordpress, contacts, settings, system-settings
---


# Question
Title: Contact subtype custom sets not loaded on webform
Since the webform CiviCRM module to 6.2.2 the option to add a custom set related to the contact sub type when selecting the contact sub type under CiviCRM webform settings.

Drupal: 9.5.2 Webform civicrm: 6.2.2 CiviCRM: 5.57.1

To Replicate:

1. Create a custom set for contact sub-type Student
2. Create a webform and enable CiviCRM.
3. Select contact sub type Student. No Custom set is loaded to add on the form.

# Answer
> 3 votes
This is a regression bug caused after fixing an issue related to the subtype having more than one word.

Have submitted the PR for the fix, can you please test and let us know if it's fixed for you?

---
Tags: webform-civicrm
---


title: Class "CRM_Core_DAO" not found

text:
# Question
Title: Class "CRM_Core_DAO" not found
I have CiviCRM 5.56.1 installed via composer on a Drupal 9 application. In a custom module I use API v4 to manipulate records. For example, get membership types.

```
\Civi\Api4\MembershipType::get()->addWhere('name', 'My Membership')->execute();

```

The error that I get is the following:

```
Error: Class "CRM_Core_DAO" not found in /var/www/html/vendor/civicrm/civicrm-core/Civi/Api4/Utils/CoreUtil.php on line 101 #0 /var/www/html/vendor/civicrm/civicrm-core/Civi/Api4/Generic/DAOGetAction.php(156): Civi\Api4\Utils\CoreUtil::getOperators()

```

In my civicrm settings file I have made sure to add the correct `$civicrm_root` variable. I have check the resulting include paths and the correct civicrm core path is included. CiviCRM in general works fine via the UI. The same command works when using the `cv` CLI.

Any ideas why this happens when calling from within Drupal? It seems namespaced classes are found. In older related questions it is suggesting to use `civicrm_initialize()`, but this function does not seem to exist anymore.

# Answer
> 1 votes
One thing you can try is invoking the service and initializing it from there. That will give you access to API4.

```
$civicrm = \Drupal::service('civicrm');
$civicrm->initialize();

```

Alternatively - `\Drupal::service('civicrm')->initialize();`

Additionally, you can use the following to access API related classes:

```
use Drupal\civicrm\Civicrm;
use Civi\Api4\Contact;
use Civi\Api4\Membership;
use Civi\Api4\Address;
use Civi\Api4\Phone;
use Civi\Api4\Email;

//in function
$memberships = Membership::get(FALSE)
  ->addSelect...........
$contacts = Contact::get(FALSE)
  ->addSelect.........

//etc

```

---
Tags: autoloading
---


# Question
Title: Recurring donations at iATS are processing twice
This week our recurring donations started process 2 times about 10 minutes apart. It is only recorded in Civi 1 time. The logs in Civi and Drupal only show the first time, there is nothing there for the second time.

iATS however, has 2 charges. Is this an iATS issue or do I need to look for something on our end?

# Answer
> 1 votes
Turns out that our webhost was transferring servers and they had our Civi instance running on both the old and the new servers. Once they shut down one, problem solved. Thanks to KarinG and Alan Dixon for helping us find where to look.

---
Tags: recurring-contributions, iatspayments
---


# Question
Title: CiviCRM's Form Processor failing when "User Registration" Form Processor in Caldera Forms is enabled to create the WordPress User
I am getting an error in a registration form built with **Caldera Forms** and the integration with **CiviCRM's Form Processor**

**Error**: *Action Create or update phone number failed. Caused by contact\_id is not valid: ***"id"****

where "***id***" should be the CiviCRM contact\_id, but instead the CiviCRM Form Processor is using ***civicrm\_email.id***, and ***not civicrm\_email.contact\_id***.

The ***CiviCRM Form Processor*** is set up in the following way:

"actions": \[

```
    {
        "name": "Contact: Get By Email or Create By Email and Names",
        "configuration": {
            "contact_type": "1"
        },
        "mapping": {
            "email": "input.email",
            "first_name": "input.first_name",
            "last_name": "input.last_name"
        }
    },
    {
        "name": "Contact: Create or update CiviCRM Fields linked to the CiviCRM Contact",
        "mapping": {
          "contact_id": "action.get_or_create_by_email.contact_id",
          <more CiviCRM fields to be created/updated based in the input fields of the Caldera
          Form>
    }

```

\]

where ***"contact\_id": "action.get\_or\_create\_by\_email.contact\_id"*** is retrieving the ***civicrm\_email.id***, ***not civicrm\_email.contact\_id*** and consequently I am getting the following ***DB Error***:

*constraint violation: a foreign key constraint fails*

as the Form Processor is trying to create/update fields of the CiviCRM Contact, but there is not contact\_id with id = ***civicrm\_email.id***.

When I disable the "***User Registration***" Form Processor in the Caldera Form , which creates the **WordPress User**, the process works perfectly. But if this Form Processor is enabled to create the WordPress user, the process fails.

Any clue will be very much appreciated.

# Answer
> 1 votes
There was a regression in the action-provider extension that contains the code for the "Get By Email or Create By Email and Names" action.

This is fixed in the extension's master branch but a new release has not been tagged yet.

---
Tags: wordpress, caldera-forms, form-processor
---


title: Issue with CiviCRM webform donation

text:
# Question
Title: Issue with CiviCRM webform donation
CiviCRM 5.51.3, Drupal 7.92, Webform 7.x-4.24, Webform-CiviCRM integration 7.x-5.8.

Since the upgrade from 5.45.7 to 5.51.3, we have been unable to submit a donation successfully via a webform. These are the two errors that result:

The CiviCRM "line\_item create" API returned the error: "One of parameters (value: ) is not of the type Integer" when called by function "postSave" on line 234 of wf\_crm\_webform\_postprocess.inc with parameters: "Array ( \[qty\] =\> 1 \[unit\_price\] =\> 2.7 \[financial\_type\_id\] =\> 1 \[label\] =\> Contribution Amount \[element\] =\> civicrm\_1\_contribution\_1 \[entity\_table\] =\> civicrm\_contribution \[line\_total\] =\> 2.7 \[entity\_id\] =\> 62880 \[contribution\_id\] =\> 62880 \[price\_field\_id\] =\> 915 \[check\_permissions\] =\> \[version\] =\> 3 ) "

TypeError: CRM\_Financial\_BAO\_Order::getPriceSetID(): Return value must be of type int, null returned in CRM\_Financial\_BAO\_Order-\>getPriceSetID() (line 461 of /var/www/wwwadmin/data/www/XXXXXXXX/sites/all/modules/civicrm/CRM/Financial/BAO/Order.php).

Per other questions/answers posted here on SE, I've checked to confirm that:

a) the financial type in question is correctly tied to the appropriate accounts (it is)

b) all line items have a populated price\_field\_value\_id field (they do)

c) the default contribution price field, price field value, and price set exist (they do)

I'm stumped as to where to go next with this. Any ideas/suggestions would be most welcome.

# Answer
> 0 votes
Adding a patch for the error you facing, the patch fix the problem

```
diff --git a/includes/wf_crm_webform_postprocess.inc b/includes/wf_crm_webform_postprocess.inc
index 8a9995a..5b0437d 100644
--- a/includes/wf_crm_webform_postprocess.inc
+++ b/includes/wf_crm_webform_postprocess.inc
@@ -2183,10 +2183,24 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base {
       if (empty($item['contribution_id'])) {
         $item['contribution_id'] = $id;
       }
-      $priceSetId = 'default_contribution_amount';
+
+      $priceFieldValueParams = [
+        'return' => ['id', 'price_field_id'],
+        'price_field_id.price_set_id' => 'default_contribution_amount',
+        'price_field_id.is_active' => 1,
+        'options' => ['limit' => 1],
+        'price_field_id.name' => 'contribution_amount',
+      ];
+
       // Membership
       if (!empty($item['membership_id'])) {
-        $priceSetId = 'default_membership_type_amount';
+        $priceFieldValueParams['price_field_id.price_set_id'] = 'default_membership_type_amount';
+        $priceFieldValueParams['membership_type_id'] = wf_civicrm_api('Membership', 'getvalue', [
+          'return' => 'membership_type_id',
+          'id' => $item['membership_id'],
+        ]);
+        unset($priceFieldValueParams['price_field_id.name']);
+
         $item['entity_id'] = $item['membership_id'];
         $lineItemArray = wf_civicrm_api('LineItem', 'get', [
           'entity_table' => "civicrm_membership",
@@ -2204,11 +2218,10 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base {
           }
         }
       }
-      $item['price_field_id'] = wf_civicrm_api('PriceField', 'get', [
-        'sequential' => 1,
-        'price_set_id' => $priceSetId,
-        'options' => ['limit' => 1],
-      ])['id'] ?? NULL;
+
+      $priceFieldValue = wf_civicrm_api('PriceFieldValue', 'getsingle', $priceFieldValueParams);
+      $item['price_field_id'] = $priceFieldValue['price_field_id'];
+      $item['price_field_value_id'] = $priceFieldValue['id'];

       // Save the line_item
       $line_result = wf_civicrm_api('line_item', 'create', $item);

```

---
Tags: webform-civicrm, contributions
---


# Question
Title: FormBuilder and Mosaico installation problems
I've got a CiviCRM v 5.57.0 site running on WordPress v6.1.1 and I have the following symptoms on an otherwise healthy site:

* FormBuilder isn't working, I can only see tokens on the UI
* I can't view Mosaico Templates - once I've created one, I can select it when creating a new mailing so I know it is saved, but when I go to the page to view the Templates (which uses FormBuilder), there are none displayed
* When trying to create a 'traditional' mailing, I can't upload an image and the error message says "Cannot write to upload folder." but the permissions for civicrm/persist/contribute/images/uploads folder is 775
* Possibly related, I have also attempted to install Mosaico Message Templates but it doesn't install and I don't get any error messages

This is what I see when I try to view the FormBuilder UI:

I'm also getting lots of error messages in the browser console like `Uncaught Error: Can only have one anonymous define call per script file` and `Uncaught TypeError: n is undefined`

I'm really not sure where to look so any help would be very appreciated!

# Answer
I had similar issues with my Joomla site. If you already have Civigrant installed it must be enabled or completely uninstalled. Weird, I know, but it is true. Something conflicts. If Civigrant is already installed but disabled and not needed it is best to uninstall it completely or it can still cause issues. My guess it has something to do with the code, since it once was part of core and is now an extension. Then you will want to disable Mosaico, Search Kit, and Form Core (I believe that is the full list.) Then, you will want to enable them 1 at a time. Search kit, form core, then Mosaico. Clear cache and test. See if that helps you too. If just disabling and enabling in that order doesn't work, try uninstalling the extensions and reinstalling in that order.
> 1 votes

---
Tags: mosaico, message-templates, formbuilder
---


title: Mutliple memberships search trouble

text:
# Question
Title: Mutliple memberships search trouble
Occasionally I have a member that ends up with multiple memberships. I think these may be a result of duplicate merging. So a member may have an expired membership and a current membership.

I have searches/auto groups set up that search for expired members. I select membership status is expired and current member is No. I get the same results no matter the selection.

The search still includes current members who have past expired memberships. In fact the check box for 'Current Member - No' seems to do nothing but add to the search description "AND Is a non-current member".

(we also have multiple membership types, but the problem exists even with the same membership type)

I did find a kludgey solution HERE that I'll attempt. I have looked at other people asking about this problem, but none seem to describe exactly what does that check box do? Is this a bug?

Oddly the help page screenshot on the documentation seems to be missing that checkbox selection? I'm looking at the Memberships-\>Find Members page but I also don't see it on that screenshot of the advanced search page in the documentation either. I have it on both screnes. Perhaps it is database driven and it should have been removed in an upgrade? (or the documentation image is really old?)

I'm using 5.57.1 installed on Joomla.

# Answer
You are exactly right about what Current Member = No does, it just searches for any contact with a non-current membership, regardless of any other memberships they may have. Here is a similar recent question — here's a solution with SearchKit from my answer there:

If you use SearchKit instead, searching for:

* Contacts
* with (required) a Contact Membership with status one of expired or cancelled
* without a Contact Membership with status one of new, pending, current (or using whichever statuses are appropriate)

you should get the results you're looking for.

Unfortunately, I doesn't look like it will be possible to change Advanced Search.
> 1 votes

---
Tags: civimember, search
---


# Question
Title: Automate from Searchkit to Google Sheets or Office 365
Has anyone found a way to daily send results from a Searchkit result or table to Google Sheets or O365 spreadsheet? Is there a way to have Microsoft PowerAutomate or Zapier get the table? Is there a way to set it up to daily auto-send an email with the table attached? Seems that there are lots of possibilities to accomplish this.

# Answer
SearchKit shows you the API query it makes. You can take the query and use it in Google Apps Script in a Google Sheet with very little code. You can also set up an email with daily results directly in Google Apps Script.
> 0 votes

---
Tags: searchkit, automation
---


# Question
Title: Reporting on online vs offline contributions possible?
As the subject suggests, I'm looking for way to break out online submitted vs backend entered contributions in order to show management a movement towards online submissions.

Is there a straightforward way to report online vs offline contributions?

Much thanks in advance for assistance.

# Answer
> 1 votes
Unless you have been manually adding a contribution page to offline contributions, all of your online contributions will have a contribution page attached and none of your offline contributions will — with one exception, online recurring contributions beyond the first in the series won't always have a contribution page (not sure why).

So you could use SearchKit and search for contributions with recurring contribution is empty and the appropriate financial type. Then on the top right side of the results, add the contribution page column and the date received column. You could export these results and then make a chart out of the data.

If you wanted data for recurring contributions as well, I'm sure there is a way, but it's probably not important for what you're trying to do here.

---
Tags: civicontribute, civireport
---


# Question
Title: Hide contact types from WordPress cms users
I am checking the CMS permissions on my CiviCRM installation on Wordpres. I have three types of CiviCRM users:

1. Administrator
2. Author
3. Publisher

In CiviCRM I have two types of contacts:

A) Donors B) Beneficiaries

We need to hide the donors (A) for the Editors and Authors users (2 and 3) and that they can see only the Beneficiaries (B).

We have disabled all Donor display permissions in WordPress Permissions and access control, however this does not work.

The ACL permissions don't get us on the right track because there are only options to **"Show"** and **not "Hide"**.

Any help is appreciated.

# Answer
I think ACLs should be able to resolve your requirement, you just have to reverse your thinking, so the Group who you want to give limited access to do NOT get given 'Access all Contacts' (or whatever the wording in the Permission is) therefore they ONLY get access to the contacts that the ACL specifies
> 3 votes

---
Tags: wordpress, permissions, acl, admin
---


# Question
Title: Smarty conditional statement in Message Template (contribution.financial_type_id)
I just can't seem to get any conditional statement to work using Smarty. Essentially, the logic should say, 'if the contribution is Membership Dues, say this. If it's a Donation, say this'.

I'm using other Smarty content in the template and it works fine, but as soon as I add the 'if' statement I get a fatal error.

Here's what I currently have:

{capture assign=contribution\_type}{contribution.financial\_type\_id}{/capture} {if "$contribution\_type" == "1"}This is for Membership. {else}This is for Donation. {/if}

Things I've tried:

* Set CKeditor - Entities =True
* Every variations of wrapping field and value in "" or '' or nothing.
* adding {} around the field e.g. {$contribution\_type}, with and without single and double quotes.
* with and without the $

Am I missing something obvious or misunderstanding altogether?

Wordpress: 6.1.1 CiviCRM: 5.55.2

Much thanks in advance for any insight.

# Answer
> 2 votes
Try

```
{capture assign=contribution_type}{contribution.financial_type_id}{/capture}
{if $contribution_type eq 1}This is for Membership. {else}This is for Donation. {/if}

```

---
Tags: message-templates, smarty
---


# Question
Title: Access event type details with query from wordpress
I'm writing a WordPress plugin to display a list of CiviCRM Events, but I'm having a difficult time figuring out how to obtain the label for the event type. I can retrieve the list of events, and the `event_type_id`, but I haven't figured out how to retrieve the label for the event type.

```
    $eventList = CRM_Event_BAO_Event::getCompleteInfo();

    foreach ( $eventList as $event ) {
        // Upon further testing, the following returns a blank
        $type = CRM_Utils_Array::value( 'event_type_id', $event );

        $typeLabel = // This is where it falls apart...

    }

```

# Answer
The field in the output from getCompleteInfo() is "event\_type" not "event\_type\_id", but note that `CRM_Event_BAO_Event::getCompleteInfo()` is an internal function that just happens to be available, so you might prefer to use the api:

```
$eventList = \Civi\Api4\Event::get()->addSelect('*', 'event_type_id:label')->execute();
foreach ($eventList as $event) {
  $typeLabel = $event['event_type_id:label'];
}

```

It's also easier to discover what fields are available with the api, using the Support - Developer menu in civi.
> 1 votes

---
Tags: wordpress, civievent, api, plugin
---


# Question
Title: webform CiviCRM integration problem with custom fields and individual sub-type
We have set of custom fields assigned to an individual contact sub-type (Child Summer Camp). In CivCRM 5.45.x the custom fields are available in the CiviCRM integration section of a webform. In CiviCRM v 5.51.x and in v 5.57.x those custom fields are no longer available!

If we change the set of custom fields that were assigned to Individual and sub-type Child Summer Camp and re-asign them to "Individual" any sub-type then that group of custom fields becomes available in he CiviCRM section of a webform in CiviCRM v 5.51.x and in v 5.57.x

Why do custom field sets assigned to an individual sub-type not work in CiviCRM 5.57.x? Is it a bug or a configuration issue.

We want to assign certain custom field sets to individual sub-types.

# Answer
> 1 votes
This is a regression bug caused after fixing an issue related to the subtype having more than one word.

Have submitted the PR for the fix, can you please test and let us know if it's fixed for you?

---
Tags: custom-fields, webform-civicrm, sub-types
---


# Question
Title: How to add Contact and Case custom fields to an Activity report?
Awhile back, I have made a copy of the the CRM/Report/Form/Activity.php, placed it under custom\_php and added additional custom Contact and Case fields to the report by updating

```
protected $_customGroupExtends = [    'Activity' ];

```

to

```
  protected $_customGroupExtends = [
    'Activity',
    'Contact',
    'Case',
  ];

```

I know this question indicates this was the proper way 4 years ago. I am wondering whether this is still the proper way to show Contact and Case custom fields on Activity report with the current version of CiviCRM 5.57.2?

# Answer
> 0 votes
Yes `_customGroupExtends` will still work. You probably want to sync any changes in CRM/Report/Form/Activity.php from the last 4 years into your custom file. But there's an argument that the time would be better spent making a new searchkit search that replaces what the custom report does, but it's true not all civireport features are available yet in searchkit.

# Answer
> 0 votes
I avoid creating custom php over-rides as it will need checks/updates when Civi is upgraded. I added the same thing using the extension. Below is an example how I achieved

```
function extensionname_civicrm_alterReportVar($varType, &$var, &$object) {
  if ('columns' == $varType && get_class($object) == 'CRM_Report_Form_Activity') {
    $permCustomGroupIds = [];
    $_customGroupExtends = $object->getVar('_customGroupExtends');
    $_customGroupExtends = array_merge($_customGroupExtends, [
      'Contact',
      'Individual',
      'Household',
      'Organization',
      'Case',
    ]);

    if (!CRM_Core_Permission::check('access all custom data')) {
      $allGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
      $permCustomGroupIds = CRM_ACL_API::group(CRM_Core_Permission::VIEW, NULL, 'civicrm_custom_group', $allGroups, NULL);
      // do not allow custom data for reports if user doesn't have
      // permission to access custom data.
      if (!empty($this->_customGroupExtends) && empty($permCustomGroupIds)) {
        $_customGroupExtends = [];
      }
    }
    $object->setVar('_customGroupExtends', $_customGroupExtends);
    $object->addCustomDataToColumns(TRUE, $permCustomGroupIds);
  }
}

```

---
Tags: custom-fields, civireport, custom-reports
---


# Question
Title: retrieve event registration link with api v4
I'm retrieving event details for a plugin, and thanks to some help here, I am now using the correct API to access the information. However, I am currently using the following to generate a registration link for an event, but I'd like to do the same using APIv4. I've searched the API reference and the API Explorer, with no luck.

```
        $id = $event['id'];
        $reglink = CRM_Utils_System::url( 'civicrm/event/register', "reset=1&id=$id" );

```

# Answer
> 1 votes
There isn't any option in the API to generate registration link, the code you are using should create the correct link

```
 $id = $event['id'];
 $reglink = CRM_Utils_System::url('civicrm/event/register', "reset=1&id={$id}");

```

---
Tags: civievent, urls, apiv4
---


# Question
Title: Search Kit with a Form to search for all contributions greater than X Contribution ID
I just came across Search Kit as an answer to my Drupal Views that completely crashed after doing an update to Civi and Views. Cudos to those building Search Kit & Form Builder. From the little bit that I have messed with it, it seems super powerful.

I have built a search and added a table and form. I would like to have the form with a single input of a contribution ID # which will then query for all contributions greater than that ID. Right now it just seems to pull in that Contribution ID only. How can I create it for "greater than"?

# Answer
Generally the filter options on the form are more limited than those configurable within a search. However, for your 'greater than' case you can achieve that as follows:

In your form, drag 'Contribution ID' on to the display to create a filter.

Then go to the cog icon to configure settings for your filter and tick the 'Search by Range' checkbox:

That gives you boxes for both the lower and upper end of the range. To search 'greater than' just enter a value in the first box and leave the second one empty.

Either sell the upper bound box as an extra feature (!), or use some css to hide it.
> 2 votes

---
Tags: searchkit, formbuilder
---


# Question
Title: DDEV, Drupal 9, CiviCRM & Civix Installation
Thanks is advance. I am using DDEV with Drupal 9.5.2 and CiviCRM 5.57.2 I would like to use civix to look at custom reports. Any advice on how to install it? I've look at the documentation but most of it is for installing on local machine, which is not what I use.

Best A.

# Answer
Have you tried using SearchKit to build your report? Going forward Searchkit is a way to build reports. We understand complex logics are not handled in Searchkit atm but if its simple report SearchKit is a best option over custom reports.

Custom reports:

1. You will need to install Civix
2. Create extension using civix
3. Create report using civix command
> 0 votes

---
Tags: civicrm-buildkit, civix, drupal-9
---


# Question
Title: Show "total contributions" from all results in data processor or search kit?
I've created a few contribution reports using data processor / search kits / afforms for my colleagues. They work great as my colleagues can quickly see the contributions as well as performing actions on them (sending email, printing acknowledgement letters, etc.). However, I'm unable to find a way to show the "total contributions" aggregated from all or the filtered results. My current workaround is to export them into excel to add them up or to run a similar contribution reports, but I wonder if there is a way to show the total contribution directly in data processor output / search kit / afforms? Any advice is appreciated. Thanks.

# Answer
> 2 votes
As of this writing SearchKit doesn't have the ability to do a "grand total" style row. You could create one search display that displays each row, and a second search display which shows aggregated totals using GROUP BY, but it can't currently be done within the same search display table.

However, SearchKit is still in development and new features are being sponsored and added all the time. Hop on https://chat.civicrm.org/civicrm/channels/search-improvements if you'd like to chip in to sponsor a feature like this!

# Answer
> 1 votes
Update - the 'Total' feature has been added.

Tick the 'Show totals in footer' option:

then configure the footer for each column:

Result:

---
Tags: searchkit, data-processor
---


# Question
Title: Fatal error when loading the webform after upgrade
All the webform stopped working after we upgrade the webform\_civicrm module from 6.2.1 to 6.2.2

Drupal: 9.5.2 CiviCRM: 5.57.1

Error in drupal log:

```
CRM_Core_Exception: Unknown api parameter: setRelationship in Civi\Api4\Generic\AbstractAction->__call() (line 234 of /var/www/html/vendor/civicrm/civicrm-core/Civi/Api4/Generic/AbstractAction.php).

```

# Answer
> 2 votes
This is a known issue and reported at https://www.drupal.org/project/webform\_civicrm/issues/3336269

The fix is available at https://github.com/colemanw/webform\_civicrm/pull/835

---
Tags: webform-civicrm
---


# Question
Title: Credit card expiration month is shown as 00 on confirmation screens and receipts
It seems the expiration date for credit cards is being displayed incorrectly as 00 YYYY (as in, it always shows 00 no matter what the actual input is) on event and contribution confirmation screens, thank you screens and in email receipts.

I can't replicate this on dmaster or locally. No errors logged and nothing in the console. Doesn't matter which payment processor is in use. Payments are still processed as usual. Anyone have any ideas what might be causing this?

5.56.2 on D7.

# Answer
The answer is ... check your date formats carefully because maybe you made a mistake entering them and never noticed. Pretty obvious!
> 2 votes

---
Tags: payment-processor, receipts, confirmation
---


title: Update custom fields with profiles?

text:
# Question
Title: Update custom fields with profiles?
Actually I would like registered contacts to be able to fill out some **custom fields** in the **easiest way possible**. I was thinking of a **"form"** type link and here they can enter their contact id (to match the information with the corresponding contact) + additional information from custom fields. I don't want them to have to create an account to fill in the information, so we were thinking about using profiles, but I haven't found a way to do it.

We are using **WordPress** and we already have all the contacts created.

# Answer
> 1 votes
You can use Caldera forms to do or CiviCRM profiles. You can email the link to the contact with the contact id and checksum in the URL. This will auto-populate the details for the contact automatically.

---
Tags: wordpress, custom-fields, profile, forms
---


title: Event config page suddenly not working

text:
# Question
Title: Event config page suddenly not working
This evening, I was working on adding a few custom fields to a profile we're using for an event. Finished up, tested, all was well. I went to take my test registration off the event and check that the right staff were copied on the notification and instead, I'm getting screens that look like this:

Errors look like this:

Any suggestions? I have torn out most of my hair now. I'm also a javascript idiot, so be gentle.

# Answer
> 2 votes
For anyone else who might have this same snafu, this was what happened:

1. Asset caching had been enabled in **Debugging and Error Handling** I usually set this as disabled, but we have been working on website speed for a while, so I enabled it. For two weeks, I had no problem with it.
2. BUT the uploaded image files resource url which is usually \[civicrm.files\]/persist/contribute/dyn is set to go somewhere outside of civi.

With the asset caching set, it was looking for js and css files in \[civicrm.files\]/persist/contribute/dyn, which is where it would store those for caching. This meant NO menu as the crm-menu related things would be stored there. I have no idea why I didn't have this problem sooner.

However, there was also a little piece of javascript in a formatting field in the profile I was using for this event, which caused the screens and errors above.

So, two unrelated errors, I think. An extra two hours troubleshooting. And, as always with me, it was a PICNIC error (Problem in chair, not in computer). Hopefully, my late night troubleshooting will help someone else.

---
Tags: civievent, javascript
---


# Question
Title: Recording membership benefits (specifically vouchers)
Our members receive, based on their membership, vouchers for consumption in a restaurant. They receive these vouchers yearly it can be anything from a voucher for $50, to multiple $50 vouchers and different amounts too (either fixed or completly individual).

Each voucher is assigned to a contact, it has a status (open, spent), has a specific amount, an individual number or other id and a issued-on, valid-from, valid-to- and spent-on-date. A contact can have several vouchers.

The restaurant will collect the vouchers regularly and send them to us for reimbursement (where we'll change the status to spent).

Is there an easy way to manage these vouchers in CiviCRM?

Thank you!

# Answer
> 0 votes
Create a new custom field set, make sure you select the ‘Does this Custom Field Set allow multiple records?’ option. Make sure the display style is ‘Tab with table -

Create the desired custom fields and the data will be displayed as below -

---
Tags: civimember
---


title: Event refund - cancelling payment

text:
# Question
Title: Event refund - cancelling payment
I'm looking for some clarification before I proceed any further in event cancelling/refunds.

Here's the situation:

* Event was cancelled.
* I issued a refund via PayPal.
* I then recorded a manual refund in the contribution record, not realizing PayPal updates that automatically.
* (Unbeknownst to me at the time to me) PayPal automatically updated CiviEvent with the refund.
* The payment now has a balance as it was doubly refunded.
* There does not appear to be the means to delete a payment.

Is there an established process to rectify this? A means to delete a payment record? Should I just issue a payment for the balance to zero it out?

Any insight is appreciated.

Much thanks :)

# Answer
This extension provides the ability to delete payments. To enable the delete option

1. Install the extension
2. Enable to option under CiviCRM \>\> Administer \>\> CiviContribute \>\> CiviContribute Component Settings.

HTH

Pradeep
> 1 votes

---
Tags: civievent, payment, refund
---


# Question
Title: Stripe Payment Error in Event registration for multiple participants: "Property 'paymentIntentID' has not been set"
I am finding an error in **Event registrations** for **multiple participants**.

The **Stripe Payment Processor** is raising the following error:

\[error\] Attempted to create **`paymentIntent`** from paymentMethod during doPayment failed: stdClass Object

(

```
[ok] => 1
[message] =>
[data] => Array
    (
        [requires_action] => 1
        [paymentIntentClientSecret] => pi_3MWNlLHijo63jtQl15z5UozV_secret_ZCGAKCKwVuI9NcLVBcU9ILQGy
    )

```

)

\[error\] Stripe Payment Error: Property **`'paymentIntentID'`** has not been set.

In the ****`civicrm_stripe_paymentintent`**** table a row has been recorded with the following column values:

identifier = NULL

contact\_id = NULL

stripe\_intent\_id = '***pi\_3MWNlLHijo63jtQl15z5UozV***'

status = '***requires\_action***'

When I test the Event Registration in Test-drive mode, the registration process succeeds and the row recorded has the same NULL values in the columns mentioned above, but with the status **'*succeeded*'**.

Nevertheless, on the **Live registration** the payment process **fails**.

Any help would be very much appreciated.

# Answer
> 0 votes
It's a known issue for stripe for multiple registrations. There is a work for this issue.

---
Tags: payment-processor, stripe, civicrm-event
---


# Question
Title: With the deprecation of Bartik under Drupal 9.5.x, what theme is recommended for CiviCRM?
Drupal 9.5 has deprecated the Bartik and Seven themes and replaced them with Olivero and Claro as the public and administrator themes respectively. Olivero has various drawbacks, so I want to use another theme. I tried Bootstrap Barrio which seems to meet most needs, but I can't edit profiles - you can't input the field information - the form appears frozen.

In Edge, the developer console yields lots of this error when trying to create a profile

```
Buttons must have discernible text: Element has no title attribute

```

with the following type of element:

```
<button type="button" class="dropdown-toggle btn-xs btn-default-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-click="colData.open = true">

```

The same error occurs with Chrome, Opera and Firefox, so it isn't browser related.

This does not happen with Olivero or Claro, but can anyone suggest another theme?

# Answer
> 1 votes
What sounds like a straightforward question doesn't really have a good answer. There are four different choices that you can configure as far as "theme" goes with CiviCRM.

That's because there are two different theme configurations for each of the 'front end' and 'administrative' experiences: one for Drupal (or your CMS) and one for CiviCRM, i.e. 2 x 2 = 4.

1. Administrative experience

It seems clear to me that you want to use Claro for the Drupal theme here, since it's now standard and designed for a good admin experience.

For the civicrm theme, the default works reasonably well out of the box, but there are some extra spaces in table rows that can be annoying. It'd be nice to have a civicrm theme that includes some bits to override that annoyance, but for most admin experiences, I'd pick reliability over customization.

2. Front end / visitor

Normally, you'd want to start here with a Drupal theme that matches the rest of your website, if not exactly the same one.

The civicrm theme that you'd want to combine that with depends on which theme you're using, and how much you're willing to customize it.

In the old days, you didn't have a civicrm theme configuration, and even today, many places will just include a bunch of custom css to clean up the places where CiviCRM looks bad.

But now there's a great new "civicrm theme" configuration option, and you can use a different one for the 'front end' vs the 'adminstration' pages.

You might think that if you're using a Drupal bootstrap theme, then using the civicrm eponomous "CiviCRM Bootstrap theme" extension/theme would be a good fit, but in fact, it's often not a good choice - that theme is a fairly opinionated design that's really for a nice admin experience and mostly just confuses your Drupal theme's look and feel (and doesn't care about or want a Drupal bootstrap theme).

My working solution these days is a new civicrm extension/theme that I've published here:

https://github.com/adixon/toronto

It's designed to let a CMS theme do it's work, and just makes up for some of the old CiviCRM stuff that doesn't usually play well (e.g. form layouts, hard-coded font sizes and styles).

The way it works is that it prevents CiviCRM from loading it's own copies of the bootstrap and civicrm stylesheets, and then has a copy of the standard civicrm style sheet with the yucky bits removed.

Most of the time, I've had to add a few more bits for cleaning up it's use with specific themes, so it's more of a starter, but it does work reasonably well out of the box in combination with most bootstrap based Drupal themes.

Note: "toronto" is not a Drupal theme, you won't see it anywhere in Drupal! After installing the extension, try enabling it as the 'civicrm front end theme', on this page:

/civicrm/admin/setting/preferences/display?reset=1

i.e. Administer -\> Customize Data and Screens -\> Display Preferences

---
Tags: theme, drupal-9
---


# Question
Title: Civievent 'Cancel' clarification - does 'Cancel' generate a refund / balance
I've recently had to deal with cancelled event and refunds. At the moment my workflow is to:

1. Issue a refund via the payment process (PayPal)
2. PayPal updates contribution with refund transaction.
3. I then 'Cancel' the event registration for the contact.

I suspect it's not the case, but I'm seeking clarification on this following:

If I do it in reverse and first 'Cancel' a contact from an Event, does it automatically issue a refund with the payment processor?

If not, does that leave a Balance associated with that contact/contribution? Can I apply (how do I apply) that balance to future events?

Any insight appreciated.

Much thanks :)

# Answer
AFAIK Civi won't cancel/refund the payment automatically at Paypal when a payment is cancelled in Civi. It's the other way around when a payment is cancelled at Paypal it sends a notification to Civi about the payment. Civi based on the notification updates/cancels the payment in Civi.

So you should be doing

1. Issue a refund via the payment process (PayPal)
2. PayPal updates contribution with refund transaction.
3. I then 'Cancel' the event registration for the contact.
> 1 votes

---
Tags: civievent, workflow
---


# Question
Title: Allow anonymous users (not logged in) to edit their fields?
The question is simple:

I have created a profile, but I would like to share a URL to the anonymous user so they can fill out the profile **WITHOUT LOGGING IN** and these responses will go to their contact.

Do you know if there is a way to do it by sharing the ID by URL, as if it were a GET method?

The url to the profile could be something like this:

https://my.page/civicrm/profile/edit/?gid=22&reset=1&id=123

# Answer
> 1 votes
Take a look at the docs for checksums: https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#checksum

---
Tags: contacts, profile, user, checksum, urls
---


title: Trigger Rebuild Is Not Working

text:
# Question
Title: Trigger Rebuild Is Not Working
I am getting this error " \[nativecode=1442 \** Can't update table 'civicrm\_contact' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.\]" after both migrating my database to another server and upgrading to the 5.19 security upgrade.

I have attempted multiple times to run the trigger rebuild URL for Drupal and to use `cv php:eval "CRM_Core_DAO::dropTriggers('civicrm_contact');"
 cv php:eval "CRM_Core_DAO::triggerRebuild('civicrm_contact');"
cv php:eval "CRM_Core_DAO::dropTriggers('civicrm_contribution');"
 cv php:eval "CRM_Core_DAO::triggerRebuild('civicrm_contribution');"` Any ideas of what else to try I would appreciate it.

Thanks, Josh

# Answer
> 3 votes
You can also use the API with `cv`, `drush`, or `wp-cli` to call `System.flush` with the parameter `triggers=TRUE`. E.g. `cv api System.flush triggers=TRUE`.

---
Tags: civicontribute, database
---


# Question
Title: How can I Add a File to an Activity in API v4?
I create activities using the API, and now I need to add an uploaded file (meaning it was uploaded in a Drupal form) to the activity. I tried this:

```
$results = \Civi\Api4\Activity::create()
->addValue('activity_type_id', 91)
->addValue('target_contact_id', [ 8, ])
->addValue('source_contact_id', 2)
->addValue('subject', 'test')
->addChain('uploaded_invoice',
  \Civi\Api4\File::create()->addValue('mime_type', 'text/plain')
     ->addValue('document', 'Just Testing')
     ->addValue('description', 'Invoice Scan')
)
->execute();

```

But this doesn't work, it creates the Activity, but no file is attached.

# Answer
Unfortunately, as of this writing, there is no access to `EntityFile` in Api v4. This is the missing link between the `Activity` and `File` that you created. (In Api v3, you could add a file to an activity using `Attachment.create`, but that has not yet been ported to Api v4 either.)

I added a comment on this page, which tracks which entities are supported by Api v4.
> 0 votes

---
Tags: php, apiv4
---


# Question
Title: Wrong activity status when public sign up for a volunteer opportunity
After registering for a given volunteer opportunity with the public signup form, an activity record is created with an activity status = completed. In a test installation of mine, the status is correctly = scheduled. This problem has some very badly consequences for the functionality of the CiviVolunteer extension.

Does anybody has any ideas how to fix that problem? I would be extremely appreciated for any helpful comments!

# Answer
For all of you who also have this problem:

I managed to solve the problem with the CiviRules extension!

See this screenshot for configuring
> 2 votes

---
Tags: civivolunteer, activity
---


# Question
Title: Is it intentional that the CiviCRM public theme always the same as the CiviCRM Administration theme for administrators?
I notice that the theme Administrators of CiviCRM get is that set for Administration, even if they are in a public part of CiviCRM, e.g. CiviCRM Home. Is this intentional?

# Answer
So, you're referring to the Drupal configuration setting under Appearance, where you can "Choose theme for CiviCRM administration/backend pages."

The main confusion here is that 'civicrm administration/backend pages' isn't well-defined, the definition depends on not just the url, but also, who's accessing it.

For your reports example, I expect what is happening is that CiviCRM considers them 'adminstration/backend', but that you have given access to the report to "non-adminstrators", and you haven't also given them access to your administration theme. So non-administrators will access the reports with the fall back to the 'front-end' theme.
> 1 votes

---
Tags: admin, theme, drupal-9
---


# Question
Title: Migrated WP site to new domain; activating Civi = critical error in WP
Successfully migrated WP 6.1.1 site to a new domain. Same a2 hosting environment, different shared hosting account and different domain. WordPress migration went without a hitch. But CiviCRM 5.57.1 (which worked fine on the original site) caused WP to spit out "There has been a critical error on this website" every time Civi was activated. Soon as I change the civicrm folder name in plugins, Civi is deactivated and WP works again. (Can easily reproduce this part.)

Same thing happens when all other WP plugins are disabled. Decided to try a fresh start, so backed up the Civi database before dropping all Civi tables from our WP database. Then uploaded and expanded a new copy of 5.57.*2* and tried to do a clean install. Same result. Attempting to activate the new CiviCRM instantly throws a critical error, and WP is dead until civicrm folder gets renamed yet again.

Running php 8.1 -- haven't tried changing php version yet. It's moot given that 7.4 seems to be on its deathbed. Tried changing themes to 2023, but no luck.

Closest thread I could find was this one, but it didn't entail a fresh install with no Civi tables in the db. So I'm hoping one of the devs might nudge me toward some productive troubleshooting. When something changes, I'll come back and report. And when this is fixed, I'll describe the solution in detail so others can learn something from my comedy of errors, or at least enjoy a laugh at my expense.

# Answer
> 1 votes
Enabling WP\_DEBUG was helpful (thanks Aidan). Looks like there was something in the wp-content/uploads/civicrm folder that caused a fatal error whenever I tried to activate Civi within wp-admin/plugins.php ... though I'd ferreted out and replaced all outdated instances of the original domain within uploads/civicrm, the fatal error persisted.

So just now, I again dropped all the civi tables from the WP db, **renamed the civicrm folder** within wp-content/uploads and again activated CiviCRM 5.57.2 which (finally) worked.

Disabling WP\_DEBUG now and getting on with my day. :)

---
Tags: wordpress, migration
---


# Question
Title: SearchKit - Can I change a text search to whole word?
I have been experimenting with SearchKit - it has proved really useful. Thanks to everyone contributing.

One of my fields on the form is a search on the Display Name of an orgnisational contact:

All other search fields work really well, but the school name search will take any instance of a string of chars and return records containing that string. We deal with schools, so if I search on *Mary*, this will also return records with *Primary* or *Maryland*. Users tend to know the school they are after, but church schools in particular have a lot of \*St Mary'\*s etc. This is of course just one example. Capitalisation is not an issue, but hundreds of records are!

So, is there a 'whole word only' setting anywhere one can turn on and off?

# Answer
There is an option called 'Automatic Wildcard' under CiviCRM \>\> Administer \>\> Customise Data and screens \>\> Search Preferences. Turning that off may fix your problem? But this setting will apply across whole site
> 3 votes

---
Tags: searchkit
---


# Question
Title: SearchKit + FormBuilder to display PCPs on Contact Record
Goal: Create a tab on contact records with a table of PCPs created by that contact.

Using SearchKit, I created a search:

* SearchFor: Personal Contribution Pages
* With: (required) Personal Campaign Page Contact

Using FormBuilder, I created a form:

* Checked: Add to contact summary page (as tab)
* Filters: I've tried 'Personal Campaign Page Contact' and 'Contact ID' from URL (cid)

I can't quite get it to return *only* the PCPs for a given contact record. Any idea what I am missing?

# Answer
> 1 votes
Looks like I figured this out.

Instead of searching for PCPs with (required) PCP Contact, I need to do the inverse.

Search for Contacts with (required) PCPs. That did the trick.

Incorrect:

Correct:

---
Tags: searchkit, formbuilder, personal-campaign-pages, pcp
---


# Question
Title: Membership price set not updating the right membership years to that of the price chosen when creating membership in civicrm backoffice
Steps to Reproduce:

1. From the user's membership page, Click on the Submit Credit Card Membership.
2. Choose the membership and choose the relative price set(having number of terms greater than 1) for the membership and make the payment.
3. For example if a price set option having number of terms as 2 is chosen, the user is only updated to the default Membership Type Duration Unit.

The expected output should be the membership term for (number of terms chosen x Membership Type Duration Unit).

# Answer
This is the sort of Price Field i thought could be a solution for the front end for you. Not sure if my Comments above were making it clear
> 0 votes

---
Tags: civimember
---


# Question
Title: Unable to upload or view files through the CKEditor
This weekend I updated our test environment to CivCRM 5.10.0 running on Wordpress 5.0.3 and PHP 7.2.

I now find that if I use the CKEditor in e.g. Message Templates and click the Image button in the toolbar, then click Browse Server, the popup window comes back completely blank.

Likewise, if I try to upload a file, I get a popup saying "Incorrect Server Response" and the JS console shows

`ckeditor.js:19 [CKEDITOR] Error code: filetools-response-error. {responseText: ""}`

Similar errors I have found seem to suggest a file path or permissions error, but that they all seem to be correct as far as I can tell (and working fine on the production machine). PHP.ini memory limit is 2Gb, post\_max\_size is 1Gb and upload\_max\_filesize is 1Gb. I can't find any other errors being logged by the system.

Any thoughts as to where I can look next?

Steve

# Answer
I'm not sure this is an answer to your question, since you seem to have a specific error. Nevertheless, we've had a similar problem and so it may be helpful to hear our solution: When the file browser gives a blank screen for our users, the problem seems to arise from slow internet connections causing some problems in the computer's DNS cache. If we clear the browser cache completely AND also the computer's DNS cache then it magically works again.

This is for us in Civicrm 5.10 and Drupal 7 latest, so again, our situation may be different to yours. For instructions on clearing computer's DNS caches we used links like this for mac and this for Windows 10.
> 2 votes

# Answer
I too have struggled with this issue. For lack of a better term I've found that it's a corruption in the browser's cookie cache. If I open my developer tools and check my Application Storage and then clear my cookies for the site, after I re log-in to the site I am able to browse the server.

Drupal 7 CiviCRM / 5.19.3

**Update:** Prompted by another answer I found here https://civicrm.stackexchange.com/a/29355/140, I set directory 755 for /civicrm/packages/kcfinder in a Drupal 7 / CiviCRM 5.57.0 site and it appears to have done the job after I deleted the session cookie in my browser and then logged in again.
> 1 votes

# Answer
There are a variety of reasons this can happen - but a good first step is to disable asset caching on **Administer menu » System Settings » Debug and Backtrace**. This only creates a modest performance hit, will often work around the problem immediately, and is an excellent troubleshooting step for finding the permanent solution.
> 1 votes

# Answer
Yet another completely different approach to the above answers that has helped us, is to be aware of the number of files in the folder you are asking CKEditor's KCFinder to browse.

We accumulate 1,000 images per year, and so when the popup has to show all these images it has to download thumbnails for them all. If a user has slow internet it's interminable. And sometimes seems to make the whole process balk.

We've overcome this by making new folders for images every year. Eg ../images/emails-2022, ../images/events-2023, etc etc.

Also, if you set your window to search a list rather than as thumbnails it dramatically speeds up the process if your folder has many images.

We've also had to use all the methods above!
> 1 votes

---
Tags: ckeditor
---


# Question
Title: How are large sites handling duplicate contact scanning?
On sites with fairly small numbers of contacts, running a "Find duplicate contacts" operation on all contacts is not an issue.

But as the number of contacts grows, this becomes increasingly impossible. (And I acknowledge that a lot of good work has been done in recent years to address this, which is great!) So we run the duplicate search against smaller groups of contacts. And we tweak the server parameters, and maybe database indexes, to facilitate longer and/or more efficient searches. We also try to avoid rules that might skip indexes (e.g. rules using a Length specifier).

That last one is reasonable enough, but the first two remedies have significant limitations:

* By searching on increasingly smaller groups, we increase the tedium of the search operation, which can lead to a snowballing tendency to avoid running duplicate scans (it becomes more tedious as our database grows and thus more likely to be avoided by busy staff).
* Tweaking server configurations requires specialized knowledge or access which is beyond the reach of most organizational staff.

For sites with a "larger" number of contacts (where "larger" means "too large to run a duplicate search on all contacts given my current server configuration"), what's the most common approach for finding potential duplicates, other than the above-mentioned options?

# Answer
You may want to have a look at the Extension X-Dedupe which was built for a number of use cases built in dedupe features cannot handle.
> 3 votes

# Answer
## Reserved Rules

I've found that the reserved rules are much more performant that custom dedupe rules created.

* Name and Address (reserved)
* Name and Email (reserved)

In one use case, a database of all ~1 million contacts would complete the scan in 20-30 seconds. For custom rules, it would take a multitude times longer or just fail. It would be interesting to investigate why these are so different.

## External Processing

With some more technical help, you can scan your MySQL for dupes and then re-import the known dupe contact ID's to a group to target just those.

## Related Tips for Site Admins

Other tips worth mentioning, even though they fall into the limitations category you mentioned.

It does avoid user frustration by setting "Default limit for dedupe screen" at Administer \> Misc (Undelete, PDFs, Limits, Logging, etc.) or via settings file

```
$civicrm_setting['CiviCRM Preferences']['dedupe_default_limit'] = '20000';

```

From a practical standpoint as a site admin, I encourage them to put their most valuable contacts (contributors, members, event attendees) into a group and work thru those dupes first.

Finally, if you setup a dedupe rule that is absolutely bullet proof I've run process\_batch\_merge scheduled job in aggressive mode to handle dupes straight away that should have never occurred in the first place and are simple merges.
> 2 votes

---
Tags: duplicate-contacts
---


# Question
Title: Automatic membership with event registration
In our club, you have to attend an event before you can join the club. We've been using CiviCRM for several years, but have yet to find the ideal solution for managing this use case automatically.

At the moment, we use a "guest membership" which gives the prospective member sufficient permissions to access the club membership form. A person becomes a "guest member" after attending a club event and paying their guest fee, which is later discounted from their membership fee if they become a club member.

## Option 1

Have the person register as a "guest" first, then allow them to register for an event. This would require the use of the Member Only Event Plugin to restrict registration to members, but this would allow them to register for any event, not just those open to guests. The extension restricts by membership status, not membership type.

## Option 2

We could use the Event Additional Signup plugin, which would allow them to select the guest membership during event registration, but would not require it nor would it prevent existing members registering for the same event to accidentally include and pay for a guest membership.

## Option 3

Get rid of the guest membership completely and use some other means of restricting access to the club membership form based on the person having attended an guest event or based on the "guest contribution" that was recorded when they paid for that guest event.

## Option 4

Create a custom event registration form in WordPress and use the CiviCRM API v4 to:

* Register the guest (or member) for the event
* Invoke a CiviCRM payment processor to collect the required payment (for guests only)
* Upon successful payment, add the guest membership, which will give them the access required to access the club membership form. Ideally, that membership wouldn't be added until the event has taken place, but that would probably require a scheduled job.

Realistically if I could schedule a job to add memberships after a non-member had attended a n "Open" event (it's an event type), I could continue with what I'm doing now, event fees with a discount for members.

# Answer
> 1 votes
> Realistically if I could schedule a job to add memberships after a non-member had attended a n "Open" event (it's an event type)

Are you thinking of adding a membership automatically to all non-members registered for the event after the event date has passed or only once you mark their status as attended? I think you could cover both scenarios with CiviRules, but the latter would definitely be simpler.

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


# Question
Title: How can I lengthen the grace period for newly-uploaded members
I just uploaded thousands of new members from a spreadsheet. CiviCRM default grace period for memberships is 1 month. I tried changing it to 3 months in Member Status Rules. Members with end dates within one month are marked Grace, but members with older end dates in the last 3 months are still marked as Expired.

Am I doing something wrong or are uploaded members treated differently from normally-entered members?

I'm using CiviCRM with WordPress.

# Answer
> 2 votes
Welcome to SE! Membership statuses are normally updated by the "Update Membership Statuses" scheduled job. You'll want to enable that under `Administer > System Settings > Scheduled Jobs` if it isn't already.

Those status rules are applied when a membership is created or updated, but otherwise, any rule changes you make won't affect existing memberships until the next run of that "Update Membership Statuses" job.

However, when that runs it normally excludes memberships that have already expired so in your case you need to run that job once with an extra parameter to force it to reconsider the expired memberships.

One way to do that is to go to `Support > Developer > Api Explorer v3`

* select the Job entity
* select the `process_membership` action
* add the parameter `Exclude membership status IDs from calculations`
* set its value to '7' (deceased)
* `Execute`

---
Tags: civimember, status
---


# Question
Title: The table civicrm_activity includes an incorrect constraint
After updating CiviCRM I get the above warning. The Link added to the warning "Learn how to fix this" leads to this page https://lab.civicrm.org/-/snippets/85 which does not describe how I remove the incorrect constraint - at least I don't understand from this how to do it. Can somebody help me?

# Answer
Do you know how to manually run SQL queries in MySQL? You can use phpMyAdmin or the command line or some other control panel tool that might be installed in your hosting.

It's telling you to do it manually because the upgrade checked that you have a lot of activities in your database so it might take a long time to run. Optionally make a backup first, and then the query you want to run is

* `ALTER TABLE civicrm_activity DROP FOREIGN KEY FK_civicrm_activity_original_id;`
* `ALTER TABLE civicrm_activity ADD CONSTRAINT FK_civicrm_activity_original_id FOREIGN KEY (original_id) REFERENCES civicrm_activity (id) ON DELETE SET NULL;`

Then there are some optional things you can do depending on what strategy you want to use for handling deprecated CiviCase activity revisions. The easiest is run `DELETE FROM civicrm_activity WHERE is_current_revision = 0;`, but DON'T do that before running the above queries.
> 2 votes

---
Tags: activities, activity
---


# Question
Title: How to fix "Class not found" Error when it is in the filesystem
When a Civi Contact wants to **resubscribe to a Mailing List** the contact was previously subscribed to, I get the following error:

**Fatal error**: Uncaught Error: Class '*CRM\_Mailing\_Event\_BAO\_Resubscribe*' not found in ./civicrm/CRM/Mailing/Page/Common.php:80

The Class "***CRM\_Mailing\_Event\_BAO\_Resubscribe***" is contained in a php file, *MailingEventResubscribe.php*, which is in the filesystem within the directory ./**civicrm/CRM/Mailing/Event/BAO** with the right permissions *644*.

This class is invoked from ./**civicrm/CRM/Mailing/Page**/Common.php file.

I would appreciate any help to fix that error so that this class can be found.

# Answer
> 0 votes
The issue has been resolved by renaming the class in "*MailingEventResubscribe.php*" to **CRM\_Mailing\_Event\_BAO\_MailingEventResubscribe**, and invoking this new renamed class in the "*Common.php*" file.

---
Tags: groups, mailing, subscribe
---


# Question
Title: Can't enable or disable extensions after migrating from Drupal to Wordpress
As Drupal 7 EoL approaches once again, we're considering a move to WordPress. I've got a test build running locally, and I've successfully imported all our CiviCRM data following the guide at https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/

That done, I am now unable to enable or disable any CiviCRM extensions on the WordPress site. The CiviCRM Extensions page loads fine, and clicking enable/disable in the right hand column on any module leads to the confirmation screen as expected. Once I confirm, however, I am returned to the Extensions page with no changes. There is no specific error message.

I do have one error that is appearing periodically as a notification in the top right seemingly at random. It simply reads, `Error The file is either empty or you do not have permission to retrieve the file`. My best guess is that this is related to the CiviMobile API that was installed on the Drupal site, and is now displaying without the QR code that would normally load - but I'm unable to disable the module to establish for sure whether that's the cause! \[**Edit:** My guess was wrong. Disabling CiviMobileAPI did nothing for that error, but disabling and re-enabling DataProcessor seems to have cleared it.\]

There's nothing in ConfigAndLog that seems to tally with the times at which I've tried to enable or disable extensions, but I do see this, if it means anything:

```
Feb 08 11:15:07  [error]
$Fatal Error Details = array:3 [
  "message" => " is not of type String"
  "code" => null
  "exception" => CRM_Core_Exception {#9862
    -errorData: array:1 [
      "error_code" => 0
    ]
    #cause: null
    -_trace: null
    #message: " is not of type String"
    #code: 0
    #file: "/Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php"
    #line: 1807
    trace: {
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1807 {
        › elseif ($abort) {
        ›   throw new CRM_Core_Exception("{$item[0]} is not of type {$item[1]}");
        › }
      }
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1657 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/uploads/civicrm/ext/dataprocessor/CRM/Dataprocessor/Form/Output/AbstractUIOutputForm.php:92 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/uploads/civicrm/ext/dataprocessor/CRM/DataprocessorSearch/Form/AbstractSearch.php:534 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:549 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:354 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:292 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /Applications/MAMP/htdocs/test_wp/wp-content/plugins/civicrm/civicrm.php:1199 { …}
      /Applications/MAMP/htdocs/test_wp/wp-includes/class-wp-hook.php:308 { …}
      /Applications/MAMP/htdocs/test_wp/wp-includes/class-wp-hook.php:332 { …}
      /Applications/MAMP/htdocs/test_wp/wp-includes/plugin.php:517 { …}
      /Applications/MAMP/htdocs/test_wp/wp-admin/admin.php:259 { …}
    }
  }
]

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

```

WordPress is on version 6.1.1, Drupal was on 7.94. CiviCRM on both is 5.58.0. System Status has a warning about making Resource URLs portable, but I've checked and they all look in order apart from CiviCRM Resource URL, which is absolute but also read only. The Extentions page is correctly listing all available extensions from wp-content/uploads/civicrm/ext. System Status lists the following installed and up to date:

* AuthX: Version 5.58.0
* Calendar: Version 3.5.1
* CiviCRM Bootstrap theme: Version 1.0.0-beta.12
* CiviMobileAPI: Version 6.1.2
* CKEditor4: Version 5.58.0
* Contribution cancel actions: Version 5.58.0
* Custom search framework: Version 5.58.0
* Data Processor: Version 1.59
* Event Cart: Version 5.58.0
* Financial ACLs: Version 5.58.0
* FlexMailer: Version 5.58.0
* Form Core: Version 5.58.0
* General Data Protection Regulation: Version 3.4
* GoCardless Direct Debit Payment Processor: Version 1.13.0
* Mosaico: Version 2.10.1665574809
* OAuth Client: Version 5.58.0
* reCAPTCHA: Version 5.58.0
* SearchKit: Version 5.58.0
* Sequential credit notes: Version 5.58.0
* Theme: Greenwich: Version 5.58.0

Obviously, I know Shoreditch is not officially supported on Wordpress, but I'd prefer to keep things consistent for our users if I can, and it seemed to be running fine before the database import using the Shoreditch WordPress Workarounds extension. But that's now disabled because it wasn't enabled in the imported Drupal database, and I can neither enable that nor disable Shoreditch itself.

Can anyone shed any light?

# Answer
> 3 votes
As per the comment, try disabling/enabling the extensions using `cv`. That might give you some other messages and clues about what is happening.

---
Tags: wordpress, extension, migration
---


# Question
Title: How to restore SearchKit searches lost on upgrade from 5.46.3 to 5.57.3
This is a WordPress 6.1.1 site. During the upgrade from 5.46.3 to 5.57.3 (using `cv`), errors came up re table `civicrm_search_segment` not existing, as in this comment on issue: Upgrader - Apply extension updates after core updates. Tried running the extension database updates separately before or after with `cv` & eventually succeeded running these from the UI.

Table `civicrm_search_segment` was created but is empty. Before the upgrade there were about a dozen SearchKit saved searches, afterwards none show in the UI. Same result from multiple attempts.

Tried exporting a search from a copy of the pre-upgrade 5.46.3 site & importing into the upgraded 5.57.3 site. This failed with the following error displayed on the import dialog: *Unsupported API action: only "save" is allowed.*

Tried changing the API method in the pasted export code from "create" to "save", it then gave a different message: *No records to import.*

Any suggestions for how to restore the missing SearchKit searches?

# Answer
The answer in this case turned out to be to update the Entity tables list extension from version 1.1 to 1.2 - the searches then reappeared.
> 1 votes

---
Tags: upgrade, searchkit
---


# Question
Title: What issues are there when running with a database that "does not fully support timezones"
I recently installed CiviCRM 5.58.0 on wordpress, but under system status I am getting a warning that says:

> The MySQL database does not fully support timezones. Please ask the database administrator to load timezone data.

Unfortunately we are on shared hosting so I can't load the timezone data myself.

What sort of issues (if any) will we have from this?

Thanks in advance.

# Answer
Some examples:

* To properly implement CiviEvent timezone support, the zones will need to be loaded. But since CiviEvent doesn't support timezones now then as a practical matter it's mostly that you won't be able to take advantage of any improvements there.
* Similarly activity datetimes don't currently support timezones.
* If you currently use trigger-based logging, you'll notice that dates on the other side of DST are off by an hour when looking at the contact changelog. The zones will fix that.
* There are some issues with the newer queue features.

It might be useful to know which hosting so we can update the survey at https://docs.civicrm.org/installation/en/latest/general/requirements/#mysql-timezones
> 1 votes

---
Tags: database, mysql, timezone
---


# Question
Title: Is it possible send a gif image correctly without breaking it?
I'm trying to create a email mosaico template with image .gif but jquery resize my image and send gif broken. Is there any option to send a .gif correctly?

Thank you.

# Answer
Did you find an answer to your question? It seems that the platform does not accept the .gif format.

---

Admin support and I figured it out... kinda:

1. It works if you use the "traditional" email. The Mosaico version seems to strip the gifs away.
2. If I view the resulting email through our standard email reader, it moves. If I view it through outlook, it does not.

Conclusion - Even if you get the gif to upload and go out properly, it doesn't work on all email readers and therefore is not a good solution for your email.
> 2 votes

# Answer
The issue is with the `intervention` library used, which doesn't support animated GIFs. The intervention bug is 5+ years old.

While intervention is open source, the maintainer is mostly inactive, and hasn't released the source code of his new version, which he's been working on for years. I think it might be time to remove intervention from Mosaico.

Note also that there's an open Mosaico issue for this topic.
> 2 votes

# Answer
I tried to do this - 2.8 v of Mosaico extension and Deprecate iMagick PHP extension - didn't work. In the end I made the animated GIF from a movie I put into Keynote (Mac) and then exported as an animated gif. I then resized it on ezgif.com to size 534px wide, which is a preset size for Mosaico images. I then uploaded the image to a server and hard-coded the image URL into a Mosaico text field. All worked fine.
> 2 votes

---
Tags: mosaico, images, jquery
---


# Question
Title: Connection refused when CiviCRM attempts to send test email via SMTP, using CiviHosting
My ultimate aim is to connect CiviCRM to AWS SES using Airmail. As a preliminary step, I've set up the SMTP credentials in AWS SES and confirmed they are working correctly using this SMTP Test Tool. Below is the output from the tool, and I do indeed receive the test email in my inbox.

However, when I enter the same credentials in CiviCRM a "connected refused" error occurs.

The contents of the log file is also shown below.

**How can I overcome this error within CiviCRM?** In case it's relevant, I'm running on a Shared Host provided by CiviHosting. My CiviCRM version is 5.55.2 and my WordPress version is 6.1.1.

# Answer
Check this blog post: https://civihosting.com/blog/outgoing-smtp-on-civihosting/

It says you need to explicitly tell them if you want to connect to an external smtp server.
> 3 votes

---
Tags: civimail, extension
---


# Question
Title: Cancel Auto Renew Memberships in Bulk for certain types
Is there a supported way via the UI to cancel the auto-renew and recurring payment profile on all memberships of a particular type? We're phasing some old membership types out.

# Answer
> 0 votes
No.

Sounds like a straightforward job for mysql or a tedious job for a person via the web ui.

In theory, if you were using Drupal, you could use views bulk actions in combination with the civicrm entity module to build a tool to do what you want.

---
Tags: civimember, recurring-contributions, auto-renew
---


# Question
Title: FormBuilder( BackDrop CMS) ... how to add fields?
Evaluating CiviCMS for a non-profit. Looks like lots of good features! Trying to make some custom forms for volunteers to fill out online. I made a custom field set, populated with lots of fields. The field set previews perfectly. But ***How*** can I get it to integrate into the form created in Form Builder??

IF I use the + tab, and add a case, I can then find the various fields in the select dropdown list. But adding them doesn't put them onto the form, it just adds them to the column to the left...

Are there docs for this module somewhere?? I've seen it described as a "UI" but it's not the kind of UI I was expecting...

# Answer
> 2 votes
Welcome to SE!

You should be able to drag the custom fields from the left on to the form and then set relevant options on them.

There are some docs at https://docs.civicrm.org/user/en/latest/the-user-interface/creating-new-forms/ but FormBuilder is evolving rapidly and the documentation may not be completely up to date. There are also a few relevant videos on https://www.youtube.com/@CiviCRM-project

You can also ask questions about FormBuilder on the ~FormBuilder channel on https://chat.civicrm.org

# Answer
> 0 votes
Ah... running BackDrop CMS is essentially a sort of port of Drupal 7, so WebForms is working nicely, and probably should run OK forever . Sadly BackDrop "CiviCRM" development as a whole seems to be almost abandoned!! I have the latest CiviCRM version but its littered with PHP8 warnings and some PHP8 errors and thus even some bugs ( like some configuration pages will not accept the changes). Kind of dragging to an unfortunate halt with this, as I have no desire to play with Drupal 8/9/10/+ and its 'composer hell' :(

---
Tags: custom-fields, forms, formbuilder
---


title: Will CiviCRM work with Backdrop?

text:
# Question
Title: Will CiviCRM work with Backdrop?
I've been keeping one eye on the Backdrop CMS since the fork from Drupal was announced, especially because part of the core audience is "small to medium sized ... non-profits" and the philosophy suggests that there is a goal of making future updates less of a major overhaul, which is appealing to some of the lower budget groups we work with.

I was curious if there is an official statement about CiviCRM/Backdrop and future support (or lack thereof)? How hard would it be to modify CiviCRM's Drupal 7 support to include a Backdrop option? I know that CiviCRM isn't "most modules", but the site claims:

> "Upgrading most modules to Backdrop can be done in days or even hours. With a familiar architecture, it's easy to upgrade."

# Answer
> 12 votes
CiviCRM is very flexible. The current (4.6) core integrates simultaneously with Drupal 6 & 7, Wordpress 4.x, and Joomla 2.5x & 3.x. With a few tweaks it can even work as a standalone app without any CMS.

*Could* it work with Backdrop? Undoubtedly yes, and it might even be as easy as you suggest. *Will* it be released with a Backdrop version? I think that's up to everyone. If this is a priority for the community, then it will be a priority for the community.

**UPDATE:** Take note of CRM17711 on Jira for this topic ("Add Support for Backdrop")

**UPDATE2:** Backdrop support is officially in place, with a stable download and its own installation page on the Wiki.

> The Backdrop team has been working together with Tim Otten to provide support for Backdrop CMS within CiviCRM.
>
> As you may know, Backdrop is a fork of Drupal that maintains most of the APIs of Drupal 7 while providing new functionality like configuration management, more powerful layouts, and built-in Views in core. Backdrop is trying to bring down the cost of ownership by shifting Drupal's backwards-compatibility approach. Drupal basically commits itself to drastic changes every few years, while Backdrop is committing to a more WordPress-like approach of minimized API changes while providing new functionality.
>
> Backdrop's primary audience is budget-restrained sites; putting us in the SMB, education, and non-profit space. Basically, the same we hope as CiviCRM. Supporting Backdrop would be a great way to bolster both projects.
>
> As Backdrop is so similar to Drupal 7, we expect the porting to go fairly quickly, though it may result in a lot of similar code to the existing Drupal integration. Considering Backdrop (or Drupal) may diverge further in the future, it's likely that adding Backdrop as a new top-level CMS (e.g. the same as WordPress or Joomla) would be a better long-term approach for maintenance.

# Answer
> 0 votes
Update: its February 2023 and latest "backdrop" CiviCRM *can* completely install and almost completely work, But its littered with PHP8 warnings, and some PHP8 errors too. PHP 8.0.20

---
Tags: backdrop
---


title: Installation on Backdrop

text:
# Question
Title: Installation on Backdrop
Has anyone managed to get CiviCRM installed on a LEMP + Backdrop CMS? I have it installed but the screen has nothing actionable. Logs show nothing useful. Is there some nginx config magic required?

# Answer
> 1 votes
The answer is: Only install it on PHP 8.0. 8.1 is too new for CiviCRM, although Backdrop is happy with it. Also, after installing, there is still no easy way back to CiviCRM config. Add /index.php?q=civicrm/admin&reset=1 to your domain URL to get there.

# Answer
> 1 votes
Menu bar is missing

Try taking a look here; this forum seems to be detailing what happened in your screenshot. What worked for me was changing the url as defined in /var/www/yoursite/sites/default/civicrm.settings.php from example.com to the actual local IP I was using

I changed

if (!defined('CIVICRM\_UF\_BASEURL')) { define( 'CIVICRM\_UF\_BASEURL' , 'http://example.com/'); }

to

if (!defined('CIVICRM\_UF\_BASEURL')) { define( 'CIVICRM\_UF\_BASEURL' , 'http://192.168.1.100/'); }

# Answer
> 0 votes
As of Feb/2023 I have a "latest version" CiviCRM PHP 8.0.20 install that is is 90% working on "latest version" Backdrop... some PHP8 errors prevent some configuration screens from saving... and if I turn on error debugging a LOT of pages are littered with PHP8 warnings.

A LOT of problems with stuff like Warning: Trying to access array offset on value of type int in include() (line 71 of /var/www/backdrop/files/civicrm/templates\_c/en\_US/%%B8/B83/B8372ABF%%CaseDashboard.tpl.php).

and errors like TypeError: array\_merge(): Argument #1 must be of type array, null given in array\_merge() (line 48 of /var/www/backdrop/modules/civicrm/backdrop/modules/civicrm\_rules/civicrm\_rules.module).

very much work-in-progress

---
Tags: backdrop, nginx
---


title: Membresia no me aparece (Nuevo miembro)

text:
# Question
Title: Membresia no me aparece (Nuevo miembro)
En el desplegable de Membresia no me aparece la opcion de nuevo miembro. Lo tengo instalado sobre wordpress.

gracias por la ayuda.

=== From Google Translate:

Membership does not appear (New member)

In the Membership dropdown, the new member option does not appear. I have it installed on wordpress.

Thanks for the help.

# Answer
ya he encontrado la solucion:

Administrar-Pantallas y Datos Personalizados-Menu Navegacion En el listado pulsar en Membership-New Membership editar y habilitar

Saludos.

=== Google Translate:

I have already found the solution:

Manage-Custom Screens and Data-Navigation Menu In the list click on Membership-New Membership edit and enable

Greetings.
> 2 votes

# Answer
Welcome!

Have you enabled the Membership component?

Have you defined Membership Types?
> 0 votes

---
Tags: civimember
---