don't search for relations if related query filter is empty
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 Feb 2016 17:12:25 +0000 (18:12 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 12 Feb 2016 09:58:50 +0000 (10:58 +0100)
... as this leads to memory problems if not checked

Change-Id: I79ee1709fc7bd515226d3e1c4608db585eef0797
Reviewed-on: http://gerrit.tine20.com/customers/2703
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Import/Abstract.php

index 228b821..b48df36 100644 (file)
@@ -580,6 +580,11 @@ abstract class Tinebase_Import_Abstract implements Tinebase_Import_Interface
      */
     protected function _mapRelation($fieldValue, $field, &$data)
     {
+        if (empty($fieldValue)) {
+            // no need to continue here
+            return;
+        }
+
         if (! isset($field['related_model']) || ! isset($field['filter'])) {
             throw new Tinebase_Exception_UnexpectedValue('field config missing');
         }