Halfagain IM Forums
May 22, 2012, 22:43 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Due to increasing spam we are forced to make this forum "Read Only". If you have an issue, most likely was discussed here. Use the Search function and try to find related discussions. If you can't find any helpful information, just email support at halfagain dot com"
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Template Mod Killed the Store - An Engine Bug  (Read 1116 times)
0 Members and 2 Guests are viewing this topic.
twostep
Newbie
*

Karma: 1
Offline Offline

Posts: 19


« on: August 13, 2008, 00:45 »

I just created a problem for myself that killed the store. I got a blank page in the store. All right, we go to admin.php intending to select a different template so that the store will at least run. No. Here's another blank page. We cannot even get the admin header bar.

Well, OK.. I guess my mod has a bug. I went to IE->view->source to see the html for my blank page. Surprise. There was no document start section. The first line was . So my mod somehow caused an error that I can't get a valid html document to execute.

First do the damage control. I uploaded the prior working copy of the template and restart the store. Same deal ... same blank page. At this point I can't get to admin to change templates and something has died that keeps the old template from running.

Here's what I found. (I was using the "default" template). The engine that creates php files to execute from raw templates saves the actual documents in store/common/templates_c/default....templatename.tpl.php. The html page actually displayed later comes from these files.

(Don't get lost in the names here. Php files are just html files on steroids.)

I deleted all the actual common/templates_c/default....tpl.php files to force the store engine program to make new ones. I restarted the store and things are back to normal with my prior version displayed properly.

Conclusion-> My bug triggered a bug in the storestacker engine. The bug is that the engine failed to notice a change in a template file. It failed to create a new php doc.

Have you ever uploaded a template change to your server and it got ignored? Same bug. Try deleting the common/templates_c/.php files
Logged
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #1 on: August 13, 2008, 08:58 »

I don't think a bug can trigger another bug. Whatever happens when a bug exist is the result of that bug. If it woud not exist, wold not cause any problems.

The files you deleted are cached files. The script failed to sucesfully load a page a new cahce could not been created so it could not notice a change in template. Template changes are ignored for same reason, as long as exist a cached page will be used. That is why i told people in more threads to set cache time from 7200 to 0 while work on templates to see changes in real time, or constantly use the flush cache button.
Logged
twostep
Newbie
*

Karma: 1
Offline Offline

Posts: 19


« Reply #2 on: August 13, 2008, 13:05 »

I think that the bug-on-bug part of this is a matter of viewpoint. My bug made a problem with handling the cache files visible.

Your explanation of the cache operation functionality of the common/templates_c/ directory helps focus on where the problem is using a simplier approach than my technical geek-speak description.

Fact is, my own bug landed me in a situation where the main engine didn't get far enough to notice that the cache files were expired. The cache pages were never going to be deleted no matter how long we waited. Nothing we could do would make the slightest difference until we at last realize that these files must be deleted.

The knowledge of the cache mechanism, the files and where they are hidden, and the failure characteristics are the scraps of knowledge we all need for troubleshooting the tough ones. That's lesson 1 from this.

Lesson 2 is to set cache time to zero before you need it. That helps prevent mods from being "ignored".

Lesson 3 is that someone mentioned having a debug.txt file in the root path. On a tough problem you need every indicator and clue you can get. Are there any other troubleshooting files available?
Logged
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #3 on: August 14, 2008, 08:39 »

As i know, templates_c is a smarty internal cache folder. That has some cache, but not ss pages. SS cache folder is /common/cachedir/

Only debug.txt file exist for troubleshooting.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!