From 22176bc1eb302c0afacd3dc9de3477c211ef0fe7 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 26 Sep 2008 20:18:02 +0000 Subject: [PATCH] fixed: shortcuts don't notify browsers of updates to their shortcutted asset --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Shortcut.pm | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 68687be49..5ec2a4da7 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.6.0 + - fixed: shortcuts don't notify browsers of updates to their shortcutted asset - fixed: anonymous registration with email confirmation is broken - added an epochDate field to the template for CS RSS items. The ^D(); macro can then format the epoch date. diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index 3aefef046..df0b0cdc3 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -222,6 +222,14 @@ END_SQL return $newAsset; } +#------------------------------------------------------------------- +sub getContentLastModified { + my $self = shift; + my $assetRev = $self->get('revisionDate'); + my $shortcuttedRev = $self->getShortcut->get('revisionDate'); + return $assetRev > $shortcuttedRev ? $assetRev : $shortcuttedRev; +} + #------------------------------------------------------------------- sub getEditForm { my $self = shift; @@ -962,7 +970,7 @@ sub www_view { # Make sure the www_view method won't be skipped b/c the asset is cached. $shortcut->purgeCache(); - if ($shortcut->get("className") =~ m/Asset::Wobject/) { + if ($shortcut->isa('WebGUI::Asset::Wobject')) { $self->session->http->setLastModified($self->getContentLastModified); $self->session->http->sendHeader; $shortcut->prepareView;