Item10715: Doesn't work well with cache
Priority: Enhancement
Current State: New
Released In: n/a
Target Release: n/a
When changing state, the built-in cache doesn't get updated, so the page doesn't change.
This can probably be fixed by adding
refresh=cache
to the redirect urls.
Or maybe, it was related to
other problems I was having.
A simple test:
- enable cache
- go to the examples in Sandbox
- run through the states until you get past the one which does not give you the edit screen
If the page doesn't change, then it is because the cache isn't getting refreshed. Suggested patch:
Index: WorkflowPlugin/lib/Foswiki/Plugins/WorkflowPlugin.pm
===================================================================
--- WorkflowPlugin/lib/Foswiki/Plugins/WorkflowPlugin.pm (revision 11634)
+++ WorkflowPlugin/lib/Foswiki/Plugins/WorkflowPlugin.pm (working copy)
@@ -407,7 +408,7 @@
# Flag that this is a state change to the beforeSaveHandler
local $isStateChange = 1;
$controlledTopic->save();
- $url = Foswiki::Func::getScriptUrl( $web, $topic, 'view' );
+ $url = Foswiki::Func::getScriptUrl( $web, $topic, 'view', refresh => 'cache' );
}
Foswiki::Func::redirectCgiQuery( undef, $url );
--
AndrewJones - 05 May 2011
A
save()
should always trigger a cache refresh by itself, i.e. for the page being saved. The other potential reason why
$web.$topic
isn't refreshed by
$controlledTopic
being saved is that they are different topics with no dependency between them. So to let a
save
of
$controlledTopic
refresh
$web.$topic
automatically you'd best establish a dependency between them using
$controlledTopic->addDependency($web, $topic);
at the time data from
$controlledTopic
was used to render the page for
$web.$topic
.
--
MichaelDaum - 08 May 2011