Today I started using this version of the cakephp-filter-component:
http://github.com/josegonzalez/cakephp-filter-component. Had some
trouble...

When posting the filter form nothing happend. After searching in the
code it suddenly hit me: I use the CakePHP Security component and that
does not allow you to change the $controller->data variable. That's
what is done in function processFilters and function _prepareFilter.
In these functions an unset of parts of $controller->data is done. The
security component does not like that at all and invalidates the data
variable.

And there is an error (well it didn't work for me) in the
documentation

original code:

$filterOptions = $this->Filter->filterOptions;
$posts = $this->paginate(null, $this->Filter->filter);
$this->set(compact('filterOptions', 'posts'));

change to:

$filter_options = $this->Filter->filterOptions;
$posts = $this->paginate(null, $this->Filter->filter);
$this->set('filter_options',$filter_options);
$this->set('posts',$posts);

I also changed the function initialize because I'm using this in /
admin routing, so the $actions array should then be like this:

$actions = array('admin_index');

Maybe this can be a configuration option somehow ?

I also changed the $fieldFormatting like this to include INTEGER
wildcard filtering:

        var $fieldFormatting = array(
                "string"        => "LIKE '%%%s%%'",
                "text"          => "LIKE '%%%s%%'",
                "datetime"      => "LIKE '%%%s%%'",
                "integer"       => "LIKE '%%%s%%'"
        );

Hope this will help the further development of this component/plugin
for CakePHP (using 1.2.5 at the moment).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to