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

XF 1.3 Do not require any content in a post in order to create a new thread.

Discussion in 'Styling and Customization Questions' started by Dynamic, Mar 16, 2014.

  1. Dynamic

    Dynamic Well-Known Member


    Is there a way to stop the "Please enter a valid message" text giving an error without actually including anything in the post?

  2. RoldanLT

    RoldanLT Well-Known Member

    Why should you create a thread without a content? :/
  3. Dynamic

    Dynamic Well-Known Member

    Because I am not using my installation for a community to focus on discussion. The discussions are not as important.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Doesn't make much sense but do an empty quote or bb code.
    Amaury likes this.
  5. Dynamic

    Dynamic Well-Known Member

    Hi @Brogan,

    This would require the user to need to do this when creating the thread. I would much prefer it if the user need not add a single thing to the editor.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to either edit the code then, or develop an add-on to override the default functionality.
    Amaury likes this.
  7. Dynamic

    Dynamic Well-Known Member

    Cool. Do you know where I would be able to find the code that says it needs something in there to post?
  8. Brogan

    Brogan XenForo Moderator Staff Member

    A quick search for please_enter_valid_message results in two relevant hits in:

  9. Dynamic

    Dynamic Well-Known Member

    Thanks mate :)
  10. Dynamic

    Dynamic Well-Known Member

    Hi everyone,

    This one was easy. Thanks to @Brogan for pointing me to that file :)

    If anyone else wishes to do this, this is what I did.

    Open up library\XenForo\DataWriter\DiscussionMessage.php


                    'message'                => array('type' => self::TYPE_STRING, 'required' => true,
    Replace with

                    'message'                => array('type' => self::TYPE_STRING, 'required' => false,

Share This Page