Opened 4 years ago
Last modified 17 months ago
#769 new defect
Comparison HTML templates duplicates group names in links when using nested groups
| Reported by: | ssm | Owned by: | nobody |
|---|---|---|---|
| Priority: | high | Milestone: | Munin 2.2 |
| Component: | master | Version: | 1.4.0 |
| Severity: | major | Keywords: | |
| Cc: |
Description
When using two levels of nested groups, the day/week/month/year comparison pages contain links with duplicate group names.
Example:
In a page generated for http://munin.example.org/FirstLevel/Secondlevel/comparison-day.html, the second group level "Secondlevel" is also included in the links, resulting in the URI http://munin.example.org/FirstLevel/Secondlevel/Secondlevel/mail.example.org/df.html
Example HTML fragment included:
<td valign="top"> <table class="invisiblebox"> <tr><td colspan="2"></td></tr> <tr><td colspan="2"><div class="lighttext"><a href="mail.example.org/index.html">mail.example.org</a> :: <a href="Secondlevel/mail.example.org/df.html">Filesystem usage (in %)</a></div></td></tr> <tr><td> <a title="Filesystem usage (in %)"/><a href="Secondlevel/mail.example.org/df.html"><img src="./mail.example.org/df-day.png" alt="Filesystem usage (in %)" width="495" height="292"/></a> </td></tr> </table> </td>
Some debugging indicates that this link ("URL1" in the template) is generated in get_group_tree in master/lib/Munin/Master/HTMLOld.pm, most likely at or around line 730:
if ($ret->{'url'} ne "/index.html") {
for (
my $shrinkpath = $ret->{'url'}, my $counter = 0;
$shrinkpath =~ /\//;
$shrinkpath =~ s/^[^\/]+\/*//, $counter++
) {
$ret->{'url' . $counter} = $shrinkpath;
}
}
I suspect that changing this to fix the comparison template may cause broken links elsewhere, and it also looks like it is hard to test...
Change History (4)
comment:1 Changed 4 years ago by janl
- Milestone changed from Munin 1.4.1 to Munin 1.4.2
- Priority changed from normal to high
- Severity changed from normal to major
comment:2 Changed 3 years ago by janl
- Milestone changed from Munin 1.4.4 to Munin 1.5
comment:3 Changed 3 years ago by janl
We need to refactor munin-html to be able to solve this I think. The current munin-html data-structure is very very overloaded and abused IMHO.
comment:4 Changed 17 months ago by snide
- Milestone changed from Munin 2.0 to Munin 2.1
Pushing to 2.1

This is trickier to fix than you would know. Will atempt to enlist help. Not in 1.4.1 I think.