Search
Other Sourcerer questions
Forum

Joomla keeps stripping out the code when saving

Bill Schnute's Avatar Bill Schnute
I am trying to put some code: using sourceror in a hikashop product file on joomla. I use pro version. Whenever I save it, joomla strips out the code and just leaves curly tags. What am I doing wrong?

<script>
pintrk('track', 'pagevisit', {
line_items: [
{
product_id: '
bulk-honey-flat-rate-gal
'
}
]
});
</script>
Sarah Hayes's Avatar Sarah Hayes
Hi Peter,

I am having a similar, but intermittent issue with Sourcerer (free). It's been fine for a while and then yesterday and this morning it has started playing up again, but this afternoon it's working.

Default editor being used is JCE Editor Pro.

Enter some JavaScript (backend editing) and nothing is displayed in the frontend, but the code is there in the editor. Close page, open page, try again and it might work or might not. Change editor to TinyMCE and inserted code and it worked. Went back to JCE and it wouldnt work. Try again with JCE and it worked and has continued to work.

I've read the article about <tag>, do [[tag]], but as it's now working I can't try this out, but will try if it happens again. Could what causes the tag issue be an intermittent problem?

Best regards

Sarah
Peter van Westen's Avatar Peter van Westen ADMIN
Well, if the code is there in the editor (after save), but not on the frontend, then this is a different issue.
Please post a rating at the Joomla! Extensions Directory
Doyle P Glaze II's Avatar Doyle P Glaze II
I am having the same issue. I am posting the following code, and clicking save. The code gets stripped. I am using JCE. Also does it in CodeMirror and TinyMCE and with No Editor. This program does not work!

{source}<?php echo date ("Y-m-d");?>{/source}

Joomla 4.1.3
Sourcerer 9.2.1 Pro
JCE 2.9.22

UPDATE: I have opened all permissions on my site, and it still does not work!

I have had this program for 15 mins and am not happy. What is the process for getting a refund?
Peter van Westen's Avatar Peter van Westen ADMIN
Did you read the faq I mentioned?
docs4.regularlabs.com/sourcerer/faqs/tro...n-i-save-the-article
Please post a rating at the Joomla! Extensions Directory
Doyle P Glaze II's Avatar Doyle P Glaze II
Using JCE
Entered
{source}[[?php echo date ("Y-m-d");?]]{/source}
Click Save
What I get after save.
{source}[[{/source}
Peter van Westen's Avatar Peter van Westen ADMIN
Well, that would be a JCE issue. Has not much to do with Sourcerer itself.
But if you want a refund, no problem.
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
@Doyle Let me know if you managed to get JCE to not strip your code. And if you still want a refund or not...
Please post a rating at the Joomla! Extensions Directory
Sarah Hayes's Avatar Sarah Hayes
I have been having the same issue. I think it could be a Firefox cross site security feature or maybe just a bug. Have you tried other browsers?

I have a website where we have had intermittent issues. The client uses JS code provided by Mailchimp to display archive newsletters. They can never seem to add it and be able to view the generated archive list. But when I try, after a couple of goes I usually can, but other times I can't. I've done all the usual things like reinstall Sourcerer, switch caching off, clear site cache and browser cache, changed editor, switched off editors, switch RSFirewall off, checked RSFirewall and server firewall to make sure that Mailchimp IPs aren't blocked etc. Plus the [[ ]] trick which had seemed to work last time.

If I add the code to a standard HTML page, I can see the generated archive list, so the code itself is working. If I view Joomla article page source, I can see the JS code is there, but no generated list.

They had problems again this week and this time, I couldn't get it to work either. Quite by accident, I realised the the localhost version of the site that I am currently working on, did have the generated list (in all browsers). Now although I am sure I've tried other browsers before, I can't be 100% sure, but right now, I can see the generated archive list on the live site in Chrome and Safari, but not Firefox, which is my default/go to browser.
Peter van Westen's Avatar Peter van Westen ADMIN
To be clear, Sourcerer is not involved with saving the article or displaying the content in the editor. That is all down to the editor and whatever setting are set in the editor config.

And yes, I guess browser plugins could mess things all. But I doubt it.
Please post a rating at the Joomla! Extensions Directory
Sarah Hayes's Avatar Sarah Hayes
Hi Peter,
I know it isn't Sourcerer. Saving isn't an issue. The code is saved. It is definitely an issue with Firefox not displaying the embedded list generated by the JS. A collegue is having the same issue with Firefox. Even FF with no plugins.
Peter van Westen's Avatar Peter van Westen ADMIN
So it is a completely different issue to what this thread is about.

Check if the javascript code is in your html output (check the View Source in your browser, not the Element Inspector).

If the code is there, then Sourcerer is doing what it should.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription