Hi,
When I click on the column header of a relation_n_n field to sort on that column in the flexigrid list view, I'm getting this error:
Fatal error: Call to a member function result() on a non-object in /Users/.../application/models/grocery_crud_model.php on line 71
The line in the model of my version (1.2.1.1) that gives the error is:
$results = $this->db->get($this->table_name)->result();
The error message keeps coming back until I clear my browser cookies.
To see the issue, I used the following code in my controller, which creates just a basis list with only an n_n relation as an extra:
function bugtest() {
$this->grocery_crud->set_table('beheerders');
$this->grocery_crud->set_relation_n_n('onderdeel', 'beheerders_onderdelen', 'onderdelen', 'pkid_beheerders', 'pkid_onderdelen', 'onderdeel');
$output = $this->grocery_crud->render();
$this->load->view('bugtest.php',$output);
}
Sorting all other columns works as expected (until I get the error message, then I need to clear my cookies).
Any idea on what might be wrong?
Thanks!
(BTW I would've liked to include a screenshot but the uploader is complaining about having reached my global upload quota of 500kb...)


Error on sorting relation_n_n column in flexigrid
Started by lherlaar, May 10 2012 10:49 AM
3 replies to this topic
#1
Posted 10 May 2012 - 10:49 AM
#2
Posted 10 May 2012 - 07:28 PM
I got a different error on sorting with relation_n_n and "display_as"
re relation has a name (is not a field) and when try to sort, GC tried to use the name instead of the field to do the order by
Is it possible to turn off the sorting, like $crud->unset_jquery() ?
re relation has a name (is not a field) and when try to sort, GC tried to use the name instead of the field to do the order by
$crud->set_relation_n_n('grupos','users_groups','groups','user_id','group_id','description');

Is it possible to turn off the sorting, like $crud->unset_jquery() ?
#3
Posted 11 May 2012 - 06:46 AM
This bug is fixed for the new version 1.2.2 ( https://github.com/s...-crud/issues/13 ) , both for search and for ordering. You can download it directly from github at https://github.com/s.../zipball/master

#4
Posted 11 May 2012 - 01:09 PM
change log for 1.2.2 looks very nice.
Good work!
Good work!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users