Skip to content

[Issue] Fixed the welcome message contains single quote character #35481

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #34061: Fixed the welcome message contains single quote character


Description (*)

This PR is fixed for the issue, that if we put the single quote character to the header welcome message config, it will lead the frontend to have a bunch of console errors:

Uncaught SyntaxError: Unable to process binding "ifnot: function(){return customer().fullname }"
Message: Unable to parse bindings.

Manual testing scenarios (*)

  1. From Admin, navigate to Content -> Design -> Configuration
  2. Select a theme and Edit
  3. In the edit page, expand the Header setting, put the Welcome Text, like "Welcome Khoi's store!"
  4. Clear cache, then go to frontend, you'll see a JS error, and some JS functions not working because of this issue.

Questions or comments

Maybe we need to bind the message as a text, instead of HTML binding, like:

data-bind="text: 'escapeHtmlAttr($welcomeMessage) ?>'"

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: AccountComponent: ThemeIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions