From f613125ffdbe48ba33dc50d6612b9ea30dd57bed Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 20 Apr 2022 21:40:06 +1200 Subject: [PATCH] Remove another good intention from the import class Once upon a time - the import classes were written.... Back then it seemed like a good idea to give the derived classes a way to abort processing. Like unicorns and mermaids derived classes turned out to be mythical creatures - not even found by searching the git universe.... --- CRM/Activity/Import/Parser/Activity.php | 6 ------ CRM/Contact/Import/Parser/Contact.php | 5 ----- CRM/Contribute/Import/Parser/Contribution.php | 6 ------ CRM/Custom/Import/Parser/Api.php | 6 ------ CRM/Event/Import/Parser/Participant.php | 6 ------ CRM/Member/Import/Parser/Membership.php | 6 ------ 6 files changed, 35 deletions(-) diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 2c7cce55cc..19d40ae451 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -594,12 +594,6 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Import_Parser { } } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode & self::STOP) { - break; - } - // if we are done processing the maxNumber of lines, break if ($this->_maxLinesToProcess > 0 && $this->_validCount >= $this->_maxLinesToProcess) { break; diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 5caa074b9f..d87b8c02af 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -2714,11 +2714,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Import_Parser { array_unshift($values, $this->_rowCount); $this->_unparsedAddresses[] = $values; } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode & self::STOP) { - break; - } // see if we've hit our timeout yet /* if ( $the_thing_with_the_stuff ) { diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index d68e026608..3fe3493a49 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -340,12 +340,6 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { } } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode == self::STOP) { - break; - } - // if we are done processing the maxNumber of lines, break if ($this->_maxLinesToProcess > 0 && $this->_validCount >= $this->_maxLinesToProcess) { break; diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 6ad43712d6..5bfb22f238 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -504,12 +504,6 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser { } } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode & self::STOP) { - break; - } - // if we are done processing the maxNumber of lines, break if ($this->_maxLinesToProcess > 0 && $this->_validCount >= $this->_maxLinesToProcess) { break; diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index d279f04841..bd32fcf4d8 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -861,12 +861,6 @@ class CRM_Event_Import_Parser_Participant extends CRM_Import_Parser { } } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode & self::STOP) { - break; - } - // if we are done processing the maxNumber of lines, break if ($this->_maxLinesToProcess > 0 && $this->_validCount >= $this->_maxLinesToProcess) { break; diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 5c90429fb6..357339d5e5 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -231,12 +231,6 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser { } } - // we give the derived class a way of aborting the process - // note that the return code could be multiple code or'ed together - if ($returnCode & self::STOP) { - break; - } - // if we are done processing the maxNumber of lines, break if ($this->_maxLinesToProcess > 0 && $this->_validCount >= $this->_maxLinesToProcess) { break; -- 2.25.1