• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

'DataWriter_Discussion_Thread' error

Mr. Goodie2Shoes

Well-known member
#1
okay, so I made this add-on: http://xenforo.com/community/resources/xensocialize-by-xencode.763/
whose main objective is to send a tweet whenever someone creates a thread... but it seems like it's also triggered when someone 'moderates' the thread (e.g. moving the thread to a different forum, deleting the thread etc...), the error has been posted by stewart1champ here: http://xenforo.com/community/threads/xensocialize-by-xencode.32084/#post-366691

and I am totally confused on what should I do next... any kinda help is welcomed :)
 
R

ragtek

Guest
#2
You can use $this->isInsert() inside your DW (and also check the message_state)

e.g that's from my automatic facebook notifier:
PHP:
if ($this->get('message_state') == 'visible')
{
if ($this->isInsert() || $this->getExisting('message_state') == 'moderated')
{
// todo move this from core to seperate add-on
Ragtek_FacebookCore_Helper::postOnUserProfile($post);