@Sparky,
If you Change the file to my solution it works perfectly.
<?php
// Check if deleteId parameter is present
$deleteId = Params::getParam('deleteId');
if($deleteId > 0) {
// Create an instance of ModelACT
$modelACT = new ModelACT();
// Retrieve the deleteId parameter again
$deleteId = Params::getParam('deleteId');
if($deleteId > 0) {
// Call deleteAuction function with the deleteId as argument
$result = $modelACT->deleteAuction($deleteId);
if($result) {
// Add success message if auction is successfully deleted
osc_add_flash_ok_message(__('Auction successfully deleted.', 'auction'), 'admin');
// Redirect to prevent the rest of the code from executing
header('Location:' . osc_admin_base_url(true) . '?page=plugins&action=renderplugin&file=auction/admin/auction.php');
exit;
} else {
// Add error message if an error occurred while deleting the auction
osc_add_flash_error_message(__('An error occurred while deleting the auction.', 'auction'), 'admin');
}
}
}
// Check if editId parameter is present
$id = Params::getParam('editId');
if($id <= 0) {
// Add flash message for invalid auction ID and redirect to appropriate page
osc_add_flash_ok_message(__('Invalid auction ID', 'auction'), 'admin');
header('Location:' . osc_admin_base_url(true) . '?page=plugins&action=renderplugin&file=auction/admin/auction.php');
exit;
}
// Retrieve auction data
$auction = ModelACT::newInstance()->getAuction($id);
// Check if the auction should not be closed, deactivated, etc.
$chk = act_check_auction($auction);
// If auction found and changed
if($chk !== false && $chk !== true) {
$auction = ModelACT::newInstance()->getAuction($id);
}
// Retrieve item data
$item = Item::newInstance()->findByPrimaryKey($auction['fk_i_item_id']);
// Set title
$title = sprintf(__('Auction #%s: %s', 'auction'), $id, ((isset($item['s_title']) && $item['s_title'] <> '') ? $item['s_title'] : __('Item removed', 'auction')));
act_menu($title);
// Create links for submenu
$links = array();
$links[] = array('file' => '_auction_edit_bids.php', 'icon' => 'fa-gavel', 'title' => __('User Action Bids', 'auction'));
$links[] = array('file' => '_auction_edit_watchlist.php', 'icon' => 'fa-bell', 'title' => __('Watchlist Users', 'auction'));
$links[] = array('file' => '_auction_edit_notifications.php', 'icon' => 'fa-envelope', 'title' => __('User Notifications', 'auction'));
$links[] = array('file' => '_auction_edit_logs.php', 'icon' => 'fa-database', 'title' => __('Auction History (Logs)', 'auction'));
$links[] = array('file' => '_auction_edit_settings.php', 'icon' => 'fa-wrench', 'title' => __('Auction Settings', 'auction'));
// Show submenu
$file = act_submenu('auction_edit.php', $links, Params::getParam('go_to_file'), '&editId=' . $id);
require_once $file;
?>