7474Hi; I have two Zope instances. On one of them, I have a boilerplate script that I use for all my clients' Web sites. Works fine. Has for years. I decided to copy it over to my other instance and I get an error. Here's the line in question: <p tal:on-error="string: mailScript() isn't defined! This should be in your *s* dir with the default installation." tal:replace="structure python:here.mailScript()" /> When the page that has this code in it is called by a form (that has the *s* directory in the URL), it throws the tal:on-error message. Even if I surf directly to that page and put the *s* dir in the URL, it still throws the error! Even if I rewrite the tal:replace to accommodate the dir: here.s.mailScript() How in the world is it doing that? The script also lives in that dir. Strange... TIA, Nancy
<p tal:on-error="string: mailScript() isn't defined! This should be in your *s* dir with the default installation." tal:replace="structure python:here.mailScript()" />
Use just: <p tal:replace="structure python:here.mailScript()" /> and tell us what error do you see now. tal:on-error catches all kind of errors that may happen and displays always same string about *s* dir (I have no idea what *s* is...) which just masks real error. I mean that instead of: 'mailScript() isn't defined! This should be in your *s* dir with the default installation.' you may write 'I don't like you so you'll se this error :P' and then wonder why this page doesn't like you ;) -- Maciej Wisniowski
Nancy Donnelly wrote:
I have two Zope instances. On one of them, I have a boilerplate script that I use for all my clients' Web sites. Works fine. Has for years. I decided to copy it over to my other instance and I get an error. Here's the line in question:
<p tal:on-error="string: mailScript() isn't defined! This should be in your *s* dir with the default installation." tal:replace="structure python:here.mailScript()" />
This is extremely bad programming style. Look at customising standard_error_message if you want to make error messages prettier... You may also want to look at MailingLogger (http://www.simplistix.co.uk/software/zope/mailinglogger) so that you get emailed salient log entries... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (3)
-
Chris Withers -
Maciej Wisniowski -
Nancy Donnelly