0010124: Broken group filter favorite
authorAlexander Stintzing <a.stintzing@metaways.de>
Fri, 15 Aug 2014 14:41:57 +0000 (16:41 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 29 Aug 2014 14:05:59 +0000 (16:05 +0200)
It works but the filter is empty and you get
an sql error if you try to edit a dataset.

https://forge.tine20.org/mantisbt/view.php?id=10124

Change-Id: Idd6c3ba04ac6a78ba7046a9826d1483f6ac889de
Reviewed-on: http://gerrit.tine20.com/customers/1000
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Addressbook/Model/List.php
tine20/Addressbook/Model/ListMemberFilter.php

index 6ad88cb..8f2d500 100644 (file)
@@ -119,5 +119,5 @@ class Addressbook_Model_List extends Tinebase_Record_Abstract
         }
         
         return $id;
-    }    
+    }
 }
index 6f8ab4d..0800088 100644 (file)
@@ -42,4 +42,19 @@ class Addressbook_Model_ListMemberFilter extends Tinebase_Model_Filter_Abstract
         );
         $_select->where($db->quoteIdentifier($correlationName . '.list_id') . ' IN (?)', (array) $this->_value);
     }
+    
+    /**
+     * returns array with the filter settings of this filter group
+     *
+     * @param  bool $_valueToJson resolve value for json api?
+     * @return array
+     */
+    public function toArray($_valueToJson = false)
+    {
+        if (is_string($this->_value)) {
+            $this->_value = Addressbook_Controller_List::getInstance()->get($this->_value)->toArray();
+        }
+        
+        return parent::toArray($_valueToJson);
+    }
 }