Skip to content

Instantly share code, notes, and snippets.

It depends on how big is the migration task like whether we only need to migrate contacts and its activities OR with contacts migrate all associated data like address, contributions, events, notes etc. In my opinion if the migration job is small and we only need to import a single entity, then I would prefer to use the PHP script techinique:

  1. PHP script which would be like:
class MigrationScript {

public function process($batchTotal, $batchsize) {
  $offset = 0;

Limitations

  1. A contribution cannot have multiple line-items which share same price_field_id and/or price_field_value_id because there is a unique key defined for line-item table which expects unique combination of these attributes
  2. A contribution cannot have multiple line-items linked with price fields of different price-sets, otherwise it will cause a issue while doing 'Record Payment' as I tested on local by relaxing the crieria to allow user to add line-item linked to price fields of different price sets. Add after paying the addtional due amount, leads to incorrect financial entries and Contribution status still kept to 'Partially Paid'.

Proposal

Keeping in mind both the limitations here's what my approach to support add multiple line-items.

New Contribution with quick-config price field

phpunit5 tests/phpunit/CRM/AllTests.php
Installing civicrm47_drupal_test database
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
............................................F........E....... 61 / 1867 ( 3%)
............................................................. 122 / 1867 ( 6%)
............................................................. 183 / 1867 ( 9%)
............................................................. 244 / 1867 ( 13%)
............................................................. 305 / 1867 ( 16%)

select2 4.0.4 compatibility issues with CiviCRM

Broken entityRef field

There are multiple issues with entityRef field which are listed below:

  1. Placeholder doesn't show
  2. Unable to populate data via REST api link
  3. Create contact dialog box doesn't render below search field
  4. Escape text doesn't showup

Action-menu select2 doesn't work on selecting record(s) in search list

4.7.23 regressions:
1. https://github.com/civicrm/civicrm-core/pull/8820 caused regression, self-merged by Eileen
fixed by Monish https://github.com/civicrm/civicrm-core/pull/10596 and merged in 4.7.23
4.7.21 regressions:
1. Load Net_SMTP, Auth_SASL, Net_Socket via Composer 
https://github.com/civicrm/civicrm-core/pull/10384 caused regression submitted by Seamus and merged by Tim
https://github.com/civicrm/civicrm-core/pull/10622 fixed it, submitted by Seamus and merged by Tim in 4.7.22
diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php
index 78f3341..ae06581 100644
--- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php
+++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php
@@ -331,7 +331,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase {
$this->fail("Missed expected exception");
}
catch (CRM_Core_Exception $e) {
- $this->assertEquals('Revenue recognition date can only be specified if the financial type selected has a deferred revenue account configured. Please have an administrator set up the deferred revenue account at Administer > CiviContribute > Financial Accounts, then configure it for financial types at Administer > CiviContribution > Financial Types, Accounts', $e->getMessage());
+ $this->assertEquals('Revenue Recognition Date cannot be processed unless there is a Deferred Revenue account setup for the Financial Type. Please remove Revenue
diff --git a/CRM/Core/DAO/CustomGroup.php b/CRM/Core/DAO/CustomGroup.php
index 7b11b4f..1c45988 100644
--- a/CRM/Core/DAO/CustomGroup.php
+++ b/CRM/Core/DAO/CustomGroup.php
@@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Core/CustomGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5e44d08da1787dd031e8e4b81c1628a5)
+ * (GenCodeChecksum:5b2dac3266e0184dc4eaa6de10c9d401)
diff --git a/api/v3/examples/Activity/Create.php b/api/v3/examples/Activity/Create.php
index a380f12..c3fae35 100644
--- a/api/v3/examples/Activity/Create.php
+++ b/api/v3/examples/Activity/Create.php
@@ -8,7 +8,7 @@
function activity_create_example() {
$params = array(
'source_contact_id' => 1,
- 'activity_type_id' => '55',
+ 'activity_type_id' => '99',
diff --git a/api/v3/examples/Activity/Create.php b/api/v3/examples/Activity/Create.php
index a380f12..27d3ce4 100644
--- a/api/v3/examples/Activity/Create.php
+++ b/api/v3/examples/Activity/Create.php
@@ -8,7 +8,7 @@
function activity_create_example() {
$params = array(
'source_contact_id' => 1,
- 'activity_type_id' => '55',
+ 'activity_type_id' => 'Test activity type',