From 3d79b8b26c35d439e055f601ddba0f50ba732ad9 Mon Sep 17 00:00:00 2001 From: Arjan Widlaak Date: Fri, 17 Dec 2010 23:06:27 +0100 Subject: [PATCH] - fixed bug 11997: maximumAssets is ignored - fixed bug 11998: maximumAssets prevents editing existing assets if maximum is reached --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c056ae177..2aaffe01d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,8 @@ - added #11968: use the language override in the registration form (Jukka Raimovaara / Mentalhouse Oy) - Changed Carousel to use TinyMCE with WebGUI plugins - fixed #11984: No JS allows invalid dates in Event asset + - fixed #11997: maximumAssets in config is ignored (Arjan Widlak / United Knowledge) + - fixed #11998: maximumAssets affects not only new assets, but als prevents editing existing assets if maximum is reached 7.10.6 - fixed #11974: Toolbar icons unclickable in Webkit using HTML5 diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 0865c74c7..020bd95a7 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -2999,10 +2999,10 @@ sub www_editSave { my $isNewAsset = $session->form->process("assetId") eq "new" ? 1 : 0; return $session->privilege->locked() if (!$self->canEditIfLocked and !$isNewAsset); return $session->privilege->insufficient() unless $self->canEdit && $session->form->validToken; - if ($self->session->config("maximumAssets")) { + if ($self->session->config->get("maximumAssets")) { my ($count) = $self->session->db->quickArray("select count(*) from asset"); my $i18n = WebGUI::International->new($self->session, "Asset"); - return $self->session->style->userStyle($i18n->get("over max assets")) if ($self->session->config("maximumAssets") <= $count); + return $self->session->style->userStyle($i18n->get("over max assets")) if ( $self->session->config->get("maximumAssets") <= $count && $isNewAsset ); } my $object; if ($isNewAsset) {