title: Smarty mismatched tag

text:
# Question
Title: Smarty mismatched tag
i use a fresh install on Wordpress (all together the newest Version)

Now i want to try to register a second user on the WP-Register Page www.myurl.de/wp-login.php?action=register

And now i have this message:

---

Hallo!

Seit WordPress 5.2 gibt es eine eingebaute Funktion, die erkennt, wenn ein Plugin oder ein Theme einen fatalen Fehler auf deiner Website verursacht, und dich deswegen mit dieser automatisierten E-Mail benachrichtigt.

In diesem Fall hat WordPress einen Fehler in einem deiner Plugins, CiviCRM, abgefangen.

Besuche zunächst deine Website (http://www.myurl.de/) und überprüfe sie auf sichtbare Probleme. Besuche als nächstes die Seite, auf der der Fehler aufgetreten ist (http://www.myurl.de/wp-login.php?action=register) und prüfe, ob es sichtbare Probleme gibt.

Bitte kontaktiere dein Hosting-Unternehmen, um Unterstützung bei der weiteren Untersuchung dieses Problems zu erhalten.

Wenn deine Website fehlerhaft zu sein scheint und du nicht mehr wie gewohnt auf dein Dashboard zugreifen kannst, hat WordPress jetzt einen speziellen „Wiederherstellungsmodus“. Auf diese Weise kannst du dich sicher in deinem Dashboard anmelden und weitere Untersuchungen durchführen.

http://www.myurl.de/wp-login.php?action=enter\_recovery\_mode&rm\_token=aRbG11nIYJQ9bwMF0hUzSd&rm\_key=3WUIQAzvX2F5ESXVFPidYr

Um deine Website zu schützen, läuft dieser Link in 1 Tag ab. Aber keine Sorge: Ein neuer Link wird dir per E-Mail zugeschickt, wenn der Fehler nach Ablauf der Frist erneut auftritt.

Wenn du Hilfe bei diesem Problem suchst, wirst du möglicherweise nach einigen der folgenden Informationen gefragt: WordPress-Version 6.0 Aktives Theme: Twenty Twenty-Two (Version 1.2) Aktuelles Plugin: CiviCRM (Version 5.50.4) PHP-Version 8.1.7

# Fehler-Details

Ein Fehler vom Typ E\_USER\_ERROR wurde in der Zeile 1100 der Datei /mnt/web733/c1/32/52347653/htdocs/ttiu4/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php verursacht. Fehlermeldung: Smarty error: \[in evaluated template line 1\]: syntax error: mismatched tag {/crmScope}. expected {/if} (opened line 1). (Smarty\_Compiler.class.php, line 2338)

# Answer
> 1 votes
I found the error, and I hope that was all now.

I have changed the following in the greeting formulas (e-mail and letter).

I have changed from:

```
Dear {contact.first_name}

```

to changed to:

```
{capture assign=p}{contact.individual_prefix}{/capture}{if $p=="Frau"}Liebe{else}Lieber{contact.first_name}

```

Now I saw in the Smarty code that I forgot the {/if} at the end.

So correct is:

```
{capture assign=p}{contact.individual_prefix}{/capture}{if $p=="Frau"}Liebe{else}Lieber{contact.first_name}{/if}

```

And now it all works again ;-)

Problem solved :-D

# Answer
> 0 votes
php 8.1 is not supported yet by CiviCRM. Are you able to use php 8.0 instead?

---
Tags: wordpress
---


# Question
Title: How to create Event Invoice with zero amount owing
Our event uses webform for registrations. Some delegates receive 100% discounts that reduces the cost to zero.

In these cases CiviCRM does not create or send an invoice - is this standard, and is there a way to force an invoice even if the amount payable is zero?

Using latest D7 and current Civi.

# Answer
> 1 votes
We found a solution.

CiviCRM will create a zero invoice (as indicated by @Ramesh in the comments).

But we found that webform\_civicrm doesn't create a Civi contribution (and hence no invoice) if totalContribution evaluates as true (not 0).

To fix it my dev changed the file includes/wf\_crm\_webform\_postprocess.inc In webform\_civicrm version: 7.x-5.8 it's at line 165.

Changed this

> ```
> if (empty($this->ent['contribution'][1]['id']) && **$this->totalContribution**) {
>   $this->createDeferredPayment();
> }
>
> ```
>
> to this
>
> ```
> if (empty($this->ent['contribution'][1]['id']) && **count($this->line_items**)) {
>   $this->createDeferredPayment();
> }
>
> ```

$this-\>totalContribution refers to the total amount after adding up the line items (when contribution amount is used it serves as a line item)

# Answer
> 0 votes
when you register for an Event using discount code - even the amount is Zero CiviCRM will create an Invoice and it will send a email to the member

If this behavior is not working in your version then try upgrading to the latest version

login to https://dmaster.demo.civicrm.org/ username/password: demo/demo

I have created a example - which has an Invoice too

I guess this helps !!!

Thanks

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


# Question
Title: How to search for civi contacts who don't have a Joomla user account
Is there a way within the civiCRM GUI to search for just those contacts who do or do not have an associated Joomla user account?

# Answer
> 3 votes
Found it: the option exists under the Advanced Search: CMS User?

---
Tags: contacts, search
---


title: Find Contacts with no Relationships

text:
# Question
Title: Find Contacts with no Relationships
Have tried using API, but `$result = civicrm_api3('Contact', 'get', array(
 'return' => "id",
 'contact_sub_type' => array('!=' => "Parent"),
));`

gives zero results, while Search builder gives results using this query:

`Contact Subtype Not Like Parent ...AND...
Contact Type = 'Individual'`

API calls also give zero results count if

```
 'organization_name' => array('IS NOT NULL' => 1),

```

and

```
'current_employer' => array('IS NOT NULL' => 1),

```

being used, although we know such records exist. Moreover, theree are records, where "Current employer' field is empty, which yet have Relationships.

In theory, it might be possible to compare two arrays (all existent Relationships wjere Contact A is an Individual and all existent Individuals), but it might be tricky a bit at current number of records in both arrays (around 100K in each). So, any reliable way to find Individual Contacts with no Relationships, nor Employers?

# Answer
> 5 votes
Thing which works is "**include/exclude custom search**" : "Search -\> Custom searches -\> Include / Exclude Search" or **/civicrm/contact/search/custom?csid=4&reset=1** Thanks @Coleman!

# Answer
> 5 votes
One way of achieving your goal would be via a temporary group:

1. Using advanced search, search for all contacts who *do* have a relationship (simply open the "Relationships" tab, enter nothing, and search - it will default to all active relationships).
2. Add all the resulting contacts to a group (or make a smart group if you want to save yourself this step in the future).
3. Using search-builder, find all contacts not in that group.

PS: the "Parent" contact sub-type has nothing to do with relationships. Contact types are quite different in CiviCRM from relationships, and having one does not automatically bestow the other.

# Answer
> 2 votes
Lots of years after the question was asked, but still a relevant question.

You can find contacts without relationships using the 'without' join in SearchKit:

See here

---
Tags: contacts, api, relationships, searchkit, cli
---


title: Mail Report Error Is Not Of Type String

text:
# Question
Title: Mail Report Error Is Not Of Type String
CiviCRM v5.48.2, WordPress v 5.9.3

I have a cron running as follows:

`/usr/local/bin/php /home/xxxxxx/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -u xxxxxx -p xxxxxxx -e Job -a execute`

```
Entity: Job Action: mail_report
Summary Starting execution of Mail Reports

Details

Parameters raw (from db settings):
instanceId=xxxx
format=PDF

Parameters parsed (and passed to API method):
a:3:{s:7:"version";i:3;s:10:"instanceId";s:4:"xxxx";s:6:"format";s:3:"PDF";}

Full message:
Starting execution of Mail Reports
2022-05-03 23:35:06 Mail Reports
Entity: Job Action: mail_report

Summary Finished execution of Mail Reports with result: Failure, Error message: is not of type String

```

