Colormap variable substitution not working if multiple layers are provided in WMS call
The issue is related to cql expressions in the rastersymbolizer style element to make the color map dynamic as described here: http://docs.geoserver.org/2.8.x/en/user/styling/sld-reference/rastersymbolizer.html#cql-expressions
It works basically, but as soon as more than one layer are passed through the layers-parameter in a WMS call the cql parameters are ignored and the defined default values are applied.
As an example, the threshold1-parameter in the following WMS call is completely ignored because two layers are passed:
The issue was confirmed in the GeoServer user group:
Mass closing all resolved issues not modified in the last 4 weeks
Fixed at the very end of my "bug stomp" day, should work fine but I could use some checks. It should be in any geoserver nightly build dated July 23rd or successive: http://ares.boundlessgeo.com/geoserver/
As remarked by Andrea, such a fix would also fix a related issue acting on SLD with multiple rules for RasterSymbolizer.
See full details in discussion http://osgeo-org.1560.x6.nabble.com/SLD-RasterSymbolizer-ColorMapEntry-variable-substitution-doesn-t-work-when-there-are-multiple-rules-D-td5272032.html#a5272056