Blank page showing with Static Pages plugin

Found a bug? Tell us!!
Post Reply
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Blank page showing with Static Pages plugin

Post by wesley »

I'm having troubles with Static Pages plugin version 2.50. It seemed to have worked for a while, but now it doesn't work again.

I have no problems with version 2.34 of the plugin and until the problem is fixed I've downgraded it to this version.

It seems to be related to the implementation of allowing custom templates that's causing it. Now, back when it worked, I had to have the .tpl file put in the templates/default/ folder. That was weird since it's supposed to work even when it was in the same folder as the plugin.

Anyways, what happens now is that, if the plugin_staticpage.tpl file is with the plugin or in templates/default/, and I load the static page, I get a blank page instead.

Viewing the source of the HTML reveals that it only has ONE line:
<!-- ENTRIES START -->
Now that's just not right.

Meanwhile, if I delete (well, move it to somewhere the plugin doesn't know) the plugin_staticpage.tpl, I do have the page loading, except for the actual content of the static page, which is still left blank. This is what happened back when the plugin 'worked' but the template file was in the same directory as the plugin.

I've made sure the files I'm working with were properly downloaded. I've dropped the database (serendipity_staticpages) and re-entered the data to make sure I'm not having corrupt data problems. None of this has helped the situation. I'm not sure what's causing this.
I make s9y plugins, too.
My s9y blog depends on them. :)
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

More on the problem!

Post by wesley »

Okay, I've done some poking around, and I think I've located the point of failure, but not how to fix it yet.

I'm using s9y 0.8.2.

I've inserted an echo statement inside "function show()" within the plugin that looks like this:
echo '<b>test</b>';
I've moved around this statement along each line of the function, and most of the times it appears after the ENTRIES START thingy according to the source. Nothing unusual there.

But after this line:
$content = $serendipity['smarty']->fetch('file:'. $tfile, null, null, false);
The echo statement does NOT work (i.e. does not show up after ENTRIES START part). This would explain the "echo $content;" line not working, and thus not putting anything out. It might also be why everything else doesn't show up either; the whole echo statement processing somehow gets disabled and every other element of the page doesn't get processed.

Something happened on that line.

Now, when there is no valid $tfile (i.e. no plugin_staticpage.tpl file anywhere) to retrieve, it doesn't process my static page content, but show all other elements of the page. The test echo statement also works. In other words, the echo statement processing isn't disabled.

EDIT: I've looked further into the fetch command, and it looks like it initially disables echo, if I understood correctly? Apparently it didn't re-enable it onwards or maybe I'm not looking at this right...

The strange thing is that the template file in question is exactly the same file that I had used back when version 2.50 of this plugin sort of worked.

P.S. I think SourceForge site is online again.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: More on the problem!

Post by garvinhicking »

Very strange, in my debugging environment it does work.

Is your plugin_staticpage exactly the file that is delivered by default, or did you change anything inside the file?

Can you try to make a die ($tfile) before the smarty->fetch method so see what contents the $tfile variable contains? Maybe it is trying to fetch a wrong file?

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

/Library/WebServer/Documents/blog/plugins/serendipity_event_staticpage/plugin_staticpage.tpl
Which is... actually the correct path and filename, as far as I'm concerned.

Also, the version that's causing the problem is an unmodified v2.50 one. Perhaps it's a 'fetch' problem but surely, this command would be used a lot in other places, too?

Very strange, indeed.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Yes, the fetch function itself should work. And, the plugin does its work on my page. Did you check a PHP/Apache errorlog to see if there are Smarty Warnings that might be surpressed? Setting errorlevel to E_ALL?

And could you, before the $serendipity['smarty'] thing is called add a print_r($serendipity['smarty']) directive? Maybe the object is not properly initialized...

Maybe it is a problem of your template? Can you try if it works with the default Serendipity template instead your toolbox one?

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/
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Ahhh! Found the problem.

Apache log showed that templates_c was not writable by the webserver and the script sort of pooped itself. I fixed the permissions. No problems now. Thanks for the help. :)

BTW, I've checked out BerliOS... the SVN client is running fine on my Mac. SourceForge account hasn't been updated, though.
I make s9y plugins, too.
My s9y blog depends on them. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Ah, great :)

I've now also added your SF.net account!

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/
Post Reply