Jump to content


set_relation and callbacks don't work

set_relation callback 1.3.1

  • Please log in to reply
2 replies to this topic

#1 saulimus

saulimus

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 07 September 2012 - 12:01 PM

If I try to use a callback with a column (haven't tried a field yet) that has a relation, the callback doesn't work.
Add the following lines to the GC 1.3.1 examples controller to see the bug in action:
function employees_management()
{
...
	$crud->callback_column('officeCode', array($this, '_callback_test'));
...
}

function _callback_test($value, $row)
{
	return 'test';
}

You can easily see that it should work by uncommenting the set_relation('officeCode'...) line.

Update:
Array $this->callback_column includes 'officeCode' but function change_list() is looking for the unique field value like 'se95a0e4e'... because get_columns() has changed the field name to the unique value.

#2 mikelamar

mikelamar

    Member

  • Members
  • PipPip
  • 16 posts

Posted 07 September 2012 - 03:05 PM

I also had a similar problem and this post helped me fix this

#3 saulimus

saulimus

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 07 September 2012 - 03:59 PM

I actually used that fix before but I think it's better to fix it for good as it's a nasty bug.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users