Closed nikosdion closed 2 years ago
Same as mark as spam and delete:
Akeeba Engage - An unhandled Exception has been detected
500 Akeeba\Component\Engage\Administrator\Table\CommentTable::onAfterDelete(): Argument #2 ($pk) must be of type int, null given
File <root>/administrator/components/com_engage/src/Table/CommentTable.php Line 110
Edit: After that, the comment is deleted.
That's a very, very different issue.
Ok ....
Original issue closed with 9c2ca8e9
When an admin deletes, unpublishes or publishes a comment we get an exception.
The events for onComEngageCommentsControllerAfterDelete, onComEngageCommentsControllerAfterPublish, onComEngageCommentsControllerAfterUnpublish pass a BaseController object, not a table.
Publish and unpublish call onContentChangeState. Use that instead of onComEngageCommentsControllerAfterPublish, onComEngageCommentsControllerAfterUnpublish. It gets a context, the PKs array and the value (0/1 for unpublish/publish).
Delete calls onContentAfterDelete. Use that instead of onComEngageCommentsControllerAfterDelete. It get a context and a table.