scoumbourdis/grocery-crud — Issue #6: unique_hash issue (not unique when having same method name in 2 diff. controllers))
Author: marwenj
Created: 2012-01-05 00:43:25+00:00
State: open

Hi John,
First of all let me thank you or this great library.

Well, if you have in 2 different controllers the same method, the unique_hash will be the same and that will mess up the grid when it is loaded via ajax. For example i have 2 controllers products and orders, in both controllers i have a method called 'manage', in that method im using grocery_crud if i got to products/manage and i use the filter , cookies including my search params will be saved , if i go to orders/manage and use the filter there, the old cookies will be used and it shouldn't.

I solved this issue with adding the class name to the method name and hash it

protected function get_method_hash() {
$ci = &get_instance();
return md5($ci->router->class.'/'.$ci->router->method);
}