#1068: AgaviExecutionFilter: Fragment caching fails with uninitialized variable
$viewGroups
--------------------+-------------------------------------------------------
Reporter: graste | Owner: david
Type: defect | Status: new
Priority: normal | Milestone: 1.0.1
Component: filter | Version: 1.0.0
Severity: normal | Keywords: execution filter fragment caching
Has_patch: 0 |
--------------------+-------------------------------------------------------
I have an action/view combo that has an {{{executeHtml()}}} and an
{{{executeXml()}}} method. The {{{executeXml()}}} just returns
{{{$dom->saveXML();}}} as response; The executeHtml creates an action
forward.
Cache definition looks like this:
{{{
<?xml version="1.0" encoding="UTF-8" ?>
<ae:configurations
xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0"
xmlns="http://agavi.org/agavi/config/parts/caching/1.0"
xmlns:xi="http://www.w3.org/2001/XInclude">
<ae:configuration>
<cachings>
<caching lifetime="30 seconds" enabled="true">
<groups>
<group>somename</group>
<group source="request_data">some</group>
<group source="request_data">thing</group>
</groups>
<views>
<view>Success</view>
</views>
<output_types>
<output_type name="xml">
</output_type>
</output_types>
</caching>
</cachings>
</ae:configuration>
</ae:configurations>
}}}
When I try to cache the XML output only I get the following error in the
compiled AgaviExecutionFilter:
{{{
Notice: Undefined variable: viewGroups in ... (should be line 506 in the
original file)
}}}
which leads to:
{{{
Catchable fatal error: Argument 2 passed to
AgaviExecutionFilter::abortedCacheCreationCallback() must be an array,
null given, called in ... (line 94, the array parameter type)
}}}
A simple
{{{
$viewGroups = array();
}}}
in Line 469 or elsewhere up in the AgaviExecutionFilter::execute() method
fixes the problem for me.
Other variables like {{{$viewCache}}}, {{{$actionGroups}}},
{{{$actionCache}}} are similar "uninitialized", but may be okay for most
cases. Perhaps that should be checked as well...
--
Ticket URL: <https://trac.agavi.org/ticket/1068>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets