#30: Compilation error with modifiers and OO syntax
Issue attachments
Issue revisions
- new by Marc Hodgins at 2009-A-07 6:09
- new by Marc Hodgins at 2009-A-07 6:09
- new by Marc Hodgins at 2009-A-07 6:09
| Type | |
|---|---|
| State | |
| Priority | |
| Resolution | |
| Assigned to | Nobody |
| Scheduled for | svn /trunk |
| Affected versions | |
| Affected components | Core |
| Last change | Tuesday 7 April 2009 06:09:26 UTC by Marc Hodgins |
Compilation fails when a modifier is applied to the output of an OO style function. For example:
Code:
@{$myObject->foo('bar')|escape}@
// where $myObject->foo('bar') returns a string
Result:
throws something to the effect of:
@Fatal error: Uncaught exception 'Dwoo_Compilation_Exception' with message 'Compilation error at line 1 in "file:myfile.tpl" : Parse error in "|escape}@
Expected behavior:
It should act just like {$foo|escape} , without a compilation error.
Jordi Boggiano at Tuesday 7 April 2009 07:23:40 UTC
That is something I might fix someday but it requires some potentially big changes to the way modifiers are parsed, and since I don't like that syntax too much I have a hard time motivating myself. So unless you want to help, in which case I could give you pointers, I would recommend you use {escape $myObject->foo('bar')} for now, which will work just fine.
thomasbachem at Monday 20 June 2011 10:39:13 UTC
I wrote a simple patch for that, find it attached.
thomasbachem at Saturday 25 June 2011 14:26:04 UTC
Find a slightly revised patch attached.