Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2005
    Posts
    500
    Plugin Contributions
    6

    Default Comments field in right pane of admin orders shows raw html

    I've tested this on a vanilla 1.5.7c installation and found that since CKEditor is loaded by default on the orders details page, any comments typed in here will show all the html formatting when viewing the order information in the right hand pane of the order summary page.

    Comments
    <p>let's test this idea out shall we</p>
    <p> </p>
    <p><span style="font-size:12px;"><span style="font-family:Arial,Helvetica,sans-serif;"><span style="background-color:#c0392b;">Does it have raw html code?</span></span></span></p>
    <p> </p>
    <p> </p>

    Doesn't make for very easy reading.

    I could just change
    Code:
    $contents[] = array('text' => nl2br(zen_output_string_protected($orders_history_query->fields['comments'])));
    to
    Code:
    $contents[] = array('text' => nl2br(zen_output_string($orders_history_query->fields['comments'])));
    but I assume you have used zen_output_string_protected rather than zen_output_string for a reason.

    Is there a fix for this so the admin posted comments display in a easy to read format?
    Last edited by strelitzia; 14 Apr 2021 at 12:37 PM.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,974
    Plugin Contributions
    109

    Default Re: Comments field in right pane of admin orders shows raw html

    Did you press the "Source" button before you entered that HTML? I can't reproduce your problem unless I paste HTML into the box without pressing Source first.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  3. #3
    Join Date
    Nov 2005
    Posts
    500
    Plugin Contributions
    6

    Default Re: Comments field in right pane of admin orders shows raw html

    Quote Originally Posted by swguy View Post
    Did you press the "Source" button before you entered that HTML? I can't reproduce your problem unless I paste HTML into the box without pressing Source first.
    No. I just tested again and this is what displays in configurationColumnRight

    Comments
    <p>Content typed into CKEditor</p>

    <p>No buttons pressed prior to typing.</p>

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,974
    Plugin Contributions
    109

    Default Re: Comments field in right pane of admin orders shows raw html

    Maybe someone else can replicate it.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    938
    Plugin Contributions
    0

    Default Re: Comments field in right pane of admin orders shows raw html

    Quote Originally Posted by swguy View Post
    Did you press the "Source" button before you entered that HTML? I can't reproduce your problem unless I paste HTML into the box without pressing Source first.
    I don't think the OP was entering HTML, just plain text. I can replicate this.

    Adding a comment on the orders details page (without changing any of the CKeditor settings):

    Click image for larger version. 

Name:	2Untitled.png 
Views:	14 
Size:	11.3 KB 
ID:	19513

    Yields this on the order list page:

    Click image for larger version. 

Name:	1Untitled.png 
Views:	13 
Size:	14.1 KB 
ID:	19514
    Simon

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,042
    Plugin Contributions
    5

    Default Re: Comments field in right pane of admin orders shows raw html

    this can be addressed as so:

    in this file your_admin/orders.php line 1425, aka here:

    https://github.com/zencart/zencart/b...ders.php#L1425

    PHP Code:
    // change this line from:

    $contents[] = array('text' => nl2br(zen_output_string_protected($orders_history_query->fields['comments'])));

    //to:

    $contents[] = array('text' => nl2br(zen_output_string_protected(strip_tags($orders_history_query->fields['comments'])))); 
    best.
    help with WCAG is now here! PM if you want some help with this. (or any ZC issue).
    if you feel so inclined, feel free to send some cake....

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,974
    Plugin Contributions
    109

    Default Re: Comments field in right pane of admin orders shows raw html

    I have a client who is reporting HTML Entities (like &nbsp;) showing up in the comments in 1.5.7. Still haven't seen the raw HTML issue reported above.

    Tried a few modifications to editors/ckeditor/config.js and nothing seemed to fix it. Turning off CKEditor for comments field on order details for now.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

 

 

Similar Threads

  1. v156 Attributes Option Name Comments field display HTML
    By Nick1973 in forum Setting Up Categories, Products, Attributes
    Replies: 16
    Last Post: 6 May 2020, 02:51 PM
  2. HTML Area is Showing Raw HTML
    By cpearsall in forum Customization from the Admin
    Replies: 1
    Last Post: 5 Jan 2011, 03:42 PM
  3. Replies: 9
    Last Post: 27 Aug 2010, 05:10 AM
  4. Adding to Important Links - Right Side Pane
    By oldwolfe in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 29 Jul 2009, 06:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR