From 48a01cc878b6fc064068927a69f5253889500046 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Tue, 29 Aug 2006 13:12:05 +0000 Subject: [PATCH] fix: Matrix 'Can instantiate template' --- docs/changelog/7.x.x.txt | 3 +++ lib/WebGUI/Asset/Wobject/Collaboration.pm | 5 +++++ lib/WebGUI/Asset/Wobject/Matrix.pm | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index c329057f8..0c2616942 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -13,6 +13,9 @@ - fix: extra elements (tags) do not show up in HTML source (Martin Kamerbeek / Procolix) - fix: Error in StockData Default View Template (Wouter van Oijen / Procolix) + - fix: Matrix 'Can instantiate template' and also fixed a bug where the style + and printable style were not set for the Collabs attached to the listings + in the Matrix (Martin Kamerbeek / Procolix) 7.0.6 diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 77f6402fd..c4558ffbb 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -1157,6 +1157,11 @@ sub view { $p->setDataByQuery($sql); $self->appendPostListTemplateVars(\%var, $p); $self->appendTemplateLabels(\%var); + + # If the asset is not called through the normal prepareView/view cycle, first call prepareView. + # This happens for instance in the viewDetail method in the Matrix. In that case the Collaboration + # is called through the api. + $self->prepareView unless ($self->{_viewTemplate}); my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate}); if ($self->session->user->userId eq '1' && !$self->session->form->process("sortBy")) { WebGUI::Cache->new($self->session,"view_".$self->getId)->set($out,$self->get("visitorCacheTimeout")); diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index a9cc85d61..d36ad51db 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -719,7 +719,9 @@ sub www_editListingSave { karmaRatingMultiplier => 0, moderatePosts => 0, moderateGroupId => '4', - postGroupId => '7' + postGroupId => '7', + styleTemplateId => $self->get('styleTemplateId'), + printableStyleTemplateId => $self->get('printableStyleTemplateId'), }); WebGUI::VersionTag->getWorking($self->session)->commit; $data{forumId} = $forum->getId;