# Answer
Apparently what fixed this was that I had to obtain the InstanceId that I pulled by selecting one of the Mailing Reports (I went to Reports - Mailing Reports - and then chose the Summary. In the browser I identified the number of the report which came after "instance%XXXX" and used the "XXXX" as the number. I entered the number by going to Admin - System Settings - Scheduled Jobs and it gave me all of the reports from which I selected Mailing Reports and then clicked the edit button which allowed me to edit both the InstanceId and the format. I selected "PDF" for the format. Not sure if the format is right, but the job runs now.
> 2 votes

# Answer
Encountering a similar problem, with similar logs, except that my instance ID is set to "\[ID of report instance\]," which had, evidently always worked before.

At the moment, I don't even have a mailing to run reports on, though we're about to do a big one and I need to make sure this is working.

> Parameters parsed (and passed to API method): a:3:{s:7:"version";i:3;s:10:"instanceId";s:23:"\[ID of report instance\]";s:6:"format";s:3:"pdf";}
>
> Full message: Finished execution of Mail Reports with result: Failure, Error message: is not of type String
> 1 votes

---
Tags: wordpress, reports
---


title: Help installing Caldera forms

text:
# Question
Title: Help installing Caldera forms
So I am trying to figure out how to install the new community maintained fork of Caldera forms that was put in place to continue the end-of-life version (for WordPress CiviCRM ).

https://civicrm.org/blog/jaapjansma/community-maintained-fork-caldera-forms

It is unclear to me how I should proceed...

Do I need to install a Caldera Forms WordPress plugin first and then install a CiviCRM Caldera Forms extension?

When I go to https://lab.civicrm.org/extensions/caldera-civicrm there is a dependencies folder and several other caldera folders.... which ones of these need to be installed (or maybe all of them)?

It talks about "building" or about using "composer" to install some of these... Is there a pre-built version that can just be uploaded/FTP firectly to /civicrm/civicrm/ext/ folder without having to get into all the fancy building/composing?

Thanks

# Answer
You want to download one of the prebuilt zip files from https://lab.civicrm.org/extensions/caldera-civicrm/caldera-forms/-/releases Do NOT use the links at the top of the page under 'Assets' but use one of the links at the bottom:

(Thanks to kcristiano: https://chat.civicrm.org/civicrm/pl/p1z3gpzadfn4pki5gsn4nsbu8o)

You only need one of those zips - they are basically the same although the 'caldera-forms-1.9.7-release.zip has a slightly later version of the monolog library. That's the main 'Caldera Forms' plugin.

You also want one of the plugins to integrate CF with CiviCRM. Options include:

If you use the second one, you also need a couple of other plugins/extensions - see its documentation.
> 3 votes

---
Tags: wordpress, webform-civicrm, extension, forms, caldera-forms
---


title: CiviCRM Icon Spins for Activity

text:
# Question
Title: CiviCRM Icon Spins for Activity
When one clicks the Activity tab on a contact's profile, the CiviCRM logo icon just spins and nothing happens. It does not show the activities for any contact. It used to work before.

All the extensions have been disabled. Also, I used WordPress' Troubleshooting mode by disabling all the plugins, except for CiviCRM. Themes were also changed.

There is no nothing in the error log.

Any idea how it can be fixed?

ARNOLD

# Answer
> 2 votes
It appears that one cannot have more than 61 custom field data sets. We had 80. After trimming it down to 60, I was able to view the Activities when clicking the Activities tab of a Contact. I deleted 20 rows from the civicrm\_custom\_group table in phpMyAdmin.

Thanks @demerit and @petednz - fuzion for the pointers. Appreciated.

---
Tags: wordpress, activities, activity
---


# Question
Title: How do I set the Organization from the Employer Relationship as a contact's Current Employer for multiple contacts at once?
I have over 1,000 contacts which I imported along with an employer relationship, but these employers aren't showing up as "Current Employer" on the contact summary page because the relationship wasn't marked as current when it was created. I know how to fix this on an individual level, but not how to fix them all at once. Is there a way for me to make it so that all of these relationships are updated to "current employer" in a batch or mass update process, or do I have to do each one individually? Is there a way to indicate that this is the current employer when running an import?

CiviCRM 5.49.5

# Answer
> 0 votes
Welcome to SE!

There are a few options. Is this an import to a new system, so can we assume that *all* employer relationships should be active? If so, you could do:

* Go to `Support > Developer > Api Explorer v4`
* Select entity: 'Relationship', action: 'update'
* Where: select 'relationship\_type\_id:name', '=', 'Employee of'
* Values: 'is\_active', 'yes'
* Execute

---
Tags: import, relationships
---


# Question
Title: DB Error : Uknown error (When a new profile is created in multilingual CiviCRM setup)
Trying to create a new profile to get attached in contribution page, when hit save, a message box "DB Error: unknown error" appears.

This happening on multilingual civiCRM setup on multiple versions 5.35.2 to 5.50.3. On single language CiviCRM setup this error doesn't appear instead.

Looking in civiCRM log appears

```
    Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = "checks" AND path = "systemStatusCheckResult"

Jun 30 15:39:23  [info]  QUERY DONE IN 0.000821  seconds. Result is 0 rows by 3 columns.

Jun 30 15:39:23  [debug] $Query = BEGIN

Jun 30 15:39:23  [debug] $Query = SELECT path, data, UNIX_TIMESTAMP(expired_date) as expires FROM civicrm_cache WHERE group_name = "contact-20fields" AND path = "custom importableFields UFGroup_0_0_0_0__0__0__0_0__1_7acce319"

Jun 30 15:39:23  [info]  QUERY DONE IN 0.000765  seconds. Result is 0 rows by 3 columns.

Jun 30 15:39:23  [debug] $Query = INSERT INTO `civicrm_uf_group_en_US` (`is_active` , `title` , `frontend_title` , `help_pre` , `help_post` , `is_update_dupe` , `name` , `created_id` , `created_date` ) VALUES ( 1 , 'New Membership Signup' ,  NULL ,  NULL ,  NULL ,  1 , 'New_Membership_Signup' ,  2 ,  20220630153923 )

Jun 30 15:39:23  [debug] $Query = COMMIT

```

When look in database this record does not exist.

----- Update ----

CiviCRM ver: 5.35.2 to 5.50.3, Wordpress ver: 5.9.1, PHP ver: 7.3.31, MariaDB ver: 10.3.31

Thanks for any guidance!

# Answer
It's probably because the language fields are set to NOT NULL in the database.

Find out what the underlying table(s) are, and then with phpMyAdmin (or another database tool) you can set these fields to NULL.

I remember I had to do this with the label\_en\_US, label\_fr\_FR... columns in the table civicrm\_option\_value.
> 0 votes

# Answer
Can you do `SELECT @@sql_mode`? My guess is it has STRICT\_TRANS\_TABLES in it, which makes multilingual very difficult to use on mariadb. If that's the problem, you can configure mysql to remove that from sql\_mode. See also https://github.com/civicrm/civicrm-core/pull/22647#issuecomment-1025391599

Either that or you have logging turned on at administer - system settings - misc, which isn't very compatible with multilingual.
> 0 votes

# Answer
I've had a similar issue and it turned out that when creating a new profile or profile field, it auto-generates a blank translation. That's okay the first time, but the second time it doesn't like it and generates an sql error.

The only work-around solution I've found is to figure out the blank translation and put something in it (which your probably want to do anyway).

If you've got sql access, then look at civicrm\_uf\_group and see if the non language/en\_US fields are blank.
> 0 votes

---
Tags: wordpress, profile, contribution-page, multilingual
---


# Question
Title: MariaDB "underlying table doesn't have a default value" on event creation
I'm using CiviCRM 5.50.4 on Drupal 7 with MariaDB. The NGO I volunteer for uses French language. When a user creates an event, we have the following error (debugging mode):

```
UserInfo    INSERT INTO `civicrm_price_set_fr_FR` (`name` , `title` , `is_active` , `extends` , `financial_type_id` , `is_quick_config` , `is_reserved` , `min_amount` ) VALUES ('apprice_set_508' , 'AP [Copie id 508]' , 1 , '1' , 4 , 1 , 0 , 0.00 ) [nativecode=1423 ** Field of view 'drupal.civicrm_price_set_fr_FR' underlying table doesn't have a default value]

```

Thanks to PhpMyadmin, I discovered the `civicrm_price_set_fr_FR` is a view based on the table `civicrm_price_set` and two of the view fields don't have a default value.

**Question 1** \- I identified two resolution possibilities:

1. I could set MariaDb to ignore that with the STRICT\_TRANS\_TABLES parameter - but it means not catching abnormal queries anymore
2. I could work to set a default value - but I still haven't figure out how to do so

Any advice?

**Question 2** \- Despite this error message, the actual issue is that I can't register Contacts on new Events since I can't save mandatory pricing information: I don't know if the above issue is the root cause of that or equally a consequence of another issue ...

**Question 3** \- Should I, someday, report this as a bug or an evolution request to avoid this issue to happen to other users?

Thanks for your help, have a nice day!

# Answer
It's a known problem that mariadb isn't very usable with multilingual with STRICT\_TRANS\_TABLES. There's a thought about how it could be solved at https://github.com/civicrm/civicrm-core/pull/22647#issuecomment-1026131715
> 2 votes

# Answer
Is this related to DB Error : Uknown error (When a new profile is created in multilingual CiviCRM setup) ?

A solution could be to set the \_fr\_FR columns to NULL (if they are NOT NULL now)
> 0 votes

---
Tags: civievent, mysql, drupal-7, mariadb
---


# Question
Title: Registering Event Attendees and Volunteers using different Profiles
We need attendees and volunteers for an event. We have been creating two parallel CiviEvent events for this one real event.

We've been registering event attendees with one event, then setting up an additional event for the volunteers for that same actual event. For these two (simultaneous) events, the first event participant role defaults to Attendee, and the second event participant role defaults to volunteer.

It occurs to us that we could expose Participant Role in a profile so that the registrant can choose from two roles with a pulldown "Participant Role = Volunteer or Participant Role = Attendee"

The issue is then that we want to collect different information from attendees and volunteers. Is there some logical way to do this, beyond something like "If you chose Volunteer, please scroll to the bottom of the page and fill in your info there."

Ideally, the choice of Volunteer for the first field would change all the other fields, or flip from one profile to another. Or am I looking at this the wrong way.

Thanks for any tips! Rick

# Answer
> 1 votes
One option is the Profile Conditionals extension It's not the easiest thing to configure but works well when you get it right.

# Answer
> 1 votes
Two ideas come to mind, both would require Drupal to work.

You could create a CiviCRM-integrated-Webform and use conditionals there to adapt the form depending on the role of the participant.

There is also an extension called RemoteEvents that would allow you to do that. Pleas note that this would imply a rather complex new approach to set up event registration and will probably not be worth the effort if you only want two registration profiles - if you plan to do fancy event stuff in the future it may be worth a look though. Also it needs Drupal 9.

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


title: Link a Case to a Contribution?

text:
# Question
Title: Link a Case to a Contribution?
Is there a way or does anyone have a current extension that allows us to link a specific Contribution to a specific Case? We'd like to be able to report on the contribution amounts we have received for a specific incoming grant case.

I know of this older extension, but it seems to be outdated (not compatible since Civi version 4.x, from what it seems): https://github.com/CiviCooP/org.civicoop.casecontribution.

Does anyone else have a more up-to-date extension or any other way to link those two entities so we can report on them?

# Answer
I have a forked version which should work on the latest Civi version.
> 2 votes

---
Tags: civicontribute, civicase
---


title: Import Google fonts in Mosaico

text:
# Question
Title: Import Google fonts in Mosaico
I've followed some posts found here and there but wasn't able to make that work on Mosaico 2.8. Here is what I've added to versafix template.

Have missed something obvious?

`@import url('https://fonts.googleapis.com/css?family=Nunito&display=swap'); @import url('https://fonts.googleapis.com/css?family=Pontano+Sans&display=swap');`

`face { label: Police; widget: select; options: Arial, Helvetica, sans-serif=Arial|Arial Black, Arial Black, Gadget, sans-serif=Arial Black|Comic Sans MS, Comic Sans MS5, cursive=Comic Sans|Courier New, Courier New, monospace=Courier|Georgia, serif=Georgia|Impact, sans-serif=Impact|Lucida Console, Monaco, monospace=Lucida Console|Lucida Sans Unicode, Lucida Grande, sans-serif=Lucida Sans Unicode|Nunito, sans-serif=Nunito|Pontano sans, sans-serif=Pontano Sans|Times New Roman, Times, serif=Times New Roman|Verdana, Geneva, sans-serif=Verdana}`

# Answer
> 1 votes
Did you clear all your caches?

I just tried this and it worked for me using your code example. I copied the @import lines before the @supports -ko-blockdefs section and then your font select options afterwards:

```
...
<style type="text/css">
    @import url('https://fonts.googleapis.com/css?family=Nunito&display=swap');
    @import url('https://fonts.googleapis.com/css?family=Pontano+Sans&display=swap');
    @supports -ko-blockdefs {
      id { widget: id }
      size { label: Size; widget: select; options: 8|9|10|11|12|13|14|15|16|18|20|22|25|28|31; }
      visible { label: Visible?; widget: boolean }
      color { label: Color; widget: color }
      radius {
        label: Corner Radius;
        widget: integer;
        max: 20;
        help: Attention - this property is not supported on all email clients (i.e. Outlook)
      }
      face { label: Police; widget: select; options: Arial, Helvetica, sans-serif=Arial|Arial Black, Arial Black, Gadget, sans-serif=Arial Black|Comic Sans MS, Comic Sans MS5, cursive=Comic Sans|Courier New, Courier New, monospace=Courier|Georgia, serif=Georgia|Impact, sans-serif=Impact|Lucida Console, Monaco, monospace=Lucida Console|Lucida Sans Unicode, Lucida Grande, sans-serif=Lucida Sans Unicode|Nunito, sans-serif=Nunito|Pontano sans, sans-serif=Pontano Sans|Times New Roman, Times, serif=Times New Roman|Verdana, Geneva, sans-serif=Verdana}
      decoration { label: Decoration; widget: select; options: none=None|underline=Underline }
      linksColor { label: Link Color; extend: color }
...

```

I did this, cleared both the Drupal and the CiviCRM cache and all was fine?

---
Tags: mosaico
---


# Question
Title: How do I set up CiviMail to automatically remove duplicate email addresses?
According to book.civicrm.org:

> **Remove duplicate emails:** CiviCRM will always dedupe your mailing based on unique contact records. For example, if a contact is in three of the groups you are including in your mailing, they will only be sent one copy of the email. However, if the same email is used by multiple contacts, that email address will receive multiple copies of the email—one for each contact using that address. Checking this box will ensure only one email is sent to each address

We do have some different contacts that use the same email address.

We would like to set up CiviMail so that it always removes duplicate email addresses and take it out of folk's hands.

I see the check box on the create a new mailing page but would always like this behavior. In fact, I can't see why you wouldn't want it to always remove them.

Is anyone aware of a way to set this as a default?

# Answer
In our case, we don't make any use of a contact with someone else's email address.

We ended up just training everyone to make sure that the Remove Duplicate Email is always checked.
> 0 votes

# Answer
A very old question - but this is possible by going to **Administer menu » CiviMail » CiviMail Component Settings** and checking the box labeled *CiviMail dedupes e-mail addresses by default*.

Note that this box is checked by default on new installations of CiviCRM and has been for years, so this should only affect folks who have had CiviCRM for a very long time.
> 0 votes

---
Tags: civimail, contacts
---


# Question
Title: PEAR_Exception: DB Error: no such field, while upgrading CiviCRM in Wordpress
I just tried to update a CiviCRM 5.47.4 installation to the latest 5.51.0 and I am getting this error during the database upgrade process.

Once the upgrade failed I reset both the filesystem and database back to where it was before I had started. So I'm back in 5.47.4. But I don't have a way to go back any farther than that. It was the first time I attempted this upgrade and I'm hoping someone can help me with what I need to do so the upgrade will be able to succeed when I try it again.

I do not see an is\_autorun field in my civicrm\_queue table so if that was supposed to be created I suppose something failed along the way that I was unaware of.

Error Field Error Value Type DB\_Error Code -19 Message DB Error: no such field Mode 16 UserInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\] DebugInfo UPDATE civicrm\_queue SET runner = "task" WHERE is\_autorun = 1 \[nativecode=1054 \** Unknown column 'is\_autorun' in 'where clause'\]

PEAR\_Exception: DB Error: no such field in /home/kepw/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922

* DB\_Error: DB Error: no such field in unknown on line unknown

# Answer
As per comments, possibly there was a sequence of failed upgrades and restore where the restore to 5.47 ended up with some changes from 5.48. Fixed in this case by `drop table civicrm_queue`, recreating with https://github.com/civicrm/civicrm-core/blob/4cbeb3a31baea58d44813905e3b131b4ae26bfea/CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl#L3-L11, and then running the upgrade.
> 0 votes

---
Tags: wordpress, upgrade
---


title: Default membership payment status

text:
# Question
Title: Default membership payment status
When creating a new membership manually in CiviCRM, you get a checbox where you could tick off to record membership payment. This payment comes with the default contribution status of Completed.

How and where can I change that default contribution status to Pending?

CiviCRM 5.20.0 on Drupal 7.67

# Answer
> 1 votes
There is the option to make all back-end contributions default to Pending by changing the order of the Contribution Status Options.

Administer \> System Settings \> Option Groups \> Contribution Status (Edit Options)

/civicrm/admin/options?gid=11&reset=1

Move the Pending option from the second row to the top –

We have had a client using CiviCRM successfully by making this change but would suggest testing thoroughly in a non-production environment to make sure it behaves as expected.

# Answer
> 0 votes
You would need an extension to do this. If you don't have bookkeeping integration, it wouldn't be hard to set the payment to "Pending" after it was recorded - but if you have bookkeeping integration, this would cause headaches. You would need to find a way to identify a payment as belonging to a membership before it was written, which will be difficult, since the normal method (finding a MembershipPayment record) isn't possible - the MembershipPayment record is created after the contribution, not before.

---
Tags: civimember
---


title: Adding custom fonts in mosaico

text:
# Question
Title: Adding custom fonts in mosaico
Basicly what it says in the title. How do I add custom fonts within mosaico templates, i.e. how do I make them selectable in the template design process?

There is the answer to my question on github and it goes like this:

> In the header of the template (the mso comments are there because Outlook is able to read webfonts declaration but then "breaks" any declared font):
>
> ```
> <!--[if !mso]><!-- -->
> <link href="https://fonts.googleapis.com/css?family=Your+Web+Font" rel="stylesheet" type="text/css" />
> <!--<![endif]-->
>
> ```
>
> In the @supports -ko-blockdefs section of your template you add your font to the select box:
>
> ```
>   face { label: Font; widget: select; options: Your Web Font, Fallback, serif=Your Web Font|Arial, Helvetica, sans-serif=Arial|Arial
>
> ```
>
> Black, Arial Black, Gadget, sans-serif=Arial Black|Comic Sans MS, Comic Sans MS5, cursive=Comic Sans|Courier New, Courier New, monospace=Courier|Georgia, serif=Georgia|Impact, sans-serif=Impact|Lucida Console, Monaco, monospace=Lucida Console|Lucida Sans Unicode, Lucida Grande, sans-serif=Lucida Sans Unicode|Times New Roman, Times, serif=Times New Roman|Verdana, Geneva, sans-serif=Verdana}

