Howdy
I'm tinkering with a module at the moment, and while I can create items (with adminapi_create) I can't seem to delete them (with adminapi_delete).
The adminapi_delete function as it stands is just a die() statement to let me know that it's being called, so I know that there's nothing amiss there. Here's the code anyway:
function Dubplate_adminapi_delete
( $ahDeleteProdInfo ){ die( "in adminapi_delete" );
}
if( !pnModAPILoad
( 'Dubplate',
'admin' ) ){ pnSessionSetVar
( 'errormsg' , pnVarPrepHTMLDisplay
( _LOADFAILED
) );
pnRedirect
( pnModURL
( 'Dubplate',
'admin',
'view' ) );
return true;
}$lbSuccess = pnModAPIFunc
( 'Dubplate',
'adminapi',
'delete',
array( 'id' =>
$loProd->
getID() ) );
die( "returned from adminapi" );
I'm certain that the
API is loading (I've tested that with die() statements), and the pnModAPIFunc arguments seem okay (the 'id' resolves to its expected value, an integer). But when I run the code above, it goes stright through to "returned from adminapi".
The only real difference between the delete code and my create code is the 'id' argument. Is 'id' perhaps a reserved word? Any thoughts?