News:

Join the Facebook Fan Page.

Main Menu

Template parse error

Started by Itchigotim, May 09, 2013, 03:46:39 AM

Previous topic - Next topic

Itchigotim

Just curious if you had a chance to look, or what you found. :)
Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


Itchigotim

I noticed something, don't know if it's the cause. In my error logs it shows a lot of this (error.jpg)

Then I noticed 2 subs.php

(I downloaded the sources/subs folder to find this).

Is there a connection here, having 2 files the same name, or is this where the error lies?
Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


Arantor

QuoteIs there a connection here, having 2 files the same name, or is this where the error lies?

They don't have the same name. One is Subs.php the other is Subs.php~ and the second is a backup of your file from the last mod you added which modified it.

So you have a rogue mod that does something it shouldn't...

Kindred

sorry... work has been busy lately. I have not had a chance to get to your site yet.  I'll try to do so by tomorrow evening.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Itchigotim

Np Kindred, thanks.

Arantor, I do have a mod that was using "compatability mode" for a previous version. But this was done some time ago, before this.
Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


Arantor

Compatibility mode is no such thing. All it means is you told the package manager to use a specific set of instructions.

It is down to a rogue mod, verse is pretty much irrelevant. So what mods do you have?

Itchigotim

We think we may have this down to some missing files. You're still welcome to take a look, but that's our best guess (my tech guy).
Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


Arantor

No, it's not down to some missing files. It's an error in the code caused by one or more of the mods you have. Your 'tech guy', if he's competent, should have been able to understand the difference between an undefined index and something more serious.

Kindred

Arantor,

I had intended to look at this on Sunday, but real life has gotten the better of me til now. I plan to look at his system tonight. :)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Itchigotim

Thank you, I really appreciate it. :)
Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


Kindred

holy moly....

I ate to say it, but your site is REALLY messed up.

You have issues with packages.template.php as well as your originally note issue with profile.template.php.
You have dozens of errors dropped into the error log with each page load.

At this point, your best bet would be to reset your forum files to default and then reinstall the mods that you need, one by one -- being read to restore a backup when then mod which messed up hits again.

If you are willing to give me your ftp login info, I will see what I can do for you.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Itchigotim

Roguepinball: ¡¡ɟooɹ ǝɥʇ uo ǝʇıs ןןɐquıd ʇsǝq ǝɥʇ


RoguePin

#52
Thanks, Kindred, and every1 else for your assistance.

It seems inevitable that a full wipe and fresh reinstall of SMF will be best at this time. Then rebuild one package at a time, as you suggest.

"I say we take off and nuke the entire site from orbit ... it's the only way to be sure." - Ripley, Aliens


RoguePin

UPDATE:

Damn ... I'm encountering very strong resistance in trying to resolve these Template Parse Errors.

A wipe and fresh reinstall of SMF won't work with a populated dbase. The installer suggests that I should use the Upgrader. I'm going to try that next ... but I don't know if simply upgrading the install will work. I'm thinking I'll still have the Parse Errors.

In FTP, I've removed all duplicate files ("index.template.php~", and all other dupe files with the ".php~" ext) from the ./Sources and other dirs. No effect; TPEs persist.

I've tried using the "repair_settings.php". No effect; TPEs persist.

QuoteTemplate Parse Error!

There was a problem loading the /Themes/default/Profile.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

The TPEs are affecting this "profile.template.php" file, as well as other files depending on what function within the forum generated the error. When I look at the .php files, I don't see where the error is. I do have a limited understanding of PHP ... but the lines that are specified in the error logs look fine to me.

I don't understand the part about "single quotes (') have to be escaped with a slash (\)". There are over 3000 lines of code in the Subs.php file, which, up until recently, have been working for several months. Much of the code uses single quotes extensively. Would all those 3000+ lines have to be "escaped with  a slash (\)"?! If so, why was it working previously, and is not working now? Has the code been changed (I think this unlikely)?

Here's an example from the Error Logs:

