"Exit-Handler: DBUtil::selectObjectByID: empty id supplied Stacktrace:"
Here's the function I'm running:
Code
function UserMod_user_delete($args)
{
$id = (int)FormUtil::getPassedValue('id', isset($args['id']) ? $args['id'] : null, 'REQUEST');
$confirmation = FormUtil::getPassedValue('confirmation', null, 'POST');
// Get the existing schedule message
$action = pnModAPIFunc('UserMod', 'user', 'getschedule', array('id' => $id));
if ($action == false) {
return DataUtil::formatForDisplayHTML(_NOSUCHITEM);
}
// Security check
if (!SecurityUtil::checkPermission('UserMod::', "$id::", ACCESS_EDIT)) {
return LogUtil::registerPermissionError();
}
// Check for confirmation.
if (empty($confirmation)) {
// No confirmation yet
// Create output object
$pnRender = pnRender::getInstance('UserMod', false);
// Add the message id
$pnRender->assign('id', $id);
// assign the full item
$pnRender->assign($action);
// Return the output that has been generated by this function
return $pnRender->fetch('usermod_user_delete.htm');
}
// Delete the banner
// The return value of the function is checked
if (pnModAPIFunc('UserMod', 'user', 'delete', array('id' => $id))) {
// Success
LogUtil::registerStatus (_USERMOD_DELETED);
}
// This function generated no output, and so now it is complete we redirect
// the user to an appropriate page for them to carry on their work
return pnRedirect(pnModURL('UserMod', 'user', 'view'));
}
{
$id = (int)FormUtil::getPassedValue('id', isset($args['id']) ? $args['id'] : null, 'REQUEST');
$confirmation = FormUtil::getPassedValue('confirmation', null, 'POST');
// Get the existing schedule message
$action = pnModAPIFunc('UserMod', 'user', 'getschedule', array('id' => $id));
if ($action == false) {
return DataUtil::formatForDisplayHTML(_NOSUCHITEM);
}
// Security check
if (!SecurityUtil::checkPermission('UserMod::', "$id::", ACCESS_EDIT)) {
return LogUtil::registerPermissionError();
}
// Check for confirmation.
if (empty($confirmation)) {
// No confirmation yet
// Create output object
$pnRender = pnRender::getInstance('UserMod', false);
// Add the message id
$pnRender->assign('id', $id);
// assign the full item
$pnRender->assign($action);
// Return the output that has been generated by this function
return $pnRender->fetch('usermod_user_delete.htm');
}
// Delete the banner
// The return value of the function is checked
if (pnModAPIFunc('UserMod', 'user', 'delete', array('id' => $id))) {
// Success
LogUtil::registerStatus (_USERMOD_DELETED);
}
// This function generated no output, and so now it is complete we redirect
// the user to an appropriate page for them to carry on their work
return pnRedirect(pnModURL('UserMod', 'user', 'view'));
}
