From e141a01d31a7ae37b083d0ae6cf26721d7b30999 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 13 Aug 2008 20:56:04 +0000 Subject: [PATCH] fixed Gallery Cross Publish not displaying correctly --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/File/GalleryFile.pm | 6 ------ lib/WebGUI/Asset/Shortcut.pm | 3 ++- lib/WebGUI/Asset/Wobject/GalleryAlbum.pm | 8 +++++++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c1a509c8d..844ab4f60 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -22,6 +22,7 @@ - fixed: Gallery slideshow JS now has better control over the buttons - fixed: The bug enigmatically named "product". - fixed: CS Thread sort on last post reply is now working correctly. + - fixed: Gallery Cross Publish now works properly 7.5.19 - fixed: paginator doesn't show correct number of page links with a limit applied diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index 408fc6594..1af64457e 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -989,16 +989,12 @@ sub www_editCommentSave { Display the form to make a shortcut. -This page is only available to those who can edit this GalleryFile. - =cut sub www_makeShortcut { my $self = shift; my $session = $self->session; - return $self->session->privilege->insufficient unless $self->canEdit; - # Create the form to make a shortcut my $var = $self->getTemplateVars; @@ -1043,8 +1039,6 @@ sub www_makeShortcutSave { my $self = shift; my $form = $self->session->form; - return $self->session->privilege->insufficient unless $self->canEdit; - my $parentId = $form->get('parentId'); my $shortcut = $self->makeShortcut( $parentId ); diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm index 1c70af8d8..0fa2099f2 100644 --- a/lib/WebGUI/Asset/Shortcut.pm +++ b/lib/WebGUI/Asset/Shortcut.pm @@ -612,7 +612,8 @@ sub getPrefFieldsToImport { =head2 getTemplateVars -Gets the template vars for this shortcut. +Gets the template vars for the asset we're a shortcut to, with any overrides +applied. =cut diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index 1e579ea2a..4918f6ebe 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -162,7 +162,10 @@ sub addChild { # Load the class WebGUI::Pluggable::load( $properties->{className} ); - if ( !$properties->{className}->isa( $fileClass ) ) { + # Make sure we only add appropriate child classes + if ( !$properties->{className}->isa( $fileClass ) + && !$properties->{ className }->isa( "WebGUI::Asset::Shortcut" ) + ) { $self->session->errorHandler->security( "add a ".$properties->{className}." to a ".$self->get("className") ); @@ -589,6 +592,9 @@ sub getThumbnailUrl { if ( $asset->can("getThumbnailUrl") ) { return $asset->getThumbnailUrl; } + elsif ( $asset->isa( "WebGUI::Asset::Shortcut" ) ) { + return $asset->getShortcut->getThumbnailUrl; + } else { return undef; }