However this doesn't work for me. When I add this to versafix-1 (mosaico/templates/versafix-1/template-versafix-1.html) I still don't have the font I specified.

Here's the begining of versafix-1 template I eddited

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="viewport" content="initial-scale=1.0" />
  <meta name="format-detection" content="telephone=no" />
  <title style="-ko-bind-text: @titleText">TITLE</title>
  <!--[if !mso]><!-- -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" />
  <!--<![endif]-->
  <style type="text/css">
    @supports -ko-blockdefs {
      id { widget: id }
      size { label: Size; widget: select; options: 8|9|10|11|12|13|14|15|16|18|20|22|25|28|31; }
      visible { label: Visible?; widget: boolean }
      color { label: Color; widget: color }
      radius {
        label: Corner Radius;
        widget: integer;
        max: 20;
        help: Attention - this property is not supported on all email clients (i.e. Outlook)
      face { label: Font; widget: select; options: Open Sans, Arial, serif=Open Sans|Arial, Helvetica, sans-serif=Arial|Arial Black, Arial Black, Gadget, sans-serif=Ari$
      }

```

# Answer
> 5 votes
What worked for me with google-fonts is the following:

After the tag add the include path generated from google-fonts, in this example Modak and Open Sans.

```
  @import url('https://fonts.googleapis.com/css?family=Modak|Open+Sans');

```

Then in the @supports block, in the face part add the fonts separated by '|', to be included in the blocks:

```
  face { label: Font; widget: select; options: Arial|Impact|'Open Sans', sans-serif|Times New Roman|'Modak'}

```

Edit: local fonts can be included by putting them on accessible on your server, and then import them in the template like this:

```
@font-face {
  font-family: 'your_font_name';
  src: url(https://example.com/files/fonts/your_font/your_font_file.ttf) format('ttf'),
    url(https://example.com/files/fonts/your_font/your_font_file.woff2) format('woff2');
        }

```

Then add those to the dropdown menu in the @supports block same as above.

That way your fonts can be loaded from your server.

# Answer
> 2 votes
I answered this the other day when I was looking at adding the Trebuchet MS font and came across a question on adding Google Fonts (see Import Google fonts in Mosaico)

I'm using the latest Mosaico (2.9.1645644008) and my versafix-1 template looked a little different. The changes I made were basically the same as above but without using @font-face:

1. Make a copy (if you want to, I did!) of the existing versafix-1 template
2. Add the @import link from Google's font pages (Google Fonts)
3. Add the additonal font/s to the @supports -ko-blockdefs section

Re 1. I did not use an extension, just added a directory called mosaico\_tpl. The correct directory name is defined in the Mosaico Settings: Administer \> CiviMail \> Mosaico Settings. The default is \[civicrm.files\]/mosaico\_tpl. I copied the entire versafix-1 directory and subdirectories to mosaico\_tpl. This gave me the template, template-versafix-1.html, along with the edres and img resource directories. I just renamed the the directory and template file to suit.

Here is copy of the section of the template html files I edited:

```
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="viewport" content="initial-scale=1.0" />
  <meta name="format-detection" content="telephone=no" />
  <title style="-ko-bind-text: @titleText">[subject]</title>

  <style type="text/css">
    @import url('https://fonts.googleapis.com/css2?family=Nunito&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Pontano+Sans&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Cormorant+SC:wght@300&display=swap');
    @supports -ko-blockdefs {
      id { widget: id }
      size { label: Size; widget: select; options: 8|9|10|11|12|13|14|15|16|18|20|22|25|28|31; }
      visible { label: Visible?; widget: boolean }
      color { label: Color; widget: color }
      radius {
        label: Corner Radius;
        widget: integer;
        max: 20;
        help: Attention - this property is not supported on all email clients (i.e. Outlook)
      }
      face { label: Police; widget: select; options: Trebuchet MS, Helvetica, sans-serif=Trebuchet MS|Arial, Helvetica, sans-serif=Arial|Arial Black, Arial Black, Gadget, sans-serif=Arial Black|Comic Sans MS, Comic Sans MS5, cursive=Comic Sans|Courier New, Courier New, monospace=Courier|Georgia, serif=Georgia|Impact, sans-serif=Impact|Lucida Console, Monaco, monospace=Lucida Console|Lucida Sans Unicode, Lucida Grande, sans-serif=Lucida Sans Unicode|Nunito, sans-serif=Nunito|Pontano sans, sans-serif=Pontano Sans|Times New Roman, Times, serif=Times New Roman|Verdana, Geneva, sans-serif=Verdana|Cormorant SC}
      decoration { label: Decoration; widget: select; options: none=None|underline=Underline }
      linksColor { label: Link Color; extend: color }

```

I had no need to import Trebuchet MS, but you will see that I imported 3 google fonts - Nunito, Pontano and Cormorant SC.

In the face {... block, each typeface is seperated by a | character and you define your fallback as the second parameter - *typeface*, *fallback* e.g. Trebuchet MS, Helvetica, sans-serif=Trebuchet MS. In this example from above, Helvetica is the fallback. The | character then ends that typeface and the next one is defined.

As I quickly learned, you **MUST** clear your caches, I did both Drupal and CiviCRM to see the changes, but all worked first time for me on Drupal 7.9, CiviCRM 5.50.1.

As a complete aside I came across this today for when I'm feeling adventurous and brave enough to start doing more with these templates:

Adding a custom block to Mosaico email editor in CiviCRM

---
Tags: message-templates, mailing, civicrm-home, mosaico
---


title: Undefined index errors after updates

text:
# Question
Title: Undefined index errors after updates
We recently updated to the latest D7 version of CiviCRM and now we're getting a bunch of errors in the back-end logs. Scheduled reminders on events seem to not be going out, either. I've deleted the templates\_c folder and let it recreate itself, cleared the cache, etc.

Here's what we're getting:

*Notice: Undefined index: defaultCurrencySymbol in include() (line 166 of /home/username/public\_html/sites/default/files/civicrm/templates\_c/en\_US/%%24/24E/24E27851%%jsortable.tpl.php).*

*Notice: Undefined index: participantListingURL in include() (line 54 of /home/username/public\_html/sites/default/files/civicrm/templates\_c/en\_US/%%58/580/5800D420%%Tab.tpl.php).*

*Notice: Undefined index: isAdmin in include() (line 15 of /home/username/public\_html/sites/default/files/civicrm/templates\_c/en\_US/%%14/140/14053CE4%%EmailCommon.tpl.php).*

# Answer
Undefined index notices don't affect the behavior of CiviCRM and you can ignore those. That's not causing your Scheduled Reminders issue, which should be investigated separately.

A good explanation of PHP notices is here. A common example is if you don't set a value on a variable, then try to do math on it, PHP will assume you meant the value to be zero - but it will emit a notice, since it's better to explicitly set a variable to zero.

The Smarty notices you're seeing is because of issue core#1328. In short, a design decision made in CiviCRM in the very early days leads to odd bugs, but fixing it causes notices in most Smarty templates unless someone changes them. This is more than can be done at once, so there are notices until the remaining notices are cleaned up.
> 0 votes

---
Tags: scheduled-reminders, system-workflow-messages
---


title: Odd REST API result

text:
# Question
Title: Odd REST API result
I am using civicrm on drupal 7. I have configured my Civi instance to accept external REST API calls with authentication.

I want to get all the values from a set of custom fields associated with an organization sub-type.

I am making a call something like this:

```
$contacts = civicrm_api4('Contact', 'get', [
  'select' => [
    'id',
    'display_name',
    'my_custom_field_set.*',
  ],
  'join' => [
    ['my_custom_field_set AS my_custom_field_set', 'LEFT'],
  ],
  'where' => [
    ['my_custom_field_set.name', 'IS NOT NULL'],
    ['contact_type', '=', 'Organization'],
    ['contact_sub_type', '=', 'CLC'],
  ],
]);

```

This mostly works... except for 5 entries in my database that get skipped. The five failures are all part of another sub-type: `ICT Program Client` which has some other fields and relationships associated with it.

If I remove the sub-type `CLC` WHERE constraint it works. But I would prefer to understand why the presence of the other sub-type on a contact would make the query fail.

The 5 failures are definitely of sub-type `CLC`.

# Answer
> 2 votes
Can you try with a LIKE 'CLC' rather than '='? This might help as the contact\_sub\_types are stored with the weird CRM\_Core\_DAO::VALUE\_SEPARATOR around the values?

---
Tags: rest, apiv4, sub-types
---


title: Clean URLs are a little bit too clean

text:
# Question
Title: Clean URLs are a little bit too clean
Drupal 7.9, CiviCRM 5.51 ( recently partially updated from v.4.7 ). Something overrides CiviCRM URLs in the menu: instead of **&contribute?reset=1** it comes as ***contribute\_reset\_1*** Drupal **.htaccess** file has no alterations, nor there are any custom module or custom theme function. Vanilla civicrm.settings.php. There is another civicrm setup on the same server which works as it should. So there is a big chance something has been rotten during the upgrade but it's unclear where to start looking. Any advice please!

# Answer
> 1 votes
Nice post title!

You could try civicrm/menu/rebuild?reset=1

If that doesn't work, a first step might be check if they are stored in civicrm\_navigation with the underscore, or whether something is translating them on the fly.

Also check if there is a custom php dir set at admin - system settings - directories and see if there are any overrides in that folder.

---
Tags: drupal, upgrade, redirect
---


# Question
Title: Upgraded Joomla CiviCRM to 5.47.2, getting PreSaveSubscriber deprecated warnings; Symfony issue?
**========== Updates ==========**

UPDATE1:

I found in the CiviCRM 5.47.0 release notes:

**(REF) APIv4 - Deprecate and stop using PreSaveSubscriber (22648)**

The only code I've found that calls PreSaveSubscriber is in the CiviCRM cache folder, media/civicrm/templates\_c:

```
CachedCiviContainer.73d843c61bfbb34674c0ff02ce48cf2d.php
CachedCiviContainer.ef856f09bf0c4699a47bf7b31ddccbf6.php

```

These PHP files in the cache were generated today just a while ago when I accessed the site.

What is CachedCiviContainer and why is this code calling a deprecated function?

UPDATE2:

I cleared the Civi cache, logged out of Joomla admin, and then logged back in.

A new CachedCiviContainer file was generated in the cache folder, and it too contains code calling PreSaveSubscriber.

It appears each time I log into Joomla a new CachedCiviContainer is created in the cache folder.

CachedCiviContainer is generated by Symfony Dependency Injection Component.

UPDATE3:

I just did a test and was not able to precipitate the "PreSaveSubscriber is deprecated" warnings, so I logged out, cleared the website's cookies, and logged back in. After this, I saw the warnings again. The warnings seem to only appear once... possibly once per day, unless I clear cookies.

**========== Original Post ==========**

Before I started the upgrade, Civi reported:

The site is using Joomla 3.10.5. I upgraded Civi from 5.45.1 to 5.47.2. I'm now seeing this sometimes when viewing system status page (not always):

> Deprecated: Use of APIv4 'PreSaveSubscriber' is deprecated. 'Civi\Api4\Event\Subscriber\ContactPreSaveSubscriber' should be removed (Contact::getFields). Caller: ::call\_user\_func\_array in /var/www/vhosts/XXXXX.org/httpdocs/administrator/components/com\_civicrm/civicrm/CRM/Core/Error.php on line 1059
>
> Deprecated: Use of APIv4 'PreSaveSubscriber' is deprecated. 'Civi\Api4\Event\Subscriber\CustomFieldPreSaveSubscriber' should be removed (CustomField::get). Caller: ::call\_user\_func\_array in /var/www/vhosts/XXXXX.org/httpdocs/administrator/components/com\_civicrm/civicrm/CRM/Core/Error.php on line 1059
>
> Deprecated: Use of APIv4 'PreSaveSubscriber' is deprecated. 'Civi\Api4\Event\Subscriber\CustomFieldPreSaveSubscriber' should be removed (CustomField::get). Caller: ::call\_user\_func\_array in /var/www/vhosts/XXXXX.org/httpdocs/administrator/components/com\_civicrm/civicrm/CRM/Core/Error.php on line 1059

Also seeing this:

thanks

# Answer
> 1 votes
the schedule job failures:

Fetch Bounces - Check the Mail accounts(Administer \>\> CiviMail \>\> Mail Accounts) are configured correctly. You can disable the scheduled job if it's not required.

Process Inbound Emails - Check the Mail accounts(Administer \>\> CiviMail \>\> Mail Accounts) are configured correctly. You can disable the scheduled job if it's not required.

Mail Reports - It requires report id to be passed, I guess you are not using this functionality so you can turn this scheduled job off.

# Answer
> 0 votes
Just started getting the same problem on an upgraded joomla site PHP 7.4.30 Joomla! 3.10.10 Stable CiviCRM 5.37.2

Error occurs when sending a Flexmail/Mosaico bulk mailing

# Answer
> 0 votes
Thanks to an advice from our friends at Fuzion, I deleted the following files:

```
<your_server_path_to_joomla_root>/administrator/components/com_civicrm/civicrm/Civi/Api4/Event/Subscriber/CustomFieldPreSaveSubscriber.php
<your_server_path_to_joomla_root>/administrator/components/com_civicrm/civicrm/Civi/Api4/Event/Subscriber/ContributionPreSaveSubscriber.php
<your_server_path_to_joomla_root>/administrator/components/com_civicrm/civicrm/Civi/Api4/Event/Subscriber/ContactPreSaveSubscriber.php

```

Where `<your_server_path_to_joomla_root>` is something like `/home/your_user_account/public_html` or `/home/your_user_account/www` on a Linux server

You may also look in the `<your_server_path_to_joomla_root>/media/civicrm/templates_c/` for any cache files and wipe them out (if you don't do this after every upgrade... which you should)

No more of these pesky errors : )

---
Tags: joomla, upgrade, symfony
---


title: creating contacts from remote websites

text:
# Question
Title: creating contacts from remote websites
is it possible to create new contacts using remote html forms?

we have three different websites related to different activities of the organization.

we would like to create adding contact forms on each of these websites and have the form perform data-entry to a single civicrm running on a separate wordpress installation.

Is it possible? How?

# Answer
Yes. CiviCRM provides an "html snippet" for every profile form you create. Simply copy and paste this into your remote website and form submissions will be saved back to your CiviCRM database.

For more information see http://docs.civicrm.org/user/en/stable/organising-your-data/profiles/#standalone-forms-with-profiles
> 5 votes

# Answer
Speaking generally, yes, you can use CiviCRM's REST API to do things remotely. In your case, that includes creating contacts.

For further reference, see the wiki article on Using the API.
> 4 votes

# Answer
For anyone using Drupal and need more nuanced or complex forms then you can also use Webform-civicrm and embed in an iframe. Generally that requires having a drupal 'blank' theme so you just get the form and nothing else. So extra work, but provides extra benefits that webform-civicrm does so nicely.
> 2 votes

# Answer
I would recommend looking at the inlay extension and inlayfp. You can create forms using CiviCRM and embed in any website supporting a script tag.
> 1 votes

---
Tags: wordpress, contacts
---


# Question
Title: Css not loading causing the dashboard not loading correctly
The error in question is as follows:

Refused to apply style from 'mysite/wp-content/uploads/civicrm/persist/contribute/dyn/crm-menubar.e7a0463626d3eb2004ca8b83b4b12bad.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Anyone have any idea how to fix this?

# Answer
> 2 votes
Fixed this by resetting the css path in the settings. It was trying to access an folder that didnt exist.

# Answer
> 1 votes
I had a similar problem with Drupal. I needed to run composer civicrm:publish

Best, Josh

---
Tags: css
---


title: Drupal Clean URL disable breaks CiviCRM

text:
# Question
Title: Drupal Clean URL disable breaks CiviCRM
In addition to this question: disabling Clean URLs in Drupal \[7.90\] somehow breaks CiviCRM resources load with cryptic errors in Dev Console:

```
Error: CRM.url called before initialization Common.js?rf6a3f:1674
Uncaught TypeError: Cannot read properties of undefined (reading 'back') crm.ajax.js?rf6a3f:34

```

It also looks like some CSS and JS resource fail to load, because of :

```
  Refused to execute script from 'https://domain/index.php?rf6a3f'
  Refused to apply style from 'https://domain/index.php?rf6a3f'

```

Resource URLs and Directores paths are triple-checked and all real paths on the server exist and writable. Backend / Menu rebuild make no difference. Cache is crystal clean. Basically, all filesystem is new and shiny, no custom Drupal code nor CiviCRM custom extension. The only place where the problem might be is the database. "**civicrm\_domain.config\_backend**" is null.

So the question is: which table(s) in the database holds information about path(s) and/or resources loaded ?

Drupal 7.9, CiviCRM 5.51.1

# Answer
> 0 votes
I believe you're probably seeing symptoms of a deeper problem, e.g. php version.

> re: "So the question is: which table(s) in the database holds information about path(s) and/or resources loaded ?"

The answer is probably not what you're hoping for. CiviCRM has some of that, which gets built/cached, but makes use of civicrm settings + Drupal. Drupal is the initial 'dispatcher' and the lack of any path suggests that civicrm is not telling Drupal what paths it controls properly.

---
Tags: drupal, angular, resource-urls
---


title: Why didn't my Scheduled Reminder send?

text:
# Question
Title: Why didn't my Scheduled Reminder send?
My scheduled reminders aren't working. What are some causes?

# Answer
There are a number of reasons Scheduled Reminders might not be working. It's important to first distinguish between "No Scheduled Reminders are working" and "A particular scheduled reminder isn't working".

### No scheduled reminders are working

* You haven't yet set up your cron job.
* Your Scheduled Reminders Scheduled Job (**Administer menu » System Settings » Scheduled Jobs**) isn't enabled.
* Your outbound email settings aren't configured correctly. Test them at **Administer menu » System Settings » Outbound Email**.

### One scheduled reminder isn't working

* Your "Effective Start Date" or "Effective End Date" are outside the range of the reminder.
* This reminder has already been sent. E.g.:
    + You have a reminder to go out 7 days before an event, which sends successfully.
    + 3 days before the event, you postpone the event to next month.
    + 7 days before the event, the same scheduled reminder will NOT fire again, because Civi won't send the same reminder twice, and the participants already received the reminder.
* Your reminder is set to go to Additional Recipients, and is an event reminder. This doesn't work, and is removed in current versions of Civi.

### Other things to check

* Check the Scheduled Job log for Scheduled Reminders to make sure you see both the "job is starting" and "job finished successfully" messages.
* Check your mail logs to ensure that the mailing actually went out. Some third-party mailers (e.g. SendGrid, Sparkpost) won't let you send with any "From" address you like, and your mail logs will indicate that the message was rejected by your mailing service.
> 3 votes

---
Tags: scheduled-reminders
---


title: Event roles in Drupal webform

text:
# Question
Title: Event roles in Drupal webform
I would like to allow only one contact to sign up for a specific role in an event, using the Drupal 7 webform. The role is 'Team Lead' and obviously there should only be one of those! The other role that's allowed is for 'Team Member'. There is a single maximum number for an event, of course but it's not 'by role'. Is there a way to restrict the number of contacts for a given role using webform - or even either of the other form builders in Civi (Form Builder or Form Processor)?

# Answer
Drupal's Webform has a 'validation' component that can do things like this - e.g. as soon as a submission has been received with a specific value in that form element, it can be configured to prevent future submissions with the same value (i.e. 'uniqueness'). You'd need to create the form in a way that can use this kind of validation, e.g. a checkbox that says "Team Lead", as opposed to being one of a selection of roles, some of which allow multiples.
> 3 votes

---
Tags: drupal, webform-civicrm, form-processor, formbuilder
---


# Question
Title: Export Activities associated with CiviCase
We're currently discussing whether it's possible to use the activities recorded in a Case (including the scheduled activities in a timeline), export them into Excel and convert it into a Gantt chart, but I can't see a way to export all activities associated with a Case. When I look at the options in the Civi Reports, it will only export the most recent activity. Would Drupal Views be any use?

# Answer
One thing that has annoyed me for years is the lack of a working Gantt Module or CiviCRM Extension. Due to the many ways people use Drupal and CiviCRM, I created an “Instruction Guide” (With Code Samples) rather than a module or extension.

You can get it here:https://github.com/jdgamsterdam/d9civicrmgantt
> 3 votes

# Answer
Yes, you would be able to do that with Drupal Views. There is also an extension that provides the Case Activities with the API: https://civicrm.org/extensions/caseactivity-api
> 1 votes

---
Tags: activities, civicase, drupal-views, export
---


title: CiviCRM and Docker

text:
# Question
Title: CiviCRM and Docker
Are any of the CiviCRM core team using docker? and is there a preferred installation?

I note there are a few drupal docker projects, such as this but couldn't see anything for Civi.

# Answer
> 9 votes
PTP has been experimenting with docker for a few months and is planning to use it in production soon (to replace our aegir provisioning system). I've just been working today on finishing a Docker file for setting up a civicrm-buildkit instance.. Feedback welcome!

# Answer
> 7 votes
No one on the core team is actively using docker, although a few of us experiment with it.

Several of us do use the civibuild command from https://buildkit.civicrm.org/ . It defines the reference/demo builds used by http://d46.demo.civicrm.org , http://wp46.demo.civicrm.org , etal.

Civibuild tackles a slightly different part of the stack than Docker or Vagrant. Where Docker and Vagrant generate a system-image (complete with Linux distro, binaries, and PHP/JS code), civibuild is only the portable part which installs the PHP/JS app. Civibuild could be used within a Vagrant/Docker/EC2/OpenStack system. Ideally, it would be great to have a http://packer.io/ setup with civibuild.

# Answer
> 3 votes
I have put together a CiviCRM-buildkit-based Docker image myself, and I would appreciate help and feedback with testing. It's quite configurable as you can choose any buildkit-based build script, and it includes SSMTP support for sending emails.

The primary advantage here is that it adheres to the Docker principals and philosophy. It is minimal, only including what the buildkit environment needs. It doesn't require the user to preconfigure their Docker build environment, which many Docker hosts don't give you access to, it doesn't use baseimage, and it doesn't bundle it's own SSH server.

https://github.com/djcf/civibuild-docker

# Answer
> 0 votes
I could never quite get the existing CiviCRM container to work right so I decided to build from scratch. It takes the basic Drupal Container (with PHP 7.4 and MariaDB) then adds all the updates and the latest versions.

You can get the scripts and instructions here: https://github.com/jdgamsterdam/civicrmdocker

---
Tags: developer
---


# Question
Title: CiviCRM - WordPress - Frequent timeout errors
I have CiviCRM installed on a development WordPress site and I keep having problems with timeout errors. This is a VPS server with a VPS SQL account. The server has 2000MB of RAM and the SQL account has another 500MB of RAM. This is the only website running on this VPS. I have configured PHP to have a memory limit of 300MB and a max execution time of 500. I have confirmed in WordPress that these settings are recognized by WordPress. I'm trying to figure out what to do next to troubleshoot what needs to be adjusted to address the timeout errors. CiviCRM version 5.44.0. WordPress version 6.0.1

Thanks!

# Answer
> 0 votes
There are a billion reasons for WP/Civi timeouts. To start from, a few notes:

* **300MB PHP RAM**: I'd make it 512Mb or 1G: the latter requires at least 4G on the server
* **500Mb SQL RAM**: well, it's actually not that much: try this https://github.com/major/MySQLTuner-perl to check DB internals: it worth following recommendations the script provides.
* **max execution time of 500** : afraid this one does not make sense nor any difference here at all. You might want to stick to 120.

Also, have you checked:

* CiviCRM Logs
* WP Debug output
* PHP error logs
* Web server \[Apache?\] error logs
* MySQL error logs?

Your answer is somewhere in the logs above.

---
Tags: wordpress
---


# Question
Title: Issue moving site from mysql 5.7 to mysql 8
I was just trying to move three old CiviCRM drupal 7 sites from Ubuntu 16, PHP7.2 and mysql 5.7 Ubnuntu 22.04 lts, php 7.4 and mysql 8 and have run into some issues.

two of the three sites work but throw this warning:

```
Missing Phone numeric function

Your database is missing a function to populate the 'Phone number' field with a numbers-only version of the phone.

```

Trying to rebuild the DB triggers throws an `Unknown database error` and just hangs.

The third site, doesn't work at all and throws this error:

```
RuntimeException: CiviCRM has not bootstrapped sufficiently to fire event "hook_civicrm_entityTypes". in Civi\Core\CiviEventDispatcher->dispatch() (line 190 of /var/www/html/mysite/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php).

```

The host drupal 7 site is connecting to the DB fine.

I've tried:

1. resetting the file permissions in the files directory
2. resyncing the site files (I used rsync)
3. re-downloading the database.

the mysql dump seem to go into the new DB without errors.

Is it possible to move a CiviCRM install from Mysql 5.7 to Mysql 8 or do I have to install an older version? And what will happen in a year or so when 5.7 is EoL?

# Answer
MySQL8 is working fine for us so far.

You may need to play around with the parameters of mysqldump to make a useable dump that works out of the box:

To fix that warning you need to add the parameter `--routines` when creating the dump: https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option\_mysqldump\_routines

Adding `--triggers` might help with having an urgent need to recreate those triggers.

The error message for your third site seems to be somewhat vague. For example there was a recent fix for dealing with missing extensions that went into CiviCRM 5.50.2: https://github.com/civicrm/civicrm-core/pull/23716. But you need to be more specific about your environment and what you did to get there.
> 1 votes

# Answer
MySQL 5.7 to 8 is a notable upgrade by itself. Have you gone through the `mysql_upgrade` process? See for example, https://dev.mysql.com/blog-archive/inplace-upgrade-from-mysql-5-7-to-mysql-8-0/

Alternatively now would be a good time to consider switching to MariaDB.

Both are supported for CiviCRM.
> 2 votes

---
Tags: mysql, mysql-5.7, mysql-8.0
---


# Question
Title: CiviCRM CDN Tax Receipts extension. How do you modify the layout?
As a new user of CiviCRM, I have been looking around for instruction how to modify the layout of the Donation Tax receipts.

In the Donation Tax Receipt configuration page you can specify a pdf template. Is there any field I should define in the pdf or is it just a plain pdf file?

If I need to change the layout of the printout how should I proceed?

I selected a pdf template and I joined a copy of the actual output I get at this point.

Any helps will be greatly appreciated. Regards

Using WP v6.0.1, CiviCRM v5.50.1, CDN Tax Receipt v1.6.0

# Answer
> 1 votes
The PDF is just a background so it will require some coding ability if you want to customize the tax receipt.

You need to create an extension with an implementation of `hook_cdntaxreceipts_writeReceipt` to write the text wherever you want on the page.

The default is implemented in file `cdntaxreceipts.functions.inc` -\> `function _cdntaxreceipts_writeReceipt`. This is called 3 times with an offset but you can decide to print only one copy and place the information where you want (as long as you do print the required information).

It should looks like :

```
/**
 * Implements hook_cdntaxreceipts_writeReceipt().
 *
 */
function myextension_cdntaxreceipts_writeReceipt(&$f, &$pdf_variables, &$receipt) {

  // starting point on the page
  $mymargin_top = $pdf_variables['mymargin_top'];
  $mymargin_left = $pdf_variables["mymargin_left"];

  // define font size
  $pdf->SetFont('Helvetica', '', 8);

  // position based on margin
  $pdf->SetX($mymargin_left + 50);
  $pdf->SetY($mymargin_top + 10);

  // printing text
  $pdf->Write(10, CRM_Core_BAO_Setting::getItem(CDNTAX_SETTINGS, 'org_name'), '', 0, 'R', TRUE, 0, FALSE, FALSE, 0);

  ...
}

```

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


# Question
Title: CiviCRM Export Field to indicate which phone number is being used
I'm trying to create an Export that indicates which phone number (out of Main, Home, Work, Billing, Alternative, etc) is being used for the Primary phone number. Is there a specific field I can include which states which phone number the Primary is using? There's a field called "Phone Type" but that just indicates whether the phone is a landline or mobile number.

# Answer
You should be able to export that information using the field `Location type` but there seems to be a bug/limitation on the UI. You can indeed find this field for address but not for phone.

As an alternative, you could use Search Kit to get the data you want. You can get a couple of interesting link to get you started on SearchKit here : https://civicrm.org/blog/wmortada/searchkit-new-way-get-data-out-civicrm

When you get there, here is a small example with the field you want :

After saving the Search, you can use View Results and Download as spreadsheet :
> 0 votes

---
Tags: export
---


# Question
Title: Fatal Error in logs with every contribution
Drupal 7.90 CiviCRM 5.51.1 We use line items & webform civi integration for all contributions.

We are having random instances where a contribution is made, it is processed in iATS, the contribution table has the information, BUT there is no record in the civicrm\_line\_item table, and the webform submission also do not show any record. Most of the time it works but several times a week we get these partially completed records.

I have tried several test contributions and have not been able to duplicate the problem. With every (successful or partial contributions) we get a Fatal Error and the Depreciated Function message in the logs. I am hoping that if I take care of the Fatal Error, the random lack of recording to SQL tables goes away.

$Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> exceptionHandler ) \[code\] =\> -1 \[message\] =\> DB Error: unknown error \[mode\] =\> 16 \[debug\_info\] =\> \[nativecode=0 \**\] \[type\] =\> DB\_Error \[user\_info\] =\> \[nativecode=0 \**\] \[to\_string\] =\> \[db\_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM\_Core\_Error::exceptionHandler prefix="" info=" \[nativecode=0 \**\]"\] )

Deprecated function ::civicrm\_api3\_contribution\_transact, use The contibution.transact api is unsupported & known to have issues. Please see the section at the bottom of https://docs.civicrm.org/dev/en/latest/financial/orderAPI/ for getting off it. Array ( \[civi.tag\] =\> deprecated )

$backTrace = #0 /home/radiusint/secure/sites/all/modules/civicrm/CRM/Core/Error.php(954): CRM\_Core\_Error::backtrace("backTrace", TRUE)
#1 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM\_Core\_Error::exceptionHandler(Object(DB\_Error))
#2 .../sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR\_Error-\>\__construct("DB Error: unknown error", -1, 16, (Array:2), " \[nativecode=0 \**\]")
#3 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB\_Error-\>\__construct(-1, 16, (Array:2), " \[nativecode=0 \**\]")
#4 .../sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::\_raiseError(Object(DB\_mysqli), NULL, -1, 16, (Array:2), " \[nativecode=0 \**\]", "DB\_Error", TRUE)
#5 .../sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-\>\__call("raiseError", (Array:7))
#6 .../sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB\_common-\>raiseError(-1, NULL, NULL, " \[nativecode=0 \**\]", "0 \** ")
#7 .../sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB\_mysqli-\>mysqliRaiseError()
#8 .../sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB\_mysqli-\>simpleQuery("")
#9 .../sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB\_common-\>query("")
#10 .../sites/all/modules/civicrm/packages/DB/DataObject.php(1829): DB\_DataObject-\>\_query("")
#11 .../sites/all/modules/civicrm/CRM/Core/DAO.php(472): DB\_DataObject-\>query("")
#12 .../sites/all/modules/civicrm/CRM/Core/DAO.php(1709): CRM\_Core\_DAO-\>query("", TRUE)
#13 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/CivirulesConditions/ContributionRecur/PaymentProcessor.php(76): CRM\_Core\_DAO::singleValueQuery("", (Array:1))
#14 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(299): CRM\_CivirulesConditions\_ContributionRecur\_PaymentProcessor-\>isConditionValid(Object(CRM\_Civirules\_TriggerData\_Edit))
#15 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(252): CRM\_Civirules\_Engine::checkCondition((Array:5), Object(CRM\_Civirules\_TriggerData\_Edit))
#16 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Engine.php(32): CRM\_Civirules\_Engine::areConditionsValid(Object(CRM\_Civirules\_TriggerData\_Edit))
#17 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Trigger/Post.php(123): CRM\_Civirules\_Engine::triggerRule(Object(CRM\_Civirules\_Trigger\_Post), Object(CRM\_Civirules\_TriggerData\_Edit))
#18 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/CRM/Civirules/Trigger/Post.php(107): CRM\_Civirules\_Trigger\_Post-\>triggerTrigger("create", "Email", 17442, Object(CRM\_Core\_DAO\_Email), "62d81355930c7")
#19 .../sites/default/files/civicrm/extensions/org.civicoop.civirules-old/civirules.php(485): CRM\_Civirules\_Trigger\_Post::post("create", "Email", 17442, Object(CRM\_Core\_DAO\_Email), "62d81355930c7")
#20 internal function: civirules\_call\_post\_trigger("create", "Email", 17442, Object(CRM\_Core\_DAO\_Email), "62d81355930c7")
#21 .../sites/all/modules/civicrm/Civi/Core/Transaction/Frame.php(198): call\_user\_func\_array("civirules\_call\_post\_trigger", (Array:5))
#22 .../sites/all/modules/civicrm/Civi/Core/Transaction/Frame.php(148): Civi\Core\Transaction\Frame-\>invokeCallbacks(2)
#23 .../sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php(103): Civi\Core\Transaction\Frame-\>finish()
#24 .../sites/all/modules/civicrm/CRM/Core/Transaction.php(126): Civi\Core\Transaction\Manager-\>dec()
#25 .../sites/all/modules/civicrm/CRM/Core/Transaction.php(113): CRM\_Core\_Transaction-\>commit()
#26 .../sites/all/modules/civicrm/Civi/API/Subscriber/TransactionSubscriber.php(155): CRM\_Core\_Transaction-\>\__destruct()
#27 .../sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\API\Subscriber\TransactionSubscriber-\>onApiRespond(Object(Civi\API\Event\RespondEvent), "civi.api.respond", Object(Civi\Core\CiviEventDispatcher))
#28 .../sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher-\>doDispatch((Array:5), "civi.api.respond", Object(Civi\API\Event\RespondEvent))
#29 .../sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(209): Symfony\Component\EventDispatcher\EventDispatcher-\>dispatch("civi.api.respond", Object(Civi\API\Event\RespondEvent))
#30 .../sites/all/modules/civicrm/Civi/API/Kernel.php(258): Civi\Core\CiviEventDispatcher-\>dispatch("civi.api.respond", Object(Civi\API\Event\RespondEvent))
#31 .../sites/all/modules/civicrm/Civi/API/Kernel.php(151): Civi\API\Kernel-\>respond(Object(Civi\API\Provider\MagicFunctionProvider), (Array:8), (Array:5))
#32 .../sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-\>runRequest((Array:8))
#33 .../sites/all/modules/civicrm/api/api.php(22): Civi\API\Kernel-\>runSafe("email", "create", (Array:5))
#34 .../sites/all/modules/webform\_civicrm/includes/utils.inc(1666): civicrm\_api("email", "create", (Array:5))
#35 .../sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc(1802): wf\_civicrm\_api("email", "create", (Array:5))
#36 .../sites/all/modules/webform\_civicrm/includes/wf\_crm\_webform\_postprocess.inc(96): wf\_crm\_webform\_postprocess-\>createBillingContact()
#37 .../sites/all/modules/webform\_civicrm/webform\_civicrm.module(698): wf\_crm\_webform\_postprocess-\>validate((Array:33), (Array:26))
#38 .../includes/form.inc(1531): wf\_crm\_validate((Array:33), (Array:26))
#39 .../includes/form.inc(1471): form\_execute\_handlers("validate", (Array:33), (Array:26))
#40 .../includes/form.inc(1193): \_form\_validate((Array:33), (Array:26), "webform\_client\_form\_21")
#41 .../includes/form.inc(892): drupal\_validate\_form("webform\_client\_form\_21", (Array:33), (Array:26))
#42 .../includes/form.inc(386): drupal\_process\_form("webform\_client\_form\_21", (Array:33), (Array:26))
#43 .../includes/form.inc(131): drupal\_build\_form("webform\_client\_form\_21", (Array:26))
#44 .../sites/all/modules/webform/webform.module(2085): drupal\_get\_form("webform\_client\_form\_21", Object(stdClass), FALSE, FALSE)
#45 .../includes/module.inc(965): webform\_node\_view(Object(stdClass), "full", "en")
#46 .../modules/node/node.module(1441): module\_invoke\_all("node\_view", Object(stdClass), "full", "en")
#47 .../modules/node/node.module(1336): node\_build\_content(Object(stdClass), "full", "en")
#48 .../modules/node/node.module(2669): node\_view(Object(stdClass), "full", "en")
#49 .../modules/node/node.module(1466): node\_view\_multiple((Array:1), "full")
#50 .../modules/node/node.module(2761): node\_show(Object(stdClass))
#51 .../includes/menu.inc(527): node\_page\_view(Object(stdClass))
#52 .../index.php(21): menu\_execute\_active\_handler()
#53 {main}

# Answer
> 1 votes
The problem seemed to be something was corrupted when updating the CiviRules extension when going from 2.40 to 2.41. The next updates (2.42 & 2.43) still did not correct the corruption.

I Disabled the CiviRules extension in Civi. Then I Uninstalled it. I checked the file system to be sure all the folders related to CiviRules were removed Cleared the cache Back in Civi extensions, I Installed CiviRules

I only had 2 Rules that I cared about so I rebuilt them from scratch in the GUI. You might want to download the SQL tables and restore them to get your rules back after the reinstall.

# Answer
> 1 votes
> /extensions/org.civicoop.**civirules-old**/civirules.php

Perhaps it is time to change this to *"new"* or *"the most recent"* ? Jokes aside, I'd start from checking *civirules* extension, looking particularly for *::civicrm\_api3\_contribution\_transact* function. Perhaps "webform\_civicrm" is worth checking as well.

---
Tags: error, contributions
---


# Question
Title: Trying to edit Agenda tab in Events gives a DB error
CiviCRM 5.50.1, WordPress 6.0.1, 8.0.28.

Someone recently tried to add an Agenda to an Event in CiviCRM, and kept getting a network error. I took a look, and yeah, going to the Agenda tab seems to cause a crash. The log file shows lots of stuff, but this:

\[nativecode=1055 \** Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'civicrm\_members.esspeaker.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql\_mode=only\_full\_group\_by\]

seems to be the most useful entry. I've seen this type of error in other posts, but nothing for the event Agenda. Most of the hits I find suggest these should have been fixed by now, so, is this a bug in CiviCRM? Not seeing anything that looks like a bug fix note in newer versions.

I'm hesitant to reconfigure SQL to turn off only\_full\_group\_by as a workaround unless that's the only way around this (and honestly, there was no need for an Agenda, as that seems to be a bit more than a text note anyway based on the fact that it cares so much about the database).

Any other ideas / fixes? I'll probably upgrade the system tomorrow as it looks like 5.51.1 may fix another bug we've hit (automatic renewal during contribution) and will update this note if I get the update done and it resolves the issue.

Thanks.

Michael

# Answer
> 0 votes
The `esspeaker` part is coming from the civimobile extension: https://civicrm.org/extensions/civimobileapi

Might want to file an issue there if it's not already fixed in a recent version: https://lab.civicrm.org/extensions/civimobileapi

---
Tags: civievent, error, database
---


# Question
Title: How do I change the credit card linked to our civiCRM account?
I used my personal credit/debit card to set-up civiCRM for my organization and now we have an organizational bank account. I'd like to stop paying personally for the hosting service. How do I make that change?

# Answer
> 1 votes
you can update your subscription using this form, and cancel the billing on the current card (otherwise it will continue to be billed on a monthly basis). The monthly email receipts have the link to interrupt the automatic billing.

If you have any questions, assuming this is related to CiviCRM Spark (i.e. your CiviCRM URL looks like "your-org.civicrm.org"), please contact spark@civicrm.org.

---
Tags: user-account, hosting-providers
---


title: Using CSV file as datasource

text:
# Question
Title: Using CSV file as datasource
I was trying to use the CSV file as a datasource but couldn't find documentation on how to form the URI. Having the CSV file hosted and using the URL https://... to refer to the csv doesn't work as the field names remain empty. Also, if I were to host the CSV file on the CIVICRM server itself, how should the URI be formed ? Thanks.

# Answer
> 1 votes
You can either use an url with https, http (e.g. `https://my.server.com/myfile.csv`) or use a local path (`/var/www/mycsv.csv`)

For urls your server needs to be able to open URLs with `fopen`.

The CSV data source uses the `fopen` function for reading the CSV file. More documentation on what kind of filenames can be used see https://www.php.net/manual/en/function.fopen.php

---
Tags: csv, data-processor
---


# Question
Title: Error: [ng:btstrpd] App already bootstrapped with this element '<crm-angular-js modules="crmDashboard">'
Getting this Error: `[ng:btstrpd] App already bootstrapped with this element '<crm-angular-js modules="crmDashboard">'` on Dashboard with the only "CiviCRM News" enabled and empty. What would it be? **Drupal 7.9, CiviCRM 5.51.1**

# Answer
**Drupal 7**

Broken upgrade, try to replace database tables (civicrm\_dashboard/\_menu/\_navigation) with vanilla tables

**Drupal 8/9**

According to https://lab.civicrm.org/dev/core/-/issues/2975 there is one extra command to run after

```
composer civicrm:publish

```

This bit might worth adding to https://docs.civicrm.org/sysadmin/en/latest/upgrade/drupal8/ unless things have been changed ( for instance, my D9 composer.json has a different "required" section. ).
> 3 votes

---
Tags: drupal, dashboard, angular
---


# Question
Title: Why would I be getting a setPriceSetID error?
I am getting the following error when I try to access the contributions of one specific contact record. The error does not come up when accessing the contributions of other contact records.

TypeError: Argument 1 passed to CRM\_Financial\_BAO\_Order::setPriceSetID() must be of the type int, null given, called in /var/www/emicrm/htdocs/sites/all/modules/civicrm/CRM/Financial/BAO/Order.php on line 910 in CRM\_Financial\_BAO\_Order-\>setPriceSetID() (line 471 of /var/www/emicrm/htdocs/sites/all/modules/civicrm/CRM/Financial/BAO/Order.php).

We are using CiviCRM 5.51.1. and Drupal 7.91.

# Answer
> -1 votes
See https://lab.civicrm.org/dev/core/-/issues/3150 for some possible ways this can happen and how to fix. Also it can come up with webform if you're using an old version of webform or the contribution was created by an old version of webform.

---
Tags: contributions
---


# Question
Title: Getting lots of "[error] Invalid method for processImg: resi" - when sending email - any idea?
Getting lots of `[error] Invalid method for processImg: resi` \- when sending email - any idea?

I think the actual error is getting cut off, as some of the errors read r, re, or res instead of resi.

This is happening during send of an email.

I am also getting `[error] Invalid params for processImg: resi`

Latest civicrm and wordpress.

# Answer
> 1 votes
This might be a clean urls issue or frontend/backend or something like that. It's coming from mosaico, and yes the error is related to parsing of url params, and it's parsing it wrong.

Maybe first try just re-saving the mosaico config? Then if not maybe there is some clue in the browser's debug tools network tab when editing the email where you can see the full url. It will be the params for the `civicrm/mosaico/img` url.

---
Tags: civimail, error, mosaico
---


# Question
Title: Does gmail/google now demand a messageId?
As of July 11, I'm getting this from civimail messages, mostly to @gmail.com addresses. The same install has been successfully sending out to the same address list for a long time.

550-5.7.1 \[209.15.213.100\] Messages missing a valid messageId header are not 550 5.7.1 accepted.

I've turned on the checkbox that generates it, so perhaps problem solved, but is this a policy change from gmail?

# Answer
I'm getting a number of other flags from other systems that gmail's deliverability rules have changed. Although DKIM still isn't required, it appears that there's been an update to google's algorithm that decides whether email is spam or not, and it's harder to cross than it used to be.

Bottom line: for civimail deliverability, you probably need at least SPF, the messageId, and a "cleanish" ip reputation, and I suspect that DKIM on the from address will help.
> 1 votes

---
Tags: civimail
---


# Question
Title: Database Connection Only Works Some of the Time
I have a CiviCRM instance that has its database hosted in RDS Aurora. This has worked well for several years. Recently I needed to restore from a copy of the Aurora cluster and I changed the name of the endpoint (database server). Nothing else changed. The change is working for the Drupal database and for CiviCRM some of the time.

I am using Drupal 9.3.6 and CiviCRM 5.46.2.

If I go to mysite.org/civicrm CiviCRM comes up well. If I go to a page that pulls CiviCRM data into Drupal Views then it cannot connect. My views could connect before this change was made. If I use the cv sql command from the command line I get access denied. If I copy and paste (meaning to reduce potential errors) from the file created by the CV command to access MySQL I can access the database.

Looking at the logs it appears that the connection fails for anything using API V3. I have tried to upgrade CiviCRM to see if that would solve this problem and the upgrade fails trying to determine installed extensions using a call to API V3.

I have checked all of the settings on the Aurora end and the restored cluster has the same settings as the cluster that has since been deleted.

Any help or suggestions on what to check are greatly appreciated.

Thanks, Josh

# Answer
> 1 votes
I solved this. ::Wipes sweat from brow:: In Drupal 9 you can no longer use database prefixes syntax.

This syntax no longer works: "$databases\['default'\]\['default'\]\['prefix'\]= array()"

Without this syntax a new database array is needed. Something like this:

```
$databases['civicrm']['default'] = array (
'database' => 'civicrm_dev',

```

'username' =\> 'user', 'password' =\> 'password', 'host' =\> 'name-cluster-cluster.cluster-someID.us-west-2.rds.amazonaws.com', 'port' =\> '3306', 'namespace' =\> 'Drupal\Core\Database\Driver\mysql', 'driver' =\> 'mysql', );

See also: https://www.drupal.org/project/civicrm\_entity/issues/3198146#comment-14352132

When I updated the settings file for Drupal I only changed the MySQL host once missing the connection to the CiviCRM database in the settings.php file.

---
Tags: drupal, api, database, drupal-views
---


# Question
Title: How to create a custom extension/module (with an example)?
The question is: How do I create an extension or module for CiviCRM?

I will be answering my own question below, as a very basic How To guide for noobs (like me)!

# Answer
These are just very basic How To instructions on getting a custom extension/module/plugin running on WordPress CiviCRM:

**Step 1** \- You need to have civix installed on your server. For this step, please take a look here: https://docs.civicrm.org/dev/en/latest/extensions

**Step 2** \- From your terminal, use the cd command change dirs to the ext directory which is the uploads folder:

```
/something/public_html/wp-content/uploads/civicrm/ext

```

**Step 3** \- Use the following command to create the extension: NOTE: *abc123\_thenameofmyextension can be anything you want, but it will need to be unique. So for example you might want to use something like com\_mydomain\_thenameofmyextension* NOTE: *When you click enter, it should generate the extension and it will ask you if you want to ENABLE it right away. I usually choose NO and then you can go the CiviCRM Extensions menu later and enable it there when you are ready to use it. But you can choose YES and it will be enabled right away.*

```
civix generate:module abc123_thenameofmyextension --author="My Name" --email="myemaile@domain.com"

```

**Step 4** \- Once the extension is generated, you can then go your new `/wp-content/uploads/civicrm/ext/abc123_thenameofmyextension` directory and edit the `info.xml` file. The only two things you really need to worry about are the `<name>FIXME</name>` and `<description>FIXME</description>` fields. So set the NAME to whatever you want and add a DESCRIPTION and save the file.

**Step 5** \- Now add some code that will make the extension do something! The file you want to add your code to is in the same `/wp-content/uploads/civicrm/ext/abc123_thenameofmyextension` directory and is called:

```
abc123_thenameofmyextension.php

```

**Step 6** \- In this step, as an example, we are actually going to add some code that will set the Default Financial Type when the New Contributions page/form is opened using the buildForm hook, which was asked here: Set a default Financial Type when adding New Contribution?

Open up the abc123\_thenameofmyextension.php and scroll all the way to the bottom of the file and then add the following code:

```
// Create a new function that will set the Default Financial Type on the New Contributions page/form
function abc123_thenameofmyextension_civicrm_buildForm($formName, &$form) {
  if ($formName == 'CRM_Contribute_Form_Contribution') { // Check which page/form we are on.
    if ($form->_action & CRM_Core_Action::ADD) { // Make sure we are adding a NEW contribution and not editing an existing contribution.
      $form->setDefaults(['financial_type_id' => 1]); // Set the default financial to type this financial_type_id
    }
  }
}

```

Now save this file, enable the extension from the CiviCRM Extensions menu and check if your New Contribution now has a default financial type set.
> 3 votes

---
Tags: wordpress, extension, modules, plugin
---


title: Making event pages visible

text:
# Question
Title: Making event pages visible
I was wondering how can one make things like event pages or eventually membership application visible 'online'. When I create the new event, I get a link in this style `https://.../crm/event/info/?reset=1&id=14` which leads to a 404 page upon clicking on it. The CMS is Wordpress.

Thanks

# Answer
You need to ensure that:

Also, in Wordpress, it's better to keep permalinks simple with :

Last, you should ensure that clean url are properly enabled with those lines in the civicrm.settings.php (updated in recent version of CiviCRM, check file civicrm/templates/CRM/common/civicrm.settings.php.template for reference) :

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

```
> 2 votes

---
Tags: wordpress, civievent
---


# Question
Title: Donors cannot update credit card info with iATSPayments?
Drupal 7.91 CiviCRM 5.51.1 iATSPayments 1.7.4

Our donors do not have the ability to update their credit card on file. They have the "View" link but not the edit.

I checked the settings in /civicrm/admin/contribute/iatssettings and the 3 enable self-service boxes are checked. I looked at the Drupal permissions. The CiviContribute: edit contributions was not enabled for Donors. I checked that box, flushed cache, but they still do not see the Edit link.

I checked my css to see if I had hidden that link. It also does not show as hidden in Chrome Inspector.

I tried several urls but get access denied messages https://secure.radiusinternational.org/civicrm/contact/edit/iatscustomerlink?reset=1&cid=11482&customerCode={iATS Code}&paymentProcessorId=3&is\_test=0

This one gives me a hard fail https://secure.radiusinternational.org/civicrm/contribute/updatebilling?reset=1&crid=964&cs={contact.checksum}

Any ideas what I am missing?

# Answer
> 1 votes
The first url you list is an iATS-specific, internal admin-only url for managing cards on file, not something that you would ever give to a client or donor.

The second one looks like it might be one that you're generating yourself. I noticed in my testing that the anonymous-access links for updating your credit card in the invoice now no longer have a crid parameter, but instead an oid parameter (corresponding to the contribution id).

An authenticated unprivileged user in their own dashboard will get a url to edit their billing information that looks like your second url without the checksum.

I've tested all these options with the current iATS 1.7.4 and they are working on my Drupal 7 test site.

Full details here: https://github.com/iATSPayments/com.iatspayments.civicrm/issues/390

---
Tags: iatspayments
---


# Question
Title: Can you select more than one bulk email address?
Example 1: One contact, has personal and work email addresses, uses both to register for events, donate, etc. Depends on how they feel. They want bulk mail sent to both addresses. I would like to maintain one contact record instead of two.

Can you select more than one bulk mail address? I thought at one point you could but I could be wrong.

# Answer
> 3 votes
1. Administer - CiviMail - CiviMail Component Settings
2. Enable multiple bulk email

---
Tags: civimail, contacts
---


# Question
Title: How to set a different default drop down item depending on profile used
If I create a new custom field with a Drop Down list, you can set a Default if you want, or leave it as blank (no default).

What I want to do is leave as blank (no default) when I use the field in one particular profile, but on another profile, I need it to default to a specific choice, and then on a third profile, I need it set again to another option.

EDIT: To add to this question... Is it possible to select a different default COUNTRY in different profiles as well?

# Answer
So the only way I have figured out how to do this, is using the buildForm hook from an extension.

You would need to check what profile form id is and then make the changes to the specific fields as needed.

This thread has similar example but would need to be modified for a profile form: How to create a custom extension/module (with an example)?

Once in the buildForm hook, you would use something like this:

```
if ( $formName == 'CRM_Profile_Form_Edit' && $form->getVar('_gid') == 15 ) {
  //Do something with profile form that has gid = 15
}

```
> 1 votes

---
Tags: webform-civicrm, profile, forms
---


# Question
Title: Jquery JavaScript error for State/Province selection not changing when Country changed
I have created a profile with both Country dropdown and State dropdown on it.

When I Preview the profile, the State selections correctly change when I change the country.

https://mydomain.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fuf%2Fgroup&action=preview&id=15&field=0&context=group

However when I go to the live profile page (even when logged in Admin) the State dropdown does not change. For example changing from United States to Canada, will leave all the US states in the dropdown.

https://mydomain.com/civicrm/profile/create?gid=15&reset=1

Checking the developer console, I see a bunch of jquery errors showing up, such as this:

Using WordPress v6.0.1 and CiviCRM v5.50.3

# Answer
So in my particular case, the issue was caused by the WordPress theme I was using called Divi.

There is setting in the Divi theme options (Divi \> Theme Options \> General \> Performance) called `Defer jQuery And jQuery Migrate` which needed to be `DISABLED` and then everything started working fine.

https://divibooster.com/disable-jquery-deferral-in-divi/
> 0 votes

---
Tags: wordpress, webform-civicrm, profile, forms
---


# Question
Title: How to setup a profile page that is only visible to logged in users?
When I setup a new Profile, it is available to everybody publicly that has the link but I want to limit access to only logged in users (or even users in a specific group).

I think this should be simple but for some reason I am missing how to do this.

# Answer
> 1 votes
Well maybe somebody has a better way of doing this, but this is how I ended up accomplishing this...

Using the buildForm hook, I checked the Contact ID of the user accessing the form, and if there was no Contact ID then they were not logged, so I then used jQuery to completely replace the form on the page with the text "You do not have permission to view this page!"

Code looks like this:

```
// Check if it is a Profile form with specific id (15 in this case)
if ( $formName == 'CRM_Profile_Form_Edit' && $form->getVar('_gid') == 15 ) {

  // What user is trying to access the form?
  $whatUser = civicrm_api3('Contact', 'get', [
      'sequential' => 1,
      'return' => ["id"],
      'id' => "user_contact_id",
    ]);

  // Check if user id is set
  if ( isset($whatUser['id']) ) {
    // User id is set so a user must be logged in
    $okToShowPage = true;
  } else {
    // No user id so user is not logged in
    $okToShowPage = false;
  }

  if ($okToShowPage) {
    // Just let the profile page display as usually and do nothing.

  } else {
    // Completely delete DIV with id=crm-container and replace it with a new DIV
    CRM_Core_Region::instance('page-body')->add( ['script' => "cj('#crm-container').replaceWith('<div><b>You do not have permission to view this page.</b></div>');"] );
  }

}

```

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


# Question
Title: Redirecting a profile page to somewhere else using hook
I am using the buildForm hook, and when a specific profile page is loaded, I am checking to see if one specific user is logged in.

If that user is logged in, then I want to redirect the page somewhere else.

Is there a way to redirect the page from the buildForm hook (or maybe another hook)?

# Answer
> 0 votes
Using the buildForm hook, you can check for the specific form/page you are looking for and then use **CRM\_Utils\_System::redirect** to redirect.

```
if ( $formName == 'CRM_Profile_Form_Edit' && $form->getVar('_gid') == 15 ) {
  //Redirect profile form that has gid = 15
  CRM_Utils_System::redirect("https://google.com"); // Redirect to another URL
}

```

This thread shows you how to use the buildForm hook: How to create a custom extension/module (with an example)?

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


# Question
Title: Upgrade issue moving from 5.49+ to 5.50*
In moving from 5.49 to 5.50 we seem to lose a table. All civimails generate a "DB missing table error" and the logs show the following. We get this error with all of the new versions of 50+ but not the last version of 49.

> Jul 29 10:45:54 \[error\] $Fatal Error Details = Array ( \[callback\] =\> Array ( \[0\] =\> CRM\_Core\_Error \[1\] =\> exceptionHandler )
>
> \[code\] =\> -18 \[message\] =\> DB Error: no such table \[mode\] =\> 16 \[debug\_info\] =\> SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`$ FROM civicrm\_search\_segment a ORDER BY `label` ASC \[nativecode=1146 \** Table 'civicrm.civicrm\_search\_segment' doesn't exist\] \[type\] =\> DB\_Error \[user\_info\] =\> SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.$ FROM civicrm\_search\_segment a ORDER BY `label` ASC \[nativecode=1146 \** Table 'civicrm.civicrm\_search\_segment' doesn't exist\] \[to\_string\] =\> \[db\_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM\_Core\_Error::exceptionHandler p$ FROM civicrm\_search\_segment a ORDER BY `label` ASC \[nativecode=1146 \** Table 'civicrm.civicrm\_search\_segment' doesn't exist\]"\]

# Answer
Thanks. The problem seems to have come from not running the extension upgrade at /civicrm/admin/extensions/upgrade?reset=1

After doing that civicrm\_search\_segment is back.
> 2 votes

---
Tags: civimail, upgrade, database
---


# Question
Title: Undefined array key "rows" in Search.tpl.php when entering "Manage Groups"
The PHP warning appears everytime when a user enters "Manage Groups" (/civicrm/group).

The full warning:

```
Warning: Undefined array key "rows" in include() (line 6 of sites/default/files/civicrm/templates_c/en_US/%%7A/7A2/7A24E297%%Search.tpl.php).

```

The line looks like.

```
<div class="crm-accordion-wrapper crm-search_builder-accordion <?php if ($this->_tpl_vars['rows'] && empty ( $this->_tpl_vars['showSearchForm'] )): ?>collapsed<?php endif; ?>">

```

and this file is compiled from CRM/Group/Form/Search.tpl where this line looks like

```
<div class="crm-accordion-wrapper crm-search_builder-accordion {if $rows and empty($showSearchForm)}collapsed{/if}">

```

I did not learn much about the rendering in CiviCRM yet so I wonder what changed and what is going on here. Could somebody give me a hint?

# Answer
> 1 votes
It's a bug and I think it's left over from before this form was ajax-ified. It doesn't cause any functional problem, but the variable should probably be removed. The idea I think was that after submitting the search form, if it found any results it would collapse the search criteria, but this page doesn't work like a normal search form anymore.

---
Tags: groups, search, templates
---


# Question
Title: After upgrading Joomla site to 5.46.2 no recipients available in mail, only 'Searching…'
After upgrading Joomla site to 5.46.2 with Mosaico 2.9 and searchkit, there are no recipients available in mail, only showing 'Searching…' in the recipient box.

The problem disappears if debugging is turned on (see comment below from Mark, experiencing same issue in Wordpress).

There is no obviously relevant sign in the logs.

Settings files and urls/directories are clean for 'http://' references and asset caching is off.

Other angular/recipient problems resolved here have identified & resolved 'invisible' recipient groups that still operate. However, in this case, no groups present themselves to be selected.

This ONLY happens with Mosaico enabled. With Mosaico disabled, choosing of recipient groups works fine using 'traditional' interface.

Browser console shows errors:

Can't find variable: date https://*domainname*/administrator/?option=com\_civicrm&task=civicrm/asset/builder&an=angular-modules.js&ap=TZAxbwIxDIX%2Fy81RlzJ1Ayo2JMQJdTYXc2eU2KfEoRVV%2F3sdTyx%2B78nyl9i%2FQ5bYEtbhY4DbTUoeFThCEsYAPLcE5UAJL2sSiAFW2oSp5O26uqjCtGRk9dRUKjyw%2B%2F0Pd%2Fl890rGm7s7AiXiV7vdebBBmqTbM1ZpZXLKWZrijjhi6dG%2Bpq2eYPbmhbwqpa7XL3pCiSH6WyOWBxnjXoUPthSoGiLfv%2BsCBWPg2dGmIzApPTE0eqtSFK7JfTNuDY37QnG%2F2CnsRn%2F%2F&ad=580ab1dd9c3945d0f1d6ff46614025bf:1384

and

\[Error\] ReferenceError: Can't find variable: results results (administrator:1660) success (select2.min.js:30:322) (anonymous function) (jquery.min.js:2:28682) i (jquery.min.js:2:27368) fireWith (jquery.min.js:2:28123) x (jquery.min.js:4:22587) c (jquery.min.js:4:26778)

# Answer
> 0 votes
As @Mark Westergaard has observed below, the problem has disappeared upon upgrading to 5.47.0, so I guess we just put it down to an obscure temporary bug?

Problems that go away by themselves come back by themselves…

# Answer
> 0 votes
The reason why it disappeared with 5.47.0 should be this fix https://github.com/veda-consulting-company/uk.co.vedaconsulting.mosaico/issues/494

---
Tags: wordpress, civimail, joomla, mosaico, angular
---


title: Sorting of Reports by Modified Date

text:
# Question
Title: Sorting of Reports by Modified Date
I am working with the Constituent Summary report and then saving a copy with the fields that I want displayed.

One of the fields is Modified Date, but when I go to SORTING, Modified Date is not one of the options.

How can I add Modified Date field to the sorting options of Reports?

Thanks

# Answer
You would have to create a new report type in an extension using code that `extends` the existing CRM\_Report\_Form\_Contact\_Summary class, and add modified\_date into the order\_by section. In here https://github.com/civicrm/civicrm-core/blob/539eb78da2cbf9834c5799e3e5e5a6ccbff08ff4/CRM/Report/Form/Contact/Summary.php#L65
> 1 votes

---
Tags: wordpress, civireport, reports, custom-reports
---