In /site/ready.php we have are hooking before Pages::delete(), and if it is the user template then it uses PagesExportImport to create a JSON representation of the data to log:
$pages->addHookBefore('delete', function(HookEvent $event) {
$page = $event->arguments('page');
// If a user is deleted, log the data
if($page->template->name === 'user') {
$event->wire()->log->save('user-deleted', json_encode((new PagesExportImport())->pageToArray($page, [])));
}
});
This is working fine on the production site, which is on version 3.0.246.
I'm working on a dev copy which is on 3.0.262, and when I delete a user I'm getting an error saying the class cannot be found. The Process module is working fine.
I assume this is related to the recent refactoring of the core? I see in the class file:
$porter = new PagesExportImport(); // works in any version
$porter = $pages->porter(); // 3.0.253+ only
I've not tried the second option here, perhaps that would work, but the first says it should work in any version?
In /site/ready.php we have are hooking before Pages::delete(), and if it is the user template then it uses PagesExportImport to create a JSON representation of the data to log:
This is working fine on the production site, which is on version 3.0.246.
I'm working on a dev copy which is on 3.0.262, and when I delete a user I'm getting an error saying the class cannot be found. The Process module is working fine.
I assume this is related to the recent refactoring of the core? I see in the class file:
I've not tried the second option here, perhaps that would work, but the first says it should work in any version?