Re: debugging
Lathan Bidwell <[email protected]> Fri, 11 Dec 2015 08:09:30 -0500
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <CAOqPvqjPpZaWakaK+B6f7tAT4hE=dNT8mcdd6Ex_4o=Hz6RkOQ@mail.gmail.com> |
--===============5106206441847716696==
Content-Type: multipart/alternative; boundary=001a11444e40adf36805269f08e5
--001a11444e40adf36805269f08e5
Content-Type: text/plain; charset=UTF-8
That's because the syntax for defined is more like:
IF help.defined('id');
See the full docs:
http://template-toolkit.org/docs/manual/VMethods.html#section_defined_exists
Lathan
Hmm,
>
> I've found a way to make that error go away.
>
> The keyword-index index included another template called shared.tt and
> it had a line that said:
>
> IF help.id ;
>
> If I comment out that line and relevant code around it, the error goes
> away. But if I substitute
>
> IF help.id.defined ;
>
> I still get the error.
>
> Any thoughts on why that doesn't fix the error too?
Cheers, Dave
>
> Dave Howorth wrote:
> > I'm sure I've forgotten something simple about how to debug templates.
> >
> > I have DEBUG_ALL on and I'm seeing this message:
> >
> >
> > keyword-index: Template undef error - id is undefined
> >
> >
> > keyword-index.tt is a template but it doesn't have any variable or
> > component of a variable called id
> >
> >
> > Neither do I see how to connect the error messages with any of the debug
> > output above it, which is a bunch of lines similar to the last pair:
> >
> >
> > [Template::Context] filter(lower, [ ]<no alias>)
> > [Template::Filters] fetch(lower, <no args>,
> > Template::Context=HASH(0xe614920))
> >
> >
> > Any thoughts on how to identify my error gratefully received.
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
>
>
--001a11444e40adf36805269f08e5
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div>That's because the syntax for defined is mor=
e like:</div><div><br></div><div>IF help.defined('id');</div><div><=
br></div><div>See the full docs:=C2=A0<a href=3D"http://template-toolkit.or=
g/docs/manual/VMethods.html#section_defined_exists">http://template-toolkit=
.org/docs/manual/VMethods.html#section_defined_exists</a></div></div><div><=
br></div><div style=3D"">Lathan</div><br><div class=3D"gmail_extra"><div cl=
ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);borde=
r-left-style:solid;padding-left:1ex">Hmm,<br>
<br>
I've found a way to make that error go away.<br>
<br>
The keyword-index index included another template called <a href=3D"http://=
shared.tt" rel=3D"noreferrer" target=3D"_blank">shared.tt</a> and<br>
it had a line that said:<br>
<br>
IF <a href=3D"http://help.id" rel=3D"noreferrer" target=3D"_blank">help.id<=
/a> ;<br>
<br>
If I comment out that line and relevant code around it, the error goes<br>
away. But if I substitute<br>
<br>
IF help.id.defined ;<br>
<br>
I still get the error.<br>
<br>
Any thoughts on why that doesn't fix the error too?=C2=A0</blockquote><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pa=
dding-left:1ex">
Cheers, Dave<br>
<span class=3D""><br>
Dave Howorth wrote:<br>
> I'm sure I've forgotten something simple about how to debug te=
mplates.<br>
><br>
> I have DEBUG_ALL on and I'm seeing this message:<br>
><br>
><br>
> keyword-index: Template undef error - id is undefined<br>
><br>
><br>
> <a href=3D"http://keyword-index.tt" rel=3D"noreferrer" target=3D"_blan=
k">keyword-index.tt</a> is a template but it doesn't have any variable =
or<br>
> component of a variable called id<br>
><br>
><br>
> Neither do I see how to connect the error messages with any of the deb=
ug<br>
> output above it, which is a bunch of lines similar to the last pair:<b=
r>
><br>
><br>
> [Template::Context] filter(lower, [ ]<no alias>)<br>
> [Template::Filters] fetch(lower, <no args>,<br>
> Template::Context=3DHASH(0xe614920))<br>
><br>
><br>
> Any thoughts on how to identify my error gratefully received.<br>
<br>
</span><span class=3D"">_______________________________________________<br>
templates mailing list<br>
<a href=3D"mailto:[email protected]">templates@template-toolki=
t.org</a><br>
<a href=3D"http://mail.template-toolkit.org/mailman/listinfo/templates" rel=
=3D"noreferrer" target=3D"_blank">http://mail.template-toolkit.org/mailman/=
listinfo/templates</a></span><br>
<br>
</blockquote></div><br></div></div>
--001a11444e40adf36805269f08e5--
--===============5106206441847716696==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates
--===============5106206441847716696==--