Quote:I don’t know if you still need the information, but there is nothing I know of that can cause CI to reload the same function, EXCEPT if you are accidentally calling $this->{controller_method}.
[SNIP]
That would call the controller method a second time. And because it isn’t getting the $id the second time, it won’t fall into a recursive loop.
$char = new Character(); $char->get_by_id($char_id);
$item = new Item(); $item->get_by_id($item_id);
if(!$item->exists()){
echo("item does not exist");
return;
}
$item->delete();
echo("item exist");
}
Like this I get output "item does not exist".
If I comment the line $item->delete() I get "item exist".
My conclusion is that somehow the controller method is called twice. First it exists, and is deleted, and then it enters a second time and does not exist.
How can I debug further? Is there a debugger for CI? If it is being called a second time, how can I kill it the first time around? I tried using "die" but that didn't help.
This is my Item model. As you can see it has two hasOne relationships. I don't know if they can cause any trouble?