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

Iframe code in redactor field breaks matrix block title bar when collapsed #9964

Closed
MoritzLost opened this issue Oct 14, 2021 · 2 comments
Closed
Labels

Comments

@MoritzLost
Copy link
Contributor

MoritzLost commented Oct 14, 2021

Description

I'm getting a really weird error regarding collapsed matrix blocks. Specifically, I have a matrix block with a redactor field inside. In the redactor field, I need to enter some sample HTML code for an iframe (so I want to display literally <iframe src="..."></iframe> on the page as code). The problem is that when I collapse this block, the interface breaks because the MatrixInput JS somehow finds that iframe and inserts it as HTML into the title bar.

The following screenshots demonstrate the problem:

matrix-demo-1
matrix-demo-2
matrix-demo-3-broken

Note that I entered the escaped HTML (with &gt; & &lt;) manually in the code view, since for some reason redactor parses it as HTML when entered normally.

EDIT: After some more testing, I can confirm this isn't related to Redactor. The problem appears to be related to the escaped HTML entities – if those are entered into a plain text field, the same error occurs.

So in a single text field, this is fine:

<iframe src="https://www.begabungslotse.de/suchformular" width="100%" height="300px" frameborder="0"></iframe>

But entering this causes the error above:

&lt;iframe src="test" width="100%" height="300px" frameborder="0"&gt;&lt;/iframe&gt;

Steps to reproduce

  1. Create a matrix field with a redactor field or plain text field inside it and add it to any entry type.
  2. Create an entry of that type, add a matrix block and paste the following code into the text field (if it's a Redactor field, paste into the HTML source view): &lt;iframe src="https://example.com" width="100%" height="300px" frameborder="0"&gt;&lt;/iframe&gt;
  3. (Maybe save the page)
  4. Collapse the panel. The interface will break. Using the devtools you can verify that the title bar somehow contains the iframe as a real element.

Additional info

  • Craft version: 3.7.16
  • PHP version: 8.0
  • Database driver & version: MySQL 8
  • Plugins & versions: Redactor (2.8.8)
@brandonkelly
Copy link
Member

Thanks for reporting that! Just fixed for the next release.

@brandonkelly
Copy link
Member

Craft 3.7.17 is out now with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants