Fix: CS pagination not working for visitors due to caching error
This commit is contained in:
parent
58449bb158
commit
8045055d12
2 changed files with 20 additions and 4 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
- fix: project editing in project management systems not reading fields correctly
|
- fix: project editing in project management systems not reading fields correctly
|
||||||
- fix: JavaScript race condition in dashlet prefs form
|
- fix: JavaScript race condition in dashlet prefs form
|
||||||
- fix: caching problem with overrides in dashlets
|
- fix: caching problem with overrides in dashlets
|
||||||
|
- fix: CS pagination does not work for visitors
|
||||||
|
|
||||||
7.0.6
|
7.0.6
|
||||||
- fix: Error in DateTime.pm
|
- fix: Error in DateTime.pm
|
||||||
|
|
|
||||||
|
|
@ -1101,10 +1101,23 @@ sub unsubscribe {
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
sub _visitorCacheOk {
|
||||||
|
my $self = shift;
|
||||||
|
return ($self->session->user->userId eq '1'
|
||||||
|
&& !$self->session->form->process('sortBy'));
|
||||||
|
}
|
||||||
|
|
||||||
|
sub _visitorCacheKey {
|
||||||
|
my $self = shift;
|
||||||
|
my $pn = $self->session->form->process('pn');
|
||||||
|
return "view_".$self->getId."?pn=".$pn;
|
||||||
|
}
|
||||||
|
|
||||||
sub view {
|
sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("sortBy")) {
|
if ($self->_visitorCacheOk) {
|
||||||
my $out = WebGUI::Cache->new($self->session,"view_".$self->getId)->get;
|
my $out = WebGUI::Cache->new($self->session,$self->_visitorCacheKey)->get;
|
||||||
|
$self->session->errorHandler->debug("HIT") if $out;
|
||||||
return $out if $out;
|
return $out if $out;
|
||||||
}
|
}
|
||||||
my $scratchSortBy = $self->getId."_sortBy";
|
my $scratchSortBy = $self->getId."_sortBy";
|
||||||
|
|
@ -1163,8 +1176,10 @@ sub view {
|
||||||
# is called through the api.
|
# is called through the api.
|
||||||
$self->prepareView unless ($self->{_viewTemplate});
|
$self->prepareView unless ($self->{_viewTemplate});
|
||||||
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||||
if ($self->session->user->userId eq '1' && !$self->session->form->process("sortBy")) {
|
if ($self->_visitorCacheOk) {
|
||||||
WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout"));
|
WebGUI::Cache->new($self->session,$self->_visitorCacheKey)
|
||||||
|
->set($out,$self->get("visitorCacheTimeout"));
|
||||||
|
$self->session->errorHandler->debug("MISS");
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue