Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    576
    Plugin Contributions
    8

    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
    9,621
    Plugin Contributions
    123

    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.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Nov 2005
    Location
    France
    Posts
    576
    Plugin Contributions
    8

    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
    9,621
    Plugin Contributions
    123

    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.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    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:	63 
Size:	11.3 KB 
ID:	19513

    Yields this on the order list page:

    Click image for larger version. 

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

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

    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.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,621
    Plugin Contributions
    123

    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.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,621
    Plugin Contributions
    123

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

    This is a longshot but I recently saw something similar.
    Does the file admin/includes/init_includes/overrides/init_sanitize.php exist?

    If so, is 'comments' missing from the array prior to
    $sanitizer->addSimpleSanitization('PRODUCT_DESC_REGEX', $group);
    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.
    Do you benefit from Zen Cart? Then please support the project.

  9. #9
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    567
    Plugin Contributions
    0

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

    Quote Originally Posted by carlwhat View Post
    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.
    I have this raw HTML problem showing up on some orders, not many and I do not see anything different between these orders and the ones that display normally.
    I tried this fix on my test site and it worked fine, no more raw HTML.

  10. #10
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

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

    Quote Originally Posted by marton_1 View Post
    I have this raw HTML problem showing up on some orders, not many and I do not see anything different between these orders and the ones that display normally.
    I tried this fix on my test site and it worked fine, no more raw HTML.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 
Page 1 of 2 12 LastLast

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