Topic #3698 (no title)

Image

(Click to enlarge)

#2899 - restore.php error on line 197

This is a spacer post for a website comment topic. The content this topic relates to: #2899 - restore.php error on line 197
Hi,

The backup restoration hasn't been tested in v10, that's an oversight.

I have just found and corrected the bug here, but I'm currently overhauling the code to be tidier and implementing a unit test so we have automated testing of this in the future.

Btw, the editor highlighting thing is actually a bug in your editor, but we will work around that with our update too.
Chris: re your BTW note.
The code editor used by InMotionHosting cPanel also shows highlights the coding error as well. I did a bunch of research on the str_replace function and concluded that your code should be correct. I discovered that the editors I checked don't like the "?" in the search argument.

Please note the next line of code in restore.php. i.e. $file = str_replace('', '', $file); I think that is a 'do nothing' line of code that maybe should be addressed in the overhauling. I'm aware that it won't slow the process down much. Just a suggestion.
The thing about '<?php' is the PHP parser won't parse the PHP start tag (<?php) inside quotes, but many editors will. So it looks like an error but isn't. So we break it up now like '<'.'?php' to fool the editors.

That str_replace line was odd, got like that via mass search and replace across the code years ago I think, didn't cause harm but now removed.

I have finished overhauling the backup system and adding the unit test. The code is now much cleaner and more robust. It will be included in the next RC.
https://github.com/ocproducts/composr/commit/56c86acfae2594e23b073a06b4cfdfa5cfe6583f
Thanks Chris
A quick question: Once the next RC is here and installed, will I be able to run a full backup and then change to one of my older restore_data files and then run via the newly generated restore.php file? My son and I both got errors in the gallery somewhere between RC18 & RC20. (A gallery that was used on the front page as well as in the gallery section would only show an "image" icon where the full size picture should have been in the gallery. In my attempts to correct, I think that I messed up the database big time and would like to restore back to R18.)
Yes that should work.

I'm not following about the (still) gallery issue, but if it's a bug please report in a new issue.
0 guests and 0 members have recently viewed this.