Gossamer Forum
Home : Products : Gossamer Links : Discussions :

GT::Template::Parser Error

Quote Reply
GT::Template::Parser Error
Sorry, I posted this in the DBManSQL forum but need a quick answer if possible. I thought that someone here might be able to help as I assume Links uses the same template parser.

Does anyone know what template file '1' in my Linux Server Error Log message is refering to?
As far as I know, none of my templates are named '1' and none of the code that I have modified calls for a template by that name. Everything seems to be running ok but the error message keeps appearing in my logs.

GT::Template::Parser (27719): Unable to locate template file '1' in '/home/path_to_script/cgi-bin/dbman/admin/templates/folder_name' or any inheritance directories at GT::Template::_compile_template line 627.

Any ideas?
Thanks.
Quote Reply
Re: [jai] GT::Template::Parser Error In reply to
Hi,

Sounds like you have a "return" somewhere. DBMan works differently to GLinks. I had a simlar problem with GComm.

AFAIK, you have to return a template name, or else GT::Template will try and parse a template named "1", which doesn't exist =)

Not sure how much help that is Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GT::Template::Parser Error In reply to
Thanks Andy.
You gave me a clue as to where to start looking and I eventually tracked down the problem.
Some of my plugins are using redirects instead of returns and the error was being caused by the script not terminating after the redirect. I added the exit (0); and it seems to have solved the problem.

print "Location:http://www.domain.com/cgi-bin/dbman/db.cgi?sid=$sid&db=db_name&do=add_form\n\n";
exit (0);

Is it usually necessary to have the exit (0); after a redirect like this?
Thanks.
Simon.
Quote Reply
Re: [jai] GT::Template::Parser Error In reply to
Further to my last post -
Peter Hargreaves was kind enough to reply to this post via email (as his forum account has been disabled by GT staff for some unknown reason).
He said -
"Ah, I think I know what the problem is. I'm guessing your redirect is the last line in the code?.....the print() is actually returning true (as it succeeded) so to stop that, underneath put:

return undef; or just return;

...that will prevent the "1" from being returned".


I have since removed the exit(0) that I mentioned in my last post and added return; instead.
So, Andy you were correct about it being a return problem.
Thank you both for your help.
Simon.