fix - [ 1216066 ] url caching broken
This commit is contained in:
parent
6b53c79940
commit
08b9808b33
1 changed files with 26 additions and 2 deletions
|
|
@ -2139,7 +2139,7 @@ Returns 1. Deletes an asset from tables and removes anything bound to that asset
|
|||
|
||||
sub purge {
|
||||
my $self = shift;
|
||||
WebGUI::Cache->new("asset_".$self->getId)->delete;
|
||||
$self->purgeCache;
|
||||
$self->updateHistory("purged");
|
||||
WebGUI::SQL->beginTransaction;
|
||||
foreach my $definition (@{$self->definition}) {
|
||||
|
|
@ -2155,6 +2155,30 @@ sub purge {
|
|||
|
||||
=head2 purgeTree ( )
|
||||
|
||||
Purges all cache entries associated with this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub purgeCache {
|
||||
my $self = shift;
|
||||
|
||||
my $assetId = $self->getId;
|
||||
my $assetUrl = $self->getUrl;
|
||||
$assetUrl =~ s/^\///; #remove beginning / from url
|
||||
my $lineage = $self->get("lineage");
|
||||
|
||||
WebGUI::Cache->new("asset_".$assetId)->delete;
|
||||
WebGUI::Cache->new("asseturl_".$assetUrl)->delete;
|
||||
WebGUI::Cache->new("childCount_".$assetId)->delete;
|
||||
WebGUI::Cache->new("firstChild_".$assetId)->delete;
|
||||
WebGUI::Cache->new("lastChild_".$assetId)->delete;
|
||||
WebGUI::Cache->new("lineage_".$lineage)->delete;
|
||||
|
||||
}
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeTree ( )
|
||||
|
||||
Returns 1. Purges self and all descendants.
|
||||
|
||||
=cut
|
||||
|
|
@ -2338,7 +2362,7 @@ Hash reference of properties and values to set.
|
|||
sub update {
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
WebGUI::Cache->new("asset_".$self->getId)->delete;
|
||||
$self->purgeCache;
|
||||
WebGUI::SQL->beginTransaction;
|
||||
foreach my $definition (@{$self->definition}) {
|
||||
my @setPairs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue