I'm trying to create a thread post using a code and I get this error:
I use this code:
Is there a better way?
MySQL query error : Field 'position' doesn't have a default value in src/XF/Db/AbstractStatement.php at line 183
$post = $this->em()->create('XF:Post'); $post->thread_id = $id; $post->user_id = $userId; $post->username = $username; $post->message = $message; $post->save();