Skip to content

PageBundle\Form\Type\ConfigType shows escaped HTML #13355

@putzwasser

Description

@putzwasser

Mautic Version

5.0.x series

Way of installing

I installed with composer using https://github.com/mautic/recommended-project

PHP version

8.1

What browsers are you seeing the problem on?

No response

What happened?

PageBundle\Form\Type\ConfigType let's you add custom tracking JS to Mautic.
You add your custom HTML and Mautic will add it to your landing pages.

Generally, this works well, but after saving this form type shows escaped HTML.

It's an UI/UX bug, because it works as expected (except if you save this again).

Before saving
before saving

After saving
after saving

I guess, this file is responsible: https://github.com/mautic/mautic/blob/5.x/app/bundles/PageBundle/Resources/views/FormTheme/Config/_config_pageconfig_widget.html.twig#L10

Instead of {{ form_row(f) }} the google_analytics type needs to get rendered raw somehow.

How can we reproduce this issue?

  1. Add custom HTML in Configuration > Landing Page Settings > Analytics script (i.e. Google Analytics)
  2. Save
  3. Open this view again → see escaped HTML
  4. (Open any landing page, see that the tracking HTML is added as expected)

Relevant log output

No response

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct




Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T1Low difficulty to fix (issue) or test (PR)bugIssues or PR's relating to bugsconfigurationAnything related to the Mautic configuration sectiontrackingAnything related to tracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions