From 75d9a3f08a997e8cf019f4af37bb97c72ee88dc6 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 24 Jul 2007 19:15:23 +0000 Subject: [PATCH] Allow editing previous revisions of assets in the current version tag --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetVersioning.pm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index d50551b37..421ef7a78 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -85,6 +85,7 @@ WebGUI and put into the WebGUI Community Wiki, http://www.webgui.org/community-wiki. - The Table of Contents view was removed from the Help system. The only view is now the Help Index. + - Allow editing previous revisions of assets in the current version tag 7.3.21 - fix: Self-deactivation doesn't show login screen after success diff --git a/lib/WebGUI/AssetVersioning.pm b/lib/WebGUI/AssetVersioning.pm index 5422bd53c..271e43a32 100644 --- a/lib/WebGUI/AssetVersioning.pm +++ b/lib/WebGUI/AssetVersioning.pm @@ -142,7 +142,9 @@ Returns 1 if it's not locked. Returns 1 if is locked, and the user is using the sub canEditIfLocked { my $self = shift; return 1 unless ($self->isLocked); - return ($self->session->scratch->get("versionTag") eq $self->get("tagId")); + my $ver_tag = $self->session->scratch->get("versionTag"); + my ($count) = $self->session->db->quickArray("select count(*) from assetData where assetId=? and tagId=?",[$self->getId, $ver_tag]); + return $count > 0; }