• I’m inserting some line breaks in the Popup message of an element, then I’m saving the chart.

    When I view the chart on the front-end, I click on the chart element, but the Popup message displays as one single line, whitout line breaks.

    When I’m again editing the elment’s Popup, it’s message appears as a single line, without the line breaks I inserted and saved before.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    What version of our plugin are you using?

    Also, can you share the URL of the chart page?

    Thanks.

    I’m using version 1.4.2

    I’m currently testing it in localhost. I haven’t uploaded the site yet.

    Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    Did you change the editor from “Visual” to “Text” mode?

    Thanks.

    This problem happens whether if I change the editor to “Text” mode, or if I just edit it on “Visual” mode without changing it to “Text”.

    Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    Can you send us the code that you have inserted into the editor?

    We will test it on one of our demo pages.

    Thanks.

    I did not insert code, just some random text with line breaks, like:

    
    First Line
    
    Second line
    
    Third line
    

    If I insert the line breaks in the HTML view (either as <br> tags or as <p> paragraphs), they don’t dissapear when I view the chart/popup on the front-end.

    But when I reopen the popup tab in the chart editor, it displays on the “Visual” mode, the line breaks are there; but if I update the element information and save the chart, the line breaks are lost. Also, if I reopen it on the “HTML” mode, the <br> and <p> tags are no longer there.

    Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    We will check it and then we will let you know.

    Thanks.

    Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    We’ve fixed the bug and updated the plugin. Now you can download the newest version, it should work correctly.

    Thanks.

    I have downloaded the latest version, but I think the bug is only partially fixed:

    When I reopen the popup tab on the chart element editor, the line breaks are still there after I saved the chart. That’s Ok.

    But when I’m on the site’s front end, I click on an element from the chart, and the popup’s content appears as one single line; the line breaks are not being displayed.

    Plugin Author wpdevart

    (@wpdevart)

    Dear @jasaldivara.

    Clear your website and browser caches after the update. Maybe there is a cache problem.

    Thanks.

    I cleared caches, but the popup text still shows as one single line in the front end while it appears as multiple lines in the editor.

    When I change the text on the editor to another multi-line text, the new text is shown in the front end, except that it appears as one sinlge line instead of multiple lines.

    But after looking at the source code of your plugin, I found a possible fix adding a call to nl2br PHP function in front/tree_class.php file. I changed the line 176 from this:

    
    $popup['html'] = '<div date-popup-theme = "' . $node['node_info']['popup_theme'] . '" class="wpda_tree_popup_content wpda_tree_element_hidden"><div class="wpda_popup_innerhtml">' . apply_filters('the_content', htmlspecialchars_decode($node['node_info']['popup_html'])) . '</div></div>';
    

    To this:

    
    $popup['html'] = '<div date-popup-theme = "' . $node['node_info']['popup_theme'] . '" class="wpda_tree_popup_content wpda_tree_element_hidden"><div class="wpda_popup_innerhtml">' . apply_filters('the_content', htmlspecialchars_decode(nl2br($node['node_info']['popup_html']))) . '</div></div>';
    

    And now the line breaks are correctly displayed on the popup.

    Plugin Author wpdevart

    (@wpdevart)

    Okay @jasaldivara.

    We will check it again.

    Thanks.

    Plugin Author wpdevart

    (@wpdevart)

    Hi @jasaldivara.

    We have tested and it works correctly, so it may be a local issue on your end.

    Thanks.

    Plugin Author wpdevart

    (@wpdevart)

    Hi.

    We will close this topic, if you have other questions let us know.

    Thanks.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Line breaks in Popup message are lost when saving’ is closed to new replies.