# Question
Title: Missing attribute payment_processor_id of entity Contribution in API Explorer v3?
I created a PHP 7 script that uses an API Call to get some information about a specific Contribution with a `$contributionID` that has been defined before. The code (below) works and correctly returns `payment_processor_id`. BUT I cannot reproduce this in CiviCRM API Explorer v3.

My code is:

```

 $result2 = civicrm_api3('Contribution', 'get', [
            'sequential' => "1",
            'return' => ["payment_processor","instrument_id","payment_instrument_id","payment_processor_id"],
            'id' => $contributionID,
        ]);
        $payment_instrument_id = $result2["values"]["0"]["payment_instrument_id"];
        $payment_processor_id = $result2["values"]["0"]["payment_processor_id"];
        echo "instrument ID: ";
        var_dump($payment_instrument_id);
        echo "processor ID: ";
        var_dump($payment_processor_id);

```

where the resulting array does correctly contain a value for `payment_instrument_id`. When I try to reproduce this in API Explorer v3, I get an array response with the following structure:

```
    {
    "is_error": 0,
    "version": 3,
    "count": 1,
    "id": 885,
    "values": [
        {
            "contact_id": "2700",
            "contribution_id": "885",
            "payment_instrument_id": "8",
            "payment_instrument": "Lastschrift",
            "instrument_id": "8",
            "id": "885"
        }
    ]
}

```

Obviously, there is no `payment_processor_id` here. So it is a big puzzle for me how the PHP API call can access an attribute that is not even there.

I entered the following values in API Explorer:

You can see that the PHP code the API Explorer produces is exactly the same as I am using in the script. Does anybody have any idea why this difference occurs?

EDIT: If @Pradeep's answer is correct, wouldn't it be logical to add this `'check_permissions' => TRUE` parameter in the PHP section of API Explorer? From my perspective, the code snippets in API Explorer should represent as exactly as possible the code that is *actually* executed.

# Answer
> 3 votes
From api explorer the results are retrieved using rest api where check\_permissions is always set to TRUE by default even though its been explicitly set via api params.

If you have check\_permissions set to TRUE than api returns only those fields which are defined for the the entity. In your case the fields would be

```
civicrm_api('Contribution', 'getfields', ['version' => 3, 'action' => 'get']);

```

Try adding `'check_permissions' => TRUE` as a api parameter in your php code, it should return exact same results you get in api explorer.

HTH

Pradeep

---
Tags: api, php7
---


title: Cannot create Price Set in Wordpress

text:
# Question
Title: Cannot create Price Set in Wordpress
I'm using CiviCRM in Wordpress but I got an issue when creating a Price Set. If I click to Save a new Price Set https://prnt.sc/1trrm1u, it auto redirect to the page that shows all price set, it should be showing a popup to add a new price field https://prnt.sc/1trs53n.

Is there anyone who knows how to fix this issue? please help me. Thanks so much!

# Answer
If the issue cannot be replicated on the demo or master sites eg https://wpmaster.demo.civicrm.org/ then it suggests that either

* a problem has been fixed and it is worth upgrading to see if this resolves it
* there is something specific about your installation, configuration or environment.
> 1 votes

---
Tags: price-sets
---


# Question
Title: Not all Activity types are displayed when creating a custom field set
I am trying to create a custom field set that will add additonal fields to a new activity type I have just defined. The activity type can be used for Contacts and Cases.

When I try and create the custom field set and select 'Used for' Activities, the drop down list of activities does not contain the new Activity I have created. It seems to stop at a certain point. What am I missing?! I have had no problems in the past.

I am using CiviCRM v5.41 with Drupal 7.82

# Answer
OK - it took me quite a while, but this answer gave me a clue:

Activity drop down list not displaying activites

The issue was that the value of filter was set to null. I used the API explorer to compare an activity I could see:

```
{
"id": 123,
"option_group_id": 2,
"label": "My Visible Activity",
"value": "50",
"name": "My Visible Activity",
"grouping": null,
"filter": 0,  //Note that filter is set to 0
"is_default": false,
"weight": 81,
...
}

```

with one I could not see:

```
{
"id": 1234,
"option_group_id": 2,
"label": "My Invisible Activity",
"value": "50",
"name": "My Invisible Activity",
"grouping": null,
"filter": null,   //note that filter is set to NULL
"is_default": false,
"weight": 81,
...
}

```

I then used an API call to update the the value of 'filter' to 0 and it appeared correctly in the dropdown list.

To update an activity you have created and make it visible, here is an example using CV, but you can of course use the API Explorer to do the same thing:

1. Get the values of the exisitng activity types:

cv api4 OptionValue.get '{"where":\[\["option\_group\_id","=",2\]\],"limit":500}'

This will give you a list of all your activity types and the various values defined.
2. Update the value of the Activity Type by setting the value of 'filter' to 0:

cv api4 OptionValue.update '{"values":{"filter":0},"where":\[\["option\_group\_id","=",2\], \["id","=",1234\]\]}'

This will now show up when you wish to add the custom field set for a particular activity type.

What I do not understand is why Activity Types I have created in the past have a filter value set correctly, but more recent ones do not. There is not an obvious way within the UI to enable or disable the visibility of individual Activity Types?
> 1 votes

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


title: Linking iats payment to specific events

text:
# Question
Title: Linking iats payment to specific events
My instance: civiCRM: 5.37.0, iATS Extension: 1.7.4, Drupal: 7.80

We organize and charge for events (each the same amount) and with civiEvent each event has a separate URL. The participant pays on line through iATS.

My iATS CreditCardJournal does not show for which event payment is being made. I would sure like to have the URL of the event (or similar tag) in the journal. Is there a way to do this?

I understand there are ways of linking the participant, payment and event within civiCRM using Summary Fields or hooking up to an accounting package but I'm inquiring about the iATS journal.

# Answer
> 1 votes
The information as to what the payment was actually for (donation, event, membership, product purchase etc) only resides in CiviCRM. Payment processors don't care about what you purchase, they are all about authorization.

We do ship two reconciliation reports with the iATS Extension along with scheduled jobs that automatically pull the iATS journals into your CiviCRM instance. What you can then do (with the Report) is e.g. select Source -\> and this will give you the Source field on the Contribution -\> which typically contains the Event name.

---
Tags: iats
---


# Question
Title: How to prevent use of a forwarded email link to a webform
We are sending emails to contacts, using Civimail, with a link to a webform. These contacts do not have a login to Civi so are seen by the webform as 'Anonymous (not verified)' users when they are submitted. However, those contacts are able to forward these emails to others, who are not contacts in Civi, who can then click on the link and complete the webform. When these unauthorised people do that, the webform sees them as the person who forwarded the email to them (because of the contact id in the link). Other than giving the original contacts a signin to Civi, is there a way of preventing this? This is a Drupal 7 site, Civi is at 5.35.2

# Answer
> 2 votes
That's one of the problems with checksum links - it's just a link connected to a specific user and although you sent the link to the specified contact, there is no guarantee that it is actually that person using it. The options come down to hoping people read your instructions and answer correctly.

You can ask people not to forward the mail ("Please don't forward this mail - it contains links to your personal data" ...) or either of the approaches Pete describes.

# Answer
> 1 votes
Another potential approach for webforms which I've used (in both Drupal 7 and Backdrop), is to adjust settings on the "Existing Contact" webform component for that contact.

In the "Contact Field Handling" section, you can configure it to lock the Contact Fields, Email, etc. if they contain data, leaving them open for editing if they are empty.

In this way, if it's attached to an existing contact by a checksum the person will not be able to change the name/email data so it's very clear who they are filling the form for. But if they come to the form with no checksum and no pre-filled info, it's just a regular empty form.

---

*EDIT: Regarding a contact reference field that is set up as autocomplete:*

The first name and last name field will be "lockable", but the autocomplete contact reference does allow a user to remove the default selection and make a new selection. So they can see who they are filling the form out for (and potentially select a different contact) but not change the first/last name (or any locked info) of the existing contacts.

---
Tags: webform-civicrm, security
---


# Question
Title: Best practice when renewing memberships while changing from one type to another
we offer two types of memberships (reduced and regular) that vary on financial status of the member, ie. if a person is unemployed/student/retired they pay the reduced fee but if their financial situation changes they pay the regular one. When renewing the membership and the type of the membership changes (from regular to reduced for example) should one renew the current membership and change in the new window membership type or just add a new membership with the current one?

If I change the type from renewal window I lose the info of the previous type (it/s visible in contribution tab) but if I add a new membership then there is a chance of having concurrent regular and reduced memberships?

Thanks.

# Answer
> I lose the info of the previous type (it/s visible in contribution tab)

If the loss of info is key issue you could try this extension which lets you view the changes that occur when a member renews but up/downgrades their Memb Type
> 1 votes

---
Tags: civimember, contributions
---


# Question
Title: How to split CiviCRM multiple database values with SQL?
The CiviCRM database stores multiple values as a `varchar` field (a string with separator characters). For example, the IDs 3, 9 and 15 are internally saved as `#3#9#15#` (where `#` is in fact the character `Ctrl+A` but displayed as `#` by phpMyAdmin).

