0

I have just updated to version 6.7.1 on my local machine from version 6.5

I made the update as I was having an issue with Contribution imports. I tried replicating the issue on dmaster demo for Wordpress, but I noticed that theses screens had changed quite a bit on there and I was able to upload demo data on dmaster without experiencing the same issue.

However after updating my local version to 6.7 I went to use the Contribution import function, but the second page in the process looked like this:

screenshot of issue

With angularjs code appearing instead of rendered content e.g. {{:: ts('Import to') }}

I am getting an error saying "TypeError: Cannot read properties of undefined (reading 'text')" in the browser console:

enter image description here

I have tried updating the languages in my installation using the Update Language Files Extension. I am using UK English as my default langauge.

Could anyone point me in the direction of where I should debug this issue, or give any advice as to why I am seeing this angularjs code on the contributions import page?

2
  • It's not smarty those are angularjs brackets. Might be a cache issue but unlikely right after an upgrade. But first step is clear caches. Then also look in the browser dev console for js errors. Commented Oct 16 at 1:06
  • Thanks @Demerit I have updated my question to refer to angularjs and I have added the error I am seeing in the browser console. I cleared the cache a few times, I deleted all files in the templates_c directory, although I never know if I should delete anything inside the en_GB dir inside template_c when I upgrade so didn't remove that. Commented Oct 16 at 8:43

1 Answer 1

2

After a bit of searching around I found that this did indeed seem like a bug.

The ContactTypes were not being loaded correctly into CRM.vars.crmImportUi, the id field was referencing the label / text and the text field was referencing the id.

On a clean install this works correctly because those 2 fields are the same as each other.

However on my install I have edited one of the Contact Types Name through the 'Administer' > 'Customise Data and Screens' > 'Contact Types' UI screen.

The erronous line of code would appear to be line 40 of ext/civiimport/CRM/CiviImport/Form/MapField.php:

  private function assignCiviimportVariables(): void {
    $contactTypes = CRM_Utils_Array::formatForSelect2(CRM_Contact_BAO_ContactType::basicTypeInfo(), 'name', 'label');
...
  }

Where the 'name' and 'label' parameters are passed in to the CRM_Utils_Array::formatForSelect2 function in the incorrect order.

Changing them to be the other way around fixed the bug and allowed me to use the importer again.

I have created an gitlab issue for this.

I would create a PR but when I tried to fork the Core repo I was unable to, probably as I do not have the correct permission.

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.