No content on website

interkob

Avatar: interkob

2013-01-12 12:20

After I changed few product names in en_products.php, all website content has gone :O After undo no results too. That shouldn't happen. So you should let the people know, how to get it work again.

» Quick.Cart v6.x

boboo

Avatar: boboo

2013-01-12 12:35

You have changed directly in the database file?
Congratulations.
If you don't know how a serialized array is built, don't touch it.

Yes, you are right, "that shouldn't happen"... your handwork in the file.

www.kimla.de

interkob

Avatar: interkob

2013-01-12 12:44

If I need to change the same word in many places, I go to database and replace it in bulk. Now I need to find a way how to restore all that.

boboo

Avatar: boboo

2013-01-12 13:04

As you maybe have seen, the structure of a serialized array is very simple, but not resistant against handmade changes.
Now you have to check the whole array - normally only the strings - for their length.
You see there something like this:

s:5:"sName";


It means: now a string with 5 character comes -> s:5
and following "sName" with 5 characters. Everything OK.
But happy counting with, for example, this:

s:3091:"<p>Sed imperdiet placerat quam. Pellentesque ut ipsum. Nulla elementum, nisl in pellentesque condimentum, ligula nisi nonummy augue, sit amet ornare tellus libero sed risus. Nam elementum, arcu sit amet fermentum ultrices, tortor est feugiat leo, sit amet aliquet velit massa at massa. Proin molestie eleifend diam. In tempor. Suspendisse mauris enim, semper feugiat, auctor placerat, sodales eu, felis. Sed rutrum, nunc vel aliquam placerat,...


If only one discrepance exists in the whole array, you will get the error message.

www.kimla.de

interkob

Avatar: interkob

2013-01-12 13:13

I noticed this. Now I need to play a little. Thanks for advice.

interkob

Avatar: interkob

2013-01-12 13:38

All is ok with the content, but still doesn't work. I tested with another one. When I use Encoding without BOM, than is ok. But in regular mode it stops working without any mistakes inside.

boboo

Avatar: boboo

2013-01-12 14:06

Look into the function getData() in /core/libraries/flat-files.php
in the line:

$aData unserializefile_get_contents$sFileNamenullnull15 ) );


there is a value "15".
What does this mean?
That means, that the head of the database php file may have only 15 chars.
it has:

<?php exit; ?> = 14 chars


But at the end of the line there is a LF char.
So it is OK.
In case of "wrong enter" you add at the end of line a CR char and now you have 16 chars in the head line, and the array cannot be unserialized.

www.kimla.de

interkob

Avatar: interkob

2013-01-12 14:13

I got it work again. Only some data were lost. Thanks.

boboo

Avatar: boboo

2013-01-12 14:15

In case of BOM you will get a char before this <?php exit...
And the length of 15 is no more given.

www.kimla.de

Back to top
about us | contact