Import fix - if there are no required fields validateRequiredFields should 'pass'
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 3 Jul 2022 00:53:56 +0000 (12:53 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 3 Jul 2022 00:53:56 +0000 (12:53 +1200)
CRM/Import/Parser.php

index 91f20a3fb7c2938a44b3fd8370c703f1c9f21013..002aa473b0d63cf7bccbe0840cf213fd11a37d91 100644 (file)
@@ -1277,6 +1277,9 @@ abstract class CRM_Import_Parser implements UserJobInterface {
    * @throws \CRM_Core_Exception Exception thrown if field requirements are not met.
    */
   protected function validateRequiredFields(array $requiredFields, array $params, $prefixString = ''): void {
+    if (empty($requiredFields)) {
+      return;
+    }
     $missingFields = [];
     foreach ($requiredFields as $key => $required) {
       if (!is_array($required)) {