fixes for weaken and iterator
This commit is contained in:
parent
60cefb3102
commit
247c607393
22 changed files with 83 additions and 47 deletions
|
|
@ -27,13 +27,19 @@ use base qw(WebGUI::AssetAspect::RssFeed WebGUI::Asset::Wobject);
|
|||
#-------------------------------------------------------------------
|
||||
sub _computePostCount {
|
||||
my $self = shift;
|
||||
return $self->getDescendantCount({includeOnlyClasses => ['WebGUI::Asset::Post']});
|
||||
return $self->getDescendantCount({
|
||||
includeOnlyClasses => ['WebGUI::Asset::Post'],
|
||||
statusToInclude => ['approved'],
|
||||
});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _computeThreadCount {
|
||||
my $self = shift;
|
||||
return $self->getChildCount({includeOnlyClasses => ['WebGUI::Asset::Post::Thread']});
|
||||
return $self->getChildCount({
|
||||
includeOnlyClasses => ['WebGUI::Asset::Post::Thread'],
|
||||
statusToInclude => ['approved'],
|
||||
});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1392,7 +1398,7 @@ sub processPropertiesFromFormPost {
|
|||
my $descendant;
|
||||
eval { $descendant = $descendantIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $descendant;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ sub getEditForm {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
@ -268,7 +268,7 @@ sub prepareView {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ sub getContentLastModified {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
@ -254,7 +254,7 @@ sub view {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ use XML::Simple;
|
|||
=head1 DIAGNOSTICS
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -937,7 +938,7 @@ sub hasSpaceAvailable {
|
|||
my $file;
|
||||
eval { $file = $fileIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $file;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ sub getEditForm {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
@ -431,7 +431,7 @@ sub getContentLastModified {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ sub deleteAttribute {
|
|||
my $listing;
|
||||
eval { $listing = $listingIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $listing;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ sub view {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
|
|||
|
|
@ -381,6 +381,7 @@ sub view {
|
|||
$current = WebGUI::Asset->getDefault($self->session);
|
||||
}
|
||||
|
||||
my @interestingProperties = ('assetId', 'parentId', 'ownerUserId', 'synopsis', 'newWindow');
|
||||
# Add properties from current asset
|
||||
foreach my $property (@interestingProperties) {
|
||||
$var->{'currentPage.'.$property} = $current->get($property);
|
||||
|
|
@ -411,7 +412,6 @@ sub view {
|
|||
$rules{assetToPedigree} = $current if (isIn("pedigree",@includedRelationships));
|
||||
$rules{ancestorLimit} = $self->get("ancestorEndPoint");
|
||||
$rules{orderByClause} = 'rpad(asset.lineage, 255, 9) desc' if ($self->get('reversePageLoop'));
|
||||
my @interestingProperties = ('assetId', 'parentId', 'ownerUserId', 'synopsis', 'newWindow');
|
||||
my $assets = $start->getLineage(\@includedRelationships,\%rules);
|
||||
my $currentLineage = $current->get("lineage");
|
||||
my $lineageToSkip = "noskip";
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ sub getRssFeedItems {
|
|||
my $story;
|
||||
eval { $story = $storyIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $story;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ sub appendMostPopular {
|
|||
my $asset;
|
||||
eval { $asset = $assetIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $asset;
|
||||
|
|
@ -744,7 +744,7 @@ sub processPropertiesFromFormPost {
|
|||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
$self->session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue