12410: Delete user should not delete participating events
authorPaul Mehrer <p.mehrer@metaways.de>
Thu, 8 Dec 2016 09:38:12 +0000 (10:38 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 8 Dec 2016 12:46:36 +0000 (13:46 +0100)
deleteContainerContents uses filter on container_id
calendar has special behaviour on container_id
forcing Tinebase_Model_Filter_Id on container_id now

Change-Id: I2830a225a92b5e570141efcb4442a165bc560869
Reviewed-on: http://gerrit.tine20.com/customers/3930
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Container.php

index 35e64d2..18bfa71 100644 (file)
@@ -1102,11 +1102,9 @@ class Tinebase_Container extends Tinebase_Backend_Sql_Abstract
                 Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
                     . ' Delete ' . $model . ' records in container ' . $container->getId());
 
                 Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
                     . ' Delete ' . $model . ' records in container ' . $container->getId());
 
-                $filter = new $filterName(array(array(
-                    'field' => 'container_id',
-                    'operator' => 'equals',
-                    'value' => intval($container->id)
-                )), Tinebase_Model_Filter_FilterGroup::CONDITION_AND, array('ignoreAcl' => $_ignoreAcl));
+                $filter = new $filterName(array(), Tinebase_Model_Filter_FilterGroup::CONDITION_AND
+                    , array('ignoreAcl' => $_ignoreAcl));
+                $filter->addFilter(new Tinebase_Model_Filter_Id('container_id', 'equals', $container->id));
 
                 if ($_ignoreAcl) {
 
 
                 if ($_ignoreAcl) {