This is strongly recommended against (see https://dba.stackexchange.com/questions/291361/transform-a-varchar-field-with-delimiters-into-multiple-rows ), but I suppose it will not be changed quickly.

For statistical reasons, I wanted to evaluate these varchar fields containing multiple IDs. Therefore, I needed to split them. But as storing data this way is not recommended, SQL has no built-in explode/split function for strings. Also, working with the built-in SQL function `substring_index()` is no choice because the number of selected options saved in this field varies, from 0 to 15. Additionally, the maximum number is not fix, as new options may be created from time to time.

So I want to share how I figured out to split these CiviCRM values with two SQL calls.

I know that I already posted part of this answer in the Database Administrators Stackexchange but I think this solution is highly CiviCRM specific and will probably be most useful to CiviCRM admins. So I wanted to post it here in a more detailed fashion.

# Answer
For every option group (that is, set of multiple values) I created two SQL views: One for splitting the varchar field correctly, and one for combining the split values with other data. All of these "splitting views" in the database pull data from an additional, common view named `match_ufid_contactid` (matching the Drupal user ID `uf_id` with a CiviCRM contact) and another view named `case_years` (containing the information in which year the first consultation of this case took place, which is a custom field in this system).

So, let's say we have a custom field/column `case_result` of type multiple-choice (residing in the normal CiviCRM database called `civi_db` here, in a table called `result_table` here). We are splitting this column into single values with the following SQL view named `stringsplit_case_result` (residing in a second statistics database called `stats_db` here):

```
select `zz`.`case_id` AS `case_id`,
       `zz`.`contact_id` AS `contact_id`,
       `zz`.`one_split` AS `one_split`
from
     (select cast(coalesce(nullif(substring_index(substring_index(`content_alias`.`fieldset_column`,char(1),`num`.`id`),char(1),-1),''),'0')
         as signed) AS `one_split`,
         `content_alias`.`case_id` AS `case_id`,
         `content_alias`.`contact_id` AS `contact_id`
     from
          ((select `fieldset_table`.`case_result` AS `fieldset_column`,
                   `case_contact`.`case_id` AS `case_id`,
                   `case_contact`.`contact_id` AS `contact_id`
          from (`civi_db`.`result_table` `fieldset_table`
          join `civi_db`.`civicrm_case_contact` `case_contact`
              on(`case_contact`.`case_id` = `fieldset_table`.`entity_id`))) `content_alias`
          join
              (select `a`.`h` * 10 + `b`.`t` + 1 AS `id`
              from ((select 0 AS `h` union select 1 AS `1` union select 2 AS `2` union select 3 AS `3` union select 4 AS `4` union select 5 AS `5` union select 6 AS `6` union select 7 AS `7` union select 8 AS `8` union select 9 AS `9`) `a`
              join (select 0 AS `t` union select 1 AS `1` union select 2 AS `2` union select 3 AS `3` union select 4 AS `4` union select 5 AS `5` union select 6 AS `6` union select 7 AS `7` union select 8 AS `8` union select 9 AS `9`) `b`)) `num`)
     where `num`.`id` > 0) `zz`
where `zz`.`one_split` > 0
order by `zz`.`one_split`

```

Then, inside `stats_db`, we create another SQL view that takes the split values from the `stringsplit_case_result` view and matches them with useful information we need for statistics (namely, the CaseID, the ContactID, the Drupal user ID, the year of first consultation, the human-readable label of this split value):

```
select `stringsplit`.`case_id` AS `case_id`,
       `stringsplit`.`contact_id` AS `contact_id`,
       `stringsplit`.`one_split` AS `one_split`,
       `option_table`.`label` AS `label`,
       `uf_table`.`uf_id` AS `uf_id`,
       years_table.first_contact AS first_contact
from `stats_db`.`stringsplit_case_result` `stringsplit`
    join (select `optionvalue`.`label` AS `label`,
                 `optionvalue`.`value` AS `value`
         from `civi_db`.`civicrm_option_value` `optionvalue`
        where `optionvalue`.`option_group_id` = 136) `option_table`
    join `stats_db`.`match_ufid_contactid` `uf_table`
    join `civi_db`.civicrm_case `case_table`
join `stats_db`.case_years `years_table`
where case_table.is_deleted = 0
  and `stringsplit`.`one_split` = `option_table`.`value`
  and `uf_table`.`contact_id` = `stringsplit`.`contact_id`
  and `stringsplit`.`case_id` = case_table.id
and stringsplit.case_id = years_table.case_id

```

These views rely on two additional SQL views called `case_years` and `match_ufid_contactid` (both inside `stats_db`). `case_years` supposes there is a table called `first_consultation` with a column `date` in the `civi_db` database, where `date` is in SQL date format. You can find them here:

`match_ufid_contactid`:

```
select `civi_db`.`civicrm_uf_match`.`uf_id` AS `uf_id`,
`civi_db`.`civicrm_uf_match`.`contact_id` AS `contact_id`
from `civi_db`.`civicrm_uf_match`

```

and `case_years`:

```
select `case_table`.`id` AS `case_id`,
extract(year from `first_consultation`.`date`) AS `first_contact`
from
(`civi_db`.`civicrm_case` `case_table`
join `civi_db`.`first_consultation` `first_consultation`)
where `case_table`.`id` = `first_consultation`.`entity_id`

```

Edit: @petednz In our system, Drupal Views doesn't recognize the CiviCRM fields as multiple value fields, which is why it doesn't allow to split the fields in Drupal.
> 2 votes

# Answer
While not a SQL-specific answer, I would typically use an ETL tool like Pentaho Data Integration to do the data transforms SQL isn't well-suited for. PDI has both a "Split fields" and "Split fields into rows" steps - depending on whether you want your data normalized or denormalized.

To deal with the control character issue, I'll generally use `UNHEX(01)` though it seems like your `CHAR(1)` serves the same purpose.
> 1 votes

---
Tags: civicase, database, sql
---


title: Tracking bequests and planned giving

text:
# Question
Title: Tracking bequests and planned giving
I am wondering if or how organizations track bequests of any kind through CiviCRM.

# Answer
> 1 votes
I haven't had to deal with this myself, and hope someone with direct experience can chime in. However, I would either handle this with CiviPledge, or with contributions of status "Pending", with some flag (e.g. a separate financial type, a custom field) indicating that this is planned giving so that you can run reports solely on those contributions.

Personally I prefer "Pending" contributions to CiviPledge, particularly if you have any sort of accounting integration, and especially if you're doing accrual or deferred revenue accounting. CiviPledge feels a little dated to me.

# Answer
> 0 votes
I think it would depend on what you mean by 'tracking'. if you mean 'money coming to us' then Jon's answer is more useful than mine. if it is to do with tracking the process from 'first contact' through to 'formal agreement' etc and how to ensure that the necessary contacts are recorded for when the bequest is finally available to you, then I would be looking at Activities, possibly within the container of a Case, but I expect it can be largely done without that extra layer of management

---
Tags: civicontribute, contributions
---


# Question
Title: How to trigger a confirmation email when registering participants via API
We have a custom module that we use to do event registrations (non - paid), however i was wondering is there anyway through the API of being able to trigger CiviCRM sending a confirmation registration email when we submit the registration via API?

# Answer
There is a send email API in an extension that should be able to handle that? Not the automatic sending but you can trigger the API in whatever processing you do. Extension can be found here: https://github.com/CiviCooP/org.civicoop.emailapi
> 4 votes

# Answer
I haven't tried the org.civicoop.emailapi extension, but I did give it a quick skim, and it didn't look like it would be suitable for the use case of an event registration confirmation email. I didn't see where it would accept params for the event ID or the participant ID, so while it might be able to send the appropriate template, much of the data wouldn't be populated.

Instead I ended up using a core BAO. This is not recommended, because presumably the method is not intended to be a public interface and could change from one version to the next.

Nevertheless, it was expedient. Here's some sample code for anyone else who may need to do this:

```
<?php

// your contact ID may come from elsewhere
$cid = $form->getVar('_primary_volunteer_id');

foreach ($form->_submitValues['field_added_by_buildform_hook'] as $eventId) {
  $participant = civicrm_api3('Participant', 'create', array(
    'contact_id' => $cid,
    'event_id' => $eventId,
    'role_id' => 'Attendee',
    'source' => 'My Customized Form',
  ));

  // elsewhere I have called civicrm_api3('Event', 'get', $params)
  // to populate $eventData
  $locBlock = civicrm_api3('LocBlock', 'getsingle', array(
    'id' => $eventData[$eventId]['loc_block_id'],
    'return' => 'all',
  ));
  // for some reason, the BAO expects 1-indexing rather than 0-indexing
  $locBlock['address'] = array(1 => $locBlock['address']);

  // Note: other stuff data can go into $mailParams, such
  // as fee information. It's not well-documented, and it
  // wasn't relevant to my use case, so I didn't bother.
  $mailParams = array(
    'event' => $eventData[$eventId],
    'location' => $locBlock,
  );
  CRM_Event_BAO_Event::sendMail($cid, $mailParams, $participant['id']);
}

```
> 3 votes

# Answer
There is a new extension called Event Messages that an alternative way to send confirmation emails for CiviCRM Events.

It creates an additional tab within CiviCRM Events that allows you to define different message templates to be sent based on conditions (including the participants status, role and preferred language). It will also allow you to suppress CiviCRM's regular emails.

Probably that should cover the use case described here.
> 1 votes

---
Tags: civievent, api
---


# Question
Title: CSV file import problem with file from Mac MS Office
I am trying to import contacts as .csv file, however when I try to upload it I get an error message saying that the input file must be in a CSV format - which it is!
I'm using a Mac and I've read that Mac Excel (which I've used to convert the initial xls file into csv) might cause some difficulties, if this is the problem, how can this be fixed?

I look forward to your suggestions. Kindly, Milla

# Answer
> 4 votes
Try using Libre Office. It is a Free and Open Source Office (MS Office compatible) application. Libreoffice.org - You can open the xls file with it and save as csv. I have used it numerous times, it comes pre-installed in ubuntu (which reminds me I should make a donation to the project)

Let us know how you get on.

# Answer
> 3 votes
I had the same issue, and I noticed when opening the CSV file (that I had created in Mac excel) in textedit, the separator was a ; rather than , After replacing I could import without issue.

# Answer
> 2 votes
Milla - when we have hit issues with imports of a csv we have often succeeded by simply copying out the content of the csv and pasting in to a new csv. saving and then importing.

i have found that if i then re-save a csv it can cause issues and the above trick gets around it.

# Answer
> 1 votes
I use Mac MS Office all the time to create csv files to import into civi without issue.

Civi parses the file looking for the correct format. It doesn't care what the file name is. So for some reason the csv file isn't either saving correctly or has extra things in it. Try saving the file as a csv. Then open it with TextEdit and look at the file. It should be something like this

```
ID,First Name,Last Name,Street Address
1,John,Smith,123 Easy Street
2,Jane,Jones,1 Main Street

```

You may or may not have the first row with the column names and the data between the commas may be inclosed in quotes.

If you file looks ok then you might need to look for hidden charaters.

You could also try the other csv formats. I see a couple of MS style cvs formats further down the list in the save as file type.

Other possibilities are the character set. The code has UTF8 all through it but I think other work.

# Answer
> 0 votes
Consult https://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding for workarounds. Personnally i use iconv to do the conversion in a terminal window.

iconv -f WINDOWS-1252 -t UTF-8 data.csv \> data.utf8.csv

# Answer
> 0 votes
I'm using LibreOffice on MacOS, best solution

---
Tags: contacts, import, error
---


# Question
Title: How to change mailing form and set the default value for url_tracking to false?
Is it possible to alter the mailing form? I want to set the default value for url\_tracking to false. Usually I would write a hook\_civicrm\_buildForm and set a custom default value but this hook is not being called when loading the mailing form.

# Answer
**Disclaimer**: I'm not an angularjs expert

Again this is a bit of a hack, we are intercepting a built-in CiviCRM angular directive and extending to add behaviour.

Create a custom extensions or use an existing one and implement hook\_civicrm\_angularModules:

```
function myextension_civicrm_angularModules(&$angularModules){
        $angularModules['myModule'] = array(
                'ext' => 'myextension',
                'js' => array('js/myModule.js'),
        );
}

```

In your js file:

```
// js/myModule.js

(function(angular, $, _){
  // Your module
  angular.module('myModule', []);

  // the hack
  angular.module('crmMailing').config(function($provide){

    // crmMailingBlockTracking directive
    $provide.decorator('crmMailingBlockTrackingDirective', function($delegate){
        var directive = $delegate[0];

        // Original link function
        var link = directive.link;

        // compile function, returns new link function
        directive.compile = function(){
            return function(scope, element, attrs){
                // get old link functionality
                link.apply(this, arguments);

                // new functionality here
                scope.$parent.$watch(attrs.crmMailing, function(){
                    var createdDate = new Date(scope.mailing.created_date).getTime()/1000;
                    var nowDate = new Date().getTime()/1000;

                    if((nowDate - createdDate) < 60){
                        scope.mailing.url_tracking = '0';
                        CRM.alert('Tracking Disabled');
                    }

                });
            };
        };

        return $delegate;
    });
  });
})(angular, CRM.$, CRM._);

```

The angular Mailing app uses a kind of boilerplate service, `crmMailingSimpleDirective` for constructing directives see here more info

The above snippet will do the same as my other answer without relying on `setTimeout()`.

Hope that helps.
> 5 votes

# Answer
I guess this is not the best way to do it and perhaps someone can point you to a better solution. I'll put it as an answer for readability purposes.

**Edit**

Create a custom extensions or use an exiting and implement `hook_civicrm_pageRun`, something like:

```
function myextension_civicrm_pageRun(&$page){
  $pageName = $page->getVar('_name');
  if ($pageName == 'Civi\Angular\Page\Main') {
    CRM_Core_Resources::singleton()->addScriptFile('myextension', 'js/myJsScript.js');
  }
}

```

**Edit: making some assumption this is with what I came up, as I said not the best thing to do but... perhaps someone finds it useful.**

```
// js/myJsScript.js

CRM.$(function($){

  var disableUrlTracking = function(){
    // Access angular $scope
    var mailingElement = document.querySelector('[ng-model="mailing.url_tracking"]');
    var mailingScope = angular.element(mailingElement).scope();

    // Convert the mailing created date into seconds
    var createdDate = new Date(mailingScope.mailing.created_date).getTime()/1000;

    // Current date into seconds
    var nowDate = new Date().getTime()/1000;

    // Compare both dates
    var dif = nowDate - createdDate;

      // if the difference is less 60 seconds, assuming that to creat a mailing takes more than 60 seconds
    if(dif <= 60){
      mailingScope.mailing.url_tracking = '0';
      CRM.alert('URL Tracking disabled', 'URL Tracking');
    }
  }
  // Optional: wait for the page to load completeley, in my case it takes some seconds until it renders the whole mailing page.
  // If you don't have that issue just call the function
  setTimeout(disableUrlTracking, 4000 );

});

```
> 3 votes

# Answer
In Drupal you can do this with hook\_civicrm\_pre():

```
function mymodule_civicrm_pre($op, $objectName, $id, &$params) {
  if ($objectName == 'Mailing' && $op == 'create') {
    $params['url_tracking'] = 0;
  }
}

```
> 1 votes

# Answer
Another option you may want to consider is installing CiviProxy. You set it up somewhere on the public Internet (I imagine a free hosting account would suffice), whitelist its IP in your firewall, and it has a very limited ability to talk to CiviCRM. But the CiviProxy extension will rewrite your URL tracking to go to the proxy - and the proxy knows how to handle the rewrite. It also lets you, e.g. embed images in your mailing, which otherwise wouldn't be possible.
> 1 votes

# Answer
I wrote an extension borrowing heavily from @andrei, with a few improvements on identifying a creation vs modification of a draft

Hope you find it useful

https://github.com/TechToThePeople/privacier
> 1 votes

# Answer
This feature is now part of core: Administer -\> CiviMail -\> CiviMail Component Settings:
> 1 votes

---
Tags: civimail, hooks, angular
---


title: Drupal 9.2 Install error

text:
# Question
Title: Drupal 9.2 Install error
Drupal 9.2, CiviCRM 5.42 Have read all related issues and followed all patches / notes, including ( but not limited to ) https://github.com/osuosl/snowdrift-civicrm/commit/695dd0384b5d37b97aab674bc30426290dc685d2 It is still happening on the fresh latest Drupal 9.2.6 / CiviCRM 5.4.2 ( tried 5.4.1 and 5.3.5 also ) with scssphp/scssphp:1.6. PHP Version 7.4.23, Apache/2.4.49 (Fedora)

> Compiling additional files (For full details, use verbose "-v" mode.) Compile: Generate CCL wrapper functions @php -r 'require\_once '''/var/www/html/d9/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::template($GLOBALS\[\Civi\CompilePlugin\TaskTransfer::GLOBAL\_VAR\]);' WARNING: Failed to read compilation-task from COMPOSER\_COMPILE\_TASK. Please use "composer compile". Script @php -r 'require\_once '''/var/www/html/d9/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::template($GLOBALS\[\Civi\CompilePlugin\TaskTransfer::GLOBAL\_VAR\]);' handling the shell-runner event returned with error code 255

> Fatal error: Uncaught InvalidArgumentException: Invalid file reference (tpl-file=NULL) in /var/www/html/d9/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php:62 Stack trace: #0 /var/www/html/d9/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php(21): CCL\Tasks\Template::assertFileField() #1 /var/www/html/d9/vendor/civicrm/composer-compile-lib/src/Tasks.php(24): CCL\Tasks\Template::compile() #2 Command line code(1): CCL\Tasks::template() #3 {main} thrown in /var/www/html/d9/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php on line 62 Subcommand @composer compile returned with error code 255 In ComposerPassthru.php line 72: Subcommand @composer compile returned with error code 255

# Answer
It has to do with environment variables. See https://github.com/civicrm/composer-compile-plugin/issues/17
> 1 votes

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


# Question
Title: $cancelSubscriptionUrl in a Contribution Receipt email links to http://%22%22/
A contributor complains it is not possible to remove from the automatic renewal option using a link in "You can cancel the auto-renewal option by visiting this web page." sentence. I've checked and indeed, the link redirects to **http://%22%22/**

Link token `{$cancelSubscriptionUrl}` has been found in **Contributions - Receipt (on-line)** message template.

Underneath link ("You can update billing details for this automatically renewed membership by visiting ...") works fine.

Should this "$cancelSubscriptionUrl" be activates / set up somewhere in CiviCRM admin area? Or the link is being sanitized somehow? Wrong / non-existing token maybe? There is not much about **$cancelSubscriptionUrl** in the civicrm codebase, a few mentions found in email templates only.

WordPress 5.8 and CiviCRM 5.39.0

# Answer
In this case it was "Enable self-service cancellation of a recurring contribution" checkbox on iATS payment settings page.
> 1 votes

# Answer
Could you check if there are any special chars in the base url defined in civicrm.settings.php?
> 1 votes

---
Tags: wordpress, civicontribute, email, contributions, receipts
---


# Question
Title: Increase autocomplete dropdown limit for existing contacts? (webform)
I have a couple of CiviCRM integrated webforms with 'existing contact' enabled, using the autocomplete option. My problem is that the fields only return the first 12 matching records, even when there are more matches.

For example our DB has 27 records with '*University*' in their names. If a user enters '*University*' the dropdown lists the first 12 records (Botswana University; Cambridge University etc). To return 'University of Zululand' users need to enter '*University of Z*', but this isn't obvious to the user

Is it possible to increase the number of existing contact results returned, and if so where?

Alternately has anyone found a different way around the problem e.g. would it be possible to add a "click for more results" at the bottom of the dropdown list?

(We are using Drupal 7.82; Webform 7.x-4.24; Webform CiviCRM Integration 7.x-5.6)

# Answer
> 1 votes
The limit of 12 is hard-coded in the webform\_civicrm module. You can find the line here

https://github.com/colemanw/webform\_civicrm/blob/8276d951fc1ab00e3b6b989fb3f2b594d41ba3a9/includes/contact\_component.inc#L669

The most crude way to change it is to edit the source code. You will lose this change the next time the webform\_civicrm module on the site is updated.

If you are a developer, you can make the limit configurable and submit a PR to the Drupal project.

Or add some instructions for your user, explaining the first twelve results are shown, so it is better to be specific.

---
Tags: webform-civicrm, drupal-7
---


# Question
Title: Heavy performance problem on 5.36 not related to query
I have an heavy problem on my Civicrm instance 5.36 on Wordpress 5.7.1 working in the backend, the time to open a dashobard is more the 20 seconds and every pages have similar time. By example: main empty dashboard take 22,9061s to open, but the query took only 0,3610s (the system cache 95,9% of hit: 6.246 hit, 269 miss). Civicrm is hosted and from cpanel there is no issue: CPU, Memory are used less than 30% Is there a way to analyze the problem?

# Answer
> 1 votes
Assuming you mean shared hosting, it's going to be difficult to analyze, mainly because you have no way of seeing the disk I/O or the database contention.

In my experience, this happens because WordPress because WordPress is bootstrapped with every CiviCRM API request, and some plugins (BuddyPress comes to mind, as does one of the multilingual plugins, I forget which) introduce a significant slowdown.

If you know how to set up a local test site, it would be good to get a baseline - is the problem server-bound, or site-bound? You can also use that to disable all your WP plugins and see how much difference that makes in timing. It's probably down to one or two plugins.

---
Tags: wordpress, performance
---


# Question
Title: Add membership after upgrading to 5.36 error on PriceSet
After upgrading to 5.36, last version, when I try to add membership to an existant contact I received an error

> Deprecated: Non-static method CRM\_Member\_Form::getPriceSetID() should not be called statically in D:\xampp\htdocs\wp-content\uploads\civicrm\custom\_php\CRM\Member\Form\Membership.php on line 672
>
> Fatal error: Uncaught Error: Using $this when not in object context in D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php:460 Stack trace: #0 D:\xampp\htdocs\wp-content\uploads\civicrm\custom\_php\CRM\Member\Form\Membership.php(672): CRM\_Member\_Form::getPriceSetID(Array) #1 D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm.php(1600): CRM\_Member\_Form\_Membership::formRule(Array, Array, Object(CRM\_Member\_Form\_Membership)) #2 D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\Form.php(591): HTML\_QuickForm-\>validate() #3 D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(136): CRM\_Core\_Form-\>validate() #4 D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Core\QuickForm\Action\Upload.php(119): CRM\_Core\_QuickForm\_Action\_Upload-\>realPerform(Object(CRM\_Member\_Form\_Membership), 'upload') #5 D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\packages\HTML\QuickForm\Controller.php(203): CRM\_Core\_QuickForm\_Action\_Upload-\>perform(Object(CRM\_M in D:\xampp\htdocs\wp-content\plugins\civicrm\civicrm\CRM\Member\Form.php on line 460

The system have Wordpress 5.7 and PHP 7.3 It works if I use a PriceSet, but I use the standard membership option

In the Demo site 5.38 it works without any error. I try to set debug mode, but I haven't any other information in the log, just the Wordpress error

I see that there is another error when there a complete payment in a pay later event:

> Notice: Undefined variable: CRM16923AnUnreliableMethodHasBeenUserToDeterminePaymentProcessorFromEvent in /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php on line 2907
>
> Notice: Undefined index: 53 in /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/PaymentProcessor.php on line 232
>
> Warning: Illegal string offset 'contribution' in /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php on line 4382
>
> Warning: Attempt to assign property 'total\_amount' of non-object in /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php on line 2617
>
> Notice: Undefined index: contribution\_recur\_id in /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php on line 2634
>
> Fatal error: Uncaught TypeError: Argument 1 passed to CRM\_Contribute\_BAO\_ContributionRecur::getTemplateContribution() must be of the type int, null given, called in /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php on line 2636 and defined in /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php:419 Stack trace: #0 /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php(2636): CRM\_Contribute\_BAO\_ContributionRecur::getTemplateContribution(NULL, Array) #1 /home/gragorg/public\_html/wp-content/uploads/civicrm/custom\_php/CRM/Contribute/BAO/Contribution.php(4435): CRM\_Contribute\_BAO\_Contribution::repeatTransaction('7', Array, Array) #2 /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(688): CRM\_Contribute\_BAO\_Contribution::completeOrder(Array, NULL, NULL, true) #3 /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php(502): in /home/gragorg/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php on line 419

I have some doubt about price set values in the DB  it seems that there is same record that I don't found the in the interface and the one I see I can't remove because the system tell me that is related to a member or event page. The id 14 in the price\_set\_entity table is related to the membership page, but I don't find any way to remove this relation.

# Answer
> 0 votes
I solved with the patch 5.36.1

# Answer
> 1 votes
The backtrace is incomplete, but there's enough to see what's happening.

Someone has customized the code of this site with an "override" - note the line in the backtrace that mentions the file: `/home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php`. Overrides are an older technique for customization before extensions existed, and are no longer recommended because of the exact issue you're seeing.

At some point, someone changed a few lines of code in this file:

```
/home/gragorg/public_html/wp-content/plugins/civicrm/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php

```

Since every upgrade would overwrite that file, they made a copy here:

```
/home/gragorg/public_html/wp-content/uploads/civicrm/custom_php/CRM/Contribute/BAO/Contribution.php

```

This means the customization isn't overwritten with every upgrade - but if you don't keep that file up to date, you'll eventually run into a place where the old code no longer works with a newer version.

Because custom code is custom, I can't give a solid recommendation of how to resolve this - but if you have a way of finding out why a customization was introduced, it may not be necessary anymore, and you can delete the override file.

Note that if you have one override file, you might have others - and each one represents a similar time bomb. I recommend allocating some time to removing these customizations and/or reimplementing them in extensions.

# Answer
> 0 votes
This code changed relatively recently, but I can't see how this error would occur without an extension doing something mildly naughty.

I recommend doing the following and updating your question to reflect the results:

* Turn on backtraces and replicate the error. You should get more detail. Post the backtrace as part of your question. It will help identify a misbehaving extension.
* You can also try replicating the problem on the demo site to see if it's a problem specific to your site. If you can replicate it on the demo site, that will get this escalated very quickly.

---
Tags: civimember
---


# Question
Title: Upgrade from 5.20.0 to 5.41.2 (Wordpress)
Our organizations site is running Wordpress 4.9.18 and we are running with CiviCRM 5.20.0. Can I upgrade from CiviCRM 5.20.0 directly to the latest 5.41.2 or do I need to upgrade to one or more interim versions to get to 5.41.2?

If I need interim upgrades, what would those versions be and do I need to upgrade Wordpress along the way?

# Answer
I think you should be able to do it in one go, but you should definitely clone the server and do a test upgrade first particularly with that many versions (and of course back everything up first before doing the upgrade of the live site). I don't think you need to upgrade WordPress, but personally I would do this to the latest version immediately before or after.

Something I would check is the version of MySQL as I got caught out by that and version 5.7.5 is recommended. Version 5.6 needed setting changes that I couldn't make on my shareed hosting service, but 5.7 had the necessary settings by default.

Worth a look at the installation requirements at https://docs.civicrm.org/installation/en/latest/general/requirements/
> 3 votes

# Answer
Our advice would be to try a full upgrade on a test/staging site first. This is the only way you'll be sure. Remember you'll need to upgrade extensions too as thats approx 21 months of upgrade being applied.

If a full upgrade fails then you can try it in parts i.e. going to 5.30.x first then up to the latest etc.
> 2 votes

---
Tags: wordpress, upgrade
---


# Question
Title: Contact Logging Report crash - the table is full
I try to run Contact Logging Report, but I get an error message about there are no data in the logging table (Detailed logging is enabled, in the MySQL tables there are a lot of data, and on the Contact's Activity log tab I can see a lot of entries). The CiviCRM Log Viewer extension gives the following error:

```
[info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT IGNORE INTO civicrm_temp_civireport_logsummary SELECT entity_log_civireport.id as log_civicrm_entity_id, 1, entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM `c5civicrm_crm`.log_civicrm_contact entity_log_civireport

INNER JOIN civicrm_contact modified_contact_civireport
        ON (entity_log_civireport.id = modified_contact_civireport.id )
LEFT  JOIN civicrm_contact altered_by_contact_civireport
        ON (entity_log_civireport.log_user_id = altered_by_contact_civireport.id) WHERE ( 1 )  AND (entity_log_civireport.log_action != 'Initialization') GROUP BY entity_log_civireport.log_conn_id, entity_log_civireport.log_user_id, EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date), entity_log_civireport.id  ORDER BY entity_log_civireport.log_date DESC  [nativecode=1114 ** The table 'civicrm_temp_civireport_logsummary' is full]
    [type] => DB_Error
    [user_info] => INSERT IGNORE INTO civicrm_temp_civireport_logsummary SELECT entity_log_civireport.id as log_civicrm_entity_id, 1, entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM `c5civicrm_crm`.log_civicrm_contact entity_log_civireport

INNER JOIN civicrm_contact modified_contact_civireport
        ON (entity_log_civireport.id = modified_contact_civireport.id )
LEFT  JOIN civicrm_contact altered_by_contact_civireport
        ON (entity_log_civireport.log_user_id = altered_by_contact_civireport.id) WHERE ( 1 )  AND (entity_log_civireport.log_action != 'Initialization') GROUP BY entity_log_civireport.log_conn_id, entity_log_civireport.log_user_id, EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date), entity_log_civireport.id  ORDER BY entity_log_civireport.log_date DESC  [nativecode=1114 ** The table 'civicrm_temp_civireport_logsummary' is full]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT IGNORE INTO civicrm_temp_civireport_logsummary SELECT entity_log_civireport.id as log_civicrm_entity_id, 1, entity_log_civireport.log_action as log_civicrm_entity_log_action, 'log_civicrm_contact' as log_civicrm_entity_log_type, entity_log_civireport.log_user_id as log_civicrm_entity_log_user_id, entity_log_civireport.log_date as log_civicrm_entity_log_date, modified_contact_civireport.display_name as log_civicrm_entity_altered_contact, modified_contact_civireport.id as log_civicrm_entity_altered_contact_id, entity_log_civireport.log_conn_id as log_civicrm_entity_log_conn_id, modified_contact_civireport.is_deleted as log_civicrm_entity_is_deleted, altered_by_contact_civireport.display_name as altered_by_contact_display_name
FROM `c5civicrm_crm`.log_civicrm_contact entity_log_civireport

INNER JOIN civicrm_contact modified_contact_civireport
        ON (entity_log_civireport.id = modified_contact_civireport.id )
LEFT  JOIN civicrm_contact altered_by_contact_civireport
        ON (entity_log_civireport.log_user_id = altered_by_contact_civireport.id) WHERE ( 1 )  AND (entity_log_civireport.log_action != 'Initialization') GROUP BY entity_log_civireport.log_conn_id, entity_log_civireport.log_user_id, EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date), entity_log_civireport.id  ORDER BY entity_log_civireport.log_date DESC  [nativecode=1114 ** The table 'civicrm_temp_civireport_logsummary' is full]"]
)

```

What's wrong?

# Answer
> 2 votes
I encountered this today, and it was because my maximum temp table size in MySQL was set too low. The solution I found (https://stackoverflow.com/a/27830218/2832108) was to edit my `/etc/my.cnf` to increase the values of `tmp_table_size` and `max_heap_table_size`. Assuming you're using `innodb_table_per_file` (and if you aren't you should!) this is likely your problem (unless you ran out of space in your temp directory, in which case that's your problem).

# Answer
> 2 votes
Your message says this several times:

```
[nativecode=1114 ** The table 'civicrm_temp_civireport_logsummary' is full]

```

See https://dev.mysql.com/doc/refman/5.6/en/server-error-reference.html#error\_er\_record\_file\_full

---
Tags: reports, db-logging
---


# Question
Title: Installing on Drupal 9 - compilation failures and resource url problems (may be related)
I got D9 installed, then set about installing Civi with `composer.phar require -W civicrm/civicrm-{core,packages,drupal-8}:'=5.36'` (I want to use 5.36, if possible)

Things seemed to go OK except the compile stage which crashed. I ran again and chose No to compile and it looked to have installed CiviCRM. I'm able to see CiviCRM in the shortcut links, and I can sort of access some CiviCRM pages. But most of the resources are 404-ing (the ones whose URLs start with `/libraries/...`)

I have done `drush cache-rebuild` and `cv flush` \- no errors. I have removed `templates_c/en_GB` manually.

So I thought maybe it was that broken compile step that caused the problem. I went back and ran `composer.phar compile`

> The following packages have new compilation tasks:
>
> * civicrm/composer-compile-lib has 1 task
> * civicrm/civicrm-core has 1 task
>
> Allow these packages to compile? (\[y\]es, \[a\]lways, \[n\]o, \[l\]ist,
> \[h\]elp) a Compiling additional files (For full details, use verbose "-v" mode.)
> Compile: Generate CCL wrapper functions Compile: Greenwich
> CSS (dist/bootstrap3.css) DEPRECATION WARNING: Calling built-in
> functions with a non-standard name is deprecated since Scssphp 1.8.0
> and will not work anymore in 2.0 (they will be treated as CSS function
> calls instead). Use "fade-in" instead of "fadein".
> on line 569 of scss/\_greenwich.scss
>
> Fatal error: Uncaught ScssPhp\ScssPhp\Exception\SassScriptException:
> $amount: Expected 5% to be within 0% and 1% in
> /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Exception/SassScriptException.php:30
> Stack trace:
> #0 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Node/Number.php(269):
> ScssPhp\ScssPhp\Exception\SassScriptException::forArgument()
> #1 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(8484):
> ScssPhp\ScssPhp\Node\Number-\>valueInRange()
> #2 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(8493):
> ScssPhp\ScssPhp\Compiler-\>libOpacify()
> #3 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(6227):
> ScssPhp\ScssPhp\Compiler-\>libFadeIn()
> #4 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(3662):
> ScssPhp\ScssPhp\Compiler-\>callNativeFunction()
> #5 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(3588):
> ScssPhp\ScssPhp\Compiler-\>fncall()
> #6 /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php(2928):
> ScssPhp\Scss in
> /var/www/d9.artfulrobot.uk/vendor/scssphp/scssphp/src/Compiler.php on
> line 553
> @php -r 'require\_once '''/var/www/d9.artfulrobot.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('''../../bower\_components/select2/select2-bootstrap.css''', '''extern/select2/select2-bootstrap.scss''');'
> @php -r 'require\_once '''/var/www/d9.artfulrobot.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS\[\Civi\CompilePlugin\TaskTransfer::GLOBAL\_VAR\]);'
> Script @php -r 'require\_once '''/var/www/d9.artfulrobot.uk/vendor/autoload.php'''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS\[\Civi\CompilePlugin\TaskTransfer::GLOBAL\_VAR\]);' handling the shell-runner event returned with error code 255

I imagine "Expected 5% to be within 0% and 1% in" is the problem somehow.

I don't believe that this is a duplicate of

I'm on PHP 7.4, MariaDB 10.3, nginx and docker. Composer 2.0.9. Drupal 9.2.6 The D9 site has some content brought in via a migration from D7; but I think just nodes and users. The reason I wanted 5.36 is because ultimately I want to learn how to upgrade a site from d7 to d9 and that site is on 5.36. I don't want to upgrade the d7 site to 5.39+ because there are bugs in core from 5.39 that I want to avoid ;-)

Oh I seem to have fixed the missing `/libraries/...` URLs by running `composer.phar civicrm:publish`.

Still interested in getting the compile working.

# Answer
The compile fix was only backported to 5.41. If you want 5.36 you need to also require scssphp 1.6 as a workaround.

https://lab.civicrm.org/dev/drupal/-/issues/164

```
composer.phar require scssphp/scssphp=1.6
composer.phar compile

```
> 2 votes

---
Tags: installation, drupal-9
---


# Question
Title: Error when importing contacts - "Warning: Illegal string offset 'code'"
After importing a CSV of contacts, I'm getting a blank screen with the error message below. Typically, I get a report of how many contacts were skipped due to duplicates. It appears the data is being imported though this makes me nervous to import a larger data set. Any ideas whats happening?

Warning: Illegal string offset 'code' in /home/DOMAINNAME/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 1019

Warning: Cannot modify header information - headers already sent by (output started at /home/DOMAINNAME/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php:1019) in /home/DOMAINNAME/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 987

# Answer
> 0 votes
TL;DR: Warnings are signs that something's not quite right, but are also *usually* ignorable.

Here it looks to me like any of the following might possibly be happening:

* There's a bug in core or in an extension or some custom code that's generating an error described by an array, where it should be using a string. It looks like the function `CRM_Core_Error::isAPIError()` allows the error to be either a string, or a special case for receiving errors from the API where the error var must be an array with a key of `'code'` which is missing in your case, hence the error.
* There is some debugging code in place which is generating output when it shouldn't (sometimes in development people might resort to "print 'what is going on here, then? Here is some data to help me figure it out...'" type code - this should never end up on production sites.
* You have XDEBUG enabled and it is the version that contains a known bug whereby it outputs *something* such that the web server thinks that the headers are sent already, so new headers can't then be added.

This probably can't be debugged in a public forum, without the actual data and environment. You could experiment with different data sets to see if it *always* happens - e.g. try importing a single row of clean-looking data, does that generate the error? If so, try importing a reduced number of columns, does that still generate the error? This way you can find if there's some specific thing that's causing the problem, which will help pinpoint the real issue.

If you have the requisite skills (or, failing that, a maveric attitude), you could try editing your `civicrm/CRM/Core/Error.php` file around line 1017 as follows...

I assume it currently looks like:

```
public static function isAPIError($error, $type = CRM_Core_Error::FATAL_ERROR) {
  if (is_array($error) && !empty($error['is_error'])) {
    $code = $error['error_message']['code'];
    if ($code == $type) {
      return TRUE;
    }
  }
  return FALSE;
}

```

You could replace that with

```
public static function isAPIError($error, $type = CRM_Core_Error::FATAL_ERROR) {
  if (is_array($error) && !empty($error['is_error'])) {
    $code = $error['error_message']['code'] ?? NULL;
    if ($code === NULL) {
      try { throw new \Exception(); }
      catch (\Exception $e) {
        Civi::log()->error("Caught invalid error parameter: " . json_encode($error) . "\n" . $e->getTraceAsString());
      }
      return FALSE;
    }
    if ($code == $type) {
      return TRUE;
    }
  }
  return FALSE;
}

```

This will mean

1. You won't see the error messages any more. (at least not the first one)
2. Where the error messages would have been seen at the browser, they will now be in your CiviCRM log file, which will show exactly what the offending data was, and possibly which code is causing it. This information could be passed to a developer for further investigation.

Do note though, that editing code files is **risky** \- can completely crash your site - so you **absolutely must make a backup of the original code file before changing it** and ideally you'd do this on an offline development version; ideally you'd be a developer :-)

---
Tags: import, php, data-import
---


# Question
Title: Again membership_id error in manual membership
After upgrading to 5.41.2 on Wordpress 5.8.1 I still have the problem with manual add a new member.

```
ott 04 14:42:55  [error]
$Fatal Error Details = array:3 [
  "message" => "Mandatory key(s) missing from params array: membership_id"
  "code" => null
  "exception" => CiviCRM_API3_Exception {#29193
    -extraParams: array:6 [
      "fields" => array:1 [
        0 => "membership_id"
      ]
      "error_code" => "mandatory_missing"
      "entity" => "MembershipPayment"
      "action" => "create"
      "is_error" => 1
      "error_message" => "Mandatory key(s) missing from params array: membership_id"
    ]
    #message: "Mandatory key(s) missing from params array: membership_id"
    #code: 0
    #file: "/home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/api/api.php"
    #line: 134
    trace: {
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/api/api.php:134 {
        › if (is_array($result) && !empty($result['is_error'])) {
        ›   throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
        › }
      }
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php:2512 { …}
      /home/gragorg/staging.grag.org/wp-content/uploads/civicrm/custom_php/CRM/Member/Form/Membership.php:1324 { …}
      /home/gragorg/staging.grag.org/wp-content/uploads/civicrm/custom_php/CRM/Member/Form/Membership.php:881 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php:526 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:152 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php:119 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php:352 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php:314 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Member/Page/Tab.php:384 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:313 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36 { …}
      /home/gragorg/staging.grag.org/wp-content/plugins/civicrm/civicrm.php:1178 { …}
      /home/gragorg/staging.grag.org/wp-includes/class-wp-hook.php:292 { …}
      /home/gragorg/staging.grag.org/wp-includes/class-wp-hook.php:316 { …}
      /home/gragorg/staging.grag.org/wp-includes/plugin.php:484 { …}
      /home/gragorg/staging.grag.org/wp-admin/admin.php:259 { …}
    }
  }
]

```

The custom php is not relevant: the problem is identical with original file (the custom is very simple and very localized) I do more investigation and for me it is strange is the variable is not set and the https://lab.civicrm.org/dev/core/-/issues/2431 I understand that the problem is related to the form which pass the data. I have printed the values:

```
ott 04 15:43:46  [info] $$this->_params = Array
(
    [hidden_custom] => 1
    [hidden_custom_group_count] => Array
        (
            [] => 1
        )

    [qfKey] => CRMMemberFormMembership2dowfisuhgsgcs4wo0c4kw08occ0wswo0c0swcw00cc0kc8gkg_9712
    [entryURL] => https://staging.grag.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fmember%2Fadd&page=CiviCRM&reset=1&action=add&context=standalone
    [join_date] => 2021-10-04
    [start_date] =>
    [end_date] =>
    [price_set_id] =>
    [contact_id] => 798
    [max_related] =>
    [membership_type_id] => Array
        (
            [0] => 1
            [1] => 2
        )

    [num_terms] => 1
    [source] =>
    [campaign_id] =>
    [status_id] =>
    [is_override] =>
    [status_override_end_date] =>
    [record_contribution] => 1
    [total_amount] => 30,00
    [receive_date] => 2021-10-04 15:43:00
    [payment_instrument_id] => 5
    [trxn_id] =>
    [contribution_status_id] => 1
    [financial_type_id] => 2
    [soft_credit_type_id] =>
    [soft_credit_contact_id] =>
    [from_email_address] => 2
    [receipt_text] =>
    [MAX_FILE_SIZE] => 1073741824
    [discountcode] =>
)

ott 04 15:43:46  [info] $this->_mode is not set

ott 04 15:43:46  [info] $$params = Array
(
    [tax_amount] => 0
    [total_amount] => 30.00
    [contact_id] => 798
    [status_id] =>
    [source] =>
    [is_override] => 0
    [status_override_end_date] =>
    [campaign_id] =>
    [custom] => Array
        (
        )

    [exclude_is_admin] => 1
    [contribution_recur_id] =>
    [payment_instrument_id] => 5
    [trxn_id] =>
    [contribution_status_id] => 1
    [check_number] =>
    [receive_date] => 2021-10-04 15:43:00
    [card_type_id] =>
    [pan_truncation] =>
    [financial_type_id] => 2
    [contribution_source] => Ordinario Iscrizione: Registrazione Offline (di Giorgio Mazzacurati)
    [lineItems] => Array
        (
            [2] => Array
                (
                )

        )

    [processPriceSet] => 1
)

```

But doesn't see any membership\_id, could you help to solve the problem and set this value?

# Answer
After a long debug analysis I understand that the problem is related to missing linenumber associated to the membership type. I solved saving every records with a price without . (Maybe it is enough to save)
> 0 votes

---
Tags: civimember
---


# Question
Title: Errors involving /wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php
Whenever I try to install/uninstall CiviCRM extensions or run Cleanup Cache, I consistently receive this error:

> Warning: require(/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/templates\_c/CachedExtLoader.8fc40bba39c0b8bd10ea54175cf9a6b3.php): failed to open stream: No such file or directory in /home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php on line 70
>
> Fatal error: require(): Failed opening required '/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/templates\_c/CachedExtLoader.8fc40bba39c0b8bd10ea54175cf9a6b3.php' (include\_path='/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/ext/org.civicoop.pdfapi/:/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/ext/org.civicoop.civirules/:/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/ext/org.civicrm.volunteer/:/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/ext/org.civicrm.angularprofiles/:.:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/packages:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear\_exception:/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/vendor/pear/auth\_sasl:/home/xxxxxxxx/public\_html/wp-content in /home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php on line 70
>
> There has been a critical error on your website. Please check your site admin email inbox for instructions.

civicrm.settings.php seems fine:

> global $civicrm\_root;
>
> $civicrm\_root = '/home/xxxxxxxx/public\_html/wp-content/plugins/civicrm/civicrm/'; if (!defined('CIVICRM\_TEMPLATE\_COMPILEDIR')) { define( 'CIVICRM\_TEMPLATE\_COMPILEDIR', '/home/xxxxxxxx/public\_html/wp-content/uploads/civicrm/templates\_c/');

Wordpress 5.3.2 CiviCRM 5.22.0 PHP 7.3

The email sent by the system had almost the same message:

> Error Details ============= An error of type E\_COMPILE\_ERROR was caused in line 70 of the file /home/nkxwvwvr/public\_html/staging02/wp-content/plugins/civicrm/civicrm/CRM/Extension/ClassLoader.php. Error message: require(): Failed opening required '/home/xxxxxxxx/public\_html/staging02/wp-content/uploads/civicrm/templates\_c/CachedExtLoader.697f143a9f2872e12a14e35583756c82.php' (include\_path='.:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/packages:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/tecnickcom:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/phpseclib/phpseclib/phpseclib:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/pear/pear\_exception:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/pear/auth\_sasl:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/pear/log:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/pear/console\_getopt:/home/xxxxxxxx/public\_html/staging02/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src:/ho

# Answer
The hosting company sent me this instruction. It worked, and I'm back in business!

> "You need to add this in your .htaccess file to avoid problem, it is caching related:"
> `php_flag opcache.enable Off`
> 1 votes

# Answer
I've been tearing my hair out on this one, attempting a clean CiviCRM install

Same error as above, during install. Clearly something to do with the database, as the install ran for a minute, and produced the error, but no tables were ever written to the database.

I know all requirements are met, as we already have two other running copies of CiviCRM on the same server.

My fix, for what it's worth, was to locate a copy of CiviCrm 5.28 (yeah, I had a very old backup lying around), install that, and then upgrade! Still have no idea what the cause was, but at least now I have a clean install of Civi running.

Ubuntu Server 18.04 MYSQL 5.7.35 PHP 7.4 Attempted install - CiviCRM 5.41.2 on Wordpress 5.8.1

Might help someone (might not)
> 0 votes

---
Tags: wordpress, extension, cache
---


# Question
Title: Sharing access to a search kit display table with non-admin user
I need to share search kit display tables with Civi users who are not at the admin level. These users have access to view all the contacts in the search, and all tables relevant to the search. I'm using WordPress.

I'm not sure if I'm missing something (is there a better way to share a display table than viewing it and copying the url?) or misunderstanding the Enforce Permissions/Bypass Permissions button.

When I have it set to Bypass Permissions, the help text says "Anyone who can view this display will be able to see all results, regardless of their permission level." But that doesn't seem to be true; when the non-admin users try to access the link, no table appears (not even headers). (And, for some reason I'm not sure about, even for me as an admin the name of the display is grayed-out and unclickable from the main search kit Saved Searches page with the help text "Display has permissions disabled")

When I have the display table set to Enforce Permissions, the non-admin users have the same result; no visible table. This may be expected, since the help text for Enforce Permissions says "Only users with 'All CiviCRM permissions and ACLs' can disable permissions checks" and the users in question do not have that permission.

A workaround would be, rather than using the display tables, just give the user access to Search Kit and let them access the search itself. But I cannot see any way to give access to Search Kit to users.

Any help would be much appreciated!

# Answer
> 4 votes
Alright, in case this is useful for anyone else -- it looks like the answer was that I needed to be embedding my Search Kit search into Form Builder rather than just the using the Search Kit displays.

I found more info on how to do that, with lots of detail about the permissions pieces, in this SearchKit Demo Video: https://www.youtube.com/watch?v=eQ0MEagAdqA (mostly around the 17 to 25 minute mark)

---
Tags: permissions, searchkit
---


# Question
Title: drush error message: CiviCRM: System: Please specify a realistic site URL (Ex: drush -l http://example.com:456 ...)
After upgrading Drupal from 8.9 to 9.2 for several weeks I always get following error message when I use the command

```
drush upgradedb

CiviCRM: System: Please specify a realistic site URL (Ex: drush -l  http://example.com:456 ...)

```

When I ignore this message I can execute the upgradedb-command, but I still don't know whether this message points to some important information. I have no idea where I should specify the url.

Has anybody any idea?

# Answer
You need to specify it in the command, e.g.

`drush -l https://my-site.org upgradedb`

For upgradedb it shouldn't be too important, but for example for a command that sends out emails with links it would have `http://default/` in them instead of your real site.
> 1 votes

---
Tags: drupal, drush
---


title: Smarty syntax error: unrecognized tag?

text:
# Question
Title: Smarty syntax error: unrecognized tag?
Does anyone know how I may resolve this issue? I'm running CiviCRM 5.40.0 on WordPress 5.8.1. When I tried to create a new / update contact record, it will throw a PHP Fatal error with the following log:

```
[Tue Oct 05 21:39:31.389811 2021] [proxy_fcgi:error] [pid 2091:tid 140391877703424] [client 172.68.133.85:0] AH01071: Got error 'PHP message: PHP Fatal error:  Smarty error: [in evaluated template line 1]: syntax error: unrecognized tag: , (Smarty_Compiler.class.php, line 441) in /webhost-file-path/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1100', referer: website-address/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fview&reset=1&cid=43

[Tue Oct 05 21:44:40.311374 2021] [proxy_fcgi:error] [pid 2090:tid 140392439719680] [client 162.158.255.225:0] AH01071: Got error 'PHP message: PHP Fatal error:  Smarty error: [in evaluated template line 1]: syntax error: unrecognized tag: , (Smarty_Compiler.class.php, line 441) in /webhost-file-path/wp.sfcp.org/wp-content/plugins/civicrm/civicrm/packages/Smarty/Smarty.class.php on line 1100', referer: website/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fadd&reset=1&ct=Individual

```

Does anyone know what the above log means? I'm looking at the smarty.php file, and line 441 is:

```
/**
 * where assigned template vars are kept
 *
 * @var array
 */
var $_tpl_vars             = array();

```

except that I have no idea what the assigned template variable is. It will be greatly appreciated if anyone would point me in the right direction on how to resolve the issue. Thanks!

# Answer
> 4 votes
Nevermind. I've looked through all of the settings, and it turns out that my colleagues modified the Addresses format but didn't do it correctly. Once this is fixed, everything is back to normal now. Thanks.

---
Tags: error, smarty
---


# Question
Title: Easy way for a user to resubmit a webform
My users are clicking on an emailed link from CiviCRM to complete a webform, which when completed and submitted adds contacts to CiviCRM. I'd like them to be able to have an easy way of submitting the webform again without having to go back to the email, find the link and start over. This is because they are submitting details of one household per webform, and may have (say) 6 household they want to submit. I'm thinking that after submission they simply go back to the start of the webform - the problem is that to do that I'd need the url they clicked on, which has a couple of contact parameters in it. I can't find that in the tokens that are available, unfortunately. (moved from Drupal Answers)

# Answer
If you are using a checksum from civimail, then I believe we have managed to 'daisy-chain' forms by enabling the checksum field and contact ID on form 1, and then use those as tokens in the path used after the submission so that info is passed through to form2 etc

EDIT I see my memory was slightly incorrect. Rather than putting the tokens in the Redirection field, we put them in an email and sent that to the person so they could jump to the next form eg

/node/xx?cid1=\[submission:values:civicrm\_1\_contact\_1\_fieldset\_fieldset:civicrm\_1\_contact\_1\_contact\_contact\_id:nolabel\]&cs1=\[submission:values:civicrm\_1\_contact\_1\_fieldset\_fieldset:civicrm\_1\_contact\_1\_contact\_cs:nolabel\]
> 2 votes

---
Tags: webform-civicrm
---


# Question
Title: Could not find valid value for id for event thankyou
after registering for an even using **PayPal - Website Payments Standard** (with the CiviCore processor) the transaction worked and email was fired but the user sees this instead of the thank you page. this is the visible error: `Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. Could not find valid value for id`

using CiviCRM 5.41.2 on top of Wordpress 5.8.1 the line in question seems to be:

```
$is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'is_monetary');

```

$id is defined:

```
$id = CRM_Utils_Request::retrieve('id', 'Positive', $controller, TRUE);

```

stack:

```
Exception trace
#   Function    Location
0   CRM_Utils_Request::retrieve('id', 'Positive', Object(CRM_Event_Controller_Registration), true)  /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Event/StateMachine/Registration.php:27
1   CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), true)   /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Event/Controller/Registration.php:27
2   CRM_Event_Controller_Registration->__construct('Event Registrati…', true, 'null', null, 'false')    /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:308
3   CRM_Core_Invoke::runItem(Array) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
4   CRM_Core_Invoke::_invoke(Array) /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
5   CRM_Core_Invoke::invoke(Array)  /var/www/html/wp-content/plugins/civicrm/civicrm.php:1178
6   CiviCRM_For_WordPress->invoke() /var/www/html/wp-content/plugins/civicrm/includes/civicrm.basepage.php:354
7   CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))    /var/www/html/wp-includes/class-wp-hook.php:303
8   WP_Hook->apply_filters(null, Array) /var/www/html/wp-includes/class-wp-hook.php:327
9   WP_Hook->do_action(Array)   /var/www/html/wp-includes/plugin.php:518
10  do_action_ref_array('wp', Array)    /var/www/html/wp-includes/class-wp.php:763
11  WP->main('')    /var/www/html/wp-includes/functions.php:1291
12  wp()    /var/www/html/wp-blog-header.php:16
13  require('/var/www/html/wp…')    /var/www/html/index.php:17
14  {main}
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
Could not find valid value for id

Return to home page.

```

logs: https://paste.ubuntu.com/p/fVWgvKK4cc/

the link after registartion/paypal looks like https://example.org/civicrm/event/register?\_qf\_ThankYou\_display=1&qfKey=CRMEventControllerRegistrationNUMBERSANDLETTERS\_NUMBERS&PayerID=NUMBERSANDLETTERS

the **Test-drive** works as expected. Example Link that works in test drive: https://example.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fevent%2Fregister&\_qf\_ThankYou\_display=1&qfKey=CRMEventControllerRegistrationNUMBERSANDLETTERS\_NUMBERS&PayerID=NUMBERSANDLETTERS I'm not sure where to go from here.

More logs!!! "ID is:" after each conditional in retrieve -\> CRM/Utils/Request.php
and more before the throw.

```
      error_log("_SESSION is: " . print_R($_SESSION, true));
      error_log("_GET is: " . print_R($_GET, true));
      error_log("_POST is: " . print_R($_POST, true));
      error_log("_REQUEST is: " . print_R($_REQUEST, true));
      error_log("_SERVER is: " . print_R($_SERVER, true));
      error_log("ID is: " . print_R($value, true));

```

https://paste.ubuntu.com/p/sKd2Qkxknc/

# Answer
> 0 votes
It turns out adding a '/' at the end of the Permalink Settings was made it work. I'm not sure how this ever worked. From

```
/%category%/%post_id%/%postname%

```

To

```
/%category%/%post_id%/%postname%/

```

https://mysite.org/wp-admin/options-permalink.php

---
Tags: civievent, paypal
---


# Question
Title: Advanced search only country united states
I am trying to do an advanced search but in country only United States appears. I have records with different countries. Thanks

# Answer
Go to: Administer \> Configure \> Global Settings \> Localization and leave the country field blank on the right for it to show them all https://docs.civicrm.org/user/en/latest/the-civicrm-community/localising-civicrm/
> 1 votes

# Answer
Go to: Administer \> Configure \> Global Settings \> Localization and make sure you have other countries selected in "Available Countries"
> 1 votes

---
Tags: advanced-search
---


title: Sending CiviCRM outgoing SMS on a case

text:
# Question
Title: Sending CiviCRM outgoing SMS on a case
It doesn't appear that CiviCRM can send an outbound SMS via an activity on a case. The outbound SMS activity shows as a normal activity, rather than the send SMS screen. Is this normal / expected behaviour and are there work arounds to support SMS on a case?

# Answer
> 3 votes
It's probably just never come up. There is special handling in the code for Email to make that work. It would need something similar.

However, by somewhat of a fluke, you can use the subject line feature for activities to send a regular SMS the normal way and have it filed on a case. Where it says "Name the SMS", include `[case #1234]` somewhere in that field, where 1234 is the appropriate case id. Then it will file it on the case.

---
Tags: civicase, sms
---


# Question
Title: Extension Download error public extensions directory
Hi this message has started appearing on our CIVI CRM system over the last couple of days - it is intermittent and not there all of the time. Any advice on this would be much appreciated. Thank you Helen.

EXTENSION DOWNLOAD ERROR The CiviCRM public extensions directory at https://civicrm.org/extdir/ver=5.41.1|cms=Drupal could not be contacted - please check your webserver can make external HTTP requests or contact CiviCRM team on CiviCRM forum.

# Answer
> 0 votes
There is a folder in to which extensions can be downloaded to be used on your site. Some server administrators, us included, prefer to not have any folder 'publically available' for security reasons.

The downsides for the site user is they cannot just grab another extension to try out. The upside is we do not have part of our system potentially vulnerable.

I am not sure if this is the issue you are describing. If you go to civicrm/a/#/status on your site, do you have an error like

> Read-Only Extensions: Your extensions directory (//civicrm/extensions) is read-only. If you would like to perform downloads or upgrades, then change the file permissions.

# Answer
> 0 votes
Thanks Pete for looking up those chat links. I think this is probably the LetsEncrypt issue that's been coming up since Oct 1. https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

You likely need to update something on the server. Unfortunately exactly what needs updating seems to vary based on the hosting and several factors.

---
Tags: extension
---


title: Theme for Civicrm / WordPress?

text:
# Question
Title: Theme for Civicrm / WordPress?
Old question I am aware. Any new answers?

Latest WordPress and CiviCRM installed. So I'm reading that picking a theme that is mostly CSS and little JS is the way to go with compatibility in mind for CiviCRM. Any rising stars out there?

# Answer
I wouldn't know whether it is a rising star or not, but we have had consistently good results with Spacious.
> 0 votes

---
Tags: wordpress, css, theme
---


# Question
Title: Caldera Forms + CiviCRM + Payment Processors
Hi I'm new with WP + CiviCRM and I would like to integrate WP forms + Civi + payment processors, I see that Caldera was the option, but now that it will no longer be available, do I have to wait for Ninja Forms? I have tried Caldera but it doesn't let me integrate any payment gateway, it seems that they are independent addons that are no longer available for new users. Any suggestions? thanks

# Answer
Cesar, we have been using Caldera + PaypalPro addon \+ Civicrm for a long while and it has been very solid so I am sorry to see it phased out. The new owners seem committed to work with Civicrm - see the update at the bottom of this post. They have released a conversion tool and have a Civicrm addon in development, and expect to have it done by the end of 2021. So to answer your question, it does look like the future is with Ninja forms, but at the moment we are stuck with no alternatives for new WP users.
> 1 votes

---
Tags: wordpress, caldera-forms
---


# Question
Title: contact report with custom field as section heading
I have a custom field, "Location" with 10 values. There are a variable number of Mentors at each location. I'm trying to get a report that, for each location, has Location as section heading, following by the number of Mentors at that location and then a list of those Mentors.

If I do not choose the Location as a column in the report, my first section heading is Location: 1 (16).

If I select Location as a column, I get Location: Miami (). Plus I have a column repeating the value "Miami" which is not useful.

The section heading I want is: Location: Miami (16)

Is there a simple way to accomplish this or does it require code?

# Answer
There was https://github.com/civicrm/civicrm-core/pull/20752 but I don't think it fully fixed it everywhere, so the short answer is it might require some code. But maybe the fix and discussion there will give some pointers.
> 0 votes

---
Tags: reports, custom-reports
---


title: CiviCRM Spark - managing bounces

text:
# Question
Title: CiviCRM Spark - managing bounces
I have the basic CiviCRM Spark installation, and am planning to use it to send out bulk emails to about 1200 recipients. How do I set up Spark to track bounces? The extension "Fetch Bounces" under System Settings is greyed out and I'm not able to enable it. The service advertises that bounce tracking is possible, but I'm not finding any Spark specific user guidance.

# Answer
> 1 votes
CiviCRM Spark uses a third-party provider for email delivery. This ensures that we have working bounce processing for the emails being sent, and also that we receive spam complaints (when people click "this is spam", it sends a notification to the hosting provider, but not as a typical bounce).

Until recently CiviCRM Spark had a different setup and we had been in the middle of migrating to the new provider (currently Sparkpost, the similar name is just a coincidence). The setup is now being rolled out.

Therefore, it is not necessary to setup the bounce processing job. Sparkpost notifies us about bounces and spam using a different mechanism (webhooks), which is automatically setup on CiviCRM Spark.

There is a catch: to comply with anti-spam best practices, we can only send domains using a domain that has been validated (technically: a domain with the correct DKIM key on the DNS). Since CiviCRM Spark aims to be a low-cost and easy to use service, we currently only support emails sent from `@notification.civimail.org`. There is more information about this now displayed in the page about the "From Email Addresses".

Until now, CiviCRM Spark had a default configuration, but did not enforce which domains were used. This often meant that emails were being sent, but the recipient's email providers often classified the emails as spam.

---
Tags: civimail, civicrm-spark
---


# Question
Title: cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings
From 1st of October ,we start getting following error, before that it was working fine...

We are on Drupal 9, CiviCRM 5.33.5 version.

Issue is with Paypal Pro.

```
Oct 04 18:55:19  [error]
$Fatal Error Details = array:3 [
  "message" => "cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  "code" => null
  "exception" => GuzzleHttp\Exception\RequestException {#1903
    -request: GuzzleHttp\Psr7\Request {#1900
      -method: "POST"
      -requestTarget: null
      -uri: GuzzleHttp\Psr7\Uri {#1892
        -scheme: "https"
        -userInfo: ""
        -host: "api-3t.paypal.com"
        -port: null
        -path: "/nvp"
        -query: ""
        -fragment: ""
      }
      -headers: array:3 [
        "Content-Length" => array:1 [
          0 => "570"
        ]
        "User-Agent" => array:1 [
          0 => "GuzzleHttp/6.5.5 curl/7.58.0 PHP/7.3.31-1+ubuntu18.04.1+deb.sury.org+1"
        ]
        "Host" => array:1 [
          0 => "api-3t.paypal.com"
        ]
      ]
      -headerNames: array:3 [
        "content-length" => "Content-Length"
        "user-agent" => "User-Agent"
        "host" => "Host"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#1894
        -stream: stream resource {@162
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 570
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -response: GuzzleHttp\Psr7\Response {#1904
      -reasonPhrase: "OK"
      -statusCode: 200
      -headers: array:9 [
        "Connection" => array:1 [
          0 => "keep-alive"
        ]
        "Date" => array:1 [
          0 => "Mon, 04 Oct 2021 23:55:19 GMT"
        ]
        "Cache-Control" => array:1 [
          0 => "max-age=0, no-cache, no-store, must-revalidate"
        ]
        "Paypal-Debug-Id" => array:1 [
          0 => "2f618f7278897"
        ]
        "X-Paypal-Operation-Name" => array:1 [
          0 => "DoDirectPayment"
        ]
        "HTTP_X_PP_AZ_LOCATOR" => array:1 [
          0 => "ccg13.slc"
        ]
        "Strict-Transport-Security" => array:1 [
          0 => "max-age=31536000; includeSubDomains"
        ]
        "x-encoded-content-encoding" => array:1 [
          0 => "NVP"
        ]
        "x-encoded-content-length" => array:1 [
          0 => "187"
        ]
      ]
      -headerNames: array:9 [
        "connection" => "Connection"
        "date" => "Date"
        "cache-control" => "Cache-Control"
        "paypal-debug-id" => "Paypal-Debug-Id"
        "x-paypal-operation-name" => "X-Paypal-Operation-Name"
        "http_x_pp_az_locator" => "HTTP_X_PP_AZ_LOCATOR"
        "strict-transport-security" => "Strict-Transport-Security"
        "x-encoded-content-encoding" => "x-encoded-content-encoding"
        "x-encoded-content-length" => "x-encoded-content-length"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#1902
        -stream: stream resource {@164
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 0
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -handlerContext: array:34 [
      "errno" => 61
      "error" => "Unrecognized content encoding type. libcurl understands deflate, gzip content encodings."
      "appconnect_time" => 0.110807
      "url" => "https://api-3t.paypal.com/nvp"
      "content_type" => null
      "http_code" => 200
      "header_size" => 358
      "request_size" => 722
      "filetime" => -1
      "ssl_verify_result" => 0
      "redirect_count" => 0
      "total_time" => 2.862486
      "namelookup_time" => 0.004156
      "connect_time" => 0.037036
      "pretransfer_time" => 0.110853
      "size_upload" => 570.0
      "size_download" => 187.0
      "speed_download" => 65.0
      "speed_upload" => 199.0
      "download_content_length" => 187.0
      "upload_content_length" => 570.0
      "starttransfer_time" => 2.862108
      "redirect_time" => 0.0
      "redirect_url" => ""
      "primary_ip" => "173.0.88.69"
      "certinfo" => []
      "primary_port" => 443
      "local_ip" => "198.58.111.95"
      "local_port" => 36104
      "http_version" => 2
      "protocol" => 2
      "ssl_verifyresult" => 0
      "scheme" => "HTTPS"
      "curl_version" => "7.58.0"
    ]
    #message: "cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
    #code: 200
    #file: "/var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php"
    #line: 201
    trace: {
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:155 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:66 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Middleware.php:29 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:70 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Middleware.php:59 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/HandlerStack.php:71 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:351 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:162 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:182 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:95 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:1051 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:562 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment.php:1374 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:493 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/BAO/Contribution/Utils.php:173 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Contribution/Confirm.php:2307 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Contribution/Confirm.php:688 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Form.php:513 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/StateMachine.php:144 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php:43 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Controller.php:347 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:312 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:68 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:36 { …}
      /var/www/web/domain.org/web/modules/contrib/civicrm/src/Civicrm.php:88 {
        Drupal\civicrm\Civicrm->invoke($args)
        › ob_start();
        › $content = \CRM_Core_Invoke::invoke($args);
        › $output = ob_get_clean();
        arguments: {
          $args: array:3 [ …3]
        }
      }
      /var/www/web/domain.org/web/modules/contrib/civicrm/src/Controller/CivicrmController.php:80 { …}
      Drupal\civicrm\Controller\CivicrmController->main() {}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/Render/Renderer.php:573 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97 { …}
      /var/www/web/domain.org/vendor/symfony/http-kernel/HttpKernel.php:158 { …}
      /var/www/web/domain.org/vendor/symfony/http-kernel/HttpKernel.php:80 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php:57 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:47 { …}
      /var/www/web/domain.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106 { …}
      /var/www/web/domain.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:47 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:52 { …}
      /var/www/web/domain.org/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/DrupalKernel.php:706 { …}
      /var/www/web/domain.org/web/index.php:19 { …}
    }
  }
]

```

Anybody have idea about this ?

Here is code block which initiated the above call. `vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php` :

```
$response = (string) $this->getGuzzleClient()->post($url, [
  'body' => $nvpreq,
  'curl' => [
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_SSL_VERIFYPEER => Civi::settings()->get('verifySSL'),
  ],
])->getBody();

```

# Answer
I am receiving this as well on a WordPress site, so it's unlikely civicrm specific. Debugging inside WordPress' wp\_remote\_post function has been annoying, so I was happy to see your findings.

I suspect the clue is this line here in the response:

```
"x-encoded-content-encoding" => array:1 [
          0 => "NVP"
        ]

```

After decoding the response, I think cURL usually throws the content-encoding header away, but guzzle maintains the original value in `x-encoded-content-encoding`.

NVP is definitely not a valid value for content-encoding.

Obviously, NVP is legacy, so it will likely be difficult to convince PayPal to admit to this, or make any corrections to stop sending this header.

I did note that CURLOPT\_HTTP\_CONTENT\_DECODING is a libcurl option that is true by default, but can be set to false to skip response decoding and just pass the content raw. I'm wondering if that might help to get past the error.

Please let me know if this results in success, as I would be very interested to know for my own challenge!
> 1 votes

# Answer
UPDATE: Looking closer at the log maybe it's not the certificate issue. The Oct 1 date made me think it might be. Are you able to see what `$nvpreq` looks like and then run the command manually to see what the content-encoding header of the response really is? e.g. something like `curl -X POST -i -d '..insert contents of $nvpreq here...' https://api-3t.paypal.com/nvp`

---

The error might be misleading. My guess is this is the LetsEncrypt issue that's been coming up since Oct 1. https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

The php/openssl root certificates file on the server probably needs updating.
> 0 votes

---
Tags: payment-processor
---


# Question
Title: Can I generate a quarterly report of Donors without the dollar amounts?
We have a group called "Donors". I want to obtain the number of new Donors each quarter, but do not wants the amount they are contributing as I can gain that from other reports. If possible I would like the result to be in graph format on the home page.

# Answer
> 1 votes
how about using the extension -\> https://civicrm.org/extensions/donor-trends-extension

---
Tags: civicontribute, contacts
---


title: Household import error

text:
# Question
Title: Household import error
I'm unable to upload my household members into a new civiCRM install. My data is set out under these headings: House ID, Household Name, Household email, member ID, member First Name, member Last Name, member Email, Mobile Phone, Address Line 1, Address Line 2, City, State, Postal Code, Date Admitted, Date Paid up to, member2 First Name, member2 Last Name, member2 Email, member2 ID

I have matched the headings ensuring all red\* fields are covered.

Everything is fine in preview (step 3 of import) but after 'import now' in step 4 I receive this error: Mandatory key(s) missing from params array: household\_name

I have definitely matched the household\_name in line 2 of my data... Please help. Thanks

# Answer
> 2 votes
Some rows in your csv you using to import might have missing household name.

---
Tags: civimember, error
---