Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<object> tags removed from twig template #6733

Closed
BillyHilly opened this issue Oct 12, 2018 · 2 comments
Closed

<object> tags removed from twig template #6733

BillyHilly opened this issue Oct 12, 2018 · 2 comments
Labels
bug Issues or PR's relating to bugs builder-legacy Anything related to the legacy email or landing page builders

Comments

@BillyHilly
Copy link

What type of report is this:

| Bug report? |

Description:

I created a custom mautic theme, based off the blank theme that ships with mautic. In the custom theme's .twig files, I added an <object> tag in both the header and footer, which contained SVG logos—this way, I get the benefits of caching the SVG while also allowing me to do CSS manipulations to the SVG.

When I tested my theme out the first time, I noticed the logos were not showing. On further inspection, the <object> tags had been completely removed!

I got to googling for answers/solutions. At first I thought I'd just need to add object to the htmlAllowTags found in /app/bundles/CoreBundle/Assets/js/libraries/froala/froala_editor.js. On further inspection, I realized it already has the object tag listed.

Next thought was maybe the <object>'s attributes were the issue and would need to be added to htmlAllowedAttrs in the froala_editor.js file. Nope. It already had the only two attributes my <object> tags had: type and data. So neither one of those seem to be causing the issue—and I'm at a loss as to why the WYSIWIG is allowed to mess with .twig template code anyway.

If a bug:

| Mautic version | 2.14.2
| PHP version | 7.1.8

Steps to reproduce:

  1. Create a new theme or edit an existing theme.
  2. Add an object tag that calls an .svg resource (not sure if it does this with anything other than .svg, didn't check). Something like this: <object type="image/svg+xml" data="https://s.cdpn.io/3/kiwi.svg"></object>
  3. Save the template file, then login to mautic and create a new landing page using the theme you added the <object> tag to.
  4. You'll see in both the builder and preview page that the <object> tag gets striped out.

Log errors:

None

@npracht npracht added the bug Issues or PR's relating to bugs label Oct 19, 2018
@npracht
Copy link
Member

npracht commented Jul 17, 2020

Hi there, as we are only providing fixes for Mautic 3.x going forward, can you confirm if this continues in Mautic 3.0.1?
Thanks!

@npracht npracht added builder-legacy Anything related to the legacy email or landing page builders triage-mautic-3 labels Jul 17, 2020
@BillyHilly
Copy link
Author

Thanks @npracht
However, this post is almost 2 years old. I'd forgotten about it honestly.
And I'm on Mautic PRO now so not sure I could even test accurately there.
I believe I just threw in the towel on this one, and went with SVG's embedded directly in CSS as backgrounds and just forgot about all the fanciness I was trying to do.
An object tag with an svg that contains css animations is great to have though for alot of cases.
I just don't have a use case at the moment, nor a local instance to test on.
Maybe someone else can give it a whirl for you...

@npracht npracht closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs builder-legacy Anything related to the legacy email or landing page builders
Projects
None yet
Development

No branches or pull requests

2 participants