Post by bluestreak » Tue Feb 10, 2015 9:45 am

Hi All,

I have recently been setting up OpenCart as a replacement to a homegrown e-commerce product as I simply do not have enough time to continue working on it and need something that offers the functions like opencart does.

I had the site working nicely and was slowly transferring the products and categories across when out of no where the main site has stopped working and I cant for the life of me understand/remember what I have done that has caused it.

The site was a basic 2.0.1.1 installation and I have installed the import/export tool along with the fix for the FTP. This had been and still is working as far as I can tell.

I haven't even changed the template yet!

Whats happening is the home page only appears to show the bottom of the site. Im missing the logo, the menus and the sliders. All other pages just result in a blank page.

I have tried to show errors and see if there is anything in the log but this isn't appearing as an error. I have even gone as far as backing up the Database and creating a brand new fresh installation with no mods which loaded ok to begin with but after restoring the database to it results in the same. This obviously leads me to believe there is something wrong with the database.

Upon closer inspection I have also noted that there appears to be something wrong with the HTML output.
Inspecting the source shows this:

the head begins ok but gets to this point:

Code: Select all

<script>
  (function(i,s,o,g,r,a,m){i[\\\\\\\
then there's a whole heap of '\', 65490 of them to be precise before it stops at this:

Code: Select all

</head>
<body class="common-home">
Chrome seems to indicate that there's a </script> missing as it shows normal HTML up until it finds the next one but its black like its just text.

I'm 99% certain this is something to do with the database where it has a strange character or something, but i just lack the skills to find it.

I'm keen to fix this as I have already put some time in configuring this site plus its good to document for anyone else!

Let me know what you need to see and Ill happily post it.

Thanks in advance
Last edited by bluestreak on Tue Feb 24, 2015 4:54 am, edited 2 times in total.

Newbie

Posts

Joined
Tue Feb 10, 2015 9:31 am

Post by bluestreak » Thu Feb 12, 2015 10:58 am

Hi,

I have found what is causing the additional / characters. It appears to be a bug with Opencart and the Google Analytics code. What I have found is that when you save the code copied from Google into Opencart slashes are added. Further saves add additional slashes.

Example Snippet:

Original

Code: Select all

ga('send', 'pageview');
Save 1

Code: Select all

ga(\'send\', \'pageview\');
Save 2

Code: Select all

ga(\\\'send\\\', \\\'pageview\\\');
Save 3

Code: Select all

ga(\\\\\\\'send\\\\\\\', \\\\\\\'pageview\\\\\\\');
As you can see that its doubling the number of slashes and adding on each time. ???

How do I stop this? I don't want to copy and paste the analytics code every time I adjust the settings...

Newbie

Posts

Joined
Tue Feb 10, 2015 9:31 am

Post by Cue4cheap » Fri Feb 13, 2015 8:34 am

Do a search for magic quotes on this forum. It might be the same fix for you.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by andyd92 » Tue Feb 17, 2015 10:47 am

This is happening to me also. Do you manage to find a solution??

New member

Posts

Joined
Tue Dec 11, 2012 1:50 am

Post by andyd92 » Tue Feb 17, 2015 11:21 am

Cue4cheap was correct.

It appears it was magic quotes causing this issue. I got my hosting support to turn off magic quotes and all appears to be good now.

New member

Posts

Joined
Tue Dec 11, 2012 1:50 am

Post by bluestreak » Tue Feb 24, 2015 4:21 am

Hi,

Sorry for the late reply the board was supposed to email me but I hadn't received any notifications!

I will have a look at this now and let you know if it fixes it for me also.

Thanks

Newbie

Posts

Joined
Tue Feb 10, 2015 9:31 am

Post by bluestreak » Tue Feb 24, 2015 4:53 am

Fixed! ;D

I can report that this is the magic_quotes_gpc option.

I use godaddy for hosting this at the moment and I added the magic_quotes_gpc = Off

Example here:

http://php.net/manual/en/security.magic ... abling.php

Newbie

Posts

Joined
Tue Feb 10, 2015 9:31 am

Post by TAC » Wed Aug 19, 2015 9:10 pm

My hosts says Magic Quotes are a thing of the past...

Is there an actual bug with Google Analytics?

User avatar
TAC
Active Member

Posts

Joined
Sun Sep 26, 2010 1:33 am
Location - England
Who is online

Users browsing this forum: Bing [Bot] and 8 guests