Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress Editor – Text Formatting Not Saving?


  • AllenPayne
    Participant

    @allenpayne

    Hi everyone,

    I’m having a very annoying problem with the tinymce and bbpress. The visual editor works find when posting on wordpress posts and pages but not with bbpress.

    The problem is simple. Almost all the text formatting is lost after i save a bbpress topic.

    I used the following formatting options: bold, italic and underline.

    When i hit the “submit” button, all the formatting is lost except BOLD. not sure why this one remains.

    Anyway, i also tried to use plugins to enhance my editor (Ultimate TinyMCE and TinyMCE Advanced). Same problem. All the formatting is lost after submitting the topic. I’ve tried adding images, the get added fine but when i save the topic, they simply disappear.

    Can anyone help…This problem has been going on for too long!!!

    FYI – i tried disabling all plugins and also changed theme. It seems the problem comes from bbpress.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Bold and Italic are working fine here with bbPress, though bbPress does not have ‘underline’ as an option so I am not sure where that is coming from for you.

    Again try disabling all plugins and try it with the Twenty Eleven or Twenty Twelve themes.


    AllenPayne
    Participant

    @allenpayne

    Hi Stephen,

    Thanks for getting back to me. I tried using the Twenty Eleven theme and No difference.

    I also tried disabling all plugins (except bbpress and buddypress) and the formatting still doesn’t get saved.

    It’s obviously an issue with either bbpress or buddypress.

    Any other ideas? It drives me crazy…I’ve been trying to find a solution for several months.

    Thanks for your support,
    Allen


    AllenPayne
    Participant

    @allenpayne

    UPDATE: I also tried disabling all plugins (except bbpress) and activated Twenty Eleven theme. Still no different..

    So this means it either a wordpress or a bbpress problem.

    I would also like to mention that used this method to give wordpress it’s own directory and maybe the editor can’t access something. I dont know.

    https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Any other ideas?

    Can you create a ticket in trac please: https://bbpress.trac.wordpress.org/
    (Use the same bbpress.org user/pass to log in)

    It will be much easier for us to track this there rather than here.

    Also include as much information (Your URL structure for your site etc.) as you can and steps to reproduce the problem so we can setup the same to test it.


    AllenPayne
    Participant

    @allenpayne

    @Stephen Edgar

    After a week of testing I finally found the problem. I notice that when i change the user role to Editor and Administrator the editor works perfectly on both the backend and frontend. So i installed the User Role Editor plugin and checked the Unfiltered HTML setting and not everything works fine except for the fact that a message shows up for all users:

    “Your account has the ability to post unrestricted HTML content.” – how can i get rid of it?

    BTW…is this the best way to do it? I’m thinking it would be better to modify the way WP filters HTML instead of disabling filtering completely.

    What do you say?


    AllenPayne
    Participant

    @allenpayne

    wp-includes/kses.php seems to be the file that filters the content.


    AllenPayne
    Participant

    @allenpayne

    I found a way to make it work without disabling filtering completely. I placed this in functions.php:

    add_action(‘init’, ‘my_html_tags_code’, 10);
    function my_html_tags_code() {
    global $allowedposttags, $allowedtags;
    //$allowedposttags[“ol”] = array();
    //$allowedposttags[“ul”] = array();
    $allowedtags[“ol”] = array();
    $allowedtags[“ul”] = array();
    $allowedtags[“li”] = array();
    $allowedtags[“span”] = array( “style” => array() );
    }

    Now i have another problem. I use the Ultimate TinyMCE plugin and i have many other buttons on my editor that don’t work (i.e. Add Images, Add Video, …etc)

    How can i know what tags they are using so i can put them in the function above?


    AllenPayne
    Participant

    @allenpayne

    Alright so i came up with this function:

    /* Allowed Tags */

    add_action(‘init’, ‘my_html_tags_code’, 10);
    function my_html_tags_code() {
    define(‘CUSTOM_TAGS’, true);
    global $allowedtags;
    $allowedtags = array(
    ‘address’ => array(),
    ‘a’ => array(
    ‘class’ => true,
    ‘href’ => true,
    ‘id’ => true,
    ‘title’ => true,
    ‘rel’ => true,
    ‘rev’ => true,
    ‘name’ => true,
    ‘target’ => true,
    ),
    ‘abbr’ => array(
    ‘class’ => true,
    ‘title’ => true,
    ),
    ‘acronym’ => array(
    ‘title’ => true,
    ),
    ‘article’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘aside’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘b’ => array(),
    ‘big’ => array(),
    ‘blockquote’ => array(
    ‘id’ => true,
    ‘cite’ => true,
    ‘class’ => true,
    ‘lang’ => true,
    ‘xml:lang’ => true,
    ),
    ‘br’ => array (
    ‘class’ => true,
    ),
    ‘button’ => array(
    ‘disabled’ => true,
    ‘name’ => true,
    ‘type’ => true,
    ‘value’ => true,
    ),
    ‘caption’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ),
    ‘cite’ => array (
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘title’ => true,
    ),
    ‘code’ => array (
    ‘style’ => true,
    ),
    ‘col’ => array(
    ‘align’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘span’ => true,
    ‘dir’ => true,
    ‘style’ => true,
    ‘valign’ => true,
    ‘width’ => true,
    ),
    ‘del’ => array(
    ‘datetime’ => true,
    ),
    ‘dd’ => array(),
    ‘details’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘open’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘div’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘dl’ => array(),
    ‘dt’ => array(),
    ’em’ => array(),
    ‘fieldset’ => array(),
    ‘figure’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘figcaption’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘font’ => array(
    ‘color’ => true,
    ‘face’ => true,
    ‘size’ => true,
    ),
    ‘footer’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘form’ => array(
    ‘action’ => true,
    ‘accept’ => true,
    ‘accept-charset’ => true,
    ‘enctype’ => true,
    ‘method’ => true,
    ‘name’ => true,
    ‘target’ => true,
    ),
    ‘h1’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘h2’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘h3’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘h4’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘h5’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘h6’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘id’ => true,
    ‘style’ => true,
    ),
    ‘header’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘hgroup’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘hr’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ‘noshade’ => true,
    ‘size’ => true,
    ‘width’ => true,
    ),
    ‘i’ => array(),
    ‘img’ => array(
    ‘alt’ => true,
    ‘align’ => true,
    ‘border’ => true,
    ‘class’ => true,
    ‘height’ => true,
    ‘hspace’ => true,
    ‘longdesc’ => true,
    ‘vspace’ => true,
    ‘src’ => true,
    ‘style’ => true,
    ‘width’ => true,
    ),
    ‘ins’ => array(
    ‘datetime’ => true,
    ‘cite’ => true,
    ),
    ‘kbd’ => array(),
    ‘label’ => array(
    ‘for’ => true,
    ),
    ‘legend’ => array(
    ‘align’ => true,
    ),
    ‘li’ => array (
    ‘align’ => true,
    ‘class’ => true,
    ),
    ‘menu’ => array (
    ‘class’ => true,
    ‘style’ => true,
    ‘type’ => true,
    ),
    ‘nav’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘p’ => array(
    ‘class’ => true,
    ‘align’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘pre’ => array(
    ‘style’ => true,
    ‘width’ => true,
    ),
    ‘q’ => array(
    ‘cite’ => true,
    ),
    ‘s’ => array(),
    ‘span’ => array (
    ‘class’ => true,
    ‘dir’ => true,
    ‘align’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘title’ => true,
    ‘xml:lang’ => true,
    ),
    ‘section’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘strike’ => array(),
    ‘strong’ => array(),
    ‘sub’ => array(),
    ‘summary’ => array(
    ‘align’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘lang’ => true,
    ‘style’ => true,
    ‘xml:lang’ => true,
    ),
    ‘sup’ => array(),
    ‘table’ => array(
    ‘align’ => true,
    ‘bgcolor’ => true,
    ‘border’ => true,
    ‘cellpadding’ => true,
    ‘cellspacing’ => true,
    ‘class’ => true,
    ‘dir’ => true,
    ‘id’ => true,
    ‘rules’ => true,
    ‘style’ => true,
    ‘summary’ => true,
    ‘width’ => true,
    ),
    ‘tbody’ => array(
    ‘align’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘valign’ => true,
    ),
    ‘td’ => array(
    ‘abbr’ => true,
    ‘align’ => true,
    ‘axis’ => true,
    ‘bgcolor’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘class’ => true,
    ‘colspan’ => true,
    ‘dir’ => true,
    ‘headers’ => true,
    ‘height’ => true,
    ‘nowrap’ => true,
    ‘rowspan’ => true,
    ‘scope’ => true,
    ‘style’ => true,
    ‘valign’ => true,
    ‘width’ => true,
    ),
    ‘textarea’ => array(
    ‘cols’ => true,
    ‘rows’ => true,
    ‘disabled’ => true,
    ‘name’ => true,
    ‘readonly’ => true,
    ),
    ‘tfoot’ => array(
    ‘align’ => true,
    ‘char’ => true,
    ‘class’ => true,
    ‘charoff’ => true,
    ‘valign’ => true,
    ),
    ‘th’ => array(
    ‘abbr’ => true,
    ‘align’ => true,
    ‘axis’ => true,
    ‘bgcolor’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘class’ => true,
    ‘colspan’ => true,
    ‘headers’ => true,
    ‘height’ => true,
    ‘nowrap’ => true,
    ‘rowspan’ => true,
    ‘scope’ => true,
    ‘valign’ => true,
    ‘width’ => true,
    ),
    ‘thead’ => array(
    ‘align’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘class’ => true,
    ‘valign’ => true,
    ),
    ‘title’ => array(),
    ‘tr’ => array(
    ‘align’ => true,
    ‘bgcolor’ => true,
    ‘char’ => true,
    ‘charoff’ => true,
    ‘class’ => true,
    ‘style’ => true,
    ‘valign’ => true,
    ),
    ‘tt’ => array(),
    ‘u’ => array(),
    ‘ul’ => array (
    ‘class’ => true,
    ‘style’ => true,
    ‘type’ => true,
    ),
    ‘ol’ => array (
    ‘class’ => true,
    ‘start’ => true,
    ‘style’ => true,
    ‘type’ => true,
    ),
    ‘var’ => array(),
    );

    }

    Is there anything i should take out? For security reasons?

    After a week of testing I finally found the problem. I notice that when I change the user role to Editor and Administrator the editor works perfectly on both the backend and frontend.

    I will see if if we can reproduce this though now I am confused as to now you are inferring that all of this is based upon you using Ultimate TinyMCE.

    So i installed the User Role Editor plugin and checked the Unfiltered HTML setting and not everything works fine except for the fact that a message shows up for all users:

    “Your account has the ability to post unrestricted HTML content.” – how can i get rid of it?

    You enabled that setting, disable that setting and the message goes away!

    As to what HTML tags you allow that is up to you and none that you list above should be of a security concern.


    gertzse
    Participant

    @gertzse

    I am also trying to get rid of the message “Your account has the ability to post unrestricted HTML content.” You said “You enabled that setting, disable that setting and the message goes away!” but I cannot see where to enable/disable that setting.

    Please advise!

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