Describe your bug or feature request.

When adding order admin comment with new lines. Then saved comment is displayed without new lines but with plain text '
'.

LogCommentForm::submitForm() contains code to convert new line to br tag before saving the log message into db. Maybe it would be better to not do this and enable 'Convert newlines to HTML
tags' for the 'Log: Rendered entity' field in the 'Commerce activity' view. In such case we can have HTML tag for the new lines.

Issue fork commerce-3559548

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

khiminrm created an issue. See original summary.

khiminrm’s picture

StatusFileSize
new13.18 KB

khiminrm’s picture

Attached patch for 8.x-2.40

jsacksick made their first commit to this issue’s fork.

jsacksick’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

ivnish’s picture

Forgot to commit?

jsacksick’s picture

Status: Fixed » Needs work

Reopening after discussing this with @rszrama who thinks no escaping should happen on input but rather on output... Currently apostrophies are wrongfully escaped.
@khiminrm: Could you look into this?

jsacksick’s picture

Title: New lines in logs are printed as plain text <br /> tag » Stop escaping log template messages on input
Version: 3.0.x-dev » 3.x-dev

Ok, so let's stop escaping on input. The same "bug" affects the customer comment and the admin comment.
We likely need to expand our tests.

tbkot made their first commit to this issue’s fork.

jsacksick’s picture

Status: Needs work » Needs review

@tbkot: Can we, in the tests confirm the input is filtered?
Right now there is nothing that confirms the <script> is properly escaped.

  • jsacksick committed 716e6d37 on 3.x
    fix: #3559548 Stop escaping log template messages on input
    
    By: khiminrm...
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.