The two events for undelete don't exist. As far as I can tell, these events can be added by
1. inserting two new entries in the database
2. altering the undelete_content.processor.php
To insert the new entries in the database:
INSERT INTO `law_modx`.`modx_system_eventnames` (
`id` ,
`name` ,
`service` ,
`groupname`
)
VALUES (
NULL , 'OnDocFormUndelete', '1', 'Documents'
), (
NULL , 'OnBeforeDocFormUndelete', '1', 'Documents'
);
To alter the undelete_document.processor.php file, add the following code after the line that says
getChildren($id);
// invoke OnBeforeDocFormUndelete event
$modx->invokeEvent("OnBeforeDocFormUndelete",
array(
"id"=>$id,
"children"=>$children
));
And add the following code:
//'undelete' the document.
$sql = "UPDATE $dbase.`".$table_prefix."site_content` SET deleted=0, deletedby=0, deletedon=0 WHERE id=$id;";
$rs = mysql_query($sql);
if(!$rs) {
echo "Something went wrong while trying to set the document to undeleted status...";
exit;
} else {
// BEGIN NEW CODE:
// invoke OnDocFormUndelete event
$modx->invokeEvent("OnDocFormUndelete",
array(
"id"=>$id,
"children"=>$children
));
// END NEW CODE
id = [some integer]
name = OnDocFormUndelete
service = 1
groupname = Documents
id = [some integer]
name = OnBeforeDocFormUndelete
service = 1
groupname = Documents