You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#105521 Editor is removing parts of JS script when I switch from Code to JCE Editor tab

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Valle on Monday, 04 January 2021 15:04 GMT

hundenarr
Dear JCE Editor Team,
I am trying to add a script code into an article. In JCE code preview and it is working, but when I am switching back to "Editor" tab and back to JCE code preview, some parts of the code is removed.
JCE Editor modifications made in an attempt to save code:
Joomla Filtering - Set to No Filtering for the user group
'Editor Parameters' - 'Cleanup and Output' Setting - I set the Validate HTML setting to - No
'Advanced' Settings - 'Allow Javascript', 'Allow CSS' and 'Allow PHP' to - Yes
'Plugin Parameters' - 'media support settings' - 'Allow IFrames' to Yes

Even if I only open an article in editor tab view without switching to code preview, parts of the script are removed after saving text changes. Any hint, what can be doneto prevent this?
I add screenshots of the sourcecode before switching to the Editor tab, and what it looks like after switching back to the Code tab.

Attachments

Ryan
The <daa-wgt> tag is not valid HTML and is an empty tag, which is why it is removed.

Please try JCE Pro 2.8.19 Beta 6 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

This includes a new system of Code Blocks that allow script tags and custom XML (like your <daa-wgt> tags) to be edited directly in the editor.

You will need to enable Allow Javascript and Allow Custom XML in Editor Profiles -> Editor Parameters -> Advanced.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hundenarr
Hi Ryan,
I installed JCE Pro 2.8.19 Beta 8 and tested it.
It worked, when I added the script in code preview, then switch back to editor tab view and saved the changes then.
Strangely it worked not, when I added the script and saved changes directly in code preview, In this case parts of the script get still removed after saving text changes.

Ryan
This should be fixed now in beta9 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hundenarr
Hi Ryan,
you are right, the problem was fixed, everything worked fine. But now, with JCE Pro 2.9.1 and Joomla! 3.9.23 I recognized the problem again, as described before.

Ryan
Please try JCE Pro 2.9.2 RC - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hundenarr
Yep, that seems to work, as far as I can see. Thank you!

hundenarr
Hy Ryan,
I have the well known problem again with deleted iframe code. It was on a website, where I didn´t had installed the 2.9.2 RC1 candidate, which solved the problem. So I installed the new one, JCE Pro 2.9.2 RC5. But the iframe code was deleted again, when I swithced back from code preview to editor tab. Iframe code attached.

Attachments

Ryan
I'm not seeing this in my tests. Please send me a login - https://www.joomlacontenteditor.net/contact/site-login

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

hundenarr
Ok, I installed RC5 on another joomla website and testetd RC5 there, JS and iframe was saved correctly there.

So I checked all default profile settings on my "problem website". Some update, maybe an earlier release candidate, seems to have changed some of JCE settings (I surely didn´t it changed it manually, there was no need to do that).

Default Profile - Editor Parameters - Cleanup and output: Validate HTML setting was Inherite instead of No.

Plugin Parameters - Media Support - Allow IFrames was No instead of Yes (I used it with Yes for years)
I changed the settings and everything is fine again.

Valle
I still have a similar issue like the one described by the op. If I have something like
<div @click=...>
in my article, the "@" is being removed as soon as I change the tabs in the JCE. I'm currently using JCE Pro 2.9.2 RC5 and have everything set up as described above. No filters, allow css, javascript, ... and even set the "cleanup" to no. But the code above will still become
<div click=...>
if I switch from "code" to "editor" and back.

Ryan
@click is not a valid HTML attribute. If you are using this as a shortcut attribute for a javascript framework, such as Vue, then you need to use the full attribute name istead, eg: v-on:click

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Valle
Thanks, didn't know that.