QuoteURL: hxxp:roguepinball.com/index.php?board=6.08 [nonactive]
Error: Undefined variable: header_doneFile
File: /home/trepadmn/public_html/roguepinball.com/Sources/Subs.php
Line: 2916

Here's the handler that starts at Line 2916:

$do_header = $header === null ? !$header_done : $header;
if ($do_footer === null)
$do_footer = $do_header;


My PHP skills are limited ... but this appears ok to me; I don't see where the error is occurring.

I'm running out of ideas. If you, Kindred, or anyone else, would be kind enough to get into it in FTP and see where we went wrong, both Tim and I would be very grateful. Kindred, if you've rec'd Tim's access info, that should work. Or let me know and I can resend it in PM. Thanks.

Antechinus

Using a large upgrade pack will overwrite all your existing files, so that means no more parse errors. :)

First thing is to try it with just uploading the files, and without actually running the upgrade script. You shouldn't need to run the upgrade script. You just need fresh files.

Kindred

#55
ummm....   darn.

By deleting those files, you have made my update for you somewhat harder, since I no longer know which of your files were updated by mods or not. anyway...

I am doing an ftp right now....


OK...  and now I am having a definite WTF moment...
fresh files have been loaded.
temporarily disabled the custom theme
forum cache was cleared
local cache was cleared...
and I *STILL* get a parse error on various template files

I may need access to your cpanel so I can get into the database to disable some of the mods which now may be partially installed...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MrPhil

Quote from: RoguePin on May 19, 2013, 03:29:44 AM
A wipe and fresh reinstall of SMF won't work with a populated dbase.
Don't reinstall SMF. It's a different operation to overwrite your files with the contents of the Large Upgrade package (zip file). You will end up with a working, albeit "vanilla" version of SMF. From there you can start re-installing your mods. To install/reinstall SMF will wipe out your database, losing all the members and their posts.

QuoteIn FTP, I've removed all duplicate files ("index.template.php~", and all other dupe files with the ".php~" ext) from the ./Sources and other dirs. No effect; TPEs persist.
No surprise there. php~ files are backups of your php files, saved when you installed a mod. They are not used, and can be erased once you are confident that your mod install is good and you will not be needing to roll back the mod installation.

QuoteI've tried using the "repair_settings.php". No effect; TPEs persist.
Unlikely to have any effect, but worth a try.

Quote
I don't understand the part about "single quotes (') have to be escaped with a slash (\)". There are over 3000 lines of code in the Subs.php file, which, up until recently, have been working for several months. Much of the code uses single quotes extensively.

Would all those 3000+ lines have to be "escaped with  a slash (\)"?! If so, why was it working previously, and is not working now?
No, no, no, no. Only if you have single quotes within a single-quote-delimited string do you need to escape the inner quotes. E.g.,
echo 'Please don't eat the daisies.';
is bad because the ' in don't ends the string (Please don) and PHP will wonder what to do with the "t".
echo 'Please don\'t eat the daisies.';
is OK because the ' in don't will not be recognized as "special" (i.e., ending a string).

Quote
Here's an example from the Error Logs:

QuoteURL: http://roguepinball.com/index.php?board=6.08
Error: Undefined variable: header_doneFile
File: /home/trepadmn/public_html/roguepinball.com/Sources/Subs.php
Line: 2916
Most likely an incomplete mod installation or removal. You're missing the code that defines the variable $header_done. It might be in this file or it might be in another file.

Kindred

Mr Phil,

(if you read the next message) I did a replace of all their files. The template error still exists, even with clean files.
At this point, I am boggled... unless there is a server-side cache that is not controlled by SMF.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MrPhil

Well, vanilla SMF only has about 3 lines involving $header_done, all in Subs.php. You've cleared out their SMF cache, too? Everyone has cleared their browser caches?

Kindred

I know...   it's the strangest thing I have ever seen.

I have confirmed that all files in FTP are showing new dates and the correct bytes to reflect the clean files.
I have cleared the browser and the SMF cache...

I am scratching my head at this point...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: