I am trying to write a plugin that runs upon doc publish, as part of the plugin I am trying to retrieve the id of the published/calling doc I have tried the following line which from reading docs etc should work
$resourceId = $modx->resource->get('id');
But as soon as I add this line to the code it causes it to stop working, I can run plugin np without the line and it does most of what I want, but retrieving the doc id would make it work as required.
There are no errors showing in either the server logs or the modx log, the plugin just stops working.
Can anyone spot any problems with the above line.