Jump to content

callback before insert not working

callback insert 1.4.1

  • Please log in to reply
No replies to this topic

#1 Mamdouh AlRamadan

Mamdouh AlRamadan


  • Members
  • Pip
  • 6 posts

Posted 17 October 2013 - 05:22 AM

This is my code:

public function special_management()
			$crud = new grocery_CRUD();

                        $crud->set_relation('variant_id', 'variant', 'item_number');
			$output = $crud->render();

		}catch(Exception $e){
			show_error($e->getMessage().' --- '.$e->getTraceAsString());
        function check_special_validity($arr)
            $value = $this->specialx->check_special_on_item($arr['item_number'],$arr['expiration_date']);
            return $value;

what's driving me crazy is that when I test on separate controller I get  

value = false
but GC ignores it and inserts into the database.
any help?



item_number is a result of set_relation so that's why it's not defined in $arr. 
my updated question would be how to pass it with $arr in callback.

Update 2:

Solved by passing the relational element instead of item_number.

Also tagged with one or more of these keywords: callback, insert, 1.4.1

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users