From: Eileen McNaughton Date: Wed, 24 Aug 2022 23:07:46 +0000 (+1200) Subject: Remove some bits that were not removed last cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6cf4270446f5876fc23555067a921fed4431e315;p=civicrm-core.git Remove some bits that were not removed last cleanup --- diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 1d6d75e748..5d5b40edad 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -97,56 +97,13 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { $this->setFieldMetadata(); } - /** - * Handle the values in preview mode. - * - * @param array $values - * The array of values belonging to this line. - * - * @return bool - * the result of this processing - */ - public function preview(&$values) { - return $this->summary($values); - } - - /** - * Handle the values in summary mode. - * - * @param array $values - * The array of values belonging to this line. - * - * @return bool - * the result of this processing - */ - public function summary(&$values) { - $params = $this->getMappedRow($values); - $errors = []; - try { - $this->validateParams($params); - } - catch (CRM_Core_Exception $e) { - $errors[] = $e->getMessage(); - } - - if ($errors) { - $tempMsg = "Invalid value for field(s) : " . implode(',', $errors); - array_unshift($values, $tempMsg); - return CRM_Import_Parser::ERROR; - } - return CRM_Import_Parser::VALID; - } - /** * Handle the values in import mode. * * @param array $values * The array of values belonging to this line. - * - * @return bool - * the result of this processing */ - public function import(&$values) { + public function import(array $values): void { $rowNumber = (int) ($values[array_key_last($values)]); try { $params = $this->getMappedRow($values); @@ -222,7 +179,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { $this->_newParticipant[] = $newParticipant->id; $this->setImportStatus($rowNumber, 'IMPORTED', '', $newParticipant->id); - return CRM_Import_Parser::VALID; + return; } throw new CRM_Core_Exception('Matching Participant record not found for Participant ID ' . $formatValues['participant_id'] . '. Row was skipped.'); } @@ -288,9 +245,8 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { if (is_array($newParticipant['error_message']) && ($participantID == $newParticipant['error_message']['params'][0]) ) { - array_unshift($values, $url); - $this->setImportStatus($rowNumber, 'DUPLICATE', ''); - return CRM_Import_Parser::DUPLICATE; + $this->setImportStatus($rowNumber, 'DUPLICATE', $url); + return; } if ($newParticipant['error_message']) { throw new CRM_Core_Exception($newParticipant['error_message']); @@ -304,16 +260,10 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { } } catch (CRM_Core_Exception $e) { - array_unshift($values, $e->getMessage()); - $this->setImportStatus($rowNumber, 'ERROR', $e->getMessage()); - return CRM_Import_Parser::ERROR; - } - catch (CiviCRM_API3_Exception $e) { - array_unshift($values, $e->getMessage()); $this->setImportStatus($rowNumber, 'ERROR', $e->getMessage()); - return CRM_Import_Parser::ERROR; + return; } - $this->setImportStatus($rowNumber, 'IMPORTED', ''); + $this->setImportStatus($rowNumber, 'IMPORTED', '', $newParticipant['id']); } /**