Weather template and template-switching bug
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Your screenshot shows that no language files of the weather template could be included/found...maybe you're missing files?! Or the UTF-8 subdir?
Regards,
Garvin
Your screenshot shows that no language files of the weather template could be included/found...maybe you're missing files?! Or the UTF-8 subdir?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi Garvin.
This is very crazy. When I install a new template by spartacus then I can see the normal input mask for "about", "contact", colors and so on. It all seems pretty well.
But after clicking the save-button, all (and it doesn't matter which template I choose) looks like in the screenshot before. I can use "smallbiz" - it looks good - save - it looks like the screenshot. I can choose "weather_template" - it looks good (without language-problems) - save - and it looks like in the screenshot.
That S9y couldn't find some language files is possible, because i deleted the whole "weather_template" folder to fall back to the default-template. But this sadly didn't work (although it worked before!).
This is very crazy. When I install a new template by spartacus then I can see the normal input mask for "about", "contact", colors and so on. It all seems pretty well.
But after clicking the save-button, all (and it doesn't matter which template I choose) looks like in the screenshot before. I can use "smallbiz" - it looks good - save - it looks like the screenshot. I can choose "weather_template" - it looks good (without language-problems) - save - and it looks like in the screenshot.
That S9y couldn't find some language files is possible, because i deleted the whole "weather_template" folder to fall back to the default-template. But this sadly didn't work (although it worked before!).
Visit Hokeys Blog!
Is it possible to "talk" to the template-switcher via code in the adressbar of the browser? Maybe I could switch back to a working template so that my blog is reachable again. (So bad that I can't reach the backups of my provider today. Had never problems with my provider, just today...)
UPDATE
Pooh, I was able to use a backup! All seems to be okay now.
UPDATE
Pooh, I was able to use a backup! All seems to be okay now.
Visit Hokeys Blog!
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Hi all,
I'm back at a machine I can work from.
Hokey, when you say "All seems to be okay now." does that mean the weather template is working for you? Or does that mean you got back to the place you started?
YellowLed, I can't see anyway the line that is a problem would be a problem.
*sigh* Any chance you could troubleshoot it and see if $old_include is being set correctly, and that PATH_SEPARATOR is a valid static? Echoing them should be enough.
I guess there could be a setting that prevents the template from either setting the directory path, or from reading the current directory name, but I don't have any idea what setting it would be.
I'm back at a machine I can work from.
Hokey, when you say "All seems to be okay now." does that mean the weather template is working for you? Or does that mean you got back to the place you started?
YellowLed, I can't see anyway the line that is a problem would be a problem.
*sigh* Any chance you could troubleshoot it and see if $old_include is being set correctly, and that PATH_SEPARATOR is a valid static? Echoing them should be enough.
I guess there could be a setting that prevents the template from either setting the directory path, or from reading the current directory name, but I don't have any idea what setting it would be.
Matthew (Feeling generous?)
Good to have you back safe and soundmgroeninger wrote:I'm back at a machine I can work from.
Let's see ...mgroeninger wrote:Any chance you could troubleshoot it and see if $old_include is being set correctly, and that PATH_SEPARATOR is a valid static? Echoing them should be enough.
echo($old_include):
Code: Select all
.:/usr/share/php:/usr/share/pear:/var/www/serendipity/bundled-libs/:/var/www/serendipity/bundled-libs/Smarty/libs/:/var/www/serendipity/:
I'm not sure if this is correct, but "echo(PATH_SEPERATOR);" says "PATH_SEPERATOR", so I'm guessing I need the $ (I really don't know much PHP, so please correct me if something's wrong).
YL
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Ahh, that might be a problem...
Something like: should echo a colon, if I am using the right variable. So I don't think I am (or it is not defined in the language files). And you shouldn't need the dollar sign in front because it is a defined static (not really a variable).
Can you add this to the top of the config.inc.php file:
And then add the troublesome line back in?
Hopefully that is enough to fix it!
Something like:
Code: Select all
echo(PATH_SEPARATOR);Can you add this to the top of the config.inc.php file:
Code: Select all
@define('PATH_SEPERATOR',':');Hopefully that is enough to fix it!
Matthew (Feeling generous?)
Nope, didn't do the trick, sorry. I do get a blank page for the blog, no output code whatsoever, and plus, "Configure Plugins" gives me a blank page, too.mgroeninger wrote:Can you add this to the top of the config.inc.php file:And then add the troublesome line back in?Code: Select all
@define('PATH_SEPERATOR',':');
Hopefully that is enough to fix it!
YL
Hi Matt!
My blog was working again. I just got the weather-template working by deleting all lines from line 146 on to the end of the config.inc.php.
That meant that I had a working backup with my smallbiz-template.mgroeninger wrote:Hi all,
Hokey, when you say "All seems to be okay now." does that mean the weather template is working for you? Or does that mean you got back to the place you started?
Visit Hokeys Blog!
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Ok, folks, sorry for absence. I've had a whole slew of stuff come up that is sucking my time away from s9y, but I want to get this template taken care of and released, so I am trying to focus on this.
Is there any chance I could have FTP access to either (or both) of your servers and few hours of downtime to play with them? Basically, I'd just ask you to set the default template to the weather template, then I would log in and fiddle with the config.inc.php and try to figure out exactly where the problems are.
If that isn't possible, here is what I would like ask you to to try:
YellowLed: Can you try to change the line to these and let me know what happens:
1.
2.
3.
4.
Could you also re-enable to the and remove the block that follows it: and see what that does?
Hokey: Is there anyway you could start at the bottom of the file and re-add lines until it stop working? That would help me find which line (or block) of code is causing you problems. Most of the code I would expect to break is at the top of the if statement, so I am hoping you can narrow it down a bit.
Thanks for your guys' patience! Hope things are well!
Is there any chance I could have FTP access to either (or both) of your servers and few hours of downtime to play with them? Basically, I'd just ask you to set the default template to the weather template, then I would log in and fiddle with the config.inc.php and try to figure out exactly where the problems are.
If that isn't possible, here is what I would like ask you to to try:
YellowLed: Can you try to change the line
Code: Select all
$new_include = $old_include . dirname(__FILE__)."/lib".PATH_SEPARATOR ; 1.
Code: Select all
$new_include = $old_include; Code: Select all
$new_include = dirname(__FILE__)."/lib".PATH_SEPARATOR ; Code: Select all
$new_include = dirname(__FILE__).PATH_SEPARATOR ; Code: Select all
$new_include = $old_include .PATH_SEPARATOR ; Code: Select all
if (function_exists('set_include_path')) {
$use_include = @set_include_path($new_include);
} else {
$use_include = @ini_set('include_path', $new_include);
}Hokey: Is there anyway you could start at the bottom of the file and re-add lines until it stop working? That would help me find which line (or block) of code is causing you problems. Most of the code I would expect to break is at the top of the if statement, so I am hoping you can narrow it down a bit.
Thanks for your guys' patience! Hope things are well!
Matthew (Feeling generous?)
Impossible, I'm sorry. This machine we're talking about is not really a server, it's just my desktop machine at home, which doesn't even have a permanent net connection.mgroeninger wrote:Is there any chance I could have FTP access to either (or both) of your servers and few hours of downtime to play with them?
Will domgroeninger wrote:If that isn't possible, here is what I would like ask you to to try:
YL
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
Yeah, that's what happened after backing up mylady's music collection to 18(!) CDs (yes, one reason for doing all this is that the machine got a DVD-RW installedcarl_galloway wrote:And you're right, you're going to be absolutely exhausted after that, I'm not a religious man so praying won't help you, how about your put yourself into a jedi trance and let the force guide you.
So I'm back at my home machine, let's get started:
1.
Code: Select all
$new_include = $old_include;2.
Code: Select all
$new_include = dirname(__FILE__)."/lib".PATH_SEPARATOR ;3.
Code: Select all
$new_include = dirname(__FILE__).PATH_SEPARATOR ;4.Warning: Smarty::require_once(Smarty/libs/internals/core.is_secure.php) [function.Smarty-require-once]: failed to open stream: No such file or directory in /var/www/serendipity/bundled-libs/Smarty/libs/Smarty.class.php on line 1594
Fatal error: Smarty::require_once() [function.require]: Failed opening required 'Smarty/libs/internals/core.is_secure.php' (include_path='/var/www/serendipity/templates/weather_template:') in /var/www/serendipity/bundled-libs/Smarty/libs/Smarty.class.php on line 1594
Code: Select all
$new_include = $old_include .PATH_SEPARATOR ;If I use the original line and remove the following block, I also get the working template like in 1. and 4.
Hope that's been of any help ...
YL
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Actually, that is a pretty big help... It at least tells me we're not having some kind of funky php version/function problem.
Can you make sure that the folder "/var/www/serendipity/templates/weather_template/lib" exists and is readable by the webserver?
That folder contains two PEAR modules which are needed for the template to get/cache weather info (and that may explain why the template isn't actually working).
The template uses the same trick as s9y core to set the php include path so that local PEAR modules are used. Since the first line change works for you, and leaving the line but removing the code to actually change the include path works for you, it means the problem would be somewhere in what the new include path is actually being set to.
Could you try removing the code block:
again and adding this instead (after the line that sets $new_include of course):
That should print the path variable the template is trying to set the path to, which might tell us what is going on.
Can you make sure that the folder "/var/www/serendipity/templates/weather_template/lib" exists and is readable by the webserver?
That folder contains two PEAR modules which are needed for the template to get/cache weather info (and that may explain why the template isn't actually working).
The template uses the same trick as s9y core to set the php include path so that local PEAR modules are used. Since the first line change works for you, and leaving the line but removing the code to actually change the include path works for you, it means the problem would be somewhere in what the new include path is actually being set to.
Could you try removing the code block:
Code: Select all
if (function_exists('set_include_path')) {
$use_include = @set_include_path($new_include);
} else {
$use_include = @ini_set('include_path', $new_include);
}Code: Select all
echo $new_include;Matthew (Feeling generous?)