# Question
Title: cURL error 6: Could not resolve host when importing contacts
I recently updated CiviCRM in Drupal 7 from version 5.17.3 to 5.42.1

Now when I try to import contacts, I get to final step and click "import now". After a few seconds that I see the popup with "importing records" I get the following error:

cURL error 6: Could not resolve host: 320RK93TB985 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

```
    #0 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Contact/Import/Parser/Contact.php(1587): civicrm_api3("Contact", "create", (Array:17))
#1 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Contact/Import/Parser/Contact.php(633): CRM_Contact_Import_Parser_Contact->createContact((Array:13), (Array:36), "4", NULL, TRUE, "1")
#2 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Contact/Import/Parser.php(196): CRM_Contact_Import_Parser_Contact->import("4", (Array:25), NULL)
#3 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Contact/Import/ImportJob.php(233): CRM_Contact_Import_Parser->run("civicrm_tmp_d_dflt_68a71677e392d1db8155657ca45c97c2", (Array:22), 8, 1, "_id", "_status", "4", "0ea8ff7d03ae43f35391c591657e5d6a", 16, NULL, 30, NULL, "1")
#4 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Contact/Import/Form/Preview.php(254): CRM_Contact_Import_ImportJob->runImport(Object(CRM_Contact_Import_Form_Preview))
#5 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Form.php(527): CRM_Contact_Import_Form_Preview->postProcess()
#6 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#7 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Contact_Import_Form_Preview), "next", "Next")
#8 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Import_Form_Preview), "next")
#9 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Import_Form_Preview), "next")
#10 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Controller.php(352): HTML_QuickForm_Page->handle("next")
#11 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(313): CRM_Core_Controller->run((Array:3), NULL)
#12 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:13))
#13 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#14 /mnt/www/html/vitintranetp3xtagv7qp/docroot/sites/all/modules/contrib/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:3))
#15 [internal function](): civicrm_invoke("import", "contact")
#16 /mnt/www/html/vitintranetp3xtagv7qp/docroot/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
#17 /mnt/www/html/vitintranetp3xtagv7qp/docroot/index.php(21): menu_execute_active_handler()
#18 {main}

```

The only thing I changed during the upgrade is in the cicivcrm.settings.php where the old CiviCRM root variable wasn't finding the path to jQuery and JavaScript files and I had to change it to `sites/all/modules/contrib/civicrm/` instead of `/var/www/html/site_name/docroot/sites/all/modules/contrib/civicrm/` (where instead of site\_name there is the name of my site).

Could this change cause the error? Everything else in CiviCRM seems to work fine.

Thank you

# Answer
As per comments the problem was an address standardization provider lookup failing.
> 0 votes

---
Tags: import, civicrm.settings.php
---


title: mass deleting on hold emails

text:
# Question
Title: mass deleting on hold emails
Scuse if I am missing something obvious:

We send all our emails out through Mandrill (aka Mailchimp transactional emails) and it places emails On Hold if they hard or soft bounce.

We want to delete all the emails from our list that are hard bounces. How might we do this?

We could use our Mandrill report to place all the contacts with emails that are hard-bouncing into a group. But that won't help us know which of their (potentially) multiple emails to delete. We'll only know which contacts have 'an email' that is hard bouncing.

Anyone got any methods for deleting the hard bouncing emails, but only those emails?

Thanks!

# Answer
> 1 votes
You can do this in api explorer, e.g. https://site/civicrm/api4. (Note to set Limit to 0)

But you might want to think twice about doing this since if the bouncing email gets added again and you send it an email again (not via mandrill) it might eventually hurt your email reputation.

(Thanks to Aidan for the simplification.)

---
Tags: civimail, mandrill
---


# Question
Title: Can one include tokens within tokens in a Message Template?
I have written a custom Token which contains several standard paragraphs on how to make membership payments to our organisation, which will be included in several Message Templates related to email and PDF renewal reminders. This works OK for text and HTML, but gives errors if I try to include a CiviCRM Token within it (e.g. the Contact Id, which we are using as a membership number).

Presumably this is because SMARTY is processing the embedded token while carrying out the insert process, and does not have the necessary context on Contact details or related Tokens. I note that one contributor to question How can I include a custom template file in an email template using smarty? indicates that this may be a problem, but I wonder if there is any way round the problem?

# Answer
Token replacements are done only once based on whats present in the html or text mail content. There won't be second round of token replacements once its replaced. In your case i guess you want to do the token replacement twice. After the token replacement is done the content is processed using smarty.

You will need to create the custom token values by replacing the tokens and passing the raw value.
> 2 votes

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


# Question
Title: Making a small application with the CiviCRM API
I'm currently trying to make a small web application in Cordova with which I can load memberships from my CiviCRM installation and display them. I already have access to my server url, the path, my personal key and the api\_key, however the documentation is so unclear that I do not know how to proceed further.

I'd be delighted if someone could give me some example code on how I can interact further with my CiviCRM installation using Ajax.

Thanks in advance

# Answer
I think what you're looking for is either https://docs.civicrm.org/dev/en/latest/api/v4/usage/#ajax, or the rest api at https://docs.civicrm.org/dev/en/latest/api/v3/rest/

Api explorer, found at https://your.site/civicrm/api or /civicrm/api4, is useful for exploring the entities and actions available.
> 3 votes

# Answer
You could review this Cordova based mobile app which integrates with CiviCRM, https://github.com/agileware/au.com.agileware.civicontact
> 2 votes

---
Tags: ajax
---


# Question
Title: How to programmatically check if an extension is installed
I want to *progressively enhance* one of my extensions by altering the code paths to use another extension, if it's installed, and fall back to my own extension's code if not.

How can I check if an extension is installed?

# Answer
The following will return an array keyed by the long extension 'key', whose values are one of `installed` `uninstalled` `disabled` (or, less commonly, `unknown`, `installed-missing`, `disabled-missing`)

```
<?php
$list = CRM_Extension_System::singleton()->getManager()->getStatuses();

```

You can find enabled ones with:

```
<?php
$list = array_keys(preg_grep('/^installed$/',
        CRM_Extension_System::singleton()->getManager()->getStatuses()));

```

There's also `getStatus()`: to directly discover whether a particular extension is enabled, you might do

```
<?php
$extensionIsInstalled = 'installed' ===
  CRM_Extension_System::singleton()->getManager()->getStatus($extensionKey);
if ($extensionIsInstalled) { ... }

```

This appears to be cached as it takes my test server 1.2s to do it a million times, though because of all the stack-work, you can cut this time by a third by implementing your own isXInstalled() function with a static var. Should you *want* to do this a million times quickly, that is :-)

## You *can* also do it with an api3 call...

```
<?php
if ('installed' ===
  civicrm_api3('Extension', 'get',
     ['key' => 'aah', 'sequential' => 1])['values'][0]['status'] ?? '') { ... }

```

But this is *hideously* inefficient for this purpose (it does a lot more), taking 40minutes to do it a million times!

## Bonus extra

Once you know it's installed you can check the version like:

```
<?php

$recentEnough = version_compare(CRM_Extension_System::singleton()
  ->getMapper()->keyToInfo($extensionKey)->version,
  $minVersionString) >= 0;

```

## Bonus: check if a particular *component* is installed

```
<?php
$memberIsInstalled = isset(\CRM_Core_Component::getEnabledComponents()['CiviMember']);

```
> 2 votes

# Answer
You can also do it with a query. Obviously it is better to do it with the API but as explained above it takes a while....

```
$query = "SELECT COUNT(*) FROM civicrm_extension WHERE full_name = %1 AND is_active = TRUE";
$countExt = CRM_Core_DAO::singleValueQuery($query, [1 => ["aah", "String"]]);

```
> 1 votes

---
Tags: extension, developer
---


# Question
Title: Why no ConfigAndLog or Templates_C folders on my test system
I've recreated my 5.35.2 test system (several times!) on Drupal 7, using the default directories. All is working OK but there isn't a ConfigAndLog or a Templates\_C folder. The 'View Log' extension is working, but I can't see these folders anywhere.

# Answer
I figured this out by looking at my civicrm settings file - in which `CIVICRM_TEMPLATE_COMPILEDIR` was defined to be in `/home/acivior1/public_html/./private/civicrm/templates_c`. This was because the Drupal private file system path was defined as `./private` so this is where Civi put these files when installing. However I notice just above this definition the comments set out below. It appears that the install ignored it?

> \** The default excludes node\_modules (can be huge), various CiviCRM dirs that are unlikely to have anything we need to scan inside, and (what could be your) Drupal's private file storage area.
> 4 votes

---
Tags: drupal, configandlog
---


# Question
Title: Upgrade to 5.43.0 fails: DB Error: constraint violation on "Make mapping field foreign key cascade delete"
I tried to upgrade our CiviCRM installation to 5.43.0 but on upgrade script an error appears:

