deal with modelconfig
authorMichael Spahn <m.spahn@metaways.de>
Thu, 13 Jul 2017 13:06:32 +0000 (15:06 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Thu, 13 Jul 2017 16:51:47 +0000 (18:51 +0200)
 - if there is no concrete filtermodel and an generic is given, try to resolve it

Change-Id: I16595e33273277605a437e4103ce5889c779d1e9
Reviewed-on: http://gerrit.tine20.com/customers/5147
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Tinebase/Model/Filter/ExplicitRelatedRecord.php

index 0f16e13..3e0e527 100644 (file)
@@ -54,8 +54,14 @@ class Tinebase_Model_Filter_ExplicitRelatedRecord extends Tinebase_Model_Filter_
 
             $notInIds = Tinebase_Relations::getInstance()->search($relationFilter, NULL)->own_id;
             $filter = new $filtergroup(array(
 
             $notInIds = Tinebase_Relations::getInstance()->search($relationFilter, NULL)->own_id;
             $filter = new $filtergroup(array(
-                
+
             ),'AND');
             ),'AND');
+
+            // Deal with generic filtermodel!
+            if ($this->_options['own_filtergroup'] === Tinebase_Model_Filter_FilterGroup::class) {
+                $filter->setConfiguredModel($_modelName);
+            }
+
             $filter->addFilter(new Tinebase_Model_Filter_Text(array('field' => $idProperty, 'operator' => 'notin', 'value' => $notInIds)));
 
             return $controller::getInstance()->search($filter, null, false, true);
             $filter->addFilter(new Tinebase_Model_Filter_Text(array('field' => $idProperty, 'operator' => 'notin', 'value' => $notInIds)));
 
             return $controller::getInstance()->search($filter, null, false, true);