XF 2.3 node_id in XFCP_Preparer

Gavo

Member
Is there an easy way to grab the node id in XFCP_Preparer?

I have a function working to force using set domains in a post or an error message is displayed, this works globally, I have added forumID array in settings, but cant call node_id when posting.

Thanks

Code:
namespace Tango\Whitelist\XF\Service\Message;

class Preparer extends XFCP_Preparer
{
    public function checkValidity($message)
    {
        // get parent
        $parent = parent::checkValidity($message);
 
PHP:
if ($this->messageEntity instanceof \XF\Entity\Post)
{
// do smth. special for posts; node_id might be accessible via $this->messageEntity->Thread->node_id
}
 
Thanks this will help.

$this->messageEntity->Thread->node_id is correct.
 
Last edited:
Back
Top Bottom