```
Type    DB_Error
Code    -3
Message DB Error: constraint violation
Mode    16
UserInfo    ALTER TABLE civicrm_mapping_field ADD CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping`(`id`) ON DELETE CASCADE [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civi_crm`.`#sql-25b0_7f`, CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping` (`id`) ON DELETE CASCADE)]
DebugInfo   ALTER TABLE civicrm_mapping_field ADD CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping`(`id`) ON DELETE CASCADE [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civi_crm`.`#sql-25b0_7f`, CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping` (`id`) ON DELETE CASCADE)]

```

The error shown:

```
PEAR_Exception: DB Error: constraint violation in \sites\all\modules\civicrm\vendor\pear\pear-core-minimal\src\PEAR.php on line 922
- DB_Error: DB Error: constraint violation in unknown on line unknown

```

The backtrace:

```
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))   \sites\all\modules\civicrm\vendor\pear\pear-core-minimal\src\PEAR.php:922
1   PEAR_Error->__construct('DB Error: constr…', -3, 16, Array, ' ALTER T…')     \sites\all\modules\civicrm\vendor\pear\db\DB.php:997
2   DB_Error->__construct(-3, 16, Array, ' ALTER T…')    \sites\all\modules\civicrm\vendor\pear\pear-core-minimal\src\PEAR.php:575
3   PEAR->_raiseError(Object(DB_mysqli), null, -3, 16, Array, ' ALTER T…', 'DB_Error', true)     \sites\all\modules\civicrm\vendor\pear\pear-core-minimal\src\PEAR.php:223
4   PEAR->__call('raiseError', Array)    \sites\all\modules\civicrm\vendor\pear\db\DB\common.php:1928
5   DB_common->raiseError(-3, null, null, ' ALTER T…', '1452 ** Cannot a…')  \sites\all\modules\civicrm\vendor\pear\db\DB\mysqli.php:936
6   DB_mysqli->mysqliRaiseError()    \sites\all\modules\civicrm\vendor\pear\db\DB\mysqli.php:406
7   DB_mysqli->simpleQuery(' ALTER T…')  \sites\all\modules\civicrm\vendor\pear\db\DB\common.php:1234
8   DB_common->query(' ALTER T…')    \sites\all\modules\civicrm\packages\DB\DataObject.php:2696
9   DB_DataObject->_query(' ALTER T…')   \sites\all\modules\civicrm\packages\DB\DataObject.php:1829
10  DB_DataObject->query(' ALTER T…')    \sites\all\modules\civicrm\CRM\Core\DAO.php:468
11  CRM_Core_DAO->query(' ALTER T…', false)  \sites\all\modules\civicrm\CRM\Core\DAO.php:1619
12  CRM_Core_DAO::executeQuery(' ALTER T…', Array, true, null, false, false)     \sites\all\modules\civicrm\CRM\Upgrade\Incremental\php\FiveFortyThree.php:176
13  CRM_Upgrade_Incremental_php_FiveFortyThree::alterMappingFK(Object(CRM_Queue_TaskContext))    \sites\all\modules\civicrm\CRM\Queue\Task.php:74
14  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))   \sites\all\modules\civicrm\CRM\Queue\Runner.php:201
15  CRM_Queue_Runner->runNext(true)  \sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php:36
16  CRM_Queue_Page_AJAX::{closure}()     \sites\all\modules\civicrm\CRM\Queue\ErrorPolicy.php:89
17  CRM_Queue_ErrorPolicy->call(Object(Closure))     \sites\all\modules\civicrm\CRM\Queue\Page\AJAX.php:38
18  CRM_Queue_Page_AJAX::runNext()   \sites\all\modules\civicrm\CRM\Core\Invoke.php:279
19  CRM_Core_Invoke::runItem(Array)  \sites\all\modules\civicrm\CRM\Core\Invoke.php:69
20  CRM_Core_Invoke::_invoke(Array)  \sites\all\modules\civicrm\CRM\Core\Invoke.php:36
21  CRM_Core_Invoke::invoke(Array)   \sites\all\modules\civicrm\drupal\civicrm.module:458
22  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')    \includes\menu.inc:527
23  menu_execute_active_handler()    \index.php:21
24  {main}

```

The error happens on my local machine as well on the dev server and it happens when calling the upgrade script via drush as well as in browser

# Answer
> 1 votes
Can you do `select f.* from civicrm_mapping_field f left join civicrm_mapping m on f.mapping_id = m.id where m.id is null`. I suspect you have some fields where the mapping\_id points to a mapping that doesn't exist and that query will locate them.

If that query does show you some rows, then since the mapping doesn't exist anyway you could just delete those rows.

---
Tags: upgrade
---


title: Mosaico refusing to run on upgrade

text:
# Question
Title: Mosaico refusing to run on upgrade
I am running CiviCRM version 5.43.0 on Wordpress 5.8.2 with PHP 7.4 - it's a new site, freshly installed.

We had Mosaico running (though in fact at the time I think we didn't have either GD or php-ImageMagick installed!) via the CiviCRM Extensions manager. FLexmailer, GD and php-ImageMagick are all now installed (for both PHP 8, and for 7.4).

On upgrade to 2.8, Mosaico is now generating errors. When opening CiviCRM, a modal appears:

> Mosaico: Packages are missing Mosaico requires dependencies in its "packages" folder. Please consult the README.md for current installation instructions.

And if you go to Mailing \> New Mailing a message appears:

> Mosaico cannot be displayed because this system does not meet all requirements.

I have the CiviCRM log viewer extension installed, and this is not showing any errors. Google searches don't return anything obvious. I'd appreciate any assistance in debugging this error further - should I be asking this on Mosaico's boards instead? Many thanks!

Tried so far:

* Install phpImageMagick
* Install GD
* Clear CiviCRM Caches
* Server reboot (never hurts hey)

# Answer
> 2 votes
I managed to fix this by uninstalling the Extension in the CiviCRM manager, then deleting the uk.co.vedaconsulting.mosaico folder from the extensions folder, and then reinstalling via the Extensions Manager

---
Tags: mosaico
---


# Question
Title: "Notify when profile form is submitted" not working
I'm a beginner. I created some simple profiles to collect volunteer interests from new contacts. I specified a Group Name for "Add contacts to a group?" and specified a valid email address for "Notify when profile form is submitted?" (I enabled "Enable Double Opt-in for Profile Group(s) field".) Everything was working fine for a few months but I'm no longer getting notifications that the new Contacts are being added to the groups. The contacts are still being added to the appropriate group. I'm just not getting the notifications. There has been no change to the email address. I think I must have accidentally disabled something. Any suggestions on how to get the notifications working again? --mike (CiviCRM 5.38.0 on WordPress 5.8.2)

# Answer
> 3 votes
I realize now that the problem is not CiviCRM related - it's downstream and something to do with the email service. I'm sorry to have taken up space on the board here.

---
Tags: profile, email, groups
---


title: Civi Campaign in views

text:
# Question
Title: Civi Campaign in views
When changing a campaign name it updates in civicrm but not in views anyone have any suggestions how to get it to update in drupal views?

where is civicampaign name stored?

# Answer
maybe your Campaign name is still in Drupal Views cache. Have You try clean Drupal View clear? Button for Clean cache is in: mysite.org/admin/structure/views/settings/advanced.

Which version of CiviCRM and Drupal do You have?
> 0 votes

# Answer
Seems like it is stored in the database and in order to make the change it needs to be done in the database (like the first name you make for a campaign is what will be shown in drupal views unless you change the name in db) (at least in that version of civi and drupal but i imagine in all versions)
> 0 votes

---
Tags: drupal-views, civicampaign
---


# Question
Title: How can I report on how many new contacts have been entered into Civi within a specific period?
I tried: menu Search -\> Find Contacts / is - any contact type / - -\> replace by the contact type you want to count (member is our subtype, but we do not have the membership module enabled, it's just the name the developers have given to the sub-contact) click Search button

This gives me the total number of 'members', but I need to be able to report regularly on how many new individuals have joined...

Individuals are entered either by staff from within Civi, or via an online form on our website.

Thx

B.

# Answer
If you use Advanced Search, then there is a section called Change Log, with an option of 'created' and you can set your date parameters including Date Range

You can also do it via Search Builder

If you cannot find Change Log there then you may need to enable Logging civicrm/admin/setting/misc?reset=1, or check your Search Display Preferences civicrm/admin/setting/preferences/display?reset=1
> 2 votes

# Answer
There's also a Date Added search under Search - Custom Searches.
> 1 votes

# Answer
If you are using a reasonably recent version of CiviCRM you can use Search Kit. This is an extension which you can install from Administer\>System Settings\>Extension. You can find documentation and instruction on how to use it here: https://docs.civicrm.org/user/en/latest/the-user-interface/search-kit/
> 0 votes

---
Tags: civireport
---


# Question
Title: Why are relationships limited to two degrees?
I have a structure in which an umbrella organization has a few dozen clubs which have members. And it has some departments some of the members have a relation to.

Now if I would want one of the admins to have some access to information in the departments, I would have to add the department as a relationship with the proper access rights. This is a tedious job and might lead to faults. I would like to have an intermediate level grouping and departments, but then I am limited to the two degrees

I have tried to draw a picture.

# Answer
> 1 votes
I will add my answer as an Answer.

The Permissioned Relationship extension does let it go multiple layers

# Answer
> 0 votes
The "why" question is fairly straightforward in an open source, community supported and community developed software world: because so far no one wanted more levels badly enough to develop or fund the development of an extensions for it :-)

But I would certainly recommend playing with the extension that @petednz recommended, and check if you can achieve your requirements.

And obviously you are very welcome to develop/fund the development of an extension that introduces more levels.

---
Tags: relationships
---


# Question
Title: Mosaico mailing - link button showing coding
Hi would appreciate some advice - I sent out a newsletter using Mosaico and have received a message from one of the recipients saying that when the hover over a Link button they can see all the coding - example attached. Is there anything I can do to change this? Thanks Helen

# Answer
> 1 votes
The "Code" is just the url - it has a heap of alpha numeric characters because you have click tracking in Send Grid turned on. How Send Grid (and CiviCRM) itself tracks who clicks on a link is it has a link which is unique for each link for each email sent - when you click on that link Send Grid records the click against their list of who got sent that link - checks where the link should go and redirects the user through.

If you don't use click tracking in Sendgrid - and want people to be able to see the link in their email you can try turning click tracking off in your Sendgrid Dashboard. You might also have to do the same in CiviCRM if you have link tracking on there too.

---
Tags: mosaico
---


# Question
Title: Guidance Request : SSO between CIviCRM & WordPress!
We've been using CiviCRM for a number of years and also running a blog on WordPress.

I can't find much information on setting up SSO / OAUTH / SAML / or even just custom CiviCRM | WP API to handshake and achieve a better user experience. (I checked the CiviCRM API Doc and don't see user authentication) I once setup SSO between Vanilla Forums 2 and a custom C# asp.net site and just don't see something like that available.

I did find this: (I wouldn't use Facebook SSO because of privacy offneses) https://civicrm.org/sites/civicrm.org/files/SingleSignOnAccess-for-CiviCRM-Facebook-case.pdf

WordPress has alot of options for SSO plugins: https://wordpress.org/plugins/tags/single-sign-on/

# Answer
One option to look at that will work for Wordpress to Wordpress and Wordpress to Drupal and Drupal to Drupal is using SimpleSAMLphp and an appropriate plugin.

The Drupal SimpleSAMLphp module https://www.drupal.org/project/drupalauth4ssp provides hooks which you can use to populate data from CiviCRM if you want to share this between the sites. (Note - you need a drupal module for drupal and a drupal simplesamlphp module for simplesamlphp)

The Wordpress plugin https://wordpress.org/plugins/wp-saml-auth/ provides similarly the WP plugin has some filters you can use.
> 1 votes

# Answer
If you moved CiviCRM over to WordPress (same instance) you would have no problem, but as you have been running on Drupal for some while I expect that you'd have to change various things and it would change the user experience a bit so probably not the route you want to take.
> 0 votes

---
Tags: wordpress, civicrm.settings.php, authentication, sso
---


# Question
Title: How do you create reports that show the number of
We need to report on various demographics (gender, age, sexuality, ethnicity, etc...) and changes over time...

So far, I seem to only manage to produce lists of individuals / contacts that match each of the criteria, but how would I go about producing a report that answers these types of questions:

How many new BAME\* joined our charity between 1st April and 30th June (\*sorry, that's british for ethnic minority)

Or how many members identify as male, female, trans F, trans M, non-binary etc

I am panicking that this is not even possible within Civi...

I've tried creating groups, searches within groups, searches using advanced search and search builder, reports...

As mentioned in my first post, I am a complete newbie

thanks for any advice

# Answer
Here's an example showing how you could get counts by gender using SearchKit on dmaster:

You probably want to add some 'Where' clauses to limit the counts to those of interest.

In general, 'changes over time' reports are harder because you need historic data and Civi primarily reflects the current state. One option is to record the current state over time and compare it outside of Civi. Other approaches make use of logging to determine the state at a previous time - eg this blog post.
> 2 votes

---
Tags: reports, searchkit
---


# Question
Title: State/Province display for a contact shows a number instead of the name for Vietnam contacts
Most of my contacts have Vietnamese addresses. When I enter the name (organization or individual), I see the correct name for the Vietnamese provinces in the list and choose one. When I view the contact details, the name of the province displays as a number (the id, I presume) instead of the name.

I have reported this several times on the old forum but never got a solution to the problem.

# Answer
Actually I don't think it is the ID, rather it is the 'abbreviation' which in the case of Viet Nam have all been entered in to table civicrm\_state\_province as numbers.

```
SELECT * from `civicrm_state_province`
WHERE country_id = 1233

```

whereas eg US ones are of type WV (West Virginia) etc

I don't know how bad it would be to suggest you copy the 'name' field and paste in to the 'abbreviation' field as a really bad hack.

I know I also raised this on the forum in the past with the hope of a solution so that there was a setting you could nominate to use either the Abbreviation or the Name on the Contacts Summary screen
> 3 votes

# Answer
Same problem here in Ireland. Export full state name - not abbreviation The solution is needed for most countries apart from USA and Canada. The exports need to include civicrm\_state\_province name as well as civicrm\_state\_province abbreviation.
> 0 votes

---
Tags: contacts, addresses
---


# Question
Title: Setting up event mailings to have link to register folks sans entering in details already in their membership record
To my surprise, CiviCRM seems to by default send e-mails to users requesting they fill out details that are already part of their membership record; Name, address, etc. There may be a use case for this, but we are just looking to have a button that can be used (if already logged in, or prompting to login if not) to "Register for event", like other event management software. Is this possible?

# Answer
You can construct these using a Checksum. Instructions are here. The actual construction will depend on CMS and on the target form
> 1 votes

---
Tags: wordpress, civievent, registration
---


# Question
Title: How do I fix a main menu that is not working?
I access CiviCRM and the dashboard is missing. The menu items don't work.

Things tried

* delete files/civicrm/templates\_c/\*
* read ConfigAndLog. No errors reported
* cv flush
* cv upgrade:db
* cv ext:upgrade-db (or /civicrm/upgrade?reset=1)
* civicrm/admin/setting/updateConfigBackend?reset=1. Reset paths, cleanup caches
* check domain in civicrm.settings.php
* check browser console for files that aren't being loaded (nothing reported)
* review resource urls civicrm/admin/setting/url?reset=1
* check system status civicrm/a#/status (still dies)

How did I get here?

* update to drupal 9
* update civicrm

All updated via composer and *git push composer.lock*. There is a git hook

```
GIT_WORK_TREE=/srv/$t/$s git checkout -f $b
export COMPOSER_COMPILE=all
(cd /srv/$t/$s && composer install --no-dev)

```

# Answer
The main symptom is that there are no files in the libraries directory.

```
> ls web/libraries/civicrm/packages
_ORIGINAL_

> composer civicrm:publish
Publishing CiviCRM assets to web/libraries/civicrm
Generating CiviCRM asset map

```

Fixed.
> 2 votes

---
Tags: theme
---


title: WP All in One SEO plugin conflict

text:
# Question
Title: WP All in One SEO plugin conflict
All of my CiviCRM profiles stopped being diplayed (via shortcode) without any Civi or PHP errors or warnings. This occurred with CiviCRM versions 5.41 and 5.43.2. Wordpress is 5.8.2.

This led to hours of extreme panic as GivingTuesday is around the corner and my donation profile was blank!

Has anyone else experienced this issue?

# Answer
> 2 votes
By deactivating my WordPress plugins, I found the issue was with the most recent All in One SEO plugin (version 4.1.5.2).

I have no idea why, but I did share this issue on the All in One SEO plugin support page.

# Answer
> 1 votes
Another solution from the All in One SEO plugin support page (Thanks, Christian!) was to add the following to my WP child theme's functions.php. This allowed me to keep re-activate the plugin:

```
add_filter( 'aioseo_conflicting_shortcodes', 'my_conflicting_shortcodes' );
function my_conflicting_shortcodes( $conflicting_shortcodes ) {
    $conflicting_shortcodes['CiviCRM'] = 'civicrm';
    return $conflicting_shortcodes;
}

```

---
Tags: wordpress, profile, plugin
---


# Question
Title: Mailing issue. Could not identify any recipients. Perhaps the group is empty?
I am experiencing a weird issue on my CiviCRM 4.7.3 on Joomla 3.5.0 (also happening on some 4.7.8 on Drupal 7)

When I try to send or schedule a mailing and I hit "Send test" I receive an error saying `Could not identify any recipients. Perhaps the group is empty?`. However I have selected a group with valid recipients inside (I can see the yellow text near the recipients field saying "~81 recipients").

If I ignore the test and try to send the mailing, it does not give me any errors, but no emails are sent and if I check the report it says:

```
Intended Recipients     1
Successful Deliveries   0 (0.00%)

```

The Mail module works - I can send mail through CiviCRM to a contact directly, only through CiviMail there is a problem.

# Further debugging information

After a lot of debugging I can narrow the problem down to an ACL issue:

In `CRM/Mailing/BAO/MailingJob.php` the `deliver()` function is reached but the query (`$eq->query`, `$eq->fetch`) doesn't return any results.

This is due to the condition from `$aclWhere`, for me it is:

```
( ( `civicrm_group_contact_cache-ACL`.group_id IN (8) ) )

```

which is joined in the full query by

```
LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache-ACL` ON contact_a.id = `civicrm_group_contact_cache-ACL`.contact_id

```

while I do get a contact joined in the query, an entry in `civicrm_group_contact_cache` seems to be missing. What is that table for, anyway?

# Answer
> 6 votes
The solution for me was to set up a Bounce Processing email account in **Administer menu \> CiviMail \> Mail Accounts**.

# Answer
> 4 votes
We're using Drupal 7.56 and CiviCRM 4.7.25 and we also have this problem. None of the above solutions worked.

This seems to be a very general type of error that can be inadvertently triggered by a great many causes. For us, we eventually discovered that our SMTP gateway had ceased authorizing payment on our account and was declining our traffic from CiviSMTP.

So if you're receiving this error, it might be a good idea to double check that your expected mail path actually works as you expect it to before you go digging through code. :-)

# Answer
> 3 votes
For me (CiviCRM 4.7.8) the problem was related to some changes introduced in 4.7.8. regarding permission checks (see GitHub PR #8415, Jira issue CRM-18159).

Reverting those changes fixed the problem:

Remove the acl clauses by replacing

```
list($aclJoin, $aclWhere) = CRM_ACL_BAO_ACL::buildAcl($senderId);

```

with

```
$aclJoin = ""; $aclWhere = "";

```
1. in `CRM/Mailing/BAO/Mailing.php` in function `getTestRecipients` (line 926)
2. and in `CRM/Mailing/BAO/MailingJob.php` in function `deliver` (line 502)

---

## Some details from Debugging

While CiviCRM works fine on another installation with 4.7.8 in our live system there seems to be some issue with ACL (access control) related to mailings, causing CiviCRM to block the user trying to send a mailing to address any contact.

It seems like the database table `group_contact_cache` is not filled with the necessary entries in the affected system. However, I don't know why that could be the case.

# Answer
> 2 votes
I was having same problem on Drupal 7.43 / Civi 4.76 and managed to fix it. Unfortunately I'm not sure which action I took achieved the fix - perhaps one of the following will help you.

* cleared all Drupal and Civi caches via the frontend
* emptied Civi Cache tables via phpMyAdmin
* deleted the contents of the templates\_c folder
* deleted the contents of the ConfigAndLog folder
* deleted the cache folder in my extensions directory
* I disabled and uninstalled the Cividesk Sparkpost extension
* installed the Proexchange extension github.com/proexchange/com.pesc.sparkpost.

In case this unfairly maligns the Cividesk Sparkpost extension note that I have it working on another of our sites that uses Drupal 6 / Civi 4.76. I am not sure whether it was the problem but I did keep getting errors which may have to do with something else in my installation.

# Answer
> 2 votes
We also had this problem. Following this other issue CRM-19685 and solving it applying the following SQL script fixes the 'Send test' problem.

`UPDATE `civicrm_contact` SET `preferred_mail_format` = 'Both' WHERE `preferred_mail_format` IS NULL;`

# Answer
> 2 votes
We noticed this issue recently on 4.7.15 but forgot to follow this fix post upgrade. Once we applied it, the error cited above disappeared.

# Answer
> 2 votes
If you are using Amazon SES for sending email, Check Return-Path email domain verified by Amazon SES (it return with error message "554 Message rejected")

More Details here : http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-response-codes.html

Same might be applicable for other provider, Check CiviCRM log for more details.

# Answer
> 2 votes
I know this is an old thread but on the off chance, someone else finds this helpful. I came across this error when I had an unclosed token in an email. I'd use the checksum token but inadvertently removed the final bracket - the email had "www.mysite.org?cid1={contact.contact\_id}&{contact.checksum/"

Once I added back in the final '}' all was back to working order!

# Answer
> 1 votes
I think perhpas you are confused about what "send test" does.

The number near the recipients field is the number who will receive the finished email. It has nothing to do with the **send test** buttons. (Possibly it would be better if they were labelled Send Draft)

**Send test** either sends one email to the email address in the box if you use the **Send test email to:** panel (the middle panel in the image below), or it sends a test email to the group you have chosen in the right panel (below **Sent test email to group:** . In the image below, the test email would be sent to the Case resouces group if the **send test** button directly below that name was clicked.

The idea of sending a test email to one or a few people before sending the actual email is so that you can check links and formating or perhaps so that others can proofread or approve the email, before you sent it out.

# Answer
> 1 votes
These suggestions have not worked for me (now on 4.7.11). The workaround for this has been to reuse & edit old successful mailings, which seem unaffected.

# Answer
> 1 votes
I had the exact same problem, but it was being caused by an incorrect password in the SMTP Outbound Mail Settings (someone had changed the password and not updated CiviCRM!).

More generally it is probably worth testing the Outbound Mail Settings as a problem here could be causing this issue.

# Answer
> 0 votes
Same problem :

I have just upgraded to Civi 4.7.16 (Drupal 7.54) :

* "Send Test" issues the same message (Could not Identify ...)
* If I overpass the test and send the mailing, the mailing fails : Intended recipients 206 Successful deliveries 0 Bounces 21 (all for "syntax" reason)

CRON Mail Report says :

\*Parameters raw (from db settings): instanceId=\[ID of report instance\] required format=\[csv or print\] optional-output CSV or print-friendly HTML, else PDF

Parameters parsed (and passed to API method): a:3:{s:7:"version";i:3;s:10:"instanceId";s:32:"\[ID of report instance\] required";s:6:"format";s:67:"\[csv or print\] optional-output CSV or print-friendly HTML, else PDF";}

Full message: Finished execution of Mail Reports with result: Echec, Error message: A fatal error was triggered: is not of type String\*

I have no ACL defined

# Answer
> 0 votes
I use CiviSMTP

Actually, it is a known issue : there is a patch there : https://forum.civicrm.org/index.php?topic=37194.0

But why isn't it finally fixed in the standard CiviCRM ?

# Answer
> 0 votes
The message identifies one possible cause, but many other problems lead to the same message. A more verbose version might read:

"No mails were successfully sent. This could be caused by many different issues. Known causes include:

* could not identify any recipients
* errors relating to the SMTP service, including authentication or network problems
* invalid tokens in your mail
* no Bounce Processing account configured"

Check the CiviCRM log file \- some causes are logged there.

# Answer
> 0 votes
Check that every contact on the list is not 'on hold'.

I deleted the mail server and since this group was used as the first test, all contacts on the list were set to 'on hold'.

---
Tags: civimail, mailing
---


title: gocardless and existing agreements

text:
# Question
Title: gocardless and existing agreements
What happens when a CiviCRM membership creates a gocardless payment within CiviCRM if he or she already has a gocardless payment made to our organisation but outside of CiviCRM? Do we just have to trace these manually and resolve? Thanks

# Answer
> 2 votes
If someone signs up to a membership using a CiviContribute page with GoCardless, then they will have:

* a new Customer
* a new Mandate
* that mandate will have a new Subscription

Any previous mandates are completely unrelated, as far as the system is concerned.

This does not necessarily need to be sorted out, but of course that's a judgement that needs operational understanding to make really.

If it's the case that they were already paying, say £10/month, to your org for *that membership*, such that they now are paying twice, then of course this must be sorted out, and the way to do that would be to cancel their old one at manage.gocardless.com which will leave the Civi one active.

## EDIT

If you have existing GoCardless mandates, subscriptions set up by non-CiviCRM means, and you want them to show up in CiviCRM, this will require some developer time to make sure it's done properly. It can be a fairly simple thing to do, and there are various non-general-use example scripts (code) available for a developer to adapt and reuse. Though, if you have already been imported GoCardless data as Contributions (for example) then this can get quite difficult, depending on how they've been imported before.

---
Tags: gocardless
---


# Question
Title: Resend a mailing to recipients who did not open
Our communications staff wants to be able to resend a mailing (or send a new mailing) to recipients who did not open a previous mailing. Of course, this is possible by creating a group from the "unique opens" of the first mailing, and then excluding that group in the new mailing.

Unfortunately, there are a number of steps with this, and it seems like a sufficiently useful workflow that I'd be interested in it as a new core feature. Other mass mailing services like Constant Contact have a "resend to non-openers" feature.

Before I open an feature request issue in lab.civicrm.org, I wanted to test it here to see if others feel it might be a worthwhile feature, or if there is some other way to streamline the workflow.

# Answer
> 2 votes
You can do this in a few steps, using my Resend Mailing extension

1. Do a search for people who were sent the mailing but have not opened it.

1. **Search » Advanced Search**
    2. Open the **Mailings** bit
    3. Enter the name of the mailing.
    4. Select "Trackable Opens" - "Unopened / hidden"
2. Click the 'all' option on the search results, then choose 'Email - resend a CiviMail mailing'
3. Tweak that mailing as you wish and hit send. Note that you'll need to select a suitable "unsubscribe group". If your original mailing was sent to a group called X then choosing X would be a sensible choice there.

---
Tags: civimail
---


title: Can't add Gmail account with OAuth

text:
# Question
Title: Can't add Gmail account with OAuth
I'm trying to set up a mail account using OAuth following the instructions here and here.

I've set up OAuth in Administer \> System Settings \> OAuth:

But when I go to Administer \> CiviMail \> Mail Accounts I still just see the regular Add Mail Account button, not a drop down that allows me to choose and OAuth account:

What have I missed?

**Edit:** Drupal 7.82 and CiviCRM 5.43.2.

# Answer
> 3 votes
I think there was a recent change that broke it. This patch was added to CiviCRM 5.44+ to fix it.

---
Tags: email, oauth
---


# Question
Title: Membership Types not translated on default Contribution page "Member sign up"
On CiviCRM 5.43.2 in WordPress, I have 2 Membership Types a user can sign up to.

All other text on the form is translated except for the "Membership Types Label" and "Membership Types". These appear in English on both English and French versions of the site.

The field "Membership Types Label" lacks an icon that you would usually click to open a form to enter the translations for other languages, as if this field is not available for translation.

I have added a translation for the Membership Type name in the Membership component.

Is there a way to translate these fields, or could this be a bug with CiviCRM?

# Answer
> 2 votes
By default, the Member Sign Up form shows options for the different available memberships but these do not get translated.

There is the option to create a price set for these fields, and this opens up new options including translating labels.

# Answer
> 1 votes
My multilingual install of Drupal + CiviCRM 5.35.2 does allow translations (assuming you're on a page url like this: /en/civicrm/admin/member/membershipType/add?action=update&id=1&reset=1)

So maybe it's a recent regression. There has been some recent work on membership as I recall.

On the other hand, most of the times these fields would be exposed would be in a fieldset, so perhaps that's where you'd want to translate them anyway?

---
Tags: civicontribute, civimember, contribution-page, translation
---


title: How do folks handle email preview text?

text:
# Question
Title: How do folks handle email preview text?
When sending a CiviMail message, users sometimes want to customize the preview text for email clients - which is good practice. (The preview text shows up under the Subject in many email clients.) Using the default mosaico pre-header, you end up with preview text of "Unsubscribe View in your browser...." \[update: HomoTechsual notes that the Mosaico pre-header has a preview text option. But this has limitations as noted in the thread.\]

It seems there are two ways to edit the preview text in Civi:

1. Creating a pre-header block with the text for the preview, but this will be visible in the text of the email, which often isn't ideal.
2. Creating a `<div style="display: none;">Preview text here</div>` before any other text in the email. This is not user-friendly and is easily forgotten by users who have the knowledge of how to do it.

Any other suggestions for handling this?

Potential feature request: I'd love to see an non-required field for Preview Text under the subject field for every mailing. And (okay, this is a different, related feature) it would be great if a Preview Text field and Subject line could accommodate emojis (as described here). If Civi doesn't add these abilities, I'm concerned it will fall behind in user expectations compared to other mass mailers.

# Answer
I recently wrote an extension to handle this: https://lab.civicrm.org/extensions/mailingpreviewtext
> 3 votes

# Answer
Mosaico 2.x on CiviCRM already has the feature to add "preview text" for emails.

This is handled in the default "versafix-1" template and any derivatives thereof by way of a hidden text field in the HTML.

Your supplemental question regarding Emoji is more difficult - the Mosaico library can handle Emoji however CiviCRM's database storage engine doesn't use UTF8MB4 and isn't setup to handle Emoji content at this time. There is an issue here however getting this change into CiviCRM core (which is where it would need to occur) is not simple nor a priority at this time.
> 4 votes

---
Tags: civimail, email, mosaico
---


# Question
Title: Problem creating a CiviCase via online form
I want a user to be able to order various stickers from our website. They are distributed for free, but in exchange we request photos of where people put them. To track the whole process of application, mailing, communications, reminders, and receiving the photos back, we need to create a CiviCRM Case. However, I'm not able to display such a Profile on the website (Wordpres 5.8.2, CiviCRM 5.38). Turns out, the сustom fields set I've created for various stickers' selection is not even listed among profiles I can put online via the CiviCRM button (which inserts the code like \[civicrm component="profile" gid="32" mode="create" hijack="0"\]). Is there a way to open a case through an online form?

# Answer
I don't think you can use civi's profiles with cases this way, partly because you'd want to collect some contact data as well and you can't mix in a profile.

In drupal I would say use webform\_civicrm. For wordpress I believe caldera/ninja forms can do cases but there was some talk about it being discontinued at some point.
> 1 votes

# Answer
I'm not 100% sure yet, but the 'Form processor' direction looks very promising to explore. https://civicrm.org/blog/jaapjansma/using-civicrm-form-processor-extension-to-handle-form-submissions-from-an-external.

At least it can open a CiviCase for a user who has just entered his name and email.
> 1 votes

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


# Question
Title: Unable to import database dump - triggers
I had a problem importing a database dump because of some trigger errors. I'm not sure exactly what caused these errors (may have had something to do with custom case activities, which we use quite a lot, or possibly CiviRules).

I tried deleting the triggers from the dump file using the awk script below, and then imported the new de-triggered dump file. Is there anything wrong with this approach? It seemed to work for me.

Btw I adapted the awk code from a post on this page.

Run the awk script as follows:
awk -f scriptfilename databasefilename \> outputfilename

awk script:

```
BEGIN { curr=0 } \
  /^DELIMITER ;;$/ { in_block=1; del_block=0 } \
  /^DELIMITER ;$/ { in_block=0; blockend=1 } \
  /TRIGGER/ { if (in_block==1) { del_block=1 } } \
  { if (in_block==0) \
    { if (blockend==0) \
      # Neither in a block nor block end reached.
      # Just print the line
      { print } \
    else { \
      # End of a block reached. Do block end handling
      # just this one time. Block end flag off
      blockend=0
        if (del_block==1) \
          { # delete the block. Just throw away the lines
          # in the lines array
          curr=0 } \
        else \
          { # End of block and no delete. Print it out
          for (i=0; i<curr; i++) { print line[i] }
          print # Print the </script> line
          # use line-array for the next block
         curr=0 \
       } \
     } \
   } \
 else \
   { # In a block. Save the current line for later
    line[curr]=$0
    curr++ } \
}

```

# Answer
Our team use

```
perl -pi -e 's#\/\*\!5001[7|3].*?`[^\*]*\*\/##g'

```
> 2 votes

---
Tags: database, trigger
---


# Question
Title: Generating letters in Docx generates empty letters
Generating letters in Docx generates empty letters and with office 365 images are oversized even if image size is locked

# Answer
In our experience using docx with the core features only works for very simple templates. Have a look at the CiviOffice Extension instead. It's still in development but could already do want you want: https://docs.civicrm.org/civioffice/en/latest/
> 1 votes

---
Tags: civireport
---


# Question
Title: CiviCRM Search page results - Custom template
Thank you in advance. I am looking for a way to create custom search result pages (perhaps through Smarty ?).

We have heavily customised CiviCRM to work for our organisation needs and most of the information you get on a search like address, city, state, country, phone etc. are of no use for us.

Just to clarify I am not asking on how to create a report to do something. I want / need to know if there is a way to modify the search result page itself by being able to change the columns that appear there.

Thank you again.

Best A.

# Answer
> 3 votes
It depends which searches you are talking about, but you can configure a Profile for displaying contact search results at `Administer > Customize Data & Screens > Search Preferences > Default Contact Search Profile` or at the top of an Advanced Search page.

You might also want to investigate SearchKit and Form Builder.

---
Tags: civicrm-home, search-results, custom
---


# Question
Title: How to update the action which behind a custom menu
We have a custom menu which has been created years ago and the one in charge is not with us anymore. The menu makes a contribution extraction and generates a pdf. The menu open a page on the url page=CiviCRM&q=civicrm%2Fcdntaxreceipts%2Fcheques&reset=1.

We would like to update the pdf content. Does anyone can tell us where we can find where the extract and pdf content ha been defined. Thks

# Answer
Under Administer - System Settings - Directories you'll see one for "Extensions Directory" that will have the path to a folder. If you look at that folder in the filesystem you'll see all the custom extensions, one per subfolder.

It may look like `[civicrm.files]/ext`. If you look near the top of the page there's a blue help icon - if you click it it will tell you the full path for `[civicrm.files]`.
> 1 votes

---
Tags: contributions, reports, menu
---


# Question
Title: Error Message "Cron not running", but it's working perfectly. CiviCRM 5.43.0
I've seen a couple of Drupal workarounds for this, but not for Wordpress.

The CiviCRM status is below; note that the last reported cron run was manually executed by me.

> All extensions are up-to-date: CKEditor4: Version 5.43.0 Contribution cancel actions: Version 5.43.0 Event Cart: Version 5.43.0 Financial ACLs: Version 5.43.0 Theme: Greenwich: Version 5.43.0 Custom search framework: Version 5.43.0 reCAPTCHA: Version 5.43.0 Sequential credit notes: Version 5.43.0

> PHP Up-to-Date This system uses PHP version 7.4.26 which meets or exceeds the recommendation of 7.3.

> Cron Not Running Last cron run at November 26th, 2021 2:35 PM.

I have a separate Cron task for each Scheduled Job, specified on cPanel using the CLI method (because this works better than wget, and no other method worked for me). I can see all tasks are running as they should \[Administer \> System Settings \> Scheduled Jobs\], yet the "Cron Not Running" message still pops-up constantly too. This is really annoying.

Here's an example of one of my cPanel Cron jobs, working as expected at 1AM daily (0 1 * * \*)

`/usr/local/bin/ea-php74 /home/ACCOUNT/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s MYDOMAIN -j -u USERNAME -p PASSWORD -e job -a version_check >/dev/null 2>&1`

So what triggers this Cron error message? I have set job=version\_check to run only once a day, yet it suggests more frequently - "CiviCRM Update Check (Always)". How can you "always" run a periodic job? Is that relevant? Is this just a dumb bug?

# Answer
It's hardcoded that it needs to be hourly or more: https://github.com/civicrm/civicrm-core/blob/69cd824e26fc6e90a88e6cf18d9d011c1c85b94e/CRM/Utils/Check/Component/Env.php#L317

And I'm pretty sure it's tracking the Job.execute job, not any individual job: https://github.com/civicrm/civicrm-core/blob/69cd824e26fc6e90a88e6cf18d9d011c1c85b94e/CRM/Core/JobManager.php#L72
> 1 votes

---
Tags: wordpress, cron, cron-job, scheduled-job
---


title: New navigation menu item broken url

text:
# Question
Title: New navigation menu item broken url
I basically have the same problem as in CiviDiscount Navigation URL incorrect not for a special extensions though, but for the search. I'm using CiviCRM 5.44.0 on Wordpress 5.8.2. I added this url to a new navigation item: `civicrm/contact/search&force=1&qfKey=0&reset=1`

When using the menu item it navigates me to: `wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fsearch_force_1_qfKey_0_reset_1`

The important characters are just converted to underscores. Is this a saftey setting I have to disable?

# Answer
I think you have to do this: civicrm/contact/search?force=1&qfKey=0&reset=1
> 2 votes

---
Tags: wordpress, menu, urls
---


# Question
Title: What is the status of the civicrm_membership_log table?
Our system is maintaining a membership log in the civicrm\_membership\_log table, even though detailed logging is switched off. This could actually be quite useful since I have been asked for some historical membership statistics, but before using it I would like to know:

1. Is this log reliable? I.e. is it correct that it is active, or is it possible that there will be some unannounced change that turns it off?
2. Is there a reason for this particular log being maintained?
3. Is it possible to switch it on and off, separately from the full detailed logging?

# Answer
> 3 votes
1/ afaik yes it is reliable, it writes a row for every membership status change 2/ yes (not a super helpful answer since i can't explain the reason!) 3/ not afaik.

And mostly I answered above in order to also provide links to these options you may find useful

https://lab.civicrm.org/extensions/contactmembershiplog which lets you expand the membership log for any single membership on the contact's membership tab

https://github.com/fuzionnz/nz.co.fuzion.historicmembershipdata

https://civicrm.org/blog/agilewarejustinfreeman/how-many-members-did-we-have-date-how-many-times-has-member-renewed-how

# Answer
> 0 votes
Regarding question 2, iirc we added this when we made some changes to membership status and membership type handling perhaps 8-10 years ago. There were problems tracing what had happened to particular memberships and I thought this might be useful both for debugging and potentially for users. There were issues with automatically merging memberships of different types at renewal time, during a grace period, then after full expiry. So: historical artifact.

---
Tags: civimember, logging
---


# Question
Title: How to resubmit a webform that's in Drupal but not in Civi
A webform was submitted & made it to Drupal but not to Civi. It's a fairly simple 'new contact' submission with 4 screens so quite a lot of information - and I can see the webform result. It has 'Contact 1' blank which is a sign of some problem but all the required fields are completed. Is there a way of actually resubmitting it so it gets to Civi? I've gone into 'Edit' and stepped through the 4 screens but that just saves it - I want to actually resubmit it. This is a Drupal 7 install with Civi at 5.42.1

# Answer
Sounds like there are two issues: 1) resubmit the form & 2) have that submit hit civi.

First issue: go to the form -\> then click on settings -\> then check the appropriate options under form and submission tabs. You may be interested in the below one under the submission tab:

```
Allow users to duplicate previous submissions

```

Second issue: it depends on whether the form is setup to communicate with civi. That is done via clicking the form then -\>settings -\> civicrm tab and checking

```
Enable CiviCRM Processing

```

If that is done and there are glitches, then look into the Drupal reports -\> recent log messages (but first test submit the form).

With hooks and such you can probably update the submission and resumbit it both to Drupal and civi.
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: No CiviCRM link in my WordPress menu after migration from Drupal to Wordpress
I migrated CiviCRM running under Drupal 7 to CiviCRM running under Wordpress due to the lack of automatic updates in Drupal.

I am able to manage CiviCRM from the administrator's backend of Wordpress, but I want to give access to CiviCRM from the front end, as I did under Drupal.

There is a page called CiviCRM but it doesn't display anything else than "Do not delete this page. Page content is generated by CiviCRM", but actually, it is not.

I searched for some shortcode to introduce the whole CiviCRM interface, menu bar included, but this doesn't exist.

I also saw nearly every post related to this issue, but couldn't get wiser. I would like to know where I have to look for solving this issue.

The docs say "There should now be a CiviCRM link in your WordPress menu. Click that link and the CiviCRM Menu, Shortcuts, Search and New Individual Blocks should appear" but it is not the case.

# Answer
WordPress doesn't have a concept of "access to CiviCRM from the front end, as I did under Drupal". You access the CiviCRM admin UI via the WordPress admin UI. That's it.

The "base page" that you see which has "Do not delete this page. Page content is generated by CiviCRM" as its content is used for displaying CiviCRM forms, profiles, events etc on the front-end. You will find links scattered throughout the CiviCRM admin UI that will point you there. It uses WordPress Rewrite Rules to tease out what to show, so, for example:

https://yourdomain.tld/civicrm/event/info/?reset=1&id=2

will show a CiviCRM Event.
> 2 votes

---
Tags: wordpress
---


title: List all members by zipcode or city

text:
# Question
Title: List all members by zipcode or city
I want to list all members by zip-code or city. Then the resulting page to be editable & linkable.

Also, want the resulting page to have "exposed filter" where someone can choose a city from dropdown filter and only list items for that city etc.

By all members i mean: display: \[name, membershp status, zipcode and city\].

I tried Drupal views, but then couldn't get the address data (zipcode and city) to show up and also couldn't get the resulting page to be editable/linkable (i.e when you click on a contact, to be taken to page where you can edit membership info (set expired to something else etc).

I have done : advanced search -\> made it smart group, but couldn't get the resulting page to be linkable. In addition, the results were too much (I just want name, membership status, zip and city).

By "be linkable" i mean i want access the final page as : http://myDomain.com/civicrm/some-link.

Using Drupal 8/9 and civicrm 5.42

Thanks for the directions

# Answer
> 3 votes
You can build this with CiviCRM Entity https://www.drupal.org/project/civicrm\_entity

Enable the "CiviCRM Contact" entity type at the settings page, /admin/structure/civicrm-entity/settings

You can start with a list of contacts, and add a Views Relationship to CiviCRM Addresses to get the state / zip

Use Views field rewrites to make one of the fields linkable to /civicrm-contact/\[contact-id\]

You can manage what fields show for the contact page at: /admin/structure/civicrm-entity/civicrm-contact/display

# Answer
> 3 votes
A CMS-agnostic way to accomplish this is with SearchKit. It ships with CiviCRM 5.42 but is disabled. Enable it at **Administer menu » System Settings » Extensions**. You'll also want to enable the Afform extensions.

Then, go to **Search menu » SearchKit** and start a new search. It's very SQL-like. Start with contacts, join address and membership, and at the bottom you can select which fields you'd like to appear. Ignore filters for now, unless you have some "non-exposed" filters.

Once you've got the basic search down, save the search, and create a new display of type "Table" based on the search. On this screen you can add exposed filters, rewrite any URLs you need, and make fields inline editable.

This is a broad overview because what you want to do has several moving parts, but if you're comfortable with Views and you watch the SearchKit videos on the CiviCRM YouTube channel you should have no problem.

---
Tags: civimember, civicrm-entity
---


# Question
Title: civimail sometimes stuck on running via Scheduled Jobs screen
We have set up a mailer using Mosaico and have set it to send immediately. There is no cron set up, so I have executed the "Send Scheduled Mailings" manually in the scheduled jobs settings.

If I use my test group (80 email addresses) the job starts and finises correctly.

If I send the mailer to the live list (120 email addresses) The job starts but never finishes and displays as running. The Successful Deliveries show as 0, but the unique opens are 1, so I'm unsure how many mailers have been sent out.

Some of the contacts in this group do not have email addresses, could this contribute to the issue?

We also have a mailer intended for 1500 email addresses that needs to go out.

The specs: CiviCRM 5.43.2 Mosaico 2.8.1637146864 Wordpress 5.8.2 Php 7.4 Memory limit set to 1200 for now We are still waiting on our hosting provider to be able to set up the Cron Job

# Answer
> 4 votes
Using "Execute Now" from Scheduled Jobs isn't safe because your web server settings (in `php.ini`) will specify a maximum amount of time a page can run before it times out. If you're executing a Scheduled Job, that job will fail. It sounds like you're using shared hosting (which is not a great CiviCRM experience, speed-wise) so you may not be able to control the timeout, which is usually 30 seconds.

Assuming you can't change that to a much higher number, you'll need to wait for cron to be set up.

If you're absolutely desperate, you can go to **Administer menu » CiviMail » Mailer Settings** and set the *Mailer Batch Limit* to **80**. This will prevent sending more than 80 emails per scheduled job, and you can manually press the "Execute Now" button once every 30 seconds for 10 minutes.

---
Tags: civimail, mosaico, scheduled-job
---


# Question
Title: Modify "Thank-you Screen" fields to support tokens?
I would like to display some data attached to an event registrant on the Thank-you page. Is there a way to enable Token parsing on the Thank-you Title, Introductory Text, and Footer Text?

Example:

```
Hey there {contact.first_name}, thanks for registering for this event!

```

# Answer
Not quite in the way you'd like, unfortunately. In time, this will be possible with Form Builder, but not yet.

For now, you have a few options. I won't go into details, but will answer follow-up questions if other Stack Exchange questions/online docs don't help.

First - the simplest solution *might* be to redirect to a different page of your choosing. If you have another page that you can configure with their info (e.g. a Drupal View), use the Front End Page Options extension.

The second-simplest answer is to modify the thank-you template. This isn't ideal because your thank-you page will be stuck on the current version of CiviCRM unless you manually redo your changes on each upgrade. I only recommend this because it takes the least tech knowledge (though still quite a bit!).

* Define a custom template directory at **Administer » System Settings » Resource URLs** and **Administer » System Settings » Directories**.
* In that folder, make the following folder hierarchy: `CRM/Event/Form/Registration`.
* Find that same folder relative to your CiviCRM root folder (in `modules` on Drupal/Backdrop, `plugins` on WP) and copy `ThankYou.tpl` to the equivalent location in your custom templates folder.
* You can now modify the (new) `.tpl` file to add text/tokens. You'll see a bunch of tokens in the file, but these aren't the "normal" tokens, which aren't available here. You can see all available tokens by adding the `{debug}` token to the page.

Note that if you're comfortable writing extensions and/or using the API and/or using Javascript, this is NOT the way to go, because of the maintainability issue.

The most "correct" way would be an extension with `hook_civicrm_buildForm` to modify the text on the page - though I'd probably just use the extension to load a line or two of jQuery to get the job done.

**EDIT** \- I just looked at your StackOverflow history, and it seems you're a coder and know jQuery - great! Go ahead and download civix, which lets you create a new extension (`civix generate:module NewExtensionName`). Then check out the Resource Reference to see how to add JS to a form using `hook_civicrm_buildForm`. If you know PHP, you can also check out the Region Reference to see how to inject a bit of HTML into the middle of the page. The `$form` object should contain the name of the registrant.
> 2 votes

---
Tags: civievent, tokens, registration, online-registration, participants
---


title: Issue with select2 widget

text:
# Question
Title: Issue with select2 widget
We're working on a french postal codes extension based on the Belgian one. We want to use the API provided by the National French Mail Company.

According to the Select2 doc for Ajax (remote request), we should use the `<select>` markup but it doesn't work, even though following this post, it should.

We can see this error in the console `Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a <select> element.`

If we use the `<input>` markup instead, we can get data in the console but it also fails and we have this error: `Uncaught TypeError: Cannot read properties of undefined (reading 'toUpperCase')` meaning that we need to transform the current result into the proper format using processResults(data) as described in the Select2 documentation.

We are using CiviCRM 5.43 on WP 5.82 and the standard Select2 library is 3.5.4. Forcing to Select2 version 4 causes a crash.

Any idea on how to overcome this issue?

# Answer
You are using docs for the wrong version of Select2. As you noted, Civi currently uses v3.5. The correct doc link is https://select2.github.io/select2/
> 1 votes

---
Tags: select2
---


# Question
Title: How to calculate SMS length, size or number for non-english languages?
Depending on the character table SMS length is variable. CiviCRM from 5.40 can count the number of character but for languages using diacritics the actual size will be calculate differently.

How can I easily check the really size of my message?

# Answer
A useful tool I've found on Twillio to check the length of a SMS, especially for non-English languages: https://twiliodeved.github.io/message-segment-calculator/

You can find here more information about the "logic" of the calculation. French `é` is considered as normal but `ê` or `ç` not :-( and this will split the message every 70 characters instead of 160! This will directly impact the cost of sending.
> 1 votes

---
Tags: sms
---


title: How to delete a contact?

text:
# Question
Title: How to delete a contact?
I just imported csv file, with organization as the contact type. I filled in all the ncessary fields and it shows that I have 0 errors and able to import all the 213 rows. However, after I import, I am only able to find 1 contact and I cant delete this contact. The message will prompt that the contact is used for some special administrative purposes. May I check how i can go about deleting this contact as well as finding all the imported contact?

# Answer
This 1 contact you can not delete (usually the contact with ID 1) is the Drupal administrator account and this can not be deleted as it is the "owner" of the installation.

I can not from a distance see what happened with your import. You should be able to see imported contacts when using the Search\>Find contacts option.

If you can not find any contacts you could check the civicrm\_contact table but you should really have received an error message in your import?
> 1 votes

---
Tags: wordpress
---


# Question
Title: Why aren't my tokens working in mosaico?
I have created a custom Drupal 8/9 module that defines hook\_civicrm\_tokens and hook\_civicrm\_tokenValues to provide tokens to CiviCRM.

It works when not using mosaico, but fails (the tokens are evaluated to "empty") without any noticeable error when using the same token with mosaico.

Any hints on debugging this?

It seemed like it could be a flexmailer issue instead and I tried the flexmailer "CiviMail BAO" setting instead, but that didn't seem to have any effect.

I also tried upgrading to civicrm to 5.42.0, but no joy there either.

# Answer
> 1 votes
@Demerit pointed me to this https://docs.civicrm.org/dev/en/latest/framework/token/#token-processor

Aside from being new and shiny, it's using some symfony bits which Drupal also uses so it kind of feels like a nice fit.

In my initial testing, I've observed that the example code in fact only fills in the gap - i.e. the tokens don't show up in the listing, nor do they work in a traditional mailing, but they do show up in a mosaico mailing!

So I've implemented this as well as the existing hook\_civicrm\_tokens and hook\_civicrm\_tokenValues, and it appears to work.

Presumably the worst that could happen would be that both processing mechanisms were invoked and that would be okay.

**Post script** ...\[2022-04-01\]

It works in all my testing, but fails when the mailing is triggered via cv! I tried adding in --level=full, thinking that Drupal wasn't getting invoked in the same way as when doing tests, but that didn't make a difference.

To make matters worse, it seems to stop working after different kinds of upgrades, and then start working, i.e. perhaps it sometimes is working off a cache.

---
Tags: civimail, tokens, mosaico, drupal-8, flexmailer
---


title: How can I update all my external-IDs?

text:
# Question
Title: How can I update all my external-IDs?
My client's outside database has changed. I have spent a few hours (fun!) matching the old and new external IDs and the internal CiviCRM contact ID as well. Not every record in the CiviCRM database has or will have an external ID.

I will probably need to do an update using SQL (mySQL/phpmySQL), but I'm a little uncertain that that's the best way and I don't want to break the entire database!

The current data is in Excel: CiviCRM ID, New ExternalID, old ExternalID.

# Answer
> 1 votes
Try doing a Contact import just of Civi ID, and new External ID, and set it to Update using a matching rule based on civi id.

---
Tags: mysql, external-id
---


# Question
Title: CiviCRM + WPML breaks resource links when in non-default language
I'm implementing CiviCRM + Wordpress + WPML for multiple languages on frontend pages. WPML provides the option of switching languages in two ways: via a URL parameter or a path parameter. For example:

I'm finding that in either of the URLs where the language is designated, it breaks all css/js resource links on the page. For example:

I have no idea why the use of the parameter converts the css reference into the non-pretty links version, or why it prepends the language parameter to the beginning of the URL (which is why it breaks things).

Anyway -- I'm wondering if anyone has run into this and has suggestions for using WPML with Civi. I'm pretty stumped.

I should note -- either language-switch option does result in the Civi page being translated as expected. It just completely breaks the site design because all css/js links fail to load.

# Answer
> 2 votes
Support for Polylang has more coverage than WPML. You'll need to look at this code and replicate for WPML using its methods to discover what's needed to modify the Rewrite Rules. Please open a PR if/when you do - it would be great to have better WPML support.

---
Tags: wordpress, localisation, translation
---


title: upgrading civicrm 4.2.0 to 5.2.2

text:
# Question
Title: upgrading civicrm 4.2.0 to 5.2.2
I am trying to upgrade CiviCRM from 4.2.0 to 5.2.2 and am getting the error below. Whenever the upgrade runs it stops at DB to 4.3.alpha1 and throws up the error. Am on Drupal 7.

```
[Error: Upgrade DB to 4.3.alpha1]
ERROR FIELD ERROR VALUE
Type    DB_Error
Code    -3
Message DB Error: constraint violation
Mode    16
UserInfo    INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
DebugInfo   INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' , 12985 , 'civicrm_contact,12985' , 2 , 20211206190550 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`fwcivi`.`civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
PEAR_Exception: DB Error: constraint violation in /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php on line 921
- DB_Error: DB Error: constraint violation in unknown on line unknown
Exception trace
#   Function    Location
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:921
1   PEAR_Error->__construct('DB Error: constr…', -3, 16, Array, 'INSERT INTO civi…')    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB.php:984
2   DB_Error->__construct(-3, 16, Array, 'INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:575
3   PEAR->_raiseError(Object(DB_mysqli), null, -3, 16, Array, 'INSERT INTO civi…', 'DB_Error', true)    /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/PEAR.php:223
4   PEAR->__call('raiseError', Array)   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1905
5   DB_common->raiseError(-3, null, null, 'INSERT INTO civi…', '1452 ** Cannot a…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:933
6   DB_mysqli->mysqliRaiseError()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/mysqli.php:403
7   DB_mysqli->simpleQuery('INSERT INTO civi…') /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/common.php:1216
8   DB_common->query('INSERT INTO civi…')   /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:2443
9   DB_DataObject->_query('INSERT INTO civi…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/packages/DB/DataObject.php:1068
10  DB_DataObject->insert() /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/DAO.php:548
11  CRM_Core_DAO->save()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/BAO/Log.php:141
12  CRM_Core_BAO_Log::register(12985, 'civicrm_contact', 12985) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php:218
13  CRM_Contact_BAO_Contact::add(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:865
14  CRM_Upgrade_Incremental_php_FourThree->createDomainContacts()   /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Incremental/php/FourThree.php:128
15  CRM_Upgrade_Incremental_php_FourThree->setPostUpgradeMessage('<span class="bol…', '4.3.alpha1') /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Upgrade/Form.php:696
16  CRM_Upgrade_Form::doIncrementalUpgradeStep(Object(CRM_Queue_TaskContext), '4.3.alpha1', '4.2.0', '5.2.2', '/private/var/fol…')  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Task.php:88
17  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Runner.php:214
18  CRM_Queue_Runner->runNext(true) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:52
19  CRM_Queue_Page_AJAX::{closure}()    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/ErrorPolicy.php:106
20  CRM_Queue_ErrorPolicy->call(Object(Closure))    /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Queue/Page/AJAX.php:54
21  CRM_Queue_Page_AJAX::runNext()  /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:275
22  CRM_Core_Invoke::runItem(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:84
23  CRM_Core_Invoke::_invoke(Array) /Applications/MAMP/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php:52
24  CRM_Core_Invoke::invoke(Array)  /Applications/MAMP/htdocs/sites/all/modules/civicrm/drupal/civicrm.module:445
25  civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   /Applications/MAMP/htdocs/includes/menu.inc:527
26  menu_execute_active_handler()   /Applications/MAMP/htdocs/index.php:21
27  {main}

```

# Answer
The correct answer is already given, but I want to add some nuance.

This is actually addressed in the upgrade guide and is expected. As the guide states, it is not generally required to do intermediate version upgrades when making a bug version jump. The issue is that the current upgrader only supports versions starting from 4.7.

So, the issue is not the size of the version bump. You just have to get to 4.7 and then the current installer will work.
> 1 votes

# Answer
You're likely making too big of a jump in versions. I try to do it in small jumps, creating a backup after each try. Then I can easily revert to the last one if something breaks.
> 3 votes

---
Tags: upgrade
---


title: Migrated WP site -> "critical error"

text:
# Question
Title: Migrated WP site -> "critical error"
I'm trying to migrate my site from Bluehost to Cloudways hosting. The migration goes thorough successfully, but when I try to access the WordPress Admin (/wp-admin) I get "There has been a critical error on this website. Please check your site admin email inbox for instructions."

I have tried deleting the migrated site and starting over. I have tried renaming the "plugins" folder to disable everything - it all works until I activate CiviCRM. I tried deleting all the CiviCRM files and installing the plugin from a fresh download. Still getting the same error caused by the CiviCRM plugin.

Obviously, this plugin is essential to my site, so hopefully someone can help me! Thank you!

# Answer
> 0 votes
What version of PHP?

Have you tried removing all of the civicrm extensions?

You say you have the issue with a fresh install... if all of the requirement checks pass on the installer page: https://docs.civicrm.org/installation/en/latest/wordpress/ ... then that would also point to extensions being the culprit.

---
Tags: wordpress, migration
---


# Question
Title: CiviCRM WordPress Upgrade to 5.44.0 Error
When upgrading I get this error:

Fatal error: Cannot redeclare Matrix\adjoint() (previously declared in /home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/vendor/markbaker/matrix/classes/src/Functions/adjoint.php:21) in /home/xxxxxx/public\_html/wp-content/uploads/civicrm/ext/ca.bidon.civiexportexcel/vendor/markbaker/matrix/classes/src/functions/adjoint.php on line 20

My guess is that it has to deal with the Civi Export As Excel extension which wasn't originally updated, but I have no idea. Is there a way to either update the extension manually if that is it or some way to just delete the problem?

Any help appreciated!

# Answer
> 2 votes
You'll need to update the export to excel extension: https://lab.civicrm.org/extensions/civiexportexcel/-/blob/8d2dad043a79e40de79c5e32a6f94e8ca596aa01/CRM/CiviExportExcel/Utils.php#L8

You can upgrade it manually by just downloading the files (https://lab.civicrm.org/extensions/civiexportexcel/-/archive/master/civiexportexcel-master.tar.gz) and replacing them in /home/xxxxxx/public\_html/wp-content/uploads/civicrm/ext/ca.bidon.civiexportexcel

---
Tags: wordpress, error, php
---


# Question
Title: ACL to limit access to contacts by Membership
It seems using ACLs to limit access to contacts is a hot topic. I've reviewed many of the questions on the topic, many years old, but have yet to find a solution. Scenario is:

• Our Federation has direct members (paid) and 52 member clubs (free).

• Each club can have hundreds of their own members and club members inherit a membership to the Federation through their Club.

• I am trying to create a login controlled by an ACL that limits a Club Admin to viewing, editing and creating only their own members.

• Clubs in Wordpress are assigned the Club Admin User Role with permissions for CiviCRM.

• I've put the Club contact type 'Organization-Member Club' into a group 'Clubs'

• I've created a Club Admin Role assigned to the group Clubs.

• I'm creating an ACL for each specific club using the Club Admin Role, allowing 'Edit' on 'group of contacts' data assigned to the specific club group

• Tried creating a 'Smart Group' on search for specific club Membership which finds the memberships but doesn't allow Access Control, only Mailing List.

The only results I can get when logged in as a Club Admin user is a listing of all Contacts, if I have 'view all contacts' in the WP permissions — if I don't have that permission, I get nothing. I've been through many, many combinations of permissions, roles, groups, relationships, memberships and ACL settings. Is there not a solution that doesn't require creating multiple entries in separate tabs? This seems like a pretty common requirement for multi-level organizations, what am I missing?

# Answer
I had a scenario similar to yours, and I have found the solution in CMS permissions using the related permission extension. CMS permissions are above ACLs rules. So before to create ACLs rules, check your CMS permissions and verify that you don't allow your "Admin club" to see all contacts. In our case, we define that "Admin club" cannot view AND edit all contacts, and in ACLs, we define "Admin club" can only see his club contact through the related permission.

It took us a few time to understand that it's an option in the dropdown select menu for 'Custom Fields' (here, 'Données personnalisées'). .
> 1 votes

# Answer
> I am trying to create a login controlled by an ACL that limits a Club Admin to viewing, editing and creating only their own members.

The Permissioned Relationship extension makes an ACL based around the relationship and could provide what you need. We use it in many scenarios similar to yours

One write up about it is here
> 0 votes

---
Tags: wordpress, acl
---


# Question
Title: Where should I start for writing a CiviCRM plugin for allowing some Wordpress users to access the CiviCRM menu from the front end of Wordpress?
CiviCRM running under Drupal gives the possibility to some users to access a complete menu for managing CiviCRM without giving them access to the settings of the CMS.

It seems this is not possible when CiviCRM is running under WordPress: the administrator of CiviCRM has full access to all the settings of WordPress, which is not an option in our case.

After some painful experiences with Drupal regarding the hassle of the updates, we decided to switch to WordPress, without knowing about this issue.

We are not the only ones concerned by that issue:

We are disposed to write an extension of CiviCRM allowing a user with enough rights to get the full menu of CiviCRM from the user side of the website, but we need some pointers to start somewhere. We are thinking about a static page containing the javascript code to launch the full CiviCRM management menu.

Any help would be appreciated.

# Answer
Personally speaking, I think your proposed plugin goes against the separation of front-end and back-end that is a deliberate feature of WordPress. You might be able to do it, but should you?

> when CiviCRM is running under WordPress: the administrator of CiviCRM has full access to all the settings of WordPress

This is not true. Please look again at roles and capabilities and what they mean when accessing the WordPress admin. Users can only ever see (and do) what you expose to them via the relevant role and/or capability. The fact that others also misunderstand the architecture of WordPress doesn't seem relevant to me.

FWIW, CiviCRM Admin Utilities has a "CiviCRM Shortcuts" menu that has links to various CiviCRM admin screens depending on a User's CiviCRM permissions. It appears on the front-end (if the theme allows the WordPress top menu to be shown) so you *could* customise it to suit your needs via the available actions \- but the resultant CiviCRM admin screens would *always* be rendered in the WordPress back-end rather than wrapped in the front-end theme.

If you *really really* have to hide CiviCRM admin screens from your Users, you could:

* Use CiviCRM Profiles to build forms for the front-end
* Use a form builder of some kind to build custom forms that interact with the CiviCRM data that you want your Users to access and/or update.

There are a number of plugins out there that provide this functionality.
> 1 votes

---
Tags: wordpress, civicrm-home
---


title: Favorite Activities

text:
# Question
Title: Favorite Activities
I was building a search with search kit and saw there's an option to pull activities that have been starred but I don't see where I can star activities and Google is giving me nothing. Does anyone know anything about that feature?

# Answer
It's in the two civicase-related extensions (either https://github.com/civicrm/org.civicrm.civicase or https://github.com/compucorp/uk.co.compucorp.civicase)
> 1 votes

---
Tags: activities
---


# Question
Title: Increase number of websites for organization
I would like to include more than five websites to an organization's profile summary. After adding a fifth website, the option to “Add” a new website is no longer available. How can I include more than five websites to an organization's profile?

The organization has several of the included options, e.g., “Main”, “Twitter”, “Slack”, “Facebook”, “LinkedIn”, “Instagram”, plus custom options I've added, “GitHub”, “Wiki”, etc., and I would like to include a URL of each.

# Answer
> 3 votes
That limit only applies to the in-place edit feature. Just click the edit button at the top of the page to edit the whole contact and you can add as many as you want.

---
Tags: summaryfields
---


title: row size too large when exporting

text:
# Question
Title: row size too large when exporting
There are a lot of "Row size too large" type errors with various different causes (for example: https://lab.civicrm.org/dev/core/-/issues/2784 and Log table: nativecode=1118 \** Row size too large. You have to change some columns to TEXT or BLOBs).

But this one I haven't seen before.

It happens when exporting primary fields after a search.

I'm using:

* MariaDB 10.5
* The default ROW\_FORMAT is already set to dynamic.

The exact error is:

```
Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

```

I tracked it down to the problem described on this mariadb page which explains:

> The root cause is that InnoDB has a maximum row size that is roughly equivalent to half of the value of the innodb\_page\_size system variable.

And, the default `innodb_page_size` is 16k, so we have exceeded 8k. Unfortunately, you can't change the `innodb_page_size` without re-initializing the database. That means exporting all databases, shutting down the server, changing the configuration, starting the server and re-importing all databases.

It's possible to hide under a rock by setting `innodb_strict_mode=Off`, but that seems risky. I'm not entirely sure why this is the first time I've come across this problem.

I'm wondering if my analsys is correct and if anyone has less drastic fixes or work-arounds?

# Answer
> 6 votes
You will need to convert all the CiviCRM tables to utf8mb4 or as a workaround convert civicrm\_contact table to utf8mb4 by running below query.

```
ALTER TABLE civicrm_contact CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

```

# Answer
> 2 votes
Interim workaround is just make an export mapping that has most of the "primary" fields but leaves out some of the useless ones, and then tell people to use that instead of "primary" (or hide the primary radio and call your mapping "primary"). I expect you could start with leaving out the ones here: https://lab.civicrm.org/dev/core/-/issues/2784#note\_66899

---
Tags: mariadb
---


# Question
Title: How to pre-fill price or "other amount" from the querystring in payment pages
We would like to be able to pre-fill the price or "other amount" in a Civi payment page based on the querystring parameters. I have tried creating an extension which adds some Javascript to select the radio button and fill the amount if appropriate:

https://github.com/AsylumSeekersCentre/au.org.asylumseekerscentre.pricequerystring

This is the Javascript which I'm using:

```
CRM.$(document).ready(function ($) {

  var objUrlParams = new URLSearchParams(window.location.search);
  selected = parseInt(objUrlParams.get('priceoption'));
  priceSetId = parseInt(objUrlParams.get('priceset'));
  radio = document.getElementById('CIVICRM_QFID_'+selected+'_price_'+priceSetId);

  if (radio != null) {

    radio.click();

  }
  else {

    otherAmount = parseInt(objUrlParams.get('otheramount'));

    if (otherAmount != null && otherAmount > 0) {

      otherAmountInput = document.getElementById('price_'+priceSetId);
      otherAmountInput.value = (otherAmount + '')
      otherAmountInput.click();

    }
  }
});

```

The radio buttons have ID strings like "CIVICRM\_QFID\_78\_price\_14", where 14 is the price set ID and 78 is the price option ID. The querystring to select this option would include "&priceset=14&priceoption=78". The "other amount" input has an ID string like "price\_15" (the number is seemingly always equal to the price set ID plus one). To set the "other amount" to 11, the querystring would include "&priceset=15&otheramount=11".

The code above first tries to select one of the default price options (if the querystring has the appropriate parameters), and if that fails, it attempts to set the "other amount".

Superficially, this looks correct when the form is loaded. However, when trying to submit the form, it returns an error:

```
Error Unable to complete payment! Missing paymentIntentID.

```

With the "other amount" option on a page where Stripe is the payment processor, the payment box doesn't appear until after there is subsequent user interaction. With the default options, the box does appear immediately but still returns the error above. If the user changes the pre-filled payment section, the form does submit correctly (e.g. if they delete and re-enter the "other amount").

I think the reason might be similar to the one behind this question from 2009:

https://forum.civicrm.org/index.php%3Ftopic=8126.0.html

If that answer is still applicable, I don't understand how to apply it. I looked at these pages, but I'm not sure if they help in this context:

https://stackoverflow.com/questions/1350917/send-post-variable-with-javascript https://stackoverflow.com/questions/12648639/set-a-post-variable

I don't want to automatically submit the form, just prefill the payment amount and leave the form in a state where it can be submitted. Is there a way to do this?

# Answer
Below code should work if you have `amount` parameter set in the url for example `amount=300&id=10&reset=1`

```
jQuery(document).ready(function() {
  let amount = new URLSearchParams(window.location.search).get('amount');

  if (jQuery('.contribution_amount-section').length) {
    if (amount !== null) {
      singleAmount = amount + '.000000000';
      //do we have an input that matches this amount?
      if (jQuery('[data-amount="' + singleAmount + '"]').length) {
        jQuery('[data-amount="' + singleAmount + '"]').prop('checked', true).trigger('click');
      }
      else {
        jQuery('input[value="0"]').prop('checked', true).click();
        jQuery('.other_amount-content input').val(amount);
        calculateText(jQuery('.other_amount-content input'));
      }
      jQuery('#priceset .price-set-row span').removeClass('highlight');
      jQuery('#priceset .price-set-row input:checked').parent().addClass('highlight');
    }
  }
});

```
> 3 votes

---
Tags: forms, javascript, payment
---


# Question
Title: Can we add a campaign field to the batch activities screen
Can we add a campaign field to the batch activities screen? My goal is to record attendance on CRM, through batching activities. I want to be able to put what the Campaign is for the specific event they attended when I batch activities

# Answer
Braincreatives welcome to CiviCRM SE, By `batch activities screen` do you mean 'Update mulitple activities' option using from search actions? If so I believe you can add campaign field to a profile, use the profile to update activities in batches
> 2 votes

---
Tags: activities
---


# Question
Title: Upgrading CiviCRM from 5.38 to 5.44 causes DB Error: constraint violation Error
Drupal 7 CiviCRM upgrade from 5.38.0 to 5.44.0

DB Error:

```
ALTER TABLE `civicrm_relationship_cache` ADD CONSTRAINT `FK_civicrm_relationship_cache_case_id` FOREIGN KEY (`case_id`) REFERENCES `civicrm_case` (`id`) ON DELETE CASCADE; [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`drupal7_crm`.`#sql-5c_2ad8`, CONSTRAINT `FK_civicrm_relationship_cache_case_id` FOREIGN KEY (`case_id`) REFERENCES `civicrm_case` (`id`) ON DELETE CASCADE)]

```

# Answer
> 3 votes
Looks like a data integrity issue. civicrm\_relationship\_cache table has CiviCase data which is deleted, Will need to clear those first by running below query and re-run the upgrade.

```
DELETE crc.* FROM civicrm_relationship_cache crc
LEFT JOIN civicrm_case cc
  ON crc.case_id = cc.id
WHERE cc.id IS NULL AND crc.case_id IS NOT NULL

```

HTH

Pradeep

---
Tags: upgrade
---


# Question
Title: Preventing duplicate organisations being created
I wonder if anyone can help me with what I'm missing re duplicate contacts.

We have a profile form which also creates a wordpress account - it asks only for first & last name, email, username and password.

Once registered and logged in, we have a separate profile form that asks users for more information, including their current employer. We ask only the employer name, and for no other information about that organisation.

If two separate users enter exactly the same current employer name, two organisation records are created.

Looking at the profile settings I'm actually surprised this is happening, because the de-dupe option that we have set is:

The unsupervised dedupe rule for organisations is:

We also have the extension 'The the' installed as it's common in our sector for people to register their company with and without a 'the' at the start.

I'm guessing the profile settings don't influence any *related* contacts that may be created, which is why people are being able to create duplicate employer/organisation records... But any thoughts on why the unsupervised de-dupe rule is not working in the way I would expect?

Especially when, if we run the de-dupe manually, the unsupervised rule DOES spot the duplicates!

I'm sure this is something basic that I'm getting wrong, but I just can't fathom it. Thanks!

# Answer
You need to set as Organisation name instead sort name.
> 2 votes

# Answer
You may want to check out https://civicrm.org/extensions/public-autocomplete-of-organisation-names but of course this means the list of Orgs that you allow to show become 'public' in a sense, and hence may have security concerns
> 0 votes

---
Tags: duplicate-contacts
---


# Question
Title: Email shows as "Cancelled" when triggered using civiRule
I have setup a civiRule to send out a email 5 mins after a contribution is added. The event does get triggered properly but the email shows up as "cancelled" under user activity and no email is received by the users. I verified the form email, template setting, everything looks correct but still no success in sending the emails.

# Answer
Can you use CiviCRM scheduled reminders to send emails? If you are still want to use Civi rule you should provide some screenshot of your settings so that we can check and provide some inputs
> 3 votes

---
Tags: civimail, civirules
---