Invalid item array received after deleting a single uploaded file
Jamroom Developers
Hi
In my module I have a delete button to delete individual files uploaded in an item of module. But after delete the redirect shows item detail page with error "Invalid Item Array Received".
The $_items array is set to false which is why it is showing the error. I'm following the example of jrGallery for my module. Below is the delete function in my module index.php,
jrUser_session_require_login();
jrCore_validate_location_url();
if (!isset($_post['id']) || !jrCore_checktype($_post['id'], 'number_nz')) {
jrCore_set_form_notice('error', 14);
jrCore_form_result('referrer');
}
$_rt = jrCore_db_get_item('gsVenue', $_post['id']);
if (!jrUser_can_edit_item($_rt)) {
jrUser_not_authorized();
}
jrCore_db_delete_item('gsVenue', $_post['id']);
//jrProfile_reset_cache();
jrCore_form_result("{$_conf['jrCore_base_url']}/{$_user['profile_url']}/{$_post['module_url']}/{$_post['id']}/{$_rt['venues_title_url']}");
Note that the item representing the file in the database is deleted. Please suggest what I can do about this.
Thanks.
updated by @dobmat: 06/25/14 02:11:58PM