I am trying to: Add some javascript (jQuery) into a content template but everytime I try, I receive an error tht says "Content Template Not Saved". The JS code that I am trying to use is code that I am using right now in a different Content Template inside of the same website. However, when I try to add it to a new Content Template, iI receive the error. I have already tried deactivating plugins but that has not worked. I am also currently running the most up-datated versions of the Toolset plugins, so I'm not sure what has changed.
Link to a page where the issue can be seen: This issue appears in the backend of the site.
I expected to see: I expected to see the Tooslet plugin save the code I wrote.
Instead, I got: Instead, I got an error.
Hi Daniel,
Thank you for contacting us and I'll be happy to assist.
The script shown in your screenshot seems to be fine and I couldn't reproduce this issue with it, on my test website.
For further troubleshooting, I'll suggest the following steps:
1. Please scan the contents of your template to make sure that there are no missing or broken HTML or shortcode tags in it.
2. You can turn WordPress debugging on, by adding the following line of code, in your website's "wp-config.php" file, in the root directory:
( ref: https://codex.wordpress.org/Debugging_in_WordPress )
define( 'WP_DEBUG', true );
3. After that, if you see any errors/warnings on screen, in server's error logs or in browser's console ( https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors ), please share them with me.
I hope these points will help and let me know how it goes.
regards,
Waqar
I know that the JS code does not have a problem because I am running the exact same script inside of a different Content Template elsewhere on the site. The problem seems to be an issue with the Toolset plugin. For some reason it has stopped allowing me to do anything inside of the JS editor area.
Hi Daniel,
Thanks for writing back.
Do you see any script errors/warnings in the browser's console when editing that content template?
(as suggested in my point 3)
For further troubleshooting, I'll need access to your website's admin area. You can share the login details in reply to this message.
Note: Your next reply will be private and only you and our support team will have access to it.
Please take a complete backup of the website, before sharing the login details.
regards,
Waqar
Hi Daniel,
Thank you for sharing the login details.
I've noticed that when certain script code/strings are included in the "JS editor" tab ( e.g. "jQuery(window)" ), the AJAX call to save the content template is blocked with "403 forbidden" error.
( screenshot: hidden link )
There is no such security filter/restriction included with Toolset plugins and I couldn't reproduce this behavior on my test websites either.
This suggests that some plugin or security configuration on your website's server is falsely treating that script code as unsafe and blocking it.
Please test this with all non-toolset plugins disabled and if the issue persists, consult your hosting's support team, to ask about any recent changes to their security policies and configurations.
regards,
Waqar