GetLegendGraphic on LayerGroup fails if SCALE is greater than MaxScaleDenominator

Description

Related to

If a layer in a LayerGroup have a MaxScaleDenominator, the GetLegendGraphic request will fail if SCALE value is greater than MaxScaleDenominator value.

In the following example, the minimum MaxScaleDenominator across all the styles in the LayerGroup is 20000.

This works: http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&height=12&width=12&layer=Daraa&style=&version=1.3.0&SLD_VERSION=1.1.0&LEGEND_OPTIONS=forceLabels%3Aon%3BfontSize%3A10&SCALE=20000

This returns an error: http://cloudsdi.geo-solutions.it/geoserver/daraa/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&height=12&width=12&layer=Daraa&style=&version=1.3.0&SLD_VERSION=1.1.0&LEGEND_OPTIONS=forceLabels%3Aon%3BfontSize%3A10&SCALE=20001

The stack trace is the following:

Environment

None

Status

Assignee

Andrea Aime

Reporter

Gnafu

Triage

Fix versions

Affects versions

Components

Priority

Medium
Configure