[Petal] [BUG] petal:attr no longer supported

Jean-Michel Hiver jhiver at mkdoc.com
Sat Oct 18 18:11:18 BST 2003


> Well, it appears that part of my problems with splitpath and Taint
> errors have to do with a Petal bug. The bug is causing confess to be
> called. Unfortunately, in my application, it appears to be using
> CGI::Carp's version of confess (even though `use Carp;` is defined in
> Petal::CodeGenerator).
> 
> At any rate, here is the error message:
> 
> [PETAL ERROR] Cannot parse <?attr name="" value=""?> : 'name' attribute
> is not defined at /usr/local/share/perl/5.6.1/Petal/CodeGenerator.pm

This error usually happens when you have an attributes tag like this:

<tag petal:attributes="<EXPRESSION>">

Instead of

<tag petal:attributes="sometag <EXPRESSION>">
                      ^^^^^^^^^

Which makes me think I need to change Petal so that it gives a better
error message for that kind of mistake.


> line 345
> 
> This is caused because the attr shortcut for attribute is no longer
> supported. Was this intentional or an oversight in the modifications to
> the latest release?

No, the 'attr' processing instruction is only a CodeGenerator hack for
petal:attributes. Nothing has changed, nothing to see here, move along
sir :)


> My problems with taintmode continue to plague me and I'm wondering if
> there are other shortcuts which I use in my templates that are no longer
> supported. JM, can you confirm that all shortcuts are still viable and
> working in 1.10_0x?

Yes, everything should be the same. Old oddities such as petal:if,
petal:inner, etc... everything ought to work.


Your patience, efforts and useful comments greatly help improve Petal
and are very much appreciated. Now I guess I'll have to look at making
this error message look better :)

Cheers,


More information about the Petal mailing list