Skip to content

Conversation

@frapell
Copy link
Member

@frapell frapell commented Nov 12, 2025

@petschki So, apparently the fix I did here was lost because around that time it was the ES6 rewrite happening...

@petschki petschki force-pushed the frapell-master-fix-486 branch from 38dca23 to d3a11c0 Compare November 12, 2025 22:36
@petschki
Copy link
Member

Thanks for this. I've simplified the access to the tiny instance on a mosaic tile, since the code was already there. Can you take a look at this?

@petschki petschki force-pushed the frapell-master-fix-486 branch from d3a11c0 to 10dcd20 Compare November 13, 2025 10:42
Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions for @petschki

@thet
Copy link
Member

thet commented Nov 13, 2025

Oh, I actually wanted to "Request changes" instead of approving. But if you solve the one valid problem, it's good to go.

@petschki
Copy link
Member

@thet @frapell I've refactored the panel/tile initialization for simpler access to tile.tinymce instances. There were some redundant initializeContent and initialize steps which got removed.

now when saving/bluring a "richtext tile" the getContent() is called correctly.

Note: I've noticed, that the schema.text field tile is handled differently than standardtiles.html tiles (because it is saved into the default edit form) ...

Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petschki tnx for the code improvement!

LGTM except one minor suggestion added.
I already approve so that this doesn't get blocked.

can we apply these changes to 3.1.x also?

@petschki
Copy link
Member

@frapell can you check this and confirm, that your mentioned usecase is solved with that?

@frapell
Copy link
Member Author

frapell commented Nov 16, 2025

@petschki @thet I tested this branch with buildout.coredev and it does work as expected, i.e. adding to the code plugin something like

<p>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" type="text/javascript"></script>
</p>

Will look exactly like that when viewing the saved mosaic.

This is not the case for the 3.1.x branch, as I explained in #657 not sure if it is me?

BTW, to test this in a fresh site, you need to go to the tinymce configuration panel, then to the advanced tab and add

{"extended_valid_elements" : "script[*]"}

Also, need to go to the HTML Filtering control panel, and mark the Disable HTML filtering setting

@petschki
Copy link
Member

petschki commented Nov 17, 2025

Here's the result from my tests with 6.1 coredev checkout:

Scenario:

  1. add RichText Tile
  2. add iframe Code snippet in tiny's code view
  3. direcly hit save on top left

Here's the result with master branch:
Bildschirmfoto 2025-11-17 um 08 42 57

interestingly, also the markup for the tinymce resizing UI got saved into the markup (because the iframe was selected inside tiny)

And the result with this fix here:
Bildschirmfoto 2025-11-17 um 08 44 59

The markup got the cleanup form getContent() correctly.

@frapell I've also tried that with <script> tags. This works too, but I just needed to add the script tag to the allowed_tags in the html filtering controlpanel. No extra settings for tinymce.

I'll merge this now and checkt the 3.1.x fix since this still doesn't call getContent correctly.

@petschki petschki merged commit f054430 into master Nov 17, 2025
10 checks passed
@petschki petschki deleted the frapell-master-fix-486 branch November 17, 2025 07:53
@petschki petschki restored the frapell-master-fix-486 branch November 17, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants