From eaf4d1d0b6488bc7f03178269fbaa958bc41ffd7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 6 Jun 2022 12:04:23 +1200 Subject: [PATCH] Move validateValues to parent as now generic --- CRM/Activity/Import/Parser/Activity.php | 2 +- CRM/Contact/Import/Parser/Contact.php | 15 --------------- CRM/Import/Parser.php | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 089fa18eac..a643be5c49 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -369,7 +369,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { * * @throws \CRM_Core_Exception */ - protected function validateValues(array $values): void { + public function validateValues(array $values): void { // Check required fields if this is not an update. if (!$this->getFieldValue($values, 'activity_id')) { if (!$this->getFieldValue($values, 'activity_label') diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 22feff092e..a3b1f96063 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1574,21 +1574,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { return $params; } - /** - * Validate the import values. - * - * The values array represents a row in the datasource. - * - * @param array $values - * - * @throws \API_Exception - * @throws \CRM_Core_Exception - */ - public function validateValues(array $values): void { - $params = $this->getMappedRow($values); - $this->validateParams($params); - } - /** * Get the invalid values in the params for the given contact. * diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index 6aa63f1094..e74fefd412 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -1567,6 +1567,21 @@ abstract class CRM_Import_Parser { } } + /** + * Validate the import values. + * + * The values array represents a row in the datasource. + * + * @param array $values + * + * @throws \API_Exception + * @throws \CRM_Core_Exception + */ + public function validateValues(array $values): void { + $params = $this->getMappedRow($values); + $this->validateParams($params); + } + /** * Search the value for the string 'invalid_import_value'. * -- 2.25.1