$char = new Character(); $char->get_by_id($char_id);
$item = new Item(); $item->get_by_id($item_id);
if(!$item->exists()){
log_message('debug', "ITEM DOES NOT EXIST");
die("item does not exists $char_id $item_id");
}
log_message('debug', "ITEM DOES EXIST");
$item->delete();
die("item exist");
}
And this is the LOG:
Quote:DEBUG - 2009-09-17 19:43:38 --> Config Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Hooks Class Initialized
DEBUG - 2009-09-17 19:43:38 --> URI Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Router Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Output Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Input Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Global POST and COOKIE data sanitized
DEBUG - 2009-09-17 19:43:38 --> Language Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Loader Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: url_helper
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: utilities_helper
DEBUG - 2009-09-17 19:43:38 --> Database Driver Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Language file loaded: language/english/datamapper_lang.php
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: inflector_helper
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: security_helper
DEBUG - 2009-09-17 19:43:38 --> Config file loaded: config/datamapper.php
DEBUG - 2009-09-17 19:43:38 --> Session Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: string_helper
DEBUG - 2009-09-17 19:43:38 --> A session cookie was not found.
DEBUG - 2009-09-17 19:43:38 --> Session routines successfully run
DEBUG - 2009-09-17 19:43:38 --> Controller Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Session class already loaded. Second attempt ignored.
DEBUG - 2009-09-17 19:43:38 --> Model Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: cookie_helper DEBUG - 2009-09-17 19:43:38 --> STARTUP DOSELL(25, 459)
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: form_helper
DEBUG - 2009-09-17 19:43:38 --> Form Validation Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Language file loaded: language/english/form_validation_lang.php DEBUG - 2009-09-17 19:43:38 --> ITEM DOES EXIST
DEBUG - 2009-09-17 19:43:38 --> Config Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Hooks Class Initialized
DEBUG - 2009-09-17 19:43:38 --> URI Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Router Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Output Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Input Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Global POST and COOKIE data sanitized
DEBUG - 2009-09-17 19:43:38 --> Language Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Loader Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: url_helper
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: utilities_helper
DEBUG - 2009-09-17 19:43:38 --> Database Driver Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Language file loaded: language/english/datamapper_lang.php
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: inflector_helper
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: security_helper
DEBUG - 2009-09-17 19:43:38 --> Config file loaded: config/datamapper.php
DEBUG - 2009-09-17 19:43:38 --> Session Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: string_helper
DEBUG - 2009-09-17 19:43:38 --> Session routines successfully run
DEBUG - 2009-09-17 19:43:38 --> Controller Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Session class already loaded. Second attempt ignored.
DEBUG - 2009-09-17 19:43:38 --> Model Class Initialized DEBUG - 2009-09-17 19:43:38 --> STARTUP DOSELL(25, 459)
DEBUG - 2009-09-17 19:43:38 --> Helper loaded: form_helper
DEBUG - 2009-09-17 19:43:38 --> Form Validation Class Initialized
DEBUG - 2009-09-17 19:43:38 --> Language file loaded: language/english/form_validation_lang.php DEBUG - 2009-09-17 19:43:38 --> ITEM DOES NOT EXIST
See the bolded items above. This confirms that the controller is run twice. It has to do with the row item->delete(), Any ideas?