From 4be1c8bbeca5ed656d055e2d53b5d4a6577d13c1 Mon Sep 17 00:00:00 2001
From: Eileen McNaughton
Date: Thu, 24 Nov 2022 13:15:00 +1300
Subject: [PATCH] Use search display to view errors when using Civi-import
extension
This replaces the link to download the csv with a link to view the search
display if civiimport is enabled, allowing re-doing within the UI
---
ext/civiimport/civiimport.php | 4 ++++
templates/CRM/Contact/Import/Form/Summary.tpl | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ext/civiimport/civiimport.php b/ext/civiimport/civiimport.php
index fe0aa5c517..1cc66e1d18 100644
--- a/ext/civiimport/civiimport.php
+++ b/ext/civiimport/civiimport.php
@@ -234,4 +234,8 @@ function civiimport_civicrm_buildForm(string $formName, $form) {
}
}
}
+
+ if ($formName === 'CRM_Contact_Import_Form_Summary') {
+ $form->assign('downloadErrorRecordsUrl', '/civicrm/search#/display/Import_' . $form->getUserJobID() . '/Import_' . $form->getUserJobID() . '?_status=ERROR');
+ }
}
diff --git a/templates/CRM/Contact/Import/Form/Summary.tpl b/templates/CRM/Contact/Import/Form/Summary.tpl
index 9c57dfa77f..629bff6a05 100644
--- a/templates/CRM/Contact/Import/Form/Summary.tpl
+++ b/templates/CRM/Contact/Import/Form/Summary.tpl
@@ -34,7 +34,7 @@
{ts count=$invalidRowCount plural='CiviCRM has detected invalid data and/or formatting errors in %count records. These records have not been imported.'}CiviCRM has detected invalid data and/or formatting errors in one record. This record has not been imported.{/ts}
- {ts 1=$downloadErrorRecordsUrl|smarty:nodefaults}You can Download Errors. You may then correct them, and import the new file with the corrected data.{/ts}
+ {ts 1=$downloadErrorRecordsUrl|smarty:nodefaults}You can See the errors. You may then correct them, and re-import with the corrected data.{/ts}
{/if}
@@ -66,7 +66,7 @@
| {ts}Invalid Rows (skipped){/ts} |
{$invalidRowCount} |
{ts}Rows with invalid data in one or more fields (for example, invalid email address formatting). These rows will be skipped (not imported).{/ts}
-
+
|
{/if}
--
2.25.1