Fix a problem where an unviewable initial asset would throw off the indent_loop

size by 1.  In the nav templates, this would generate bad closing markup.
This commit is contained in:
Colin Kuskie 2008-12-31 16:58:26 +00:00
parent 70a5299114
commit 436ca52676
2 changed files with 8 additions and 4 deletions

View file

@ -21,6 +21,7 @@
- refixed #9147: Misspellings in Account
- fixed #9348: Required Upgrade Step Not Documented - 7.6.0
- fixed #8993: Gallery Image Details Overlap Image
- fixed #9380: CoolMenus template - invalid markup affecting page layouts
7.6.7
- fixed #9263: Thingy possibleValues processing, and List type autodetection.

View file

@ -405,10 +405,6 @@ sub view {
my $previousPageData = undef;
my $eh = $self->session->errorHandler;
foreach my $asset (@{$assets}) {
# Set absoluteDepthOfFirstPage
if ( !defined $absoluteDepthOfFirstPage ) {
$absoluteDepthOfFirstPage = $asset->getLineageLength;
}
# skip pages we shouldn't see
my $pageLineage = $asset->get("lineage");
@ -426,6 +422,13 @@ sub view {
$lineageToSkip = $pageLineage unless ($pageLineage eq "000001");
next;
}
# Set absoluteDepthOfFirstPage after we have determined if the first page is viewable!
# Otherwise, the indent loop calculation below will be off by 1 (or more)
if ( !defined $absoluteDepthOfFirstPage ) {
$absoluteDepthOfFirstPage = $asset->getLineageLength;
}
my $pageData = {};
my $pageProperties = $asset->get;
while (my ($property, $propertyValue) = each %{ $pageProperties }) {