Skip to:
Content
Pages
Categories
Search
Top
Bottom

New Topic Validation causes post to dissapear


  • markramos83
    Participant

    @markramos83

    By default, bbPress will validate new topic fields and reload the page with errors, but all content is lost. This is pretty frustrating to a user that has entered a long post, but forgot to enter a topic title. Is there any easy workaround for this, whether it be PHP, jQuery, etc?

Viewing 2 replies - 1 through 2 (of 2 total)

  • hironroy
    Participant

    @hironroy

    I ran into the same issue w/ bbPress 2.2.3. Just the content is cleared out when a new topic has validation errors; the tags and topic type fields are preserved. I directly modified bbPress 2.2.3 in order to resolve this issue on my installation:

    1. Navigated to bbpress/includes/common/template-tags.php line 1605
    2. Removed the “if” statement so that the $post_content gets set by calling ‘bbp_get_form_topic_content’
      //if ( bbp_is_edit() ){
      $post_content = call_user_func( 'bbp_get_form_' . $context . '_content' );
      // }

    I did some minimal testing and the behavior of other topic editing seems to be unaffected by this change, and the change makes the content persist on New Topic Validation Error responses


    markramos83
    Participant

    @markramos83

    Awesome, that did it for me too – thanks! For anyone using bbPress 2.1.2 by chance, this file is located at bbpress/bbp-includes/bbp-common